Bojie Li
2014-11-28
Translator’s note: Jennifer Rexford is a professor at Princeton University and a leading figure in the field of network research. She gave a talk to new graduate students in the field of engineering in 2010: Advice for New Graduates.
Those who know me know that I have a hobby of collecting famous quotes. A sentence explains the story behind this: famous quotes are short and portable, which is a suitable hobby for me who often moved when I was a child. Two famous scientists from Princeton in the 1930s, Einstein and Thomas Lewis, made interesting and somewhat opposing comments on the role of the “individual”.
Einstein in the field of physics said: “All valuable things in human society depend on the opportunity for individual development.”
Thomas Lewis in the field of pharmacology and biology said, “In fact, there is no such thing as a single individual; his own life is not much more than a cell torn from the surface of the skin.”
These two quotes summarize well what graduate students do.
2014-11-25
Many people are confused about the difference between these two sets of concepts. Let’s use the example of Xiao Ming downloading a file.
- Synchronous Blocking: Xiao Ming keeps staring at the download progress bar until it reaches 100%.
- Synchronous Non-blocking: After Xiao Ming starts the download, he goes to do other things, occasionally glancing at the progress bar. When it reaches 100%, the download is complete.
- Asynchronous Blocking: Xiao Ming switches to a software that notifies him when the download is complete. However, he still waits for the “ding” sound (which seems silly, doesn’t it?)
- Asynchronous Non-blocking: Still using the software that “dings” when the download is complete, Xiao Ming starts the download and then goes to do other things. When he hears the “ding”, he knows the download is complete.
In other words, synchronous/asynchronous refers to the notification method of the download software, or the API being called. Blocking/non-blocking refers to Xiao Ming’s waiting method, or the API caller’s waiting method.
2014-11-20
Why does a C program need to be compiled before it can be executed? Why does a C program need to go through the four steps of preprocessing, compiling, assembling, and linking to become an executable file? Let’s start with this simple C program.
Why Compile
This is not a simple question. We know that Python code does not need to be “compiled”, and you can run the result by entering a line of code, which is very user-friendly, isn’t it! This interactive runtime environment is called REPL (Read-Evaluate-Print-Loop), which reads the user’s input statement, executes the statement, outputs the value of the statement, and then returns to the waiting input state.
2014-11-19
On September 19, 2014, at 22:30, I was dragging a suitcase half my weight, walking alone under the mottled tree shadows in the west district of USTC. Just a few hours ago, I was studying the knapsack problem: how to bring back as many valuable things as possible under the constraint of backpack volume.
At that time, only a few people knew I was back: the boss and colleagues in the group, my parents, and Zhang Jingning. Just a few days ago, the LUG buddies were still discussing whether I would come back in October: because I messed up the mirrors server, I still owe everyone a meal!
This was the original beginning of the life summary written on October 20, “Escape from the Activity Room“. But I felt it was inappropriate, so I changed it to “Escape from Microsoft”. At the beginning of this month, I changed my Renren cover photo to the staff group photo of SFD on September 20, just to commemorate the beginning of this year’s new life.
2014-11-09
When we mention Ken Thompson, the first thing that comes to mind is the UNIX operating system he invented. For this, he won the Turing Award in 1984. In his Turing Award speech, Ken Thompson raised a profound question: Does seeing the source code of software mean there are no backdoors? Could there be self-replicating backdoors in compilers?
This paper published in “ACM Communications” is only three pages long and omits many details. The principle is a bit like a C program that outputs its own code, but it’s much more difficult. Following in the footsteps of the sages, I inserted a self-replicating backdoor into an open-source C compiler—tcc. This compiler, with the backdoor, will automatically insert a backdoor when compiling the source code of the Linux login program sulogin.
2014-11-05
The day before yesterday, my classmate Zhang Qingyu told me that it’s best to use Wi-Fi and turn off the 3G network when Wi-Fi is available, which can save a lot of power. Does 3G really consume more power than Wi-Fi? I looked up the literature and found that it is indeed the case. When the data to be transmitted is less, the difference in power consumption can be as much as 10 times.
Blue line: 3G power consumption; Green line: wifi power consumption; Purple line: power consumption considering wifi scanning and establishing connection (Source: TailEnder)
The reasons are mainly two-fold:
- After the 3G network completes data transmission, it needs to maintain a high power state for a period of time;
- The transmission power of the 3G network is much greater than that of the Wi-Fi network.
2014-10-29
All active members of LUG will sooner or later be attracted to the circle of coders.
The origin and truth of this rumor are not considered for the time being. Whether it is the atmosphere of LUG that leads the buddies to the road of coders, or those who are determined to take the road of coders will be active in LUG for a long time, I can’t tell.
Why choose computer science major, in fact, is two propositions:
- Why choose computer as a future career?
- Why choose computer science major during undergraduate?
I try to interpret these two propositions with my own experience. In my youth, I once regarded scientist as my dream. In the third year of high school, I thought about doing theoretical computer research. At the juncture of freshman to sophomore, I once hesitated between mathematics and computer science, and even considered studying physics. Because I couldn’t figure it out, I didn’t apply for a change of major in the second semester of my freshman year. A week after the start of the second semester of sophomore year, I felt that I couldn’t continue to be chaotic, so I submitted an application for a change of major. From the second week, I embarked on the road of no return to coders.
2014-10-20
Escape from Microsoft
On the morning of September 17, 2014, in the conference room on the 12th floor of Microsoft Research Asia. The boss just returned to Beijing after a month-long international conference, and I nervously reported the unsatisfactory progress of the past month at the group meeting. In the previous few days, my heart was beating wildly, fearing that the boss would see through my nature of not working hard. Unexpectedly, the boss did not scold me after the report, but said that my model has made great progress compared to a month ago. However, we both clearly realized that our work could not catch up with the NSDI conference deadline on September 26.
2014-09-29
The Trouble with DHCP
The story begins with the update of the network access management device at USTC.
The reason for the unified allocation of IP addresses in public internet access areas is that the IP address segments scattered and allocated by each building are not enough. A few years ago, the main force of the Internet was desktop computers and laptops, and it was impossible to keep them on all the time; but now everyone has smart terminals, possibly more than one, and will connect to the Wi-Fi wherever they go. Many places that were more than enough with the /24 address segment (256 IPs) have encountered situations where IP addresses cannot be allocated during peak periods. The size of USTC’s IP address pool is limited, and centralized allocation has solved the problem of insufficient addresses.
This was originally a happy event for everyone, but the new equipment brought new problems. The library query machine that uses network booting freezes after a period of time. The reason is that the IP addresses allocated during the startup phase of the parent system and the startup phase of the subsystem are different, and this difference is due to the bug of the BRAS network access management device.
2014-07-06
Those who use the ext file system to store data may have noticed that a 200 G partition can only use 190 G, and a 2000 GB partition can only use 1900 GB. Where did this 5% disk space go? Some people think this is the difference between the decimal system (1000) and the binary system (1024), but this is not the case.
1 | $ df /mnt/sdb/ |
The available space of the above-mentioned 2 T disk is 0, which seems to be full. Try to create a directory and find that there is no space left.
1 | $ mkdir hello |
But sudo mkdir hello can succeed! What’s going on? The answer lies in the “reserved space” of the ext file system.