Origin of Ray

Lift the fog of the Internet together

Recently encountered a strange problem, achieve the following effect:

sum(2, 3).result = 5;

sum(2, 3)(4, 5).result = 14;

sum(1, 2)(3).result = 6;

This topic looks very strange, in fact, it is a function currying plus a brain teaser, here to record the idea of this topic, if you do not understand currying, after reading the introduction of currying, you can first think about how to achieve this effect, anyway, the author thought for half an hour to slow down the mind turned out to be so simple, in the final analysis, the theory is sufficient, but less knowledge.

Read more »

Basic concepts

In computer science, divide and conquer is a very important algorithm. The literal interpretation is “divide and conquer”, which is to divide a complex problem into two or more identical or similar sub-problems, and then divide the sub-problems into smaller sub-problems… Until the final sub-problem can be simply solved directly, the solution of the original problem is the combination of the solutions of the sub-problems. This technique is the basis of many efficient algorithms, such as sorting algorithms (Quick Sort, Merge Sort), Fourier Transform (Fast Fourier Transform)…

Read more »

When it comes to VPN, the first reaction of many of us is to circumvent the wall, which is actually a famous reason for VPN. ** VPN will actually assign you an extranet IP directly, but this IP is only valid on the proxy server at the other end of this dedicated line **. The advantage and usage of VPN is not circumvention, but data encryption. And because of its obvious traffic characteristics, its performance when used to circumvent the wall is not very good. Proxies such as ** SS help you forward requests, provided that you can find a server that can be accessed within the wall **, and the server is willing to forward traffic for you. Let’s start by talking about what a VPN is. What is the difference between it and a proxy?

Read more »

What is Token?

What exactly is Token, I have not found a better definition, but looking back at its translation, I understand that the original name is the definition, Token is the token.

So what is a token?

Read more »

The HTTPS protocol is a combination of HTTP + SSL/TLS, and HTTP is the protocol used to obtain information from the World Wide Web server, so let’s start with the World Wide Web.

The World Wide Web and HTTP

The World Wide Web (WWW) is not a special kind of computer network. The World Wide Web is a large-scale, online information repository, referred to as the web in English. The World Wide Web uses links to make it very convenient to access another site from one site on the Internet.

Every site on the World Wide Web contains many docs. The text in some of these docs is displayed in a special way. When we move the mouse over these places, the mouse arrow changes into the shape of a hand, which indicates that there is a link here. If we click on these links, we can link from this doc to another doc that may be far away.

It is precisely because of the emergence of the Internet that the Internet has changed from being used by a few computer experts to being used by ordinary people.

We usually open web pages from the browser to obtain information from the World Wide Web server, using the HTTP protocol. But when we go to play LOL, the communication between the Client and the server can not be HTTP protocol.

The World Wide Web is a distributed hypermedia. It is an extension of the hypertext system. The so-called hypertext refers to the text that contains links to other docs. A hypertext is made up of multiple sources of information that are distributed around the world.

** The Client program of the World Wide Web is the browser **, and the host where the World Wide Web doc is stored is the World Wide Web server, which runs the World Wide Web server program. ** The client program sends a request to the server program, and the server program sends the World Wide Web doc required by the client program **. The World Wide Web doc displayed in the browser is called a page.

Read more »

Features

  • TCP is a connection-oriented transport layer protocol. That is, a TCP connection must be established before an application can use it. After the data is transferred, the TCP connection must be released.
  • Each TCP connection can only have two endpoints, and each TCP connection is point-to-point.
  • TCP provides reliable delivery service, which means that data is error-free, not lost, not duplicated, and arrives in order.
  • TCP provides full-duplex communication, allowing both sides of the communication to send data at any time.** Both sides of TCP have a send cache and a receive cache**, which are used to temporarily store data for both sides of the communication.
  • Byte-stream-oriented The term "stream " in TCP refers to the sequence of bytes** flowing into and out of a process. Byte-stream oriented means that although the application and TCP interact one block at a time, TCP sees the data handed off by the application as just a sequence of unstructured byte streams. TCP does not know the meaning of the byte stream being transmitted, nor does it guarantee that the size of the block received by the receiver corresponds to the size of the block sent by the sender. It is possible to send and send 10 blocks of data to the upper layer and have it organized into 4 blocks on the receiving side.
Read more »

The Chinese name of OAuth is the Open Authorization Protocol. This name is carefully tested by everyone. It is an authorization protocol. ** Any website that implements this protocol can grant corresponding users to certain applications registered here under the conditions of user consent. Permission ** for certain resources on this website, and this permission is generally represented by token.

Read more »

Principle

Fast and slow pointer

The two-pointer technique is further divided into two categories, one is “fast and slow pointers”, and the other is “left and right pointers”. The former mainly solves problems in linked lists, such as typically determining whether a linked list contains a ring; the latter mainly solves problems in arrays (or strings), such as binary search.

Read more »

Principle

Knuth (who invented the KMP algorithm) said that dichotomous lookups are simple, but the details are the devil**. Many people like to talk about the integer overflow bug, but the real pitfall of dichotomous lookup is not that detail at all, but whether to add one or subtract one to mid, and whether to use <= or < in while.

If you do not have a proper understanding of these details, writing dichotomous is certainly metaphysical programming, there is no bug can only rely on the blessing of God.

Read more »
0%