Tag:control power

  • Goroutine in go language learning


    Coroutine characteristic Lightweight “thread” Non preemptive multi task processing, in which coprocessor takes the initiative to hand over control Compiler / interpreter / virtual machine level multitasking, non operating system Multiple coroutines can be executed on one or more threads Go keyword opens a coroutine func main() { for i := 0; i < 10; […]

  • Regular expressions (JavaScript)


    JavaScript regular expression Character matching Metacharacters for common matching characters: .Matches any character except newline. \wMatch letters or numbers or underscores or Chinese characters. \sMatches any whitespace. \dMatch numbers. \WMatch any character that is not a letter, number, underline, or Chinese character. \SMatches any character that is not whitespace. \DMatches any non numeric character. [0-9]and[^abc]They […]

  • [regular expression series] greedy and non greedy patterns


    preface Greedy pattern and non greedy pattern are important characteristics of regular matchingWhen we understand the difference between greed and non greed, we can step by step according to the examples outline Introduction to matching rules Quick understanding of greedy mode and non greedy mode Example exercise Backtracking and matching failure Introduction to matching rules […]

  • Promise.all concurrency limit


    background In general, when we need to ensure that the code is executed after multiple asynchronous processes, we will use: Promise.all(promises: []).then(fun: function); Promise.allCan guarantee that,promisesAll promise objects in the array reach the resolve state before executionthenCallback. Consider a scenario: if yourpromisesEach object in the array is an HTTP request or contains complex call handling. […]

  • Shell programming interaction free expect


    This article is mainly aboutshellScript interaction freeexpectUse. Summary ExpectIs built ontclBased on a tool,ExpectIt is a tool for automatic control and testing. Main solutionshellNon interactive issues in scripts. install Install before using this tool yum install -y expect Basic command send Send string to process to simulate user input This command does not automatically return […]

  • IOC Container Thought Used in the Practice of [PHP] Project


    1. Container means a global variable in which many objects are stored. If an object is to be used, it must be put in first.2. Inversion of control means giving control to others.3. The combination of the two is to hand over control to others and put the objects created into a global variable.4. The […]