模运算的运算规律
摘要:sicp 1.26 涉及模运算,需要知道模运算的规律1. 模运算是取余运算(记做 % 或者 mod),具有周期性的特点。m%n的意思是n除m后的余数, 当m递增时m%n呈现周期性特点, 并且n越大,周期越长,周期等于n。 例如 0 % 20 = 0,1 % 20 = 1, 2 % 20 = 2, 3 % 20 = 3, ..., 19 % 20= 19 20 % 20 = 0,21 % 20 = ...
阅读全文
posted @
2009-11-28 17:53
lbsx
阅读(1736)
推荐(0)
work with git from emacs
摘要:http://xtalk.msk.su/~ott/en/writings/emacs-vcs/EmacsGit.html翻译:http://kzjeef.yo2.cn/articles/%E5%9C%A8emacs%E4%B8%AD%E4%BD%BF%E7%94%A8git%EF%BC%88%E7%BF%BB%E8%AF%91.html有的功能是在vc里面,比如vc-create-repo,新建仓...
阅读全文
posted @
2009-11-16 09:26
lbsx
阅读(236)
推荐(0)
moinmoin apache2配置
摘要:对apache2不熟,折腾了半天,记录一下,主要就是virtualhost那块比较乱Virtual Hosts Settings Virtual hosts allow you to run different servers for different IP addresses, different host names, or different ports on the sam...
阅读全文
posted @
2009-11-15 14:44
lbsx
阅读(504)
推荐(0)
ibus添加自定义词组
摘要:每输入一个字都用Ctrl+Num进行选择,直到词组输入完毕,然后按空格提交还有一种就是在normal commit状态下,先把词组输入完,但是不空格确认,此时按左shift,再空格就可以添加一些快捷键:Space commit inputted string.Shift_L when no key inputted: shift the input mode between English and...
阅读全文
posted @
2009-11-10 12:27
lbsx
阅读(1219)
推荐(0)
linux opencv 环境
摘要:debian testing中的opencv是1.0版本的,太老了下载2.0版本,解压 编译过程: cd OpenCV-2.0.0/ mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/opencv -D BUILD_PYTHON_SUPPORT=ON ..配置:在.bash...
阅读全文
posted @
2009-11-09 21:29
lbsx
阅读(277)
推荐(0)
python 字符集转换
摘要:decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串转换成unicode编码。encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unicode编码的字符串转换成gb2312编码。to unicode:s = '中文'此时s的字符集与环境有关,比如...
阅读全文
posted @
2009-11-08 18:55
lbsx
阅读(3413)
推荐(0)
快排思路
摘要:今天写个快排,居然调试了N久。。。orz。。。[代码]找一个pivot,将小于它的放到左边,将大于它的放到右边,然后再对左右分别递归,返回条件是begin >= end。pivot一般在begin, middle, end中选取中值。http://baike.baidu.com/view/19016.htmlhttp://www.comp.nus.edu.sg/~xujia/mirror/a...
阅读全文
posted @
2009-11-04 20:01
lbsx
阅读(435)
推荐(0)