Relocate to http://www.leetcode.cn so goodbye my friends:)
Posted on 2017年3月31日 23:20RT
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!
https://community.kde.org/Frameworks/Porting_To_qCDebug
http://doc.qt.io/qt-5/qloggingcategory.html#logging-rules
git真是好东东,直接git diff commitid1 commitid2 > patch.txt
但没有git的情况下 diff -Naur standard_moodle my_moodle > patch.txt
打patch -Np1 -i 0001-fixme.patch
Boundary Crossings https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/boundaries/boundaries.html
kext https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIntro/introduction.html
man regex中有Byte Offsets这样的一段,介绍遍历满足正则表达式条件的所有子串的rm_so(起始位置)和rm_eo(终止位置);
用到了regmatch_t结构:
typedef struct {
regoff_t rm_so;
regoff_t rm_eo;
} regmatch_t;
有这样的字符串"xzhai=\"Unix/Linux geek\";legendren=\"GOD\";"
想寻找="xxx";里的xxx内容;
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; }
Linux下rm_eo的值是正确的,而UNIX下rm_eo始终为0,不解