nodejs pushes messages through a group of nails robot

nodejs pushes messages through a group of nails robot Intro Recently, nodejs has been used for writing. The previous nodejs crawler code was written in js. It feels that the maintainability is too poor, and there is no intelligent prompt. Therefore, js is rewritten with ts(typescript) to improve the code quality. After the start of the crawler, ...

Posted by daniel-g on Mon, 18 Nov 2019 06:58:44 -0800

Module 2: serialization module and collections module

I. serialization module json module ''' Serialization: converting data types from python or other languages to string types json module: is a serialization module. json: Is a "third party" special data format. You can use the python data type -- json data format -- string -- File To use python data in ...

Posted by richardbotw on Mon, 18 Nov 2019 01:47:32 -0800

OkHttp3 source code details Request class

Every network request is a request. Request is the encapsulation of URL, method, header and body. It is also the encapsulation of request line, request header and entity content in Http protocol public final class Request { private final HttpUrl url; private final String method; private final Headers headers; private final RequestB ...

Posted by gazever on Mon, 18 Nov 2019 01:39:59 -0800

Various postures of exception handling in Spring

1. Preface The importance of unified exception handling for application is self-evident. Today, let's talk about how Spring can handle unified Rest exception handling. At the same time, we will simply compare their advantages and disadvantages. 2. @Controller Combine @ ExceptionHandler Declare a method in the controller and mark it with the @ ...

Posted by birwin on Sun, 17 Nov 2019 18:51:14 -0800

4. Permission interception control \ AccessToken jwt - API nodejs + Express + MySQL in the back end of Blog

Authority control Business requirements: View user list interface (only available to administrators), update user information interface (only available to current corresponding users) At this time, middleware needs to be added to realize permission control: At this time, we need to learn the following: AccessToken jwt AccessToken jwt Learn bef ...

Posted by damianraine on Sun, 17 Nov 2019 11:42:03 -0800

Smart use of references to convert arrays to tree arrays

Preface A project by the author needs to be a front-end tree menu. The data returned by the back-end is a parallel list. Each element in the list is an object, such as the value of list[0] is {id: 1, fid: 0, name: first-level menu}. Each element specifies a parent element, and the resulting menu can be nested indefinitely.The plug-in you were l ...

Posted by idweb on Sun, 17 Nov 2019 04:40:49 -0800

010.Kubernetes binary deployment kube-controller-manager

1. Deploy highly available kube-controller-manager 1.1 Introduction to highly available kube-controller-manager In this experiment, a Three-instance cluster of kube-controller-manager is deployed. After starting, a leader node will be generated through the competitive election mechanism, and the other nodes will be blocked.When the leader nod ...

Posted by 00Sven on Sat, 16 Nov 2019 21:55:10 -0800

Understand JSONP principle

Cross domain Why cross domain? Because browser has the limitation of homology policy, homology policy is the core and basic security policy of browser. Port, protocol, domain name, there will be a different cross domain problem. How to solve cross domain problems JSONP CORS How does JSONP solve cross domain problems? The so-called JSONP sol ...

Posted by NFWriter on Sat, 16 Nov 2019 13:35:31 -0800

. NET Core tutorial -- add a server cache to the API

In the past, the basic way to write cache to API interface was to write code as follows: // redis key var bookRedisKey = ConstRedisKey.RecommendationBooks.CopyOne(bookId); // Get cached data var cacheBookIds = _redisService.ReadCache<List<string>>(bookRedisKey); if (cacheBookIds != null) { // return } else { // Perf ...

Posted by mlefebvre on Sat, 16 Nov 2019 11:04:25 -0800

Cas implementation of subsystem login and mutual kick

Implementation ideas 1. A class, which maintains a map of the logged in user, takes out the corresponding session of the last user every time when logging in, and adds an expired attribute ID lasthttpsession.setattribute (be ﹣ "your account is logged in at another location, and you are forced to log off") 2. Write ...

Posted by drorgo on Sat, 16 Nov 2019 09:21:31 -0800