摘要:mercurial由于仓库内部编码,使用的是UTF-8,而 windows 上的文件名采用却是ASCII(中文环境下就是cp936)。这样导致遇到文件名有中文的,就会抛异常。可以用 mercurial 的一个扩展 hg-fixutf8 来搞定,但这个扩展还有点缺陷,国人在其基础上做了小改动,代码可见下面的 mercurial 仓库https://bitbucket.org/tinyfish/hg-fixutf8启用此扩展后配合 TortoiseHG 使用,本人未见异常。但在命令行下使用常会抛异常(如:hg log),原因是由于界面翻译后的字符串,和来自仓库的历史所用字符串,两者编码不一致导致r
阅读全文
摘要:mount //192.168.xxx.xxx/remotefolder /localfolder -o username=Administrator,password=1234 -t smbfs而 RHEL 5 上已经不能用了(会报错:unknown filesystem type 'smbfs'),我们只需要将文件系统类型从 smbfs 改为 cifs就行了mount //192.168.xxx.xxx/remotefolder /localfolder -o username=Administrator,password=1234 -t cifs英文解释:Server M
阅读全文
摘要:unix时间转换为可识别的格式 例如,对2000转换date -d '2000 seconds 1970-01-01 UTC'date -d @2000两者是等价的,后者使用@是GNU的扩展。获取特定年月日的unix时间表现形式date +%s -d '1970-01-01 08:33:20'
阅读全文
摘要:-1/20=?C++ 里面结果是 0Python 里面结果是 -1 Python里面的注意事项里面,也提到了这点“总是向负无穷取整” For (plain or long) integer division, the result is an integer. The result is always rounded towards minus infinity: 1/2 is 0, (-1)/2 is -1, 1/(-2) is -1, and (-1)/(-2) is 0. Note that the result is a long integer if either operan...
阅读全文