<?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; Programming</title>
	<atom:link href="http://9rivers.linkka.com/category/articles-in-english/programming/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>Mon, 30 Aug 2010 13:55:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Uncompress tar to specific directory + Other tar/untar tricks</title>
		<link>http://9rivers.linkka.com/2010/08/10/uncompress-tar-to-specific-directory/</link>
		<comments>http://9rivers.linkka.com/2010/08/10/uncompress-tar-to-specific-directory/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 11:07:34 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Articles in English]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=521</guid>
		<description><![CDATA[The order of the options of tar command does matter on some systems (Cygwin problem is discussed in this post). ]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/08/10/uncompress-tar-to-specific-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internal overflow compressing coordinates</title>
		<link>http://9rivers.linkka.com/2010/04/23/internal-overflow-compressing-coordinates/</link>
		<comments>http://9rivers.linkka.com/2010/04/23/internal-overflow-compressing-coordinates/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 16:41:46 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mpi]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=476</guid>
		<description><![CDATA[I occasionally got this error while running some mpi programs. I could not find the exact reason. Even when I google it, it seems no relevant explanation of it. By investigating the codes with debugger, I notices some data in the memory are huge, when I correct them, the error information was gone too. Therefore [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/04/23/internal-overflow-compressing-coordinates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An MPI implementation I didn&#8217;t know before</title>
		<link>http://9rivers.linkka.com/2010/04/23/an-mpi-implementation-i-didnt-know-before/</link>
		<comments>http://9rivers.linkka.com/2010/04/23/an-mpi-implementation-i-didnt-know-before/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 10:45:53 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[mpi]]></category>
		<category><![CDATA[Scientific computing]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=474</guid>
		<description><![CDATA[DeinoMPI is an implementation of MPI-2 for Microsoft Windows. DeinoMPI is a derived work from MPICH2 provided by Argonne National Lab.  By starting with the MPICH2 code base DeinoMPI inherits a stable and complete implementation of the MPI-2 standard.  DeinoMPI heavily modifies the original code base and does not rely on anything from Argonne National [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/04/23/an-mpi-implementation-i-didnt-know-before/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where to download xulrunner-1.8.1.3 (or older version)?</title>
		<link>http://9rivers.linkka.com/2010/04/06/where-to-download-xulrunner-1-8-1-3-or-older-version/</link>
		<comments>http://9rivers.linkka.com/2010/04/06/where-to-download-xulrunner-1-8-1-3-or-older-version/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 12:08:15 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=410</guid>
		<description><![CDATA[The download link of this version on the Mozilla webpage has broken. But you can find it here.]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/04/06/where-to-download-xulrunner-1-8-1-3-or-older-version/feed/</wfw:commentRss>
		<slash:comments>2</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>Bash下的目录回退</title>
		<link>http://9rivers.linkka.com/2010/04/01/bash%e4%b8%8b%e7%9a%84%e7%9b%ae%e5%bd%95%e5%9b%9e%e9%80%80/</link>
		<comments>http://9rivers.linkka.com/2010/04/01/bash%e4%b8%8b%e7%9a%84%e7%9b%ae%e5%bd%95%e5%9b%9e%e9%80%80/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 15:14:17 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[中文文章]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=401</guid>
		<description><![CDATA[Bash下可以使用&#8221;cd -&#8221;来实现在当前目录和上一次访问的路径间切换。 如果我们需要回退多级目录怎么实现呢？ Bash有两个内置命令pushd和popd，每次调用它们，系统会把当前目录压入目录栈中保存起来，或者从栈顶弹出一级目录并进入那个目录。利用这两个命令可以实现访问路径的存储与调用。为了使用方便可以在~/.bashrc中创建一个自己的命令，例如 123456function cd &#123; &#160; &#160; if &#91; -n &#34;$1&#34; &#93;; then pushd $1 &#62; /dev/null &#160; &#160; &#160;else pushd $HOME &#62; /dev/null &#160; &#160; fi &#125; alias pd='popd &#62; /dev/null' 这里创建的cd函数覆盖了built-in的cd命令，可以自动保存当前路径到栈中。而调用pd命令则可以返回上次访问的目录。 如果我们想恢复系统默认的cd命令怎么办呢？可以使用“unset -f cd”来取消自定义的cd函数。 参考： 1. http://www.mollison.us/blog/2009/08/24/go-back-in-bash/ 2. http://stackoverflow.com/questions/245406/how-do-i-delete-a-bash-function]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/04/01/bash%e4%b8%8b%e7%9a%84%e7%9b%ae%e5%bd%95%e5%9b%9e%e9%80%80/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>
		<category><![CDATA[editors]]></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的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>Get random numbers under BASH and DOS</title>
		<link>http://9rivers.linkka.com/2010/03/01/get-random-numbers-under-bash-and-dos/</link>
		<comments>http://9rivers.linkka.com/2010/03/01/get-random-numbers-under-bash-and-dos/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 15:32:44 +0000</pubDate>
		<dc:creator>9rivers</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[DOS]]></category>

		<guid isPermaLink="false">http://9rivers.linkka.com/?p=357</guid>
		<description><![CDATA[Both Linux Bash and Windows DOS support random number generation. The random number is &#8216;stored&#8217; in a system environment variable named &#8220;RANDOM&#8221; (I believe this variable links to a script to generate the actual random numbers on both systems), use it in the same way as you use other ENV variables.  E.g. On Linux: 1echo [...]]]></description>
		<wfw:commentRss>http://9rivers.linkka.com/2010/03/01/get-random-numbers-under-bash-and-dos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
