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

Create react app quickly builds react projects, antd loads incoming and local request data on demand

# Global installation npm install -g create-react-app # Build a my-app Item npx create-react-app my-app cd my-app # Tap on the key points of the blackboard, if you want to use less,Or it depends on the use webpack Configuration files, exposing webpack Profiles, using create-react-app The created projec ...

Posted by Misticx on Thu, 16 Jan 2020 02:51:06 -0800

Flow operation of new Java 8 features

What is flow operation The Java 8 API adds a new abstraction called streaming Stream, which allows you to process data in a declarative way. Stream provides a high-level abstraction of Java set operations and expressions in an intuitive way similar to querying data from a database using SQL statements. Stream API can greatly improve ...

Posted by mathewvp on Thu, 16 Jan 2020 00:24:28 -0800

Seven principles of design mode

In the process of writing our call later, we will face from coupling. Cohesion and maintainability, scalability, reusability, flexibility and other challenges, design patterns to make the program have better: Code reusability (i.e. code with the same function, not written many times) Readability (i.e. ...

Posted by AwptiK on Wed, 15 Jan 2020 03:46:08 -0800