关于popen

今天才知道 popen 运行一个系统调用时, 通过 popen 返回的文件句柄只能读到系统调用往 stdout 的输出内容。 输出到 stderr 的内容是得不到的。 有一个办法,就是在调用命令的尾部加上 2>&1 这样的内容, 其含义为:将 stderr(2)重定向到 stdout(1)中。 例如 iwconfig eth0 这个命令,如果 eth0 不是无线网卡,运行此命令的后果是得到...

2006-11-15 · wuan

iterator

初始化stl容器,最终四个容器的内容都是1 2 3 4 int d1[4] = {1,2,3,4}; int d2[4] = {5,6,7,8}; vector v1(d1,d1 + 4), v2(d2,d2 + 4), v3(d2,d2 + 4), v4; copy(v1.begin(),v1.end(),v2.begin()); // copy - .begin() copy_backward(v1.begin(),v1.end(),v3.end()); // backward - .end() copy(v1.begin(),v1.end(),back_inserter(v4)); // init a empty vector

2006-11-01 · wuan

regex_replace控制某个子表达式的更新

str = boost::regex_replace(str, reg, "(?1become1)$2(?3become3)$4", boost::format_all ); 其中第一个子表达式更新为become1,第三个子表达式更新为become3。

2006-11-01 · wuan

Beans'OS about author

转自 http://www.beanos.org/ Beans’OS about author Welcome to my website, I’m Shaojie Zhou At this flippancy age. as a programmer, it’s easy to lost the glory. I always think that a good programmer should be a knight, with powerful sword and fight for the hope. Although for live, I have to face one troubled after another every day, but I always believe that one day I could carry out my dream. Being a programmer is the most lucky thing to me. Thanks the God. Please consider this project as a toy, I expect buddies with the same hobby, a game with more persons is always more interesting. Contact me: [email protected]

2006-10-26 · wuan

如何成功运作 pm 用户组

转自 http://www.perlchina.org/archive/archive.php?action=archive&page=7 概要 每个 Perl Monger Group 都有点不同,有些是纯社会性的小组,有些是纯技术小组,而大多数在这两者之间;有些成员多至上百人,有些却只有寥寥数个。有一些高效的办法可以帮助你的 PM 小组获得成功。在这篇文章里面,Dave Cross 和我们分享一些他三年来领导 London.pm 小组的成功经验。 找到会员 最困难的事情要数发展新会...

2006-10-25 · wuan