C + + learning notes

C + + learning notes (1) Siddhartha Rao, 21st day learning C + + (8th Edition) auto Auto auto inference type (new in C++11) //Initialization is required when using auto auto largeNumber = 25000000000000; //The compiler determines the appropriate value according to the initial value, which should be long long here auto iteration int ...

Posted by beginneratphp on Thu, 10 Mar 2022 17:09:08 +0100

Bound and unbound methods of python classes

1, Binding method 1. Object binding method First, let's make it clear that all methods or functions in a class are bound to objects by default. Next, we will slowly analyze the application of binding methods through examples. class People: def __init__(self,name,age): self.name = name self.age = age def talk(self): ...

Posted by kgahn on Tue, 08 Mar 2022 21:14:23 +0100

Java thread: thread creation and startup, static proxy, Lambda expression

catalogue preface thread Thread creation and startup Inherit Java Lang.Thread class Implement Runnable interface Implement Callable interface Static proxy Lambda expression Functional interface last preface I don't know if you have ever thought about why so many people can play together at the same time when we play the glory of t ...

Posted by discorevilo on Tue, 08 Mar 2022 01:23:39 +0100

Java enumeration based on Java

Ramble Yesterday, I happened to encounter a small problem with enumeration, and then found that I am not so familiar with it. Then in development, enumeration is used very much, so I have today's article. What is enumeration Enumeration in Java is a type, just as the name suggests: it is enumerated one by one. Therefore, it generally represe ...

Posted by ben2k8 on Mon, 07 Mar 2022 23:22:58 +0100

JDK8: HashMap source code analysis: hash method

1, Overview We know that in HashMap, the location of a key value pair stored in the internal data of HashMap is related to the hashCode value of K, which is also because the hash algorithm of HashMap is based on the hashCode value. Three concepts should be distinguished here: hashCode value, hash value, hash method and array subscript hashCo ...

Posted by kidintraffic on Mon, 07 Mar 2022 22:59:18 +0100

Java -- use of methods

1. Method definition and call So what is the method? A method is essentially a block of codeSo what is the significance of the method? After defining a method, you can call it repeatedly in different positions, so you don't need to write the same piece of code repeatedly. 1. Method definition and calling syntax Method definition syntax ...

Posted by Josh954r on Mon, 07 Mar 2022 21:49:56 +0100

C + + improve programming -- STL common algorithm: common sorting algorithm

3. Common sorting algorithms   learning objective: master common sorting algorithms.   introduction to algorithm: Sort   / / sort the elements in the containerrandom_shuffle    / / shuffle and randomly adjust the order of elements within the specified rangeMerge   / / merge container elements and store them ...

Posted by admin on Mon, 07 Mar 2022 18:24:47 +0100

Python practical unpopular knowledge sorting

1.print print information with color You know the print function in Python. Generally, we will use it to print something as a simple debugging. But you know, the font color printed by Print can be set. A small example def esc(code=0): return f'\033[{code}m' print(esc('31;1;0') + 'Error:'+esc()+'important') After running this code on the ...

Posted by GreenCore on Mon, 07 Mar 2022 15:51:02 +0100

JavaScript core knowledge Chapter 2 - Advanced events (including a lot of code analysis)

preface❤️ How much talent a person has, how much humility will be engraved in his bones ❤️ 1, JavaScript event advanced (1) Registration event (binding event) 1.1 overview of registration events one ️⃣ Adding an event to an element is called a registration event or a binding event. two ️⃣ There are two ways to register events: traditi ...

Posted by djwiltsh on Sun, 06 Mar 2022 21:50:52 +0100

Linux Bash Shell build base script

Build basic script When creating a shell script, you must specify the shell to be used in the first line of the file. Its format is: #!/bin/bash environment variable Example: #!/bin/bash #display user information from the system echo "User info for userid: $USER" echo UID: $UID echo HOME: $HOME User variable The user variable can be any ...

Posted by Gafaddict on Sat, 05 Mar 2022 20:34:55 +0100