- 博客(18)
- 收藏
- 关注

原创 Word of the Day
preeminentadjectivepree-EM-uh-nuntmore important, skillful, or successfulexactverbig-ZAKTto call for forcibly or urgently and obtainto call for as necessary or desirablegulositynoungoo-LAH-suh-teeexcessive appetite: greedinesssarcophagus
2022-01-06 17:02:00
227
原创 chess基础
scholar’s matee4e5qh5kc6bc4bc5qf7#scholar’s mate defense: queen’s knighte4e5bc4kc6qh5qe7/qf6?g6scholar’s mate defense: king’s knighte4e5bc4kf6king’s gambite4e5f4f4kf3 to stop qh4kc6d4d6bf4kf6kc3?bc4?castlingk..
2022-03-24 14:13:59
176
原创 华为机试复习
1. 杂乱知识点判断x是否为素数(质数)bool is_prime(int x) { for (int i=2; i<=sqrt(x); i++) if (x%i == 0) return false; return true;}栈的使用方法stack<int> s;int 5;s.push(5);bool b = (s.size() != 0);int y = s.top();if (b == true) s.pop();排列组合的使用方法vector
2022-03-24 14:09:43
290
原创 C++面经
placement newnormal newallocates memoryconstructs an object in allocated memoryplacement newseperate above two thingswe can pass a pre-allocated memory and construct an object in the passed memorynew allocates memory in heap, whereas placement ne
2022-03-17 22:44:26
7468
原创 华为机试书签
note1. again!ctrl + F + again! to find the problems that need a double checkhj7. castingfloat i;int j = (int) i;hj9. unordered_setunordered_setreverse(str.begin(), str.end())set.count©set.insert©hj46. sub stringstring s;s.substr(0, 3); // 3 is
2022-02-19 22:11:05
355
原创 基础排序算法
选择排序算法描述(从小到大)首先找到数组中最小的元素,并将这个元素与数组的第1个元素交换位置。然后找数组中剩下的元素中最小的元素,再与数组的第2个元素交换位置。以此类推完成排序。代码vector<int> selection_sort(vector<int>& nums) { int n = nums.size(); for (int i=0; i<n; i++) { int min_index = i; for (int j=i+1; j<n
2022-02-11 12:48:17
469
原创 Java基础
1. syntaxmain() methodpublic class Main { public static void main(String[] args) { System.out.println("Hello"); }}Every line of code that runs in Java must be inside a class. In our example, we named the class Main. A class should always start wi
2022-01-07 11:40:56
732
原创 Makefile基础
DefinitionsTargets: file names separated by spaces; typically one target per rule; the default target is the first targetCommands: series of steps typically used to make the target(s); start with a tab characterPrerequisites: also called “dependencies”
2022-01-06 17:01:25
78
原创 Go Context - Cancelation and Propagation
import "context"!view context package source code!see example code for a server that uses contexts!view golang documentation about context!假设你需要制作一个三明治,于是你安排了三个人分别去买番茄、面包和火腿。买火腿的人到了超市后发现没有火腿了,于是叫超市的店员给他现场制作一个火腿。买面包和番茄的人分别在去面包店和番茄店的路上。这时你突然决定不吃火腿了,为了不
2022-01-06 17:00:51
180
原创 Go Concurrency
BasicsWhat is a thread?A thread is a path of execution within a process.Why multi-threading?The idea is to achieve parallelism by dividing a process into multiple threads. For example, in a browser, multiple tabs can be different threads.Process and
2022-01-06 17:00:15
107
原创 Go Methods and Interfaces
MethodA method is a function with a special receiver argument.func (v Vertex) Abs() float64{ return math.Sqrt(v.X*v.X + v.Y*v.Y) // In this example, the `Abs` method has a receiver of type `Vertex` named `v`}// is equivalent to (in terms of functiona
2022-01-05 16:52:36
217
原创 Go Basics
Packagespackage mainimport ( "fmt" "math/rand")Exported namesfunc main() { fmt.Println(math.Pi)}Functionsfunc add(x, y int) int { return x + y}// multiple resultsfunc swap(x, y string) (string, string) { return y, x}// named-return va
2022-01-05 11:04:03
319
原创 Git Commands
echo -e "First line.\nSecond line." >> file_name.txt is a shortcut of two commands.git add . puts all files into “Index”.master is a reference to the end of a branch. By convention (and by default) this is usually the main integration branch, but .
2022-01-05 10:37:45
382
原创 Charles和iPhone抓包
声明:本文转载自 https://www.charlesproxy.com/download下载Charles下载方式1 - 官网下载地址:Charles官方网站下载!下载方式2 - 如遇官网下载慢,点击这个链接下载:国内网站下载!配置Charles主机配置破解。点击这里下载破解文件!打开Charles,Click “Help” -> SSL Proxying -> Install Charles Root Certificate打开钥匙串,点击Charles Proxy
2022-01-05 10:37:03
1399
原创 C语言基础
ArrayIt is often useful to think of an array as a collection of variables of the same type.All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest to the last element.Declaring Arraysthe t
2022-01-05 10:36:34
606
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人