Code makes the world a better place

Core Competencies for Computer Science Students

What skills should a CS undergraduate have upon graduation? What skills should a CS graduate student have after finishing a master’s program?
Beyond what you learn in specialized courses, I want to seriously discuss the “core competencies” that CS students should develop.

Continue reading

A Detailed Guide to the Unix/Linux `top` Command

TOP Overview

The top command is one of the most fundamental tools on Unix/Linux. It is similar to Windows Task Manager and lets you monitor the execution status of currently running programs. top is also one of the simplest ways to monitor a program: you can use it to observe how much memory and CPU a program consumes, along with many other details. There are many similar tools (such as htop and gtop) which are extended versions. If you’re interested, you can look them up, but for basic needs, top is more than sufficient.

Continue reading

Configure DNS on Linux/Unix from the Command Line

Here’s what happened: starting yesterday, a machine in my lab suddenly couldn’t access the Internet. I usually use that machine as a proxy, because sometimes I need an NCTU IP address for looking up papers. At first I thought Squid was broken, so I spent a long time tweaking the configuration—only to realize the issue didn’t seem to be Squid. Then I was shocked to find that I could SSH into the machine, but it couldn’t connect outbound.

Continue reading

A Concise Guide to Shell Internals and Implementation

Shell Introduction

Whether you are using a local Unix machine, Windows, or connecting to a remote server, you will open a terminal (Terminal). After you log in, the initial screen is a shell, where developers can enter commands to run programs. In a sense, when people say “using the terminal,” they often mean “using the shell,” even though those terms are not originally identical. For more details about shells, see the English Wikipedia page “C shell”.

Continue reading

How I Became Interested in Computer Science

I am currently pursuing a graduate degree in computer science at NCTU. Deciding to go down the CS path was a long process for me. This story starts from the very beginning and describes how my interest in computer science gradually took shape. Everyone’s story is unique; I hope mine can offer some inspiration and lessons for others.

Continue reading

Red-Black Tree (RBT) Introduction

Red-Black Tree Overview

A red-black tree is a special data structure that can automatically balance itself, similar to an AVL tree.

A red-black tree has the following properties:

  • Each node is either red or black
  • The root must be black
  • Every leaf (NIL) is black
  • If a node is red, its children must be black
  • Every path from the root to a leaf has the same number of black nodes

Following these rules ensures the tree stays balanced during insertions and deletions. A red-black tree guarantees that when the number of nodes is n, the height is at most 2log(n+1).

In practice, it is often used to implement sets and dictionaries. In C++, std::set and std::map are backed by red-black trees.

Continue reading