Owner: Xiaofan SHEN Tags: Infrastructure
A variable in a program acts like a container. It can be used to store a string, a number, or other kinds of data.
str1.find(str2)
Pipelining is a form of parallelism where tasks are solved faster by having multiple tasks simultaneously at various levels of completion.
Parallelism can improve performance by improving latency (the time that a task takes from beginning to end) or by improving throughput (the amount of tasks that can complete during a given interval of time).
Inexpensive computers can perform 3 basic computations in a nanosecond — that’s one (wildly oversimplified) way of describing what it means to be a “3 GHz” computer.
Caching is a general problem-solving approach that provides a much more flexible way of dealing with certain resource tradeoffs.
Hardware caches
An API is an interface or menu that different programs can use to communicate with each other.
“向荆市长隐藏的信息允许档案部在不打扰荆市长的情况下改变其工作方式。这是界面意义的重要组成部分。”
Bridges of Königsberg
图中每条边都经过一次的路径称为欧拉路径。
A list is a data type for storing multiple items of the same type that are related and belong together.
Writing the logic of programs in English is called pseudocode.
An algorithm is a step by step process designed to achieve some outcome, and computers are the fastest machines ever conceived for carrying out step by step processes!
That means that the study of algorithms is a core aim of computer science, but their use transcends any one discipline.
Code worked or delivered
When a computer scientist says an algorithm “works,” that doesn’t just mean it promises to produce a correct result. It also has to deliver on that promise, finish, and produce the result, on every possible input.
Making sure an algorithm always finishes and produces a result is called proving termination, and it can be a little bit tricky!
Langton’s ant、Boolean
Dictionary
cleaned_word = word.lower().strip(punctuation)
reader = open(‘data/jekyll.txt’) punctuation = ‘.;,-“’”:?—‘!()_’
freq_dict = {} for line in reader: for word in line.split(): cleaned_word = word.lower().strip(punctuation) if cleaned_word in freq_dict: freq_dict[cleaned_word]+=1 else: freq_dict[cleaned_word]=1
print(len(freq_dict))