Python object-oriented metaclass
I. Preface
Metaclasses belong to the deep magic of python object-oriented programming. 99% of people don't know the point. In fact, some people who think they understand metaclasses only justify themselves and point to the end. In terms of the control of metaclasses, they are full of flaws and logical confusion. Today I'll take you to deeply u ...
Posted by Kold on Mon, 03 Jan 2022 20:57:27 +0100
Buffer stream (character type) to copy text files [Java]
Buffer stream (character type) realizes the copy of text file
Using buffered stream can improve the speed of file reading
When the character buffer stream reads data, it can read text line by line
That is, use the readLine() method in the BufferedReader class
readLine();
If there is content in this line, the content of this line wi ...
Posted by greenber on Mon, 03 Jan 2022 18:59:11 +0100
Using shared_for C++ smart pointer PTR weak_ PTR unique_ PTR
shared_ptr
Heap memory is used very frequently in C++ programming. The application and release of heap memory are managed by the programmer himself. Programmers themselves Managing heap memory improves program efficiency, but overall heap memory management is cumbersome, with the introduction of smart pointers in C++11 Concepts to facilitate h ...
Posted by lewel on Mon, 03 Jan 2022 18:34:18 +0100
Ownership of Rust
What is ownership
Ownership is a unique core concept of Rust. This feature enables Rust to write memory safe programs even without garbage collection mechanism. Therefore, understanding the working mechanism of ownership is very important for learning Rust. Other things related to ownership include borrowing, slicing, and memory layout of data ...
Posted by kickassamd on Mon, 03 Jan 2022 18:09:25 +0100
Java day 16 - circular queue
The effect of division Imagine putting a team of people in the playground runway, and the feeling of circulation comes out In order to distinguish between empty queues and full queues, a space needs to be reserved It is equivalent to not allowing end to end connection You'd better draw a picture, otherwise it's easy to get into the pit With cha ...
Posted by SeanStar on Mon, 03 Jan 2022 17:02:18 +0100
Elegant solution of Spring dependency injection
I am Xiao Hei, a programmer who "lingers" on the Internet
Pay attention to the official account of the same name [Xiao Hei Java], more dry cargo content is served first, and more occasional lottery offers.
Running water doesn't compete first. It's important to talk
In this article, I'll show you how to use Project Lombok as a b ...
Posted by iriedodge on Mon, 03 Jan 2022 16:49:11 +0100
[an ordinary day to learn java] java basic grammar 1 (with homework)
Part I HelloWorld
1. The name of the java file must be consistent with the name of the public class
2. A java file can contain multiple classes, but only one public class
3.public static void main(String[] args) is the entry point for all java programs
4. The parameter list in the main method supports multiple writing methods: String[] args ...
Posted by EOS on Mon, 03 Jan 2022 16:28:38 +0100
Reflection of Java
Four methods to obtain Class instances
Call the properties of the runtime classCall getClass() through the object of the runtime classCalling Class static method: the most commonly used method in forName(String classPath) developmentLoader using class: ClassLoader (just know)
package day_12_29;
import org.junit.Test;
/**
* @author ...
Posted by andrewb on Mon, 03 Jan 2022 16:16:54 +0100
[Android development, geek time resource sharing
**android:divider="#f00" * * color of split line
android:dividerHeight = "2dp" the height of the splitter bar
**android:cacheColorHint="#0fff" * * when the background image is used in the list, there will be a problem in the drop-down or pull-up: the background image is missing
android:scrol ...
Posted by jackread on Mon, 03 Jan 2022 15:17:35 +0100
Creating objects in Java
1. new an object
Creating objects with the keyword new is almost one of the most common operations when writing code, such as:
Sheep sheep1 = new Sheep();
Sheep sheep2 = new Sheep( "codesheep", 18, 65.0f );
Through the new method, we can call the parameterless or parameterless constructor of the class to instantiate an object.
On the s ...
Posted by faswad on Mon, 03 Jan 2022 14:24:41 +0100