Origin of Ray

Lift the fog of the Internet together

Recently, in the background of building our own WeChat official account robot, after the user sends a small message to the official account, it will be forwarded to the server set by the WeChat server level. At the beginning, we can choose the plaintext mode, but for safety reasons, we will still turn on Safe mode, in this mode, all messages will be encrypted as a whole, we need to decrypt them at the server level, and the WeChat official doc is not well written, and there is no example code for the nodejs version, so I combined the example code to make a version of express plug-in, record it:

Read more »

The technology that programmers master is called information technology and is designed to collect and process information quickly, so why is this technology important? Understanding this issue, in fact, can also understand what AI has brought us in the end

Read more »

Recently tried to implement the AVL tree, found that this thing to write up or a lot of details, messed up half a day, so here to record.

An AVL tree is a balanced binary search tree. On the one hand, it is a BST, i.e., a binary search tree, and on the other hand, it is balanced, i.e., the difference between the height of the left and right subtrees of any subtree whose node is the root node is less than one.

Read more »

The division of business areas should also achieve high cohesion, low coupling, the principle of least knowledge, if each business area needs to know a lot of knowledge of other business areas, then in fact, or coupling

Read more »

The previous blog talked about bipartite graph matching匈牙利算法However, each matching edge weight in the Hungary algorithm is the same. If we get the best match under different matching edge weights, then we need to use the KM algorithm.

Read more »

I came into contact with this algorithm because I saw a problem called prime significant other. That is to say, you are given a string of numbers, and you choose two numbers to add. If their sum is a prime number, then this pair is called a prime significant other. Then we need to find how many pairs of prime numbers significant other can be found at most in this string of numbers.

The solution to this problem is first to divide the number into two parts, one part is even and the other part is odd, because the addition of two even numbers or the addition of two odd numbers must still be even and cannot be prime.

So the problem becomes to choose one of the even numbers, then choose one of the odd numbers, and see how many pairs are added to the prime number at most. This problem uses the Hungary algorithm.

Hungary algorithm is mainly used to solve some problems related to bipartite graph matching, so let’s first understand bipartite graph.

Read more »

A previous blog talked about the update process of React, but in that blog, task scheduling uses the browser’s requestIdleCallback, and in fact React uses a task scheduler implemented by itself. We will analyze its source this time. Code, and why React implements the task scheduler itself.

This article is based on the 16.18.6 branch in the React repository.

Read more »

Recently, I encountered several problems on leetcode that were solved by dichotomy. I summarized the rules. To put it simply, if you want to find the maximum or minimum value that meets the conditions from a bounded interval, you can Consider using a dichotomy, but it is not the basic dichotomy, but a dichotomy that keeps looking for the left boundary or the right boundary.

Read more »
0%