This category stores my personal info in English.

xfinity drop off devices randomly – solved

Problem: Since this afternoon, xfinity drops my lenovo yoga 2 laptop Wifi connection frequently. My laptop keeps reconnecting to the xfinity every 10 seconds. Process: First I suspected there are some problems with my laptop internet card driver, since my other device, smartphone and ipad, all works fine. I followed […]

Java Design Philosophy

Writing a Library Exception Always throw exception as early as possible. // DO class Animal{ static final String name; static { name = LoadNameFromDisk() if (name == null) { throw IllegalStateException(“Can not read name from disk”); // Throw exception here } } public Animal(){} } // DON’T class Animal{ static […]

Learning Note for Functional Programming

Coursera Note Sentence in red is my own perspective, inspired by the instructor. 1.1 Programming Paradigms Imperative Programs and Computers There is strong correspondence between Mutable variables ~ Memory cells Variable dereference ~ load instructions Variable assignments ~ store instructions Control structures ~ jumps Problem: how can we avoid conceptualizing […]

Differences Between Threads and Processes

Motivation The difference between threads and processes used to confused me. Why do we need threads since we already have processes to support concurrency? What’s the mechanism of the context switch between threads?(rather than processes) How is locks implemented? This article may be your answer. Acknowledgement: Some of the sentences […]

How to Generate a Maze in C++

Generating maze is amazing! This algorithm is also widely used in lots of computer games. Given a 2D array, generate a maze in it. There are several requirements of this maze: There are no circles in the maze, which means all roads in the maze lead to an dead end or to […]

User and Group Privilege

type ls -al in the terminal Privilege: There are 10 bits in privilege part. bit 1: [d] – directory [-] –  file [l] – link file [b] – interface devices [c] – serial port devices, such as mouse, keyboard bit 2-4: privilege of the file owner. read, write and execute […]