<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nine Rivers &#187; 编程</title>
	<atom:link href="http://9rivers.linkka.com/category/%e4%b8%ad%e6%96%87%e6%96%87%e7%ab%a0/%e7%bc%96%e7%a8%8b/feed/" rel="self" type="application/rss+xml" />
	<link>http://9rivers.linkka.com</link>
	<description>Molecular modeling in Materials Sciences Web development Programming IT</description>
	<lastBuildDate>Fri, 02 Dec 2011 06:20:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Chinese character display with VPtyhon</title>
		<link>http://9rivers.linkka.com/2011/11/15/chinese-character-display-with-vptyhon/</link>
		<comments>http://9rivers.linkka.com/2011/11/15/chinese-character-display-with-vptyhon/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 08:38:12 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=640</guid>
		<description><![CDATA[VPython到底能不能显示中文字符？能显示哪些中文字体？下面的code给出答案。 123456789101112131415from visual import * label&#40;pos=&#40;0,0,0&#41;, text=u'测试'&#41; #print shapes.findSystemFonts() #pl = shapes.text(text=u'测试') #凡是ttf字体文件用windows字体查看器查看typeface name不乱码的（显示中文）字体都可以使用 text&#40;text=u'中文', align='center', depth=-0.3, color=color.green, font=u'C:\\WINDOWS\\Fonts\\simkai.ttf'&#41; text&#40;text=u'字体', align='center', depth=-0.3, color=color.yellow, font=u'C:\\WINDOWS\\Fonts\\msyh.ttf',pos=&#40;0,-1,0&#41;,height=0.5&#41; text&#40;text=u'字体', align='left', depth=-0.3, color=color.red, font=u'C:\\WINDOWS\\Fonts\\jianhuangcao.ttf',pos=&#40;0,-1,0&#41;&#41; 可见VPython不仅支持中文3D字体生成，而且也支持不同字体。但是我发现并不是所有中文字体都能使用，至少在我的英文版WinXP上是这样。一个技巧是，在windows中双击字体ttf文件用字体查看器查看字体，如果显示的typeface name是正确的中文字符，那么这个字体可以使用，如果是乱码则不能。 最近VPython又加入了extrusion的功能，因此生成的中文字形也可以经过挤出形成其它复杂造型，会有很多不同用途。]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2011/11/15/chinese-character-display-with-vptyhon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用tesseract-ocr做文字识别</title>
		<link>http://9rivers.linkka.com/2010/08/06/%e4%bd%bf%e7%94%a8tesseract-ocr%e5%81%9a%e6%96%87%e5%ad%97%e8%af%86%e5%88%ab/</link>
		<comments>http://9rivers.linkka.com/2010/08/06/%e4%bd%bf%e7%94%a8tesseract-ocr%e5%81%9a%e6%96%87%e5%ad%97%e8%af%86%e5%88%ab/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 17:45:06 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[中文文章]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[tesseract]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=517</guid>
		<description><![CDATA[Tesseract-OCR是一个开源的文字识别引擎。它默认支持一些主要的西方语言，包括荷兰语等，并有Linux和Windows二进制版本。直接作为命令行工具使用十分方便：&#8221;tesseract(.exe) *.tiff&#124;bmp *.txt -l en&#124;nld&#8221; , 也就是制定一个tiff或bmp（在Windows上）图像文件作为输入，然后给出一个文字识别后的txt文件，“-l”参数指定语言（例如，nld就是荷兰语的缩写）。默认的字典在./tessdata/中并按语言分子目录。 有些网友说提供的图像文件要足够大才有较好的识别率。 此外tesseract-OCR还支持训练功能，以提高(对不同字体的)识别效率或者对新语种的支持。大致就是通过给定的包含已知字符的tiff文件生成相应的box文件，经过手工更正后，训练tesseract-OCR的识别能力。也可以用一些训练工具完成这个过程。 有了这个工具就可以把网页或者pdf的内容转换为图片，进行OCR，可以编写脚本对多图进行批处理。]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/08/06/%e4%bd%bf%e7%94%a8tesseract-ocr%e5%81%9a%e6%96%87%e5%ad%97%e8%af%86%e5%88%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>评书吧批量下载脚本</title>
		<link>http://9rivers.linkka.com/2010/08/05/%e8%af%84%e4%b9%a6%e5%90%a7%e6%89%b9%e9%87%8f%e4%b8%8b%e8%bd%bd%e8%84%9a%e6%9c%ac/</link>
		<comments>http://9rivers.linkka.com/2010/08/05/%e8%af%84%e4%b9%a6%e5%90%a7%e6%89%b9%e9%87%8f%e4%b8%8b%e8%bd%bd%e8%84%9a%e6%9c%ac/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 22:32:16 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[中文文章]]></category>
		<category><![CDATA[互联网编程]]></category>
		<category><![CDATA[爱好]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=513</guid>
		<description><![CDATA[通常只要修改Page_name和total_pages即可实现自动换页批量下载，喜欢听书的朋友可以试试。 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204#coding=utf8 # Author: Ting Li 2010-08 import httplib, sys, time import HTMLParser global download_links download_links=&#91;&#93; # request the page def GetUrl&#40;ServerAdr,PagePath, Page&#41;: # &#160; &#160;print ServerAdr,PagePath &#160; &#160; conn = httplib.HTTPConnection&#40;ServerAdr&#41; &#160; &#160; conn.request&#40;'GET',PagePath+Page&#41; # &#160; &#160;print conn # &#160; &#160;conn.putrequest('GET', PagePath) # &#160; &#160;conn.putheader('Accept', 'text/html') &#160; # &#160; &#160;conn.endheaders() # &#160; &#160;conn.send(&#34;&#34;) &#160; [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/08/05/%e8%af%84%e4%b9%a6%e5%90%a7%e6%89%b9%e9%87%8f%e4%b8%8b%e8%bd%bd%e8%84%9a%e6%9c%ac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>为了环保也要提高代码效率！</title>
		<link>http://9rivers.linkka.com/2010/04/02/%e4%b8%ba%e4%ba%86%e7%8e%af%e4%bf%9d%e4%b9%9f%e8%a6%81%e6%8f%90%e9%ab%98%e4%bb%a3%e7%a0%81%e6%95%88%e7%8e%87/</link>
		<comments>http://9rivers.linkka.com/2010/04/02/%e4%b8%ba%e4%ba%86%e7%8e%af%e4%bf%9d%e4%b9%9f%e8%a6%81%e6%8f%90%e9%ab%98%e4%bb%a3%e7%a0%81%e6%95%88%e7%8e%87/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 22:34:23 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[杂感]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=406</guid>
		<description><![CDATA[目前全球有约10亿台计算机，每台按100Wh实际功率计算，总功率为1亿千瓦时。也就是说每小时耗电量为1亿千瓦。按计算机一天工作10小时计算，一天全球消耗总电量为10亿千瓦时。世界超大型水电站（如三峡电站）在汛期全部机组开动发电量不过4亿千瓦时（参见）。意味着我们需要2-3个这样的超大水电站全负荷供电才能满足基本需求。我们知道，建设一个这样的电站要耗费数以亿计的金钱和数十年的人工。但是，如果作为程序员，往往可以轻易地提高编码质量和运行效率以达到节省计算时间的目的，变相地节约了宝贵的能源，有利于保护地球环境。我觉得如果所有程序员都朝这个方向努力，每天节省一个三峡电站的电量是完全可能的。]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/04/02/%e4%b8%ba%e4%ba%86%e7%8e%af%e4%bf%9d%e4%b9%9f%e8%a6%81%e6%8f%90%e9%ab%98%e4%bb%a3%e7%a0%81%e6%95%88%e7%8e%87/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using MPICH2 on Debian</title>
		<link>http://9rivers.linkka.com/2010/03/30/using-mpich2-on-debian/</link>
		<comments>http://9rivers.linkka.com/2010/03/30/using-mpich2-on-debian/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 21:23:10 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[mpi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=399</guid>
		<description><![CDATA[1. apt-get install mpich2 (remove other implementation to prevent trouble) 2. create .mpd.conf file under home dir ~/ , add a line &#8220;password=qwert&#8221; (replace qwert with any other texts) 3. create a hostfile or machine file (e.g. mpd.hosts) with node names listed one per line. (this file can be in any folder) 4. start mpd. [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/30/using-mpich2-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control file extensions of Notepad2</title>
		<link>http://9rivers.linkka.com/2010/03/22/control-file-extensions-of-notepad2/</link>
		<comments>http://9rivers.linkka.com/2010/03/22/control-file-extensions-of-notepad2/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 18:54:46 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=392</guid>
		<description><![CDATA[By default Notepad2 add a .txt extension to the file name when you save a newly created file. For files already having extensions, this will not be done. However, this is sometimes annoying if you often create files which do not use txt as extension although they are actually plain text files. I think this [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/22/control-file-extensions-of-notepad2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用VC和gcc同时编译unicode编码的c++源程序</title>
		<link>http://9rivers.linkka.com/2010/03/22/compile-utf8-source-in-vc-and-gcc/</link>
		<comments>http://9rivers.linkka.com/2010/03/22/compile-utf8-source-in-vc-and-gcc/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:58:59 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[中文文章]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[crossplatform]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=388</guid>
		<description><![CDATA[经常在C++程序中加入中文注释，但是如果使用不同的编辑器，编码识别或转换不当，会导致非ASCII字符乱码。 考虑到目前绝大多数编辑器都支持unicode编码(UTF-8)的源文件，我觉得一个稳妥的方式是把自己的代码都保存为unicode(UTF-8)。把原来的ACSII编码的文件转换为unicode网上有一些批量转换工具。值得一提的是众多文本编辑器中只发现EditPlus可以做批量转换，其它编辑器如Notepad++都只能一个文件一个文件地转换（知道如何批量操作的朋友请给些提示？）。VS也可以选择保存文件时的编码格式（在高级保存选项中设置）。还有一个要注意的地方是unicode≠UTF-8，在这点上我以前没有注意，（这里的一篇博文说清楚了这两种编码间的异同，主要区别是unicode固定使用四字节编码所有语言，而UTF-8是可变长度的编码，所以并不一样。） 通过试验得知，VC++和Intel的编译器均支持直接编译带有BOM的UTF-8源文件，但是gcc却不支持。事实上gcc和iconv都不支持读取BOM，但是对于没有BOM的UTF-8编码文件却可以编译。因此，对于跨平台的程序，如果想同时使用VC++和gcc来编译有BOM或无BOM的UTF-8源文件都存在兼容问题。（关于BOM （Byte order mark），wikipedia上有所讨论。） 事实上，解决办法并不难，只是这个问题并没有引起所有编译器厂家的足够重视。这篇文章指名了问题所在并给出了几种解决办法。对于UTF-8，BOM是加在文件最开始的三个字节。我们可以把源文件都保存为带有BOM的格式，这样就满足了VC++编译器的要求。当换用gcc编译器时，在编译之前我们需要使用一些脚本工具来检测BOM的存在并删除它，这样gcc就可以顺利处理无BOM的UTF-8源文件了。 最好的办法是 1awk '{if(NR==1)sub(/^\xef\xbb\xbf/,&#34;&#34;);print}' INFILE &#62; OUTFILE ,它使用awk命令和正则表达式来检测文件的第一行开头的三个字符，如果是UTF-8特有的标记，则用空字符串取代它们，这样就实现了清除BOM的目标。 另一个办法是使用tail命令只保留第四个字节和其后的字符，命令如下 1tail -c +4 UTF8 &#62; UTF8.nobom 这个方法有一定缺陷，应为只有对于确定是带有BOM的UTF-8文件才能这样做，否则就会失误。我们可以使用 1hd -n 3 UTF8 来预先查看一下文件的头三个字符，以确认是否为带有BOM的文件。 至此关于UNICODE源文件和BOM的迷惑终于有了一个完满的答案。]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/22/compile-utf8-source-in-vc-and-gcc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>为Visual Studio编译事件添加声音</title>
		<link>http://9rivers.linkka.com/2010/03/15/%e4%b8%bavisual-studio%e7%bc%96%e8%af%91%e4%ba%8b%e4%bb%b6%e6%b7%bb%e5%8a%a0%e5%a3%b0%e9%9f%b3/</link>
		<comments>http://9rivers.linkka.com/2010/03/15/%e4%b8%bavisual-studio%e7%bc%96%e8%af%91%e4%ba%8b%e4%bb%b6%e6%b7%bb%e5%8a%a0%e5%a3%b0%e9%9f%b3/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:55:55 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[中文文章]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=386</guid>
		<description><![CDATA[VS中编译有时很费时间，如果有声音提示编译结果会比较方便，这样就不用总是查看输出窗口了。根据这篇文章，VS声音提示并不在VS软件设置中，而是在系统的“控制面板”中。打开“声音和音频设备”点击“声音”选项卡，在“程序事件”列表下找到“Microsoft Visual Studio”，就可以为编译成功、编译失败和取消编译等事件指定声音了。 我的设置是： 编译成功 &#8212; notify.wav 编译失败 &#8212; Windows XP Critical Stop.wav 到达断点 &#8212; Windows Navigation Start.wav]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/15/%e4%b8%bavisual-studio%e7%bc%96%e8%af%91%e4%ba%8b%e4%bb%b6%e6%b7%bb%e5%8a%a0%e5%a3%b0%e9%9f%b3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>禁用Visual Studio的Addins</title>
		<link>http://9rivers.linkka.com/2010/03/11/%e7%a6%81%e7%94%a8visual-studio%e7%9a%84addins/</link>
		<comments>http://9rivers.linkka.com/2010/03/11/%e7%a6%81%e7%94%a8visual-studio%e7%9a%84addins/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 22:57:20 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=377</guid>
		<description><![CDATA[某些VS的Addins会导致程序异常缓慢或出错，一个小技巧是在启动VS的时候提前按住左边的shift键，即可禁止加载所有插件。]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/11/%e7%a6%81%e7%94%a8visual-studio%e7%9a%84addins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python模块的反安装</title>
		<link>http://9rivers.linkka.com/2010/03/07/python%e6%a8%a1%e5%9d%97%e7%9a%84%e5%8f%8d%e5%ae%89%e8%a3%85/</link>
		<comments>http://9rivers.linkka.com/2010/03/07/python%e6%a8%a1%e5%9d%97%e7%9a%84%e5%8f%8d%e5%ae%89%e8%a3%85/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 22:23:58 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=372</guid>
		<description><![CDATA[Python的distutils可以很方便地制作模块安装程序，但是没有提供反安装/卸载功能。 可以通过一个trick来实现反安装： 首先，安装模块时使用“&#8211;record” 参数把所安装文件记录到一个文件中 python setup.py install &#8211;record files.txt 然后通过这个“反安装文件”来卸载： cat files.txt &#124; xargs rm -rf 事实上这仅仅相当于手工删除，但是不失为一个解决办法。个人以为，Python的包管理系统很完善，期待更强的包管理器出现。 参考：http://kmandla.wordpress.com/2009/01/08/there-is-no-setuppy-uninstall/]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/07/python%e6%a8%a1%e5%9d%97%e7%9a%84%e5%8f%8d%e5%ae%89%e8%a3%85/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

