Learn Rust from scratch, the first program Hello World, and the package management tool Cargo
In the previous section, Rust's development environment was installed . This section begins with the first program and the introduction
Use of Cargo.
hello world
Create Hello manually_ World folder:
mkdir hello_world
cd hello_world
Then create a hello_world.rs file, i.e. t rust source file:
touch hello_world.rs
Write the follow ...
Added by sasquatch69 on Sat, 29 Jan 2022 14:25:56 +0200
Even some people think that Redis is only as simple as get set?!
Five data types and application scenarios of Redis
Redis has five data types, namely, string,list,hash,set,zset(sort set). I think this point should be clear to all partners who have a little knowledge of redis. Next, let's discuss the application scenarios of these five data types. [get notes]
string
This type is believed to be the most fam ...
Added by kansaschuck on Wed, 26 Jan 2022 07:20:04 +0200
TiDB compilation and sharing on CentOS
Here are some points in the compilation process of TiDB. Although in theory, the source code downloaded from github can be compiled after decompression, in the actual operation process, there may still be errors due to various reasons. This paper shares several problems and solutions in the actual operation process.
The environment used in t ...
Added by Donnamabob on Tue, 25 Jan 2022 14:22:14 +0200
Comparison between Go Rust sorting and binary search
Author: Wang DongyangprefaceSorting and binary search are very common algorithms in computer science leveldb memdb source code analysis (Part 2): Rust implementation You can see that many methods use binary search. This paper will compare some characteristics and differences in sorting and search methods between Go and Rust. For Go, we mainly u ...
Added by suncore on Sat, 15 Jan 2022 11:24:57 +0200
New generation compiler SWC
Recently, there has been a rush of trust in the front-end circle. All front-end tools that can be rewritten with trust are rewritten with trust. The tool introduced today is bable: swc, a tool that converts ES6 into ES5.Moreover, on the official website of swc, it is very straightforward to say that they are benchmarking with babel. swc and bab ...
Added by Brokenhope on Thu, 13 Jan 2022 13:23:59 +0200
[algorithm] 2103 Ring and rod (Java / C / C + + / Python / go / trust)
1281. Difference between bit product sum of integers:
There are n rings in total, and the color of the ring can be one of red, green and blue. These rings are distributed on 10 rods numbered 0 to 9.
Give you a string rings with a length of 2n to represent the distribution of these n rings on the rod. Every two characters in rings form a ...
Added by geo3d on Thu, 13 Jan 2022 05:32:22 +0200
Rust implementation of leveldb memdb source code analysis
prefaceThe memdb module in leveldb uses skiplist as a kv memory storage, and the related code implementation is very beautiful. The following is described above:Compare the implementation of query, insert and delete in c + + and golangAnalyze the places in the golang version that can be optimized, and then optimize the t rust versionThen in thi ...
Added by mrvijayakumar on Tue, 11 Jan 2022 09:06:55 +0200
Rust async understanding and preliminary preparation
Rust async understanding and preliminary preparation
Operating environment: win10 x64, rustc 1.57 0, author: Oolong Hari, date: December 31, 2021
1, Original program
Suppose we want to cook a meal now, and the stove has only one stove. The steps are generally as follows:
1. For pot washing, rice washing, etc., we set fn prepare()
2. Start coo ...
Added by bobob on Tue, 04 Jan 2022 05:28:09 +0200
10. Common auxiliary classes
10.1. CountDownLatch (counter)
In the official documents, the explanation of this block is complex. In short, this class is a subtraction counter, which is generally used to calculate the execution times of threads and execute an operation when it reaches 0.
For example, suppose there are six students in a class. Now after school, if the ...
Added by daniellynn2000 on Wed, 15 Dec 2021 23:34:31 +0200
Rust introduction notes
Make a backup
Rust
case
Guess number
use std::io;
use rand::Rng;
use std::cmp::Ordering;
fn main() {
let mut guess = String::new();
let secret_number = rand::thread_rng().gen_range(1, 101); // 1-100
println!("{}", secret_number);
loop {
io::stdin().read_line(&mut guess).expect("cant read line");
let ...
Added by bingo333 on Tue, 14 Dec 2021 06:40:28 +0200