C++Primer copy control and resource management

Generally speaking, there are two options for copy semantics of type objects: you can define copy operations to make the behavior of a class look like a value or a pointer. Class behaves like a value, meaning that it should also have its own state. When we copy an object like value, the copy and the ori ...

Posted by skehoe on Sat, 18 Jan 2020 03:19:58 -0800

PAT B1015 theory of virtue and talent (25 points)

Sima Guang, a historian of the Song Dynasty, has a famous "theory of virtue and talent" in his "general guide to the rule of capital": "it is because of this that all the talents and virtues are called saints, while both the talents and virtues are called fools, only when virtue ...

Posted by kender on Fri, 17 Jan 2020 22:35:57 -0800

[LeetCode 45 55 1306]Jump Game I,II,III[JAVA]

Jump game, three questions in total. 55. Jump Game 1. topic 2. way of thinking This problem is to consider whether we can reach the last position. When we reach each subscript, we can maintain a maximum subscript value to determine whether we can reach the last subscript of the array. 3. code ...

Posted by OttoBufonto on Fri, 17 Jan 2020 20:21:54 -0800

Advanced properties of thread control -- Realization of functions such as mutex and lock

Content: 1. What is one-time initialization? Example 1: one time initialization verification of pthread ﹣ once function: #include"stdio.h" #include"unistd.h" #include"sys/types.h" #include"pthread.h" #include"stdlib.h" #include"string.h" pthread_once_t once = PTHREAD_ONCE_INIT;//Declare global var ...

Posted by srdva59 on Fri, 17 Jan 2020 05:01:52 -0800

C + + design pattern observer pattern

Observer mode In GOF's "design pattern: the foundation of reusable object-oriented software", the observer pattern is said as follows: define a one to many dependency between objects. When the state of an object changes, all objects that depend on it are notified and automatically updated. ...

Posted by mrMarcus on Fri, 17 Jan 2020 01:00:43 -0800

Java design pattern 2: observer pattern

Observer mode Definition One to many dependencies between objects are established, so that when the state of an object changes, all its dependents will be notified and updated automatically. In observer mode, when the state of the observed object changes, all observers will be notified. There are ...

Posted by Ellen67 on Thu, 16 Jan 2020 20:58:22 -0800

B-tree-Java implementation

Active insertion algorithm is adopted in this paper First, introduce B tree: B - tree is a self balanced search tree. In most other self balancing search trees, such as AVL and red black trees, it is assumed that everything is in main memory. To understand the use of b - trees, we have to consider large ...

Posted by jmfillman on Thu, 16 Jan 2020 20:19:01 -0800

Django Web framework teaching notes

Catalog Article directory Catalog Query data Field lookup query predicate Modify data record Delete record Aggregate query F object Q object - Q() Native database operation method Query data The query of database needs to use manager object Call the query interface through the MyModel.ob ...

Posted by BDKR on Thu, 16 Jan 2020 07:22:00 -0800

store (mall project) Springboot+springmvc+ajax+mybatis(11)

44. Receiving address - display list - controller layer (a) Handling newly created exceptions nothing (b) Requests to be processed for design Request path / addresses/ Request parameter: HttpSession session Request method: GET Response result: jsonresult < list < address > > (c) P ...

Posted by tengkie on Thu, 16 Jan 2020 05:31:01 -0800

POJ2485 greedy algorithm for minimum spanning tree prim algorithm and kruskal algorithm

POJ2485 greedy algorithm for minimum spanning tree prim algorithm and kruskal algorithm Title Analysis http://poj.org/problem?id=2485 The input of this problem is adjacency matrix, any two points are directly connected, which is a typical problem of finding the minimum spanning tree. prim algorith ...

Posted by vfwood on Thu, 16 Jan 2020 05:14:41 -0800