java nio message half package and sticky package solution

java nio message half package and sticky package solution Background of problemNIO is buffer oriented, not stream oriented. We all know that since it's a buffer, it must have a fixed size. In this way, there are usually two problems: Message packet sticking: when the buffer is large enough, multiple messages may be read into the buffer from the ...

Posted by unklematt on Sun, 19 Apr 2020 14:59:08 +0200

ziplist source code analysis of Redis

ziplist source code analysis of Redis 1, ziplist introduction From the previous analysis, we know that ziplist (compressed list) is used for the underlying storage of quicklist. Since the compressed list itself has many contents, we reopened this article. Before the official source code, we should first look at the characteristics of ziplist: ...

Posted by gazolinia on Sun, 19 Apr 2020 14:58:37 +0200

JEP interpretation and tasting Series 2 - JEP 142 cache line filling simplification

This article is based on OpenJDK 8 ~ 14 JEP 142 content It is used to fill a cache row with one or some field s that need to be read and modified by multiple threads. At the same time, due to the way of filling cache rows before Java 8, which is cumbersome and not elegant enough, there may be different sizes of cache rows, so the @ contented ...

Posted by lightningstrike on Sat, 18 Apr 2020 10:02:43 +0200

Data Processing with Python 1 - Learn to use NumPy

1. Learn to use ndarray 1.1 What is ndarray? ndarray is a multidimensional array object in NumPy that can be one-dimensional, two-dimensional, or even more.Of course, creating more dimensional arrays is not his advantage. Its advantage is that it has a rich method of operation, and it is also the base of another advanced Python library, panda ...

Posted by kneifelspy on Fri, 17 Apr 2020 21:56:32 +0200

Unity3d determines whether to arrive at the destination

Because I don't know much about JAVA, I can't understand Golder's java api basically. At the beginning, I wanted to directly use Golder's web api to set up a Geographical fence , and then make a judgment, but the geofence list is always empty when the last request is made. Bad return value.png Geofence has been created, that ...

Posted by InfiniteA on Tue, 14 Apr 2020 20:16:18 +0200

Sliding window (data structure)

Sliding window: there are two pointers L,R. Add a number r to move to the right, and subtract a number L to move to the right. Generally, it is necessary to maintain the maximum or minimum value in the window, and the query complexity can be O (1). Generally, two-way queue assistance is needed, such as Title: sliding window Suppose it is a w ...

Posted by cuteflower on Mon, 13 Apr 2020 16:19:51 +0200

The correct posture of encapsulating echarts in vue project

Why we need to encapsulate echarts Every developer needs to write a complete option configuration from the beginning to the end, which is very redundant In the same project, all kinds of chart design are very similar, even the same, so there is no need to do repeated work all the time Some developers may forget to consider the features of upda ...

Posted by ranjita on Sat, 11 Apr 2020 10:41:54 +0200

[2017.7.7 popularization] ultimate number

subject Title Description Given a sequence a of length n, we try to find the ultimate number x of each prefix of sequence a Minimum, try to find the ultimate number t (if there are multiple ultimate numbers t, just output the smallest one) input The first line is an integer n, the second line is an integer n, separ ...

Posted by phpvn.org on Thu, 09 Apr 2020 18:39:01 +0200

Many people do not know the knowledge of Python multi process and multi thread details!

Single process and single thread: a person eats food on a table.2. Single process and multithreading: many people eat together on the same table.3. Multi process single thread: many people, each of them, eat at their own table. The problem of multithreading is that when more than one person eats a dish at the same time, it is easy to compete. ...

Posted by godsent on Mon, 06 Apr 2020 08:41:44 +0200

Algorithmic questions - fast sorting

Given a set of intervals, please merge all overlapping intervals. Example: //Give [1,3],[2,6],[8,10],[15,18], //Return [1,6],[8,10],[15,18]. //Known: static class Interval { int start; int end; Interval() { start = 0; end = 0; } Interval(int s, int e) { start = s; end = e; } ...

Posted by void_function on Sat, 04 Apr 2020 06:30:37 +0200