1、HTTP Keep-AliveIn the early days of http, each HTTP request required a TPC socket connection to be opened, and the TCP connection was disconnected after one use.The use of keep-alive improves this state by continuing to send multiple data at one TCP connection without disconnecting. By using the keep-alive mechanism, you can reduce the number of TCP connection setups, which also means you can reduce the TIME_WAIT state connectionThen, to improve performance and throughput of the httpd server (fewer TCP connections means fewer system kernel calls, socket accept () and close () calls).Howev...
Definition of factory mode:For the client, hiding object creation logic does not need to use new to generate objects.
Implementation mode of factory mode:
Create an interface such as Shape;
Create specific classes to implement Shape, such as circles, squares and triangles.
Create Shape’s Factory, and create different specific classes by Shape type.
Finally, the client first creates a Shape factory, and then passes the different shape type parameters to get the concrete class.
Abstract factory definition:Create super factories for other factories;
Abstract factory implementatio...
1、cannyoperator
CannyThe edge detection operator was developed by John F.Canny in 1986.Multilevel edge detectionAlgorithm. More importantly, Canny created the Computational Theory of edge detection to explain how this technique works. Canny edge detection algorithm in the name of Canny.Word naming is regarded by many as the best edge detection algorithm nowadays.
Among them, Canny’s goal is to find an optimal edge detection algorithm, let’s look at the three main evaluation criteria of optimal edge detection:
1.Low error rate: Identify as many actual edges as possible and minimi...
AtomicInteger class” understanding and use
First look at the two paragraph of code, one is Integer, and the other is AtomicInteger.
public class Sample1 {
private static Integer count = 0;
synchronized public static void increment() {
count++;
}
}
The following is AtomicInteger’s:
public class Sample2 {
private static AtomicInteger count = new AtomicInteger(0);
public static void increment() {
count.getAndIncrement();
}
}
When using Integer, you must add synchronized to ensure that no concurrent threads are accessed at the same ti...
Introduction to BroadcastReceiver
BroadcastReceiverIs one of the four components to complete communication between components or applications.
Broadcast: Radio broadcast
BroadcastReceiver: Broadcast receivers
A radio and broadcast receiver completes a message mechanism at the weight level because it needs to activate the component.
Two attention
Every time a broadcast message arrives in Android, an instance of BroadcastReceiver is created and the onReceive () method is executed
onReceive()After execution of the method, the instance of BroadcastReceiver will be destroyed.
onReceive()Method ...
Title Description
There is a checkerboard for M * N, some of which are obstacles. Now you have to choose some grid to place some soldiers, a grid can place up to one soldier, obstacle grid can not place soldiers. We call these soldiers occupying the whole chessboard. When they meet the requirements of line I, at least Li soldiers are placed, column J.At least Cj soldiers were placed. Now your task is to require the use of a minimum number of soldiers to occupy the whole chessboard.
Input output format
Input format:
The first row, the two numbers M, N and K, respectively indicate the number...