Queue, interprocess communication, thread

Catalog Process mutex Multi process and rush to buy the remaining tickets at the same time Using locks to secure data queue Interprocess communication Producer and Consumer thread The concept of thread Two ways to create threads Method of thread ob ...

Posted by ondercsn on Tue, 22 Oct 2019 14:10:23 -0700

Java foundation - branch statement

Branch statements mainly include the following structures: If, if else, multiple if, nested if, switch Let's explain the structure and use examples of each statement in detail.1,if // Simple if structure /* * if(Condition) { * content * } */ int num = 3; if (num >= 0) { ...

Posted by flash-genie on Tue, 22 Oct 2019 11:55:07 -0700

Luogu P2471 - [SCOI2007] rainfall

Local AC submits RE... Portal: QAQQAQ   Look at it by yourself   Thought: it is said that RMQ can be used for this question very quickly, but the line tree of this question is OK The line tree maintains the leftmost and rightmost years of a section, whether there is a gap and the maximum value of the section. The classification and discu ...

Posted by abelajohnb on Mon, 21 Oct 2019 09:12:40 -0700

Python learning journal Mysql database Chapter 9

Preface The main function of index is to restrict and speed up the search. The ORM framework (sqlalchemy) uses classes and objects to operate the database.   Types of indexes By category 1. General index: can speed up search 2. Primary key index: can speed up search, cannot be empty, cannot be duplicate 3. Unique index: accelerated searc ...

Posted by leightons on Mon, 21 Oct 2019 07:00:00 -0700

Java fresh e-commerce platform - in-depth thinking and practice of starting and sending price of e-commerce

Java fresh e-commerce platform - in-depth thinking and practice of starting and sending price of e-commerce   Note: in fresh food e-commerce, starting and sending price is a very common topic. Today we will tell you how to set the starting and sending price, how to write the code of starting and sending price, and how to synchronize the start ...

Posted by Alelinux on Mon, 21 Oct 2019 01:44:20 -0700

Source code analysis of DelayQueue of JUC blocking queue

DelayQueue is a * * * blocking queue that supports delay acquisition elements. And the elements in the queue must implement the Delayed interface. When you create an element, you can specify how long it takes to get the current element from the queue. Elements can only be obtained from the queue when the delay expires. DelayQueue has a wide ra ...

Posted by Loran on Sun, 20 Oct 2019 14:30:16 -0700

Android eyes spherical refraction

Design sketch thinking Use the built-in refract function, because what you want to draw is a sphere, so there is the center and radius of the sphere. Use the distance function to calculate the distance. If the distance between the center and the sphere is less than the radius, use the refract funct ...

Posted by php4geek on Sun, 20 Oct 2019 09:29:01 -0700

Display Lock for java Concurrent Programming learning

Display lock and built-in lock Advantages of built-in lock (Synchronized) Code concise The lock will not leak because the lock is not released. Show Lock benefits Flexibility, lock acquisition can be interrupted, you can try to acquire locks. Read more and write less. usage If you can use the built-in lock, you can use the built-in lock. If ...

Posted by PugJr on Fri, 18 Oct 2019 15:55:11 -0700

React 16.8 change Webpack support Less file

Create project The latest React version is 16.8.6Create a project using the create react app scaffolding toolBecause you want to use AntD in your project Expose profile To configure less loader, you need to expose the webpack configuration file. This requires using the eject command provided by the create react app scaffold tool. Before running ...

Posted by statrat on Fri, 18 Oct 2019 11:19:20 -0700

JavaScript Design Pattern - strategy pattern

The strategy pattern is the behavior pattern in JavaScript Design pattern. Definition: Define a series of algorithms, encapsulate them into strategy classes (Methods), and then separate the invariant part and the changing part, and these algorithms can replace each other Vernacular explanation: In fact, the so-called policy pattern is ...

Posted by yarub on Fri, 18 Oct 2019 00:55:18 -0700