Home
Jacob Lin
Cancel

How does browser render a page

HTML, CSS and JavaScript HTML is made up of tags and text. Each tag has its semantic meaning, and the browser will display the HTML content correctly according to the semantic meaning of the tag. ...

From source code to runtime

What happens behind the scene when we compile the following code: #include <iostream> #include "demo.h" int main() { std::cout << "Demo" << std::endl; return GREETING; }...

Floating point numbers and fixed point numbers

How can we represent numbers with a point in computer? Fixed point numbers We know that we can represent 32^2 different numbers with 32 bits, which gives us almost 4 billion distinct numbers. An i...

Select, poll and epoll

What is I/O multiplexing Consider a program that reads from stdin and sends the read in content to a socket channel and vice versa (reads from socket channel and writes to stdout). We could use the...

How to shorten the url

Have you ever used the short URL service? If we post a message with a URL in a microblog, the microblog will convert the URL inside into a shorter URL. If we visit this short URL, it is the same as...

Visitor design pattern and k8s kubectl implementation

Visitor pattern A machine learning framework will typically implement its dataset I/O functionality. Data source are usually of different types and format. Say we have 3 kinds of format to parse, n...

Writing a LLVM pass

Basic function pass We can register our own function pass for LLVM to execute for us. The following are quoted from the LLVM documentation: All FunctionPass execute on each function in the pro...

My notes of reading effective C++

Following is my note of reading effective c++ (this is an on-going post) Copy all parts of an object In a mature object-oriented C++ system, there are only two ways of copying objects: copy co...

Learning Java annotations

Overview Java developers must have used @Override annotation which declares that an instance method overrides a method of the same name and the same parameter type of the parent class. The definit...

Common loop optimization techniques by compiler

Before optimizing a loop, we need to first define a loop in the control flow graph. Note that each node in a control flow graph is a basic block. Identifying loops Cycles in the control flow graph...