Tag: function
-
Post Views: 25 Preface In the previous series of articles, I have completed multi-language adaptation of classification, and today I want to solve the most cumbersome part of the entire multilingualization: batch translation of 8060 Chinese labels. Manually add more than 8000 tags to translate one by one? This is obviously unrealistic. After clicking these 8,000 buttons, I am afraid…
-
Post Views: 63 Following the previous articleMaps word counting exercisesAfter this, another classic exercise in the introduction of Go language – using closure to implement the Fibonacci sequence generator. This question can not only consolidate the core usage of closed packages, but also deeply understand the characteristics of ‘function as the return value’ in the Go language. This article will…
-
Post Views: 90 Recently, when I was doing the slices practice of the official go to the go, I encountered a series of dependencies download and running errors, and after tossing, I finally succeeded in running through. I have sorted out the complete stepping process and solutions, hoping to help those who practice Go Tour locally like me, and avoid…
-
Post Views: 16 1. Report an error in PHP 7.4: Cannot RedeClare GetFirstSkuIndex(). Indicates that the function getFirstSkuIndex() has been defined. PHP does not support redefining declared functions. as shown in Figure 1 2. Reference:https://www.shuijingwanwq.com/2022/11/14/7149/, now because the same file is repeatedly introduced (re-introduced on business). This leads to the same function being duplicated. 3. View the code implementation of…
-
Post Views: 48 1. Upload pictures in WordPress, prompting: The server cannot process pictures. This happens if the server is busy or does not have enough resources to complete the task. Uploading smaller pictures may help. The recommended maximum size is 2560 pixels. as shown in Figure 1 2. Check the size of the uploaded image is 23 KB, and…
-
Post Views: 20 1. The existing implementation is as follows 2. Reference 10.1 Decompose conditional expression (decompose conditional), adjust to the following 3. 10.2 Consolidate conditional expression (Consolidate conditional expression). Extracting the inspection conditions into a separate function is very useful for clarifying the meaning of the code, because it replaces the statement describing “what to do” with “why do…
-
Post Views: 17 1. Reference:https://www.shuijingwanwq.com/2022/11/02/7121/. Now, due to the existence of some special version numbers, it does not meet the specification of semantic 2.0. The final requirements are as follows: v2.0.0 < v2.0.0-h.1 2. Implement v2.0.0 < v2.0.0-h.1, after executing version_compare, the result is: bool(false), that is, v2.0.0 is not less than v2.0.0-h.1. 3. The existing code is implemented as…
-
Post Views: 18 1. The existing array structure is as follows, and its key name is the form of lowercase letters and underscores. 2. It is expected to adjust the name of the array key to the hump form. The traditional way is to generate a new key in the form of a hump based on the foreach traversal. This…
-
Post Views: 19 1. When writing the automated test case of Lighthouse 5, split a test method into two test methods. The present stage is a method 2, split into two methods 3. Run the test and report an error: Error: Error: call to undefined method illuminate\support\facades\config::set(). as shown in Figure 1 4. At this time, if any of the…