programmer group

[JZOJ] 3422. Dance of water jingling

Description Time Limits: 1000 ms Memory Limits: 262144 KB The water jingling gets a colorful checked carpet as a birthday gift. More specifically, the color of the checks on the carpet can change with the trampling. In order to please her idol, Rainbow Cat, Water Ding decided to dance a light dance on the carpet to sell Meng.~~~ The lattices on the carpet have N rows and N columns. Each lattice represents its color with a number between 0 and 5. Water jingling can choose a color between 0 and 5 at will, and then jump one step gently. All the...

programmer group

Common methods of realizing array de-duplication

Common methods of array de-weighting 1. Set implementation of de-duplication based on ES6 let ary = [10, 20, 13, 15, 10, 5, 15, 13, 15, 20, 14, 12, 12]; let res = []; //Using the Set method to achieve de-duplication will become an object, which is required to use the [...] method in the array to convert to an array. ary = new Set(ary); res = [...new Set(ary)]; console.log(ary); // => {10, 20, 13, 15, 5, 14, 12} objects console.log(res); // => [10, 20, 13, 15, 5, 14, 12] array 2. forEach / map method in array: traverse all items in...

programmer group

c++ Chapter 11 Use Classes

Chapter 11 Categories of Use This chapter includes: Operator overloading Friend function Overloaded operator for output Status members Using rand() to generate random values Class Automatic Conversion and Forced Type Conversion Class transformation function Operator overloading: Computing time: an example of operator overloading Time.h class Time { private: int hours; int minutes; public: Time(); Time(int h, int m=0); Time operator+(const Time & time) const ; Time operator*(int m) const ; void...

programmer group

Multithreading of Concurrent Programming (Updating...)

Multithreading of Concurrent Programming What is thread? Running directly by the cpu, a thread refers to the control flow in a single sequence. In a process, multiple processes can be executed in parallel, and each process can perform different tasks in parallel. If the operating system is compared to a workshop, the process is a workshop, the thread is a pipeline in the workshop, and the power supply is the cpu. The difference between processes and threads - Threads: Single-fingered code execution process - Process: Application and...

programmer group

Starting rushSpring transactions from Annotation Transaction Aspect

0. Spring transactions with LTW 0.1. Reasons for Spring Transaction With LTW: Pure Proxy-base mode l is defective, its failure reason analysis and operation mechanism (LoadTime Weaver Bean Definition Parser and AspectJ Weaving Enabler) have been written, no more writing; 0.2 JDBC transactions are at the Connection level: Basic operation template: setAutoCommit(false)-> setTransactionIsolation(isolation_level)->statement.excute()... —>commit()-> onException conn.rollBack() ; 0.3 Spring transactions are based on JDBC...

programmer group

ES6 Core Knowledge Mini Pack

More Content Attention GitHub 1. Give up using var Instead of using var, use: let: for variables with variable values const: For constants, values are immutable let num = 0; num = 1; console,log(num); // 1 const NEWNUM = 0; NEWNUM = 1; // Throw wrong 2. Use arrow function Arrow function automatically binds this One parameter may not be parenthesed, and other cases must be parenthesed (no parameters or multiple parameters) When {} of the arrow function is not used, it returns automatically // Auto-binding this Class Person { arrow...

programmer group

httpclient multithreaded crawler instance

In the process of researching security testing recently, I stumbled upon a loophole in a certain station, which did not need to be checked when accessing resources. The original limit on the number of times users accessed resources every day was gone. I want to use crawler to crawl more data, but the amount of data is too large, so I want to use multithreading to crawl. After the attempt, the script was rough, because I didn't really want to climb it. It is estimated that 100,000 data, 10 threads, 10,000 per thread, 100 data per time...

programmer group

ECMAScript/Javascript AST (Abstract Syntax Tree)

In computer science, Abstract Syntax Tree (AST) is an abstract representation of the grammatical structure of source code. It represents the grammatical structure of programming language in the form of tree, and each node in the tree represents a structure in the source code. The reason why grammar is "abstract" is that the grammar here does not represent every detail of the real grammar. ECMAScript also has the corresponding abstract syntax tree (hereinafter referred to as AST). Today we will parse ECMAScript to see how our code...

programmer group

cherry-pick and rebase commands of git

cherry-pick command The cherry-pick command can merge the commit content of another branch into the current branch. Suppose there are now two branches v1.0, v1.1.v1.0 has the following commit: commit 4d3b38f3e6b9f49776f6e2d2861f0425e10df8d6 (HEAD -> v1.0) Author: bin <bininhere@163.com> Date: Tue Mar 19 10:33:43 2019 +0800 feature5 commit 65ad383c977acd6c7e7bed486bbf3631851a9eda Author: bin <bininhere@163.com> Date: Tue Mar 19 10:30:44 2019 +0800 feature4 commit a2a438f2652166f13a6a2aa36f447968fff3b15d Author:...