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


nsSCM::Install 多个依赖之间用什么隔开

Posted on 2010年5月21日 16:57




// 7
  char* Depend = STRNEW ();

  if (popstring (Depend))
    STRDEL (Depend);
    STRDEL (LoadGroup);
    STRDEL (ServiceFile);
    STRDEL (ServiceDisplay);
    STRDEL (ServiceName);
    RET_DWORD (rc, Tag);

  /* fixup end of multistring */
  DWORD len = strlen (Depend);
  Depend [len + 1] = 0;

  /* replace comma separator on null separator */
  for (DWORD i = 0; i < len; i++) if (',' == Depend [i]) Depend [i] = 0;


可以用逗号隔开 bingo



iPhone 3.0 jialbreak dev

Posted on 2009年12月06日 20:19


cd ~/Desktop

vi script

cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
printf "\x8f\x2a\x00\x00" >> working
dd if=iPhoneOS\ Build\ System\ Support of=working bs=1 skip=127504 seek=127504
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
/bin/mv working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support



wayland 依赖

Posted on 2009年9月24日 16:50






libudev >= 136


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;