• An in-depth analysis of the writing method of for loop in go language


    For loop is a loop control structure, which can effectively write a specific number of loops that need to be executed. grammarThe syntax of for loop in go programming language is as follows: Copy codeThe code is as follows: for [condition |  ( init; condition; increment ) | Range] {    statement(s); } The following […]

  • Analysis of some bugs in for command


    1. About colon: when a line begins with, use for / F “tokens = 1 * delims =:”%% I in (‘findstr / n* test.txt ) do echo.%% J will:Filter out; 2. About semicolon: findstr* test.txt You can display the lines beginning with semicolons completely, but you can’t find them in the for statement. You must […]

  • Summary of several separator forms in for statement


    In fact, for / L% I in (1,1,99) do @ echo% I there are many kinds of separators in the middle of bracketsThe form is as follows:for /l %i in (1,1,99) do @echo %i for /l %i in (1 1 99) do @echo %i for /l %i in (1;1;99) do @echo %i for /l %i […]

  • Detailed explanation of “pit” in go language for range


    preface The combination of for range in go can easily traverse an array or slice, but in some cases, it is likely to be “pit” when using for range func main() { arr1 := []int{1, 2, 3} arr2 := make([]*int, len(arr1)) for i, v := range arr1 { arr2[i] = &v } for _, v […]

  • For statement from beginning to mastery


    For statement from beginning to mastery A prefaceThe basic usage of two for sentencesThree for / F ﹣ delay with variableFour for / RFive for / DSix for / L 1、 Preface In batch processing, for is the most powerful command statement. Its appearance makes it possible to parse the text content, traverse the file […]

  • Summary of delims and tokens in batch processing for


    In the parameter f of the for command statement, the most difficult to understand is the options delims and tokens. This paper makes a simple comparison and summary.“For / F” is often used to parse text and read strings. In the division of labor, delims is responsible for cutting strings, while tokens is responsible for […]

  • A detailed explanation of the tokens of batch for parameter / F


    (4) Tokens = x, y, M-N extract column Format: FOR /F “tokens=x,y,m-n” %%I IN (Command1) DO Command2 Usage: One sentence summary: extract columns. Generally speaking, extract the content of section m of each line together. Therefore, you can use this command to specify the extraction of text information. Tokens = sometimes means to extract all. […]

  • The method of extracting the whole line of text for


    This is what we usually write when we need to extract the entire line of text. Copy codeThe code is as follows: for /f “delims=” %%a in (a.txt) do echo.%%a But the lines at the beginning of semicolon, for will also be ignored. Many times we need these lines. What should we do.It’s too troublesome […]

  • Using VBScript for command to realize timing shutdown


    The following statement implements the shutdown at a specified time on each day of the weekIf you want to change to a few days of the month, change the letters to numbers and separate them with commasThere are no error detection statements in the following code, so you must input the time in the specified […]

  • Detailed explanation of for loop usage in shell


    For command: Various usages of for I in: for i in “file1” “file2” “file3” for i in /boot/* for i in /etc/*.conf For I in $(SEQ – W 10) for i in {1…10} for i in $( ls ) for I in $(< file) For I in “[email protected]” – “takes all positional parameters, which can […]

  • Python does not use for to calculate IOU between two groups of rectangles


    Solution: do not use for to calculate the IOU between two groups and multiple rectangles Using numpy broadcast method, it is not recommended to use for statement in Python program. The for statement in Python takes a lot of time. If you use numpy broadcast, the idea will speed up a lot. code: def calc_iou(bbox1, […]