自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 资源 (1)
  • 收藏
  • 关注

原创 Mercurial修改历史changeset

(源信息来自stackoverflow...)‍ - Enable the MQ extension, by adding something like this to your hgrc:      [extensions]      mq =- 修改最后一次ci的注释:    - Import the current changeset into the queue

2011-11-16 17:04:41 581

原创 ifstream.getline()的陷阱

ifstream.getline(buf, len);如果要读的行长度超过了len, stream将置位failbit。这样,如果检查stream状态,可能会误当作文件读结束了;如果不检查stream状态,则后续的getline都不会读到数据。

2011-08-25 13:05:49 921

原创 多线程(pthreads) & fork

子进程hang在了一个mutex上,这才第一次关注多线程情况下fork的问题。http://cboard.cprogramming.com/linux-programming/99421-pthreads-plus-fork.htmlhttp://pubs.openg

2011-08-25 12:58:59 705

原创 hg (mercurial) 一个端口serve多个repo

webdir_config:--------------------------------[paths]/prefix1 /path/to/repo1/prefix2 /path/to/repo2--------------------------------

2011-08-25 12:57:11 945

原创 再次遇到 undefined reference to `vtable for XXXX'

之前遇到过一次,这次又遇到,又想不起来了,搜了一通还是找到了上次搜索的结果,特此记录备忘:http://bytes.com/topic/c/answers/161894-undefined-reference-vtable===================That

2011-08-25 12:54:49 551

原创 覆盖虚函数时的返回值(Return type of an overriding virtual member function)

http://www.devx.com/tips/Tip/12476Once declared virtual, a member function can be overridden in any level of derivation, as long as the ov

2011-08-25 12:53:49 684

原创 文件锁 fcntl (F_SETLK) 的“陷阱”

http://www.gnu.org/s/libc/manual/html_node/File-Locks.htmlLocks are associated with processes. A process can only have one kind of lock se

2011-08-25 12:51:52 2545

原创 fstream的性能陷阱

1. std::endlcout, cerr经常用的std::endl如果用到ofstream上来换行,就悲剧了....因为它会导致flush...所以还是用'\n'吧。2. tellg看上去tellg只是告诉读指针的当前位置,但是,如果频繁调用,你会发现读性能糟

2011-08-25 12:48:02 846

原创 vim相关

键映射======每天用vim面临两个问题:ESC大量使用,但离得太远;Ctrl造成小指压力过大。第一个问题有两种常用解法:映射Caps Lock作为ESC,或映射Caps Lock作为Ctrl,用'Ctrl + [’替代ESC。考虑到第二个问题,我映射 ‍Cap

2011-08-25 12:44:13 361

原创 gcc weak symbol

‍(a) don't complain if this gets overridden.(b) don't complain and set it to zero if this doesn't exist at all.

2011-08-25 12:40:54 454

原创 调用python脚本时让stdout不缓冲

在其它代码中调用python脚本时,因为stdout由行缓冲变成了块缓冲(block buffered),导致不能及时看到python脚本print的内容。python -u选项指定stdin, stdout, stderr为unbuffered,对于在其他程序中调用pyth

2011-08-25 12:39:13 686

原创 让svn & hg使用vimdiff

svn:svn_vimdiff.sh!/bin/shvimdiff $6 $7svn --diff-cmd=/path/to/svn_vimdiff.shhg:[extensions]hgext.extdiff =[extdiff]cm

2011-08-25 12:38:09 1012

原创 vimdiff

Ctrl+W Ctrl+W 切换窗口do 拉过来另个窗口的改变dp 把改变应用到另个窗口zo 打开折叠代码zc (关闭)折叠代码vimdiff 颜色配置: vimdiff默认的颜色方案会使红色看不清,可以为vimdiff换个colorschema,例如

2011-08-25 12:07:56 3777

c++标准库扩展 TR1

std::tr1现在已经广泛应用了,shared_ptr, function, bind, mem_fn, tuple都是很重要的工具。

2011-08-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除