Relocate to so goodbye my friends:)

Posted on 2017年3月31日 23:20


git syncing a fork

Posted on 2015年11月05日 11:20
git remote -v git remote add upstream git remote -v git fetch upstream git checkout master git merge upstream/master

infinite loop

Posted on 2015年10月26日 16:46

For example, A can have a neighbor called B. Therefore, we may traverse from A to B. An undirected graph implies that B can always traverse back to A. Is it true here? No, because whether B could traverse back to A depends if one of B’s neighbor is A.

The fact that B can traverse back to A implies that the graph may contain a cycle. You must take extra care to handle this case. Imagine that you finished implementing without considering this case, and later being pointed out by your interviewer that your code has an infinite loop, yuck!


Posted on 2015年10月14日 10:17


Posted on 2015年10月10日 13:46

git真是好东东,直接git diff commitid1 commitid2 > patch.txt

但没有git的情况下 diff -Naur standard_moodle my_moodle > patch.txt

打patch -Np1 -i 0001-fixme.patch

mac kernel and user space communication

Posted on 2015年9月29日 16:19

Boundary Crossings


rm_eo 在 Linux、UNIX下居然不同,不解

Posted on 2009年9月02日 16:51

man regex中有Byte Offsets这样的一段,介绍遍历满足正则表达式条件的所有子串的rm_so(起始位置)和rm_eo(终止位置);


typedef struct {
    regoff_t rm_so;
    regoff_t rm_eo;
} regmatch_t;
有这样的字符串"xzhai=\"Unix/Linux geek\";legendren=\"GOD\";"



while (!regexec(&m_reg, tmp, 1, &m_match, 0)) 
    // FIXME: Unix regex`s rm_eo is often 0 test under Mac OS X Leopard;
    // But Linux POSIX regex`s rm_eo is normal test under Gentoo Linux
    printf("%d - %d\n", m_match.rm_so, m_match.rm_eo);
    tmp += m_match.rm_eo;