• Sed command in shell


    grammar Sed [- hnv] [- e < script >] [- f < script file >] [text file] Parameter Description: -e<script>or–expression=<script>The input text file is processed with the script specified in the options. -F < script file >or–File = < script file >The input text file is processed with the script file specified in the options. […]

  • Detailed explanation of insert() function in C + + string


    The following code to introduce C++   String insert() function, the details are as follows: basic_string& insert (size_type pos, const basic_string& str); Insert the string STR before the character marked POS in the original string basic_string& insert (size_type pos, const basic_string& str, size_type pos1, size_type n); The n characters of STR starting from the subscript […]

  • KMP


    Basic concepts Intuitive understanding of match function 1. The match array records where we need to return to the pattern in case of mismatch 2. The function match (J) can be expressed as When the pointer points to p [J] (not including the whole string itself) fromHead startA substring and a segment ofEnd at P […]

  • Analysis of JS data type string using examples


    This article mainly introduces the JS data type string use example analysis, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to Convert to string var num = 10 num.toString(); //” 10 “to string – the parameter represents a string […]

  • Tkinter (12) message unit


    Creation of message parts and their options Similar to label components, mainly used to display multiple lines of the same font message import tkinter as tk parent = tk.Tk() message = tk.Message(parent, option, …) option explain aspect The percentage of degree relative to height is 150 bg or background background color bd or borderwidth If […]

  • Bash tips 03: the importance of double quotes


    Suppose in a bash script, the functionfooIt is defined as follows: function foo { echo “>> $1 …” echo “>> $2 …” } Call foo: foo “” “test” That is, empty strings and”test”Call for parameter valuefooThe results are as follows >>> … >>> test … Now let’s say there’s a functionbar, which is defined as […]

  • Linux learning notes — environment variables and file search


    Environment variable and file search Shell variable Symbols used to record a value (not necessarily a numerical value, but also a character or string) in a computer, and these symbols will be used in different operations. The scope of a variable is the effective range of a variable (such as a function, a source file, […]

  • [Zhuan]: using regularization to realize matching and replacement


    Tbox encapsulates three regular libraries (PCRE / pcre2 / POSIX) to achieve unified interface and cross platform processing. As long as xmake automatically detects one of the libraries when compiling and configuring, it can be used. Generally, pcre2 is preferred. If you don’t want to rely too much on third-party libraries, you can switch to […]

  • Tkinter (34) radio button unit ttk.Radiobutton


    Creation of TTK radio button part and its options w = ttk.Radiobutton(parent, option=value, …) option explain class_ Component classification name cannot be changed after creation command A program called when the state of a radio button component changes compound The position of the graph relative to the text when the graph is shared with the […]

  • The method of string replacing all specified strings in C + +


    C + + string provides a replace method to replace strings. However, string does not implement the function of replacing all strings in a string. This is what we are going to do today. First of all, understand the concept that string replaces all strings, and all “12” of “12212” are replaced with “21”. What […]

  • Golang deals with JSON structures


    First, let’s take a look at the JSON string { “resp”: { “respCode”: “000000”, “Respmsg”: success, “app”: { “appId”: “xxxxxx” } } } Go has built-in JSON string parsing package “encoding / JSON” Next, we need to define the structure. According to the analysis of the JSON library, eachCurly bracketsIt’s a structure The disassembled structure […]

  • Linux file view command


    File view command     1. Cat: displays the contents of the file from the first line Usage: cat file or file path For example: cat ifcfg-eth0 or cat / etc / sysconfig / network scripts / ifcfg-eth0 Parameters: -A: The integration option equivalent to – vt can list some special characters instead of blanks; […]