• A summary of the methods of string slice assignment in go language


    Preface A lot of string operations are involved in all programming languages, so it is very important to be familiar with string operations. This paper introduces the method of string slice assignment in go language in detail through examples, and the interested friends will follow the editor to have a look. 1. In the range […]

  • Go customer information relationship system


    Customer information relationship system Project demand analysis1) Simulate the realization of customer information management software based on text interface.2) The software can insert, modify and delete customer objects (realized by slicing), and print customer list Interface design of the project See the running result of the code Project function realization – display main menu and […]

  • Go arrays and slices


    1、 Definition of array //Var variable name [capacity of array] type = [capacity of array] type {value 1, value 2} var a [4]int = [4]int{1,2,3} perhaps var a = [4]int{1,2,3} perhaps a := [4]int{1,2,3} //These results are [1 23 0] //The accepted length is determined by the assigned length package main import “fmt” func main(){ […]

  • Go file operation


    Chapter document operation Basic introduction of the document Concept of documents File is not new to us. File is a kind of data source (the place where data is saved), such as the word document and TXT document that we often useFiles, Excel files… Are files. The main function of file is to save data. […]

  • Tidb source reading series (XIII) introduction to index range calculation


    Sketch When processing query requests in the database, if irrelevant data can be filtered out as early as possible, then subsequent operators can do less idle work and improve the efficiency of the whole SQL execution. The most common way to filter data is to use index. The optimizer of tidb will also try to […]

  • Go slice copy and assignment


    I. copy. package main import “fmt” func main(){ //Copy function, copy one slice to another var a [1000]int=[1000]int{0,1,2,3,4,5} b:=a[:4] c:=make([]int,4,4) copy(c,b) fmt.Println(c) c[1]=3 fmt.Println(a) } //Copy is to create a new control to copy both the index part and the value part in the memory. A has no relationship with C, and a will not […]

  • Go – & get address and * dereference


    &Variable gets the address of the variable in memory space *Variable address gets the value of a variable 1、 General data package main import “fmt” func main(){ b :=1111 C: = & B // when getting the type of address C of B * int test(c) FMT. Println (b) // a value of 333 sent […]

  • Tensorflow: quick start


    Introduction QuickStart tensorflow-googles-latest-machine Installation Because of the well-known reasons, building tensorflow environment in China has experienced some twists and turns. I am used to using docker as the development environment of complex dependent projects. The installation methods provided by Google are as follows. Binary Installation Tensorflow’s Python API is 2.7, and the simplest way is […]

  • Bytebuf interpretation of the buffer of netty (2)


    The first part introduces the simple read-write operation of bytebuf and the basic introduction of read-write pointer. This paper continues to interpret the basic operation of bytebuf. Read write pointer rollback The demo example here is still used in the previous section. ByteBuf buf = Unpooled.buffer(15); String content = “ytao official account”; buf.writeBytes(content.getBytes()); System.out.println(String.format(“\nwrite: ridx=%s […]

  • Canvas drawing pictures


    We have learned some basic methods of using canvas. In canvas, we can draw pictures directly. In canvas, we mainly use DrawImage method to draw pictures 1: There are three cases of DrawImage method parameters 1: Three parameters ctx.drawImage(image,dx,dy) Image: IMG image to be drawn DX, Dy: the coordinates of the drawn img image in […]

  • GO summary


    1. Foundation Go language introduction and development environment configuration Go- package Go data type and variable, constant Go – get variable data type Go arrays and slices Go slice copy and assignment Go- function Go- closure Go logical judgment (if, else if, else, switch) Go-for cycle Go-map Go – & get address and * dereference […]

  • 56. Consolidation interval


    Given a set of intervals, please merge all overlapping intervals. Example 1: Input: [[1,3], [2,6], [8,10], [15,18]]Output: [[1,6], [8,10], [15,18]]Explanation: the intervals [1,3] and [2,6] overlap and merge them into [1,6]Example 2: Input: [[1,4], [4,5]]Output: [[1,5]]Explanation: the intervals [1,4] and [4,5] can be regarded as overlapping intervals. The main purpose is to find out the […]