Tag: Array
-
Post Views: 111 Preface In most programming languages, it is quite complex to check if two binary trees store the same sequence of values. It is usually necessary to write a recursive algorithm to traverse the two trees and then compare them by node. But in the Go language, we can use its powerful concurrent primitives and channel (channel) mechanisms…
-
Post Views: 22 1. In Laravel 9, a list of APIs has now been implemented, which is based on Spatie\QueryBuilder\QueryBuilder to easily build Eloquent queries from API requests. However, now you need to implement a function of exporting Excel on the list page, planned to be implemented in asynchronous queues. So, if you want to reuse the code that built…
-
Post Views: 21 1. The json field is stored in the array format, the value example:[249, 247, 250, 244, 243, 255, 246, 245, 257, 248, 259, 252, 256]. as shown in Figure 1 2. The existing code running in the queue job is implemented as follows, the generated SQL is as follows 3. Since the queue tasks can be run…
-
Post Views: 21 1. Existing code implementation 2. The final generated structure is as follows, which is an array with the field name: SETTING_MIGRATIONS 3. Decide to adjust the name of the adjustment field as extra, and include the value of the setting_migrations field. The code is adjusted as follows, based on the helper function ar. 4. The final generated…
-
Post Views: 17 1. The troupe stores the data of the play in a simple JSON file. 2. The bills they issued are also stored in a JSON file. 3. The following simple function is used to print the details of the bill. 4. Use the above data files (invoices.json and plays.json) as test input, run this code, you will…
-
Post Views: 19 1. At this stage, there is a requirement, and it is necessary to send the corresponding operation logs generated to the log system of the middle platform in an interface call. The log system interface of Zhongtai supports multiple log records at the same time. Therefore, it is decided to plan to first save the generated N…
-
Post Views: 18 1. The XML data is printed as follows. as shown in Figure 1 2. At this stage, the XML is converted into an array. The code is implemented as follows. The libxml_disable_entity_loader function has been abandoned since PHP 8.0.0. It is strongly recommended not to rely on this function. 3. After converting to an array, the printing…
