<?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>Dutor &#187; 程序应用</title>
	<atom:link href="http://www.dutor.net/index.php/tag/application/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dutor.net</link>
	<description>熟读而精思，循序而渐进，厚积而薄发。</description>
	<lastBuildDate>Tue, 17 Jan 2012 14:44:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ubuntu 9.10 &amp; mplayer &amp; amule</title>
		<link>http://www.dutor.net/index.php/2009/11/ubuntu-9-10-mplayer-amule/</link>
		<comments>http://www.dutor.net/index.php/2009/11/ubuntu-9-10-mplayer-amule/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 14:23:58 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[amule]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=1711</guid>
		<description><![CDATA[配置amule，
　　首次打开amule，会提示添加默认server list，Cancel之，打开amule->preferences->general，Nick随便填一个[CHN][VeryCD]dutor之类的，connection里设定Download、Upload速率上限，TCP、UDP端口可以默认，不行的话就在ufw中allow这两个端口。关于server list，随网络不同供使用的server也不同，我现在是教育网，用的是一个叫做BYR eserver的，<a href="ed2k://&#124;server&#124;211.68.71.81&#124;42422&#124;/">ed2k://&#124;server&#124;211.68.71.81&#124;42422&#124;/</a>，即IP：211.68.71.81，端口：42422，填入Add server manually。
配置FireFox，
　　about:config里面添加Boolean键，名：network.protocol-handler.external.ed2k，键值：true。添加String键，名network.protocol-handler.app.ed2k，键值：呃，你得看看你的ed2k程序的安装路径了，可以用whereis ed2k或者whereis ed2k.amule，我的是/usr/bin/ed2k，做键值添入即可。重启FireFox，这时候amule应该可以使用了。
　　
　　Sucks……没想到会写这么多……真失败……]]></description>
			<content:encoded><![CDATA[<p>　　近两天解决了ubuntu 9.10 karmic中的两个软件使用的问题，mplayer和用amule下载verycd资源。<br />
<strong>mplayer出错</strong><br />
　　在karmic里面装好了的mplayer无法正常播放视频，出现&#8221;致命&#8221;错误警告框：Fatal error!: Error opening/initializing the selected video_out(-vo) device. 确认后，视频只有声音，而没有图像。<br />
<div class="wp-caption aligncenter" style="width: 553px"><img alt="mplayer fatal error" src="http://www.dutor.net/files/images/mp_fatal.jpg" title="mplayer fatal error" width="543" height="378" /><p class="wp-caption-text">mplayer fatal error</p></div><br />
　　根据提示，是视频liu输出设备的错误，打开preference，video选项卡，将视频输出设置成X11就行了(其他的我没试，因为我只认识X11 ^_^).<br />
<div class="wp-caption aligncenter" style="width: 495px"><img alt="mplayer preference" src="http://www.dutor.net/files/images/mp_video_config.png" title="mplayer preference" width="485" height="497" /><p class="wp-caption-text">mplayer preference</p></div><br />
<strong>amule &#038; verycd</strong><br />
　　我这个人对音乐的音质和视频的画面有极强的洁癖，下电影动辄就是4G 8G的。但每次下片都要切到Windows用迅雷到VeryCD上面&#8221;吸血&#8221;。也曾经试图用过amule、mldonkey、emule这些骡子，但终因繁琐的配置而放弃。但今天我还是把amule给赶出来拉磨了。<br />
安装，</p>

<div class="wp_codebox"><table><tr id="p17111"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1711code1"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> amule amule-utils amule-gnome-support</pre></td></tr></table></div>

<p>需要注意的是amule-gnome-support也是要安装的，不然的话，后面FireFox里面ed2k程序的关联会遇到麻烦。<br />
配置amule，<br />
　　首次打开amule，会提示添加默认server list，Cancel之，打开amule->preferences->general，Nick随便填一个[CHN][VeryCD]dutor之类的，connection里设定Download、Upload速率上限，TCP、UDP端口可以默认，不行的话就在ufw中allow这两个端口。关于server list，随网络不同供使用的server也不同，我现在是教育网，用的是一个叫做BYR eserver的，<a href="ed2k://|server|211.68.71.81|42422|/">ed2k://|server|211.68.71.81|42422|/</a>，即IP：211.68.71.81，端口：42422，填入Add server manually。<br />
配置FireFox，<br />
　　about:config里面添加Boolean键，名：network.protocol-handler.external.ed2k，键值：true。添加String键，名network.protocol-handler.app.ed2k，键值：呃，你得看看你的ed2k程序的安装路径了，可以用whereis ed2k或者whereis ed2k.amule，我的是/usr/bin/ed2k，做键值添入即可。重启FireFox，这时候amule应该可以使用了。<br />
　　<br />
　　Sucks……没想到会写这么多……真失败……</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/11/ubuntu-9-10-mplayer-amule/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ubuntu下使用网络电视sopcast</title>
		<link>http://www.dutor.net/index.php/2009/10/ubuntu-sopcast/</link>
		<comments>http://www.dutor.net/index.php/2009/10/ubuntu-sopcast/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 07:43:38 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[sopcast]]></category>
		<category><![CDATA[程序应用]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=1416</guid>
		<description><![CDATA[　　大二看世乒赛时曾经用过sopcast这个软件，不过是Windows版本的，常看的频道都挺流畅的。昨天在Ubuntu社区偶然看到的一个帖子提到了这个软件，找了一下，搜出来两个包，安装测试成功，记录一下。
　　首先，下子这两个相互依赖deb包，<a href="http://dutor.googlecode.com/files/sp-auth_3.0.1_i386.deb">sp-auth_3.0.1_i386.deb</a>、<a href="http://dutor.googlecode.com/files/sopcast-player_0.2.1-1_i386.deb">sopcast-player_0.2.1_i386.deb</a>。]]></description>
			<content:encoded><![CDATA[<p>　　大二看世乒赛时曾经用过sopcast这个软件，不过是Windows版本的，常看的频道都挺流畅的。昨天在Ubuntu社区偶然看到的一个帖子提到了这个软件，找了一下，搜出来两个包，安装测试成功，记录一下。<br />
　　首先，下子这两个相互依赖deb包，<a href="http://dutor.googlecode.com/files/sp-auth_3.0.1_i386.deb">sp-auth_3.0.1_i386.deb</a>、<a href="http://dutor.googlecode.com/files/sopcast-player_0.2.1-1_i386.deb">sopcast-player_0.2.1_i386.deb</a>。<br />
　　依次安装sp-auth_3.0.1_i386.deb，sopcast-player_0.2.1_i386.deb，后者依赖前者。<br />
　　安装python2.5，# sudo apt-get install python2.5<br />
　　修改文件<em>/usr/bin/sopcast-player</em>中</p>
<pre>/usr/bin/python /usr/share/sopcast-player/lib/sopcast-player.pyc $@</pre>
<p>　　为</p>
<pre>/usr/bin/python2.5 /usr/share/sopcast-player/lib/sopcast-player.pyc $@</pre>
<p>　　这时候，可以从终端或者Application > Internet里面启动sopcast-player，刷新Channel Guide，会得到频道列表，若无法获得频道列表，可以将Edit > Preference > Channel Guide > Channel Guide URL的com改作cn。好了现在我们可以收看电视节目了。<br />
　　巧的是，从sopcast看到的第一个画面竟然是今年的世界杯！<br />
<div class="wp-caption aligncenter" style="width: 602px"><img alt="陈玘 vs. 吴尚垠" src="http://www.dutor.net/files/images/sopcast.jpg" title="陈玘 vs. 吴尚垠" width="592" height="436" /><p class="wp-caption-text">陈玘 vs. 吴尚垠</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/10/ubuntu-sopcast/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>用convert命令处理图片</title>
		<link>http://www.dutor.net/index.php/2009/08/convert-cmd/</link>
		<comments>http://www.dutor.net/index.php/2009/08/convert-cmd/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 01:51:29 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[命令]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=1165</guid>
		<description><![CDATA[convert是imagemagick软件包中的一个命令。它可以读取、转换、写入多种格式的图片。图片切割、颜色替换、各种效果的应用，图片的旋转、组合，文本，直线，多边形，椭圆，曲线，附加到图片伸展旋转。这里介绍几个简单的命令，具体的用法请参考man手册或者其<a href="http://www.imagemagick.org/" target="_target">官方网站</a>。在Ubuntu中用命令
<pre lang="bash" line="1">sudo apt-get install imagemagick</pre>
来安装，windows下的使用可以到官方网站下载。]]></description>
			<content:encoded><![CDATA[<p>convert是imagemagick软件包中的一个命令。它可以读取、转换、写入多种格式的图片。图片切割、颜色替换、各种效果的应用，图片的旋转、组合，文本，直线，多边形，椭圆，曲线，附加到图片伸展旋转。这里介绍几个简单的命令，具体的用法请参考man手册或者其<a href="http://www.imagemagick.org/" target="_target">官方网站</a>。在Ubuntu中用命令</p>

<div class="wp_codebox"><table><tr id="p11652"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1165code2"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> imagemagick</pre></td></tr></table></div>

<p>来安装，windows下的使用可以到官方网站下载。</p>
<h6>原始图片是一张文根英的美图：</h6>
<div class="wp-caption aligncenter" style="width: 554px"><img alt="文根英" src="http://www.dutor.net/files/images/wgy3.jpg" title="文根英" width="544" height="816" /><p class="wp-caption-text">文根英</p></div>
<h6>先加个边框：</h6>

<div class="wp_codebox"><table><tr id="p11653"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1165code3"><pre class="bash" style="font-family:monospace;">convert <span style="color: #660033;">-mattecolor</span> purple 8x8+<span style="color: #000000;">4</span>+<span style="color: #000000;">4</span> wgy.jpg frame.jpg</pre></td></tr></table></div>

<div class="wp-caption aligncenter" style="width: 570px"><img alt="加边框" src="http://www.dutor.net/files/images/frame.jpg" title="加边框" width="560" height="832" /><p class="wp-caption-text">加边框</p></div>
<h6>黑白靓照：</h6>

<div class="wp_codebox"><table><tr id="p11654"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1165code4"><pre class="bash" style="font-family:monospace;">convert <span style="color: #660033;">-colorspace</span> gray wgy.jpg gray.jpg</pre></td></tr></table></div>

<div class="wp-caption aligncenter" style="width: 554px"><img alt="黑白靓照1" src="http://www.dutor.net/files/images/gray-1.jpg" title="黑白靓照1" width="544" height="816" /><p class="wp-caption-text">黑白靓照1</p></div>
<div class="wp-caption aligncenter" style="width: 554px"><img alt="黑白靓照2" src="http://www.dutor.net/files/images/gray-2.jpg" title="黑白靓照2" width="544" height="816" /><p class="wp-caption-text">黑白靓照2</p></div>
<h6>生成缩略图：</h6>

<div class="wp_codebox"><table><tr id="p11655"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1165code5"><pre class="bash" style="font-family:monospace;">convert <span style="color: #660033;">-sample</span> 250x250 wgy.jpg sample.jpg</pre></td></tr></table></div>

<p><div class="wp-caption aligncenter" style="width: 177px"><img alt="缩略图" src="http://www.dutor.net/files/images/sample.jpg" title="缩略图" width="167" height="250" /><p class="wp-caption-text">缩略图</p></div><br />
另外，你还可以加水印，就不再赘述了。命令行的强大之处还是在于其简洁、快速，更适用于批量处理，写好了的脚本或者批处理可以一劳永逸。把如下命令写入Shell脚本，可以将当前目录下的所有的.jpg文件压缩到原来的50%，同时转换成.png格式：</p>

<div class="wp_codebox"><table><tr id="p11656"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1165code6"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.jpg<span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #000000; font-weight: bold;">do</span>
convert <span style="color: #660033;">-resize</span> <span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${i%.jpg}</span>.png&quot;</span>;
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/08/convert-cmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>控制台小时钟(strftime)</title>
		<link>http://www.dutor.net/index.php/2009/08/clock-using-strftime/</link>
		<comments>http://www.dutor.net/index.php/2009/08/clock-using-strftime/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 12:41:56 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[边走编程]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=997</guid>
		<description><![CDATA[一直没弄明白在控制台下如何实现实时更新、无闪烁的时间显示，今天偶然发现回车(CR)和换行(LF)是不同的，在C语言中分别用转义字符'\r'和'\n'表示。回车的语义应该是"光标"移动到当前行的行首，而换行是"光标"移动到下一行，并没有定义一定移动到行首。这样，这里要实现的控制台下实时更新、无闪烁的小时钟就可以用相关的时间函数和回车符来完成：]]></description>
			<content:encoded><![CDATA[<p>一直没弄明白在控制台下如何实现实时更新、无闪烁的时间显示，今天偶然发现回车(CR)和换行(LF)是不同的，在C语言中分别用转义字符&#8217;\r&#8217;和&#8217;\n&#8217;表示。回车的语义应该是&#8221;光标&#8221;移动到当前行的行首，而换行是&#8221;光标&#8221;移动到下一行，并没有定义一定移动到行首。这样，这里要实现的控制台下实时更新、无闪烁的小时钟就可以用相关的时间函数和回车符来完成：</p>

<div class="wp_codebox"><table><tr id="p9977"><td class="code" id="p997code7"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;iostream&gt;</span>
<span style="color: #339900;">#include &lt;ctime&gt;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">int</span> 
main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">time_t</span> current_tm<span style="color: #008080;">;</span>
	<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> tm_len <span style="color: #000080;">=</span> <span style="color: #0000dd;">50</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">char</span> ftime<span style="color: #008000;">&#91;</span>tm_len<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #666666;">//~ 延时一秒(1000000微秒), Windows下用Sleep()替代</span>
		usleep<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1000000</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 
		<span style="color: #666666;">//~ 获得当前时间</span>
		<span style="color: #0000dd;">time</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>current_tm<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #666666;">//~ 按照自定义格式输出日期与时间到ftime[]中</span>
		<span style="color: #0000dd;">strftime</span><span style="color: #008000;">&#40;</span>ftime, tm_len, <span style="color: #FF0000;">&quot; %Y-%B-%d, %A, %H:%M:%S&quot;</span>, <span style="color: #0000dd;">localtime</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>current_tm<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 
		<span style="color: #666666;">//~ 输出时间到终端</span>
		<span style="color: #0000dd;">cout</span><span style="color: #000080;">&lt;&lt;</span>ftime<span style="color: #000080;">&lt;&lt;</span>flush<span style="color: #008080;">;</span> 
		<span style="color: #666666;">//~ 回车</span>
		<span style="color: #0000dd;">cout</span><span style="color: #000080;">&lt;&lt;</span><span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\r</span>'</span><span style="color: #008080;">;</span> 
	<span style="color: #008000;">&#125;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/08/clock-using-strftime/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Chrome for linux</title>
		<link>http://www.dutor.net/index.php/2009/06/google-chrome-early-developer-channel/</link>
		<comments>http://www.dutor.net/index.php/2009/06/google-chrome-early-developer-channel/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 14:41:59 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=723</guid>
		<description><![CDATA[<img src="http://www.dutor.net/wp-content/uploads/2009/06/screenshot_006.png" alt="Google Chrome" title="screenshot_006" width="450" height="340" class="size-full wp-image-724" />]]></description>
			<content:encoded><![CDATA[<p>Google Chrome early developer channel发布，比起早前的版本有了很大的改观，但是有一些功能还是没有完成，比如在ubuntu下，scim输入法无法使用，复制、粘贴时候也会出现一些问题，无法下载PDF等普通文件，Flash无法正常显示等。不过在速度上那是没的说的，尤其是打开一些Javascript脚本比较多的网页，相对Firefox要快很多。就拿本站来说，打开一个普通网页连一秒都不到，Firefox在页面基本加载完成后对于Google 广告脚本的调用时间有时甚至比加载整个页面用的时间还要多。期待，正式版本能够尽早发行。</p>
<p><div id="attachment_728" class="wp-caption alignnone" style="width: 647px"><img class="size-full wp-image-728" title="chrome" src="http://www.dutor.net/wp-content/uploads/2009/06/chrome.png" alt="Chrome" width="637" height="485" /><p class="wp-caption-text">Chrome</p></div><br />
<div id="attachment_742" class="wp-caption alignnone" style="width: 456px"><img src="http://www.dutor.net/wp-content/uploads/2009/06/chromium.png" alt="Chromium" title="chromium" width="446" height="340" class="size-full wp-image-742" /><p class="wp-caption-text">Chromium</p></div></p>
<p>下载地址：</p>
<ul>
<li><a href="http://www.google.com/chrome/intl/en/eula_dev.html?dl=unstable_i386_deb">google-chrome-unstable_current_i386.deb</a></li>
<li><a href="http://www.google.com/chrome/intl/en/eula_dev.html?dl=unstable_amd64_deb">google-chrome-unstable_current_amd64.deb</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/06/google-chrome-early-developer-channel/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ubuntu+Texlive+CJK</title>
		<link>http://www.dutor.net/index.php/2009/06/ubuntu-texlive-cjk/</link>
		<comments>http://www.dutor.net/index.php/2009/06/ubuntu-texlive-cjk/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 23:34:44 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[程序应用]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=697</guid>
		<description><![CDATA[<strong>四、参考资料</strong>
<a href="http://reciteword.cosoft.org.cn/yaoguang/showarticle.php?category=myarticle&#038;&docpage=0&#038;&newsid=25">Fedora上配置Tex UTF-8 中文系统</a>
<a href="http://mailboxpublic.googlepages.com/texlive2007cjkchinesehowto">TeXLive 2007 CJK Chinese Howto</a>
<a href="http://blog.linuxsky.org/58/viewspace-3824">ubuntu 7.10下搞定Latex + CJK</a>]]></description>
			<content:encoded><![CDATA[<p><strong>一、安装TexLive+Latex+CJK：</strong></p>
<p>打开终端，执行下述命令安装TexLive和常用的一些Latex宏包（可以根据自己的需要增改）：</p>

<div class="wp_codebox"><table><tr id="p6978"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p697code8"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> texlive texlive-math-extra texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-pictures texlive-science texlive-bibtex-extra texlive-common latex-beamer</pre></td></tr></table></div>

<p>如果硬盘充裕的话，直接完整安装也可以：</p>

<div class="wp_codebox"><table><tr id="p6979"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p697code9"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> texlive-full latex-beamer</pre></td></tr></table></div>

<p>安装完后，就可以安装CJK的相关软件包了，如果只需要获得中文支持，那么执行：</p>

<div class="wp_codebox"><table><tr id="p69710"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p697code10"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> latex-cjk-chinese ttf-arphic-<span style="color: #000000; font-weight: bold;">*</span> hbf-<span style="color: #000000; font-weight: bold;">*</span></pre></td></tr></table></div>

<p>否则，建议安装latex-cjk-all以获取完整支持。</p>
<p><strong>二、生成中文字体包</strong></p>
<p>安装好TexLive+CJK以后，还需要安装一个软件──fontforge用于生成字体：</p>

<div class="wp_codebox"><table><tr id="p69711"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p697code11"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> fontforge</pre></td></tr></table></div>

<p>好了，前面所做的，都是标准的Debian式安装，假如哪天你不需要了，直接remove安装即可。<br />
生成字体前，请自己准备你需要生成的字体文件：simsun.ttc，simhei.ttf等，这里以simsun.ttc（宋体）为例。<br />
准备好后下载下面这个包，解压到一个地方，如自己的主目录~/font：<br />
<a href="http://code-of-tualatrix.googlecode.com/files/font.tar.bz2">font.tar.bz2</a><br />
然后把simsun.ttc也复制到~/font里去，执行下面的命令生成字体地图：</p>

<div class="wp_codebox"><table><tr id="p69712"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p697code12"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>font
$ fontforge <span style="color: #660033;">-script</span> subfonts.pe simsun.ttc song Unicode.sfd</pre></td></tr></table></div>

<p>字体生成好了，再建立一个描述文件吧。<br />
在~/font下，建立一个makemap文件，内容如下：</p>
<pre>
    for i in *.tfm
    do
    cat >> song.map << EOF
    ${i%.tfm} ${i%.tfm} < ${i%.tfm}.pfb
    EOF
    done
</pre>
<p>然后在终端下执行：chmod +x makemap让文件加上执行权限，最后执行：</p>

<div class="wp_codebox"><table><tr id="p69713"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p697code13"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>makemap</pre></td></tr></table></div>

<p>再建立一个一个c70song.fd文件：</p>
<pre>
    % This is c70song.fd for CJK package.
    % created by Edward G.J. Lee
    % modify by Yue Wang
    \ProvidesFile{c70song.fd}
    \DeclareFontFamily{C70}{song}{\hyphenchar \font\m@ne}
    \DeclareFontShape{C70}{song}{m}{n}{<-> CJK * song}{}
    \DeclareFontShape{C70}{song}{bx}{n}{<-> CJKb * song}{\CJKbold}
    \endinput
</pre>
<p>好的，相关文件都已生成，开始复制字体使其生效。</p>
<p>执行下面的命令，在你的主目录下生成隐藏的个人Tex配置，如果你哪天不需要了，也可以删除：</p>

<div class="wp_codebox"><table><tr id="p69714"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p697code14"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>map<span style="color: #000000; font-weight: bold;">/</span>dvips<span style="color: #000000; font-weight: bold;">/</span>CJK
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>tfm<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>song
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>type1<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>song
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>tex<span style="color: #000000; font-weight: bold;">/</span>latex<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>UTF8</pre></td></tr></table></div>

<p>建立完这层层叠叠的目录以后，就把刚刚生成的字体复制进去吧。</p>

<div class="wp_codebox"><table><tr id="p69715"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p697code15"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>font<span style="color: #000000; font-weight: bold;">/</span>song.map ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>map<span style="color: #000000; font-weight: bold;">/</span>dvips<span style="color: #000000; font-weight: bold;">/</span>CJK
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>font<span style="color: #000000; font-weight: bold;">/*</span>.tfm ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>tfm<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>song
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>font<span style="color: #000000; font-weight: bold;">/*</span>.pfb ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>type1<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>song
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>font<span style="color: #000000; font-weight: bold;">/</span>c70song.fd ~<span style="color: #000000; font-weight: bold;">/</span>.texmf-var<span style="color: #000000; font-weight: bold;">/</span>tex<span style="color: #000000; font-weight: bold;">/</span>latex<span style="color: #000000; font-weight: bold;">/</span>CJK<span style="color: #000000; font-weight: bold;">/</span>UTF8</pre></td></tr></table></div>

<p>复制完后就执行命令刷新缓存，让它生效：</p>

<div class="wp_codebox"><table><tr id="p69716"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p697code16"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> texhash
$ <span style="color: #c20cb9; font-weight: bold;">updmap</span> <span style="color: #660033;">--enable</span> Map song.map</pre></td></tr></table></div>

<p><strong>三、测试LaTex</strong><br />
假如一切顺序的话， 就测试一下我们安装的song体是否能用吧。</p>
<p>在任意位置编辑这个文件，然后保存为test.tex，支持UTF-8格式：</p>
<pre>
    \documentclass{article}
    \usepackage{CJKutf8}
    \begin{document}
    \begin{CJK}{UTF8}{song}
    你好！这里是Ubuntu下的TexLive+CJK环境！
    \end{CJK}
    \end{document}
</pre>
<p>执行分别生成pdf文档和用evince来查看文档：</p>

<div class="wp_codebox"><table><tr id="p69717"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p697code17"><pre class="bash" style="font-family:monospace;">$ pdflatex test.tex
$ evince test.pdf</pre></td></tr></table></div>

<p>看看你的过程顺不顺利，生成的PDF档也是下面这样吗？<br />
<div class="wp-caption alignnone" style="width: 435px"><img alt="texlive.png" src="http://linuxdesktop.cn/wp-content/uploads/2008/02/texlive.png" title="texlive" width="425" height="56" /><p class="wp-caption-text">texlive.png</p></div><br />
<div class="wp-caption alignnone" style="width: 435px"><img alt="texlive-2.png" src="http://linuxdesktop.cn/wp-content/uploads/2008/02/texlive-2.png" title="texlive-2.png" width="425" height="56" /><p class="wp-caption-text">texlive-2.png</p></div><br />
用同样的方法搞定hei和kai等常用中文标准字体，开始享受你的Tex吧！<br />
<strong>四、参考资料</strong><br />
<a href="http://reciteword.cosoft.org.cn/yaoguang/showarticle.php?category=myarticle&#038;&#038;docpage=0&#038;&#038;newsid=25">Fedora上配置Tex UTF-8 中文系统</a><br />
<a href="http://mailboxpublic.googlepages.com/texlive2007cjkchinesehowto">TeXLive 2007 CJK Chinese Howto</a><br />
<a href="http://blog.linuxsky.org/58/viewspace-3824">ubuntu 7.10下搞定Latex + CJK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/06/ubuntu-texlive-cjk/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Linux软件分类列表</title>
		<link>http://www.dutor.net/index.php/2009/06/linux-application-list/</link>
		<comments>http://www.dutor.net/index.php/2009/06/linux-application-list/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 23:35:29 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[OS基础]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=685</guid>
		<description><![CDATA[<ul>
	<li>Office:
<ul>
	<li>OpenOffice</li>
</ul>
</li>
	<li>Text:
<ul>
	<li>Vim</li>
	<li>Emacs</li>
	<li>gedit</li>
	<li>LyX</li>
</ul>
</li>
	<li>Reader:
<ul>
	<li>Adobe Reader</li>
	<li>ChmSee</li>
</ul>
</li>
	<li>Dictionary
<ul>
	<li>StarDict</li>
</ul>
</li>
</ul>]]></description>
			<content:encoded><![CDATA[<ul>
<li>Internet:
<ul>
<li>IM:
<ul>
<li>Pidgin</li>
<li>Psi</li>
<li>LumaQQ</li>
<li>aMSN</li>
<li>XChat</li>
<li>Ekiga</li>
</ul>
</li>
<li>Browser:
<ul>
<li>Firefox</li>
<li>Opera</li>
<li>w3m</li>
</ul>
</li>
<li>Download:
<ul>
<li>Wget</li>
<li>Axel</li>
<li>d4x</li>
<li>MultiGet</li>
<li>Azureus</li>
<li>aMule</li>
<li>BitTorrent</li>
<li>Aria2</li>
<li>Transmission</li>
</ul>
</li>
<li>FTP:
<ul>
<li>Lftp</li>
<li>FileZilla</li>
</ul>
</li>
<li>E-mail:
<ul>
<li>Evolution</li>
<li>Thunderbird</li>
<li>CheckGmail</li>
<li>Mutt</li>
</ul>
</li>
<li>Other:
<ul>
<li>QTerm</li>
<li>Liferea</li>
<li>Drivel</li>
<li>Google Earth</li>
</ul>
</li>
</ul>
</li>
<li>Office:
<ul>
<li>Office:
<ul>
<li>OpenOffice</li>
</ul>
</li>
<li>Text:
<ul>
<li>Vim</li>
<li>Emacs</li>
<li>gedit</li>
<li>LyX</li>
</ul>
</li>
<li>Reader:
<ul>
<li>Adobe Reader</li>
<li>ChmSee</li>
</ul>
</li>
<li>Dictionary
<ul>
<li>StarDict</li>
</ul>
</li>
</ul>
</li>
<li>Multimedia:
<ul>
<li>Picture
<ul>
<li>F-Spot</li>
<li>Picasa</li>
<li>GIMP</li>
<li>X-Scan</li>
</ul>
</li>
<li>Music
<ul>
<li>Rhythmbox</li>
<li>Last.fm</li>
<li>Amarok</li>
<li>Sound Juicer</li>
</ul>
</li>
<li>Video
<ul>
<li>Totem</li>
<li>MPlayer</li>
<li>SMPlayer</li>
<li>Gmlive</li>
<li>SopCast</li>
<li>RealPlayer</li>
</ul>
</li>
<li>Other
<ul>
<li>Brasero</li>
<li>Sound Recorder</li>
</ul>
</li>
</ul>
</li>
<li>Network:
<ul>
<li>All
<ul>
<li>Apache</li>
<li>MySQL</li>
<li>Vinagre</li>
<li>TSclient</li>
</ul>
</li>
</ul>
</li>
<li>Programing:
<ul>
<li>All
<ul>
<li>GCC</li>
<li>Eclipse</li>
<li>Quanta</li>
<li>KompoZer</li>
</ul>
</li>
</ul>
</li>
<li>System:
<ul>
<li>All
<ul>
<li>Fcitx</li>
<li>VirtualBox</li>
<li>Wine</li>
<li>Google Desktop</li>
</ul>
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/06/linux-application-list/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>matlab2009 下载及安装</title>
		<link>http://www.dutor.net/index.php/2009/06/matlab-install/</link>
		<comments>http://www.dutor.net/index.php/2009/06/matlab-install/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 22:37:03 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[尚未分类]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=612</guid>
		<description><![CDATA[<pre>
IP:202.118.224.241
User:hit
Pas:anypass //密码是任意的
Port:21
</pre>
推荐用ftp下载工具来下载，比如filezilla, flashxp, leapftp等。进入到ftp后，顺着我的手看：<em>software/Science/Mathworks.Matlab/Mathworks.Matlab.R2009a.ISO-TBE/</em> 找到了吧！将里面的压缩包全部都下载下来，会得到很多matl2k9a.r00这样的压缩包，用winrar打开并解压第一个分卷，即matl2k9a.r00，即可得到一个.iso格式的光盘镜像。用虚拟光驱加载，在光盘内可以找到Crack文件夹，里面有readme文件，按照提示安装即可。]]></description>
			<content:encoded><![CDATA[<p> <script type="text/javascript"><!--
google_ad_client = "pub-8781012522518994";
/* 468x15, chk_matlab */
google_ad_slot = "0885612183";
google_ad_width = 468;
google_ad_height = 15;0
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<div style="float:right;display:inline;">
<script type="text/javascript"><!--
google_ad_client = "pub-8781012522518994";
/* 200x200, chk_mat */
google_ad_slot = "3729434782";
google_ad_width = 200;
google_ad_height = 200;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
</div>
<p>教育网的同志们，可以在哈工大的资源FTP上下载matlab2009年的最新版本(当然是破解过的，真是佩服搞破解的同胞们，唉)。</p>
<pre style="display:block;">
IP:202.118.224.241
User:hit
Pas:anypass //密码是任意的
Port:21
</pre>
<p>推荐用ftp下载工具来下载，比如filezilla, flashxp, leapftp等。进入到ftp后，顺着我的手看：<em>software/Science/Mathworks.Matlab/Mathworks.Matlab.R2009a.ISO-TBE/</em> 找到了吧！将里面的压缩包全部都下载下来，会得到很多matl2k9a.r00这样的压缩包，用winrar打开并解压第一个分卷，即matl2k9a.r00，即可得到一个.iso格式的光盘镜像。用虚拟光驱加载，在光盘内可以找到Crack文件夹，里面有readme文件，按照提示安装即可。</p>
<p>另：Unix/linux版本在<em>/software/Science/Mathworks.Matlab/Mathworks.Matlab.R2009a.UNIX.ISO-TBE/</em>,想必你已经看到了，安装方法见readme，解压命令为unrar，使用e选项，后面加第一个分卷的文件名matl2k9a.r00就可以了：</p>

<div class="wp_codebox"><table><tr id="p61218"><td class="code" id="p612code18"><pre class="bash" style="font-family:monospace;">$ unrar e matl2k9a.r00</pre></td></tr></table></div>

<p>若提示找不到unrar命令，按照提示安装即可，例如在Debian/Ubuntu下：</p>

<div class="wp_codebox"><table><tr id="p61219"><td class="code" id="p612code19"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> unrar</pre></td></tr></table></div>

<h6>UPDATE</h6>
<p>可能哈工大的ftp不能再用了，给大家在VeryCD上面找了一个比较快的：<a href="http://www.verycd.com/topics/2768208/" target="_blank" >http://www.verycd.com/topics/2768208/</a><br />
另外我这里也有一个，只是没有足够的空间用来共享，如果哪位有空间愿意拿出来的话，我乐意传给他。</p>
<h6>UPDATE again</h6>
<p>ftp已经恢复正常，依然教育网。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/06/matlab-install/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>C++编译器的选择</title>
		<link>http://www.dutor.net/index.php/2009/05/selection-of-cplusplus-complilers/</link>
		<comments>http://www.dutor.net/index.php/2009/05/selection-of-cplusplus-complilers/#comments</comments>
		<pubDate>Wed, 13 May 2009 14:17:53 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[之语言特性]]></category>
		<category><![CDATA[Cpp]]></category>
		<category><![CDATA[程序应用]]></category>
		<category><![CDATA[译文]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=449</guid>
		<description><![CDATA[
<blockquote>经常有人要我(Bjarne Stroustrup)推荐一种C++的编译器。但是，我通常不会推荐任何编译器，因为我可能因此而在编译器的商战中表明"立场"。而且我并不是对所有的编译器都了解，C++编译器实在是太多了，我平时会用到半打(6个)C++ 编译器，但那只是"沧海一粟"罢了。
我希望人们在选择自己的编译器时，一定要严格参照现行的C++标准。尽量避免使用不支持或者违背ISO标准的编译器。
你如果是一个初学者而且不知道如何测验一个编译器是否符合标准的话，你可以试试下面这个小程序:</blockquote>
]]></description>
			<content:encoded><![CDATA[<blockquote><p>经常有人要我(Bjarne Stroustrup)推荐一种C++的编译器。但是，我通常不会推荐任何编译器，因为我可能因此而在编译器的商战中表明&#8221;立场&#8221;。而且我并不是对所有的编译器都了解，C++编译器实在是太多了，我平时会用到半打(6个)C++ 编译器，但那只是&#8221;沧海一粟&#8221;罢了。<br />
我希望人们在选择自己的编译器时，一定要严格参照现行的C++标准。尽量避免使用不支持或者违背ISO标准的编译器。<br />
你如果是一个初学者而且不知道如何测验一个编译器是否符合标准的话，你可以试试下面这个小程序:</p></blockquote>

<div class="wp_codebox"><table><tr id="p44920"><td class="code" id="p449code20"><pre class="cpp" style="font-family:monospace;">        <span style="color: #339900;">#include &lt;iostream&gt;</span>
	<span style="color: #339900;">#include &lt;string&gt;</span>
&nbsp;
	<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		string s<span style="color: #008080;">;</span>
		<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Please enter your first name followed by a newline<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008080;">;</span>
		<span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> s<span style="color: #008080;">;</span>
		<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Hello, &quot;</span> <span style="color: #000080;">&lt;&lt;</span> s <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> <span style="color: #666666;">// this return statement isn't necessary</span>
	<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>假如你的编译器无法正常运行这段简单的代码的话，那么它不应该是你学习标准C++的一种好的选择。<br />
虽然有些过时，但还是要推荐一篇较详尽的介绍标准的文章和boost.org的编译器的页面。符合标准只是评价一个编译器品质的一个方面，其他还包括:生成代码的质量，生成的错误信息，编译速度，集成的工具，厂商支持的力度，向后兼容性等等等等。不过，和标准的一致性确实是相当重要的一个方面。另外，一些编译器提供它自己对语言的一些扩展，使用这些扩展的特性将降低你的代码的可移植性，当你换用其他编译器是也会比较困难。<br />
当在网络上寻找编译器时，你会发现，很多信息被各种各样的产品名称掩盖了。这里，我搜集了一些C++编译器。其中有一些是可以免费下载的：</p></blockquote>
<ul>
<li> <a href="http://developer.apple.com/tools/macosxtools.html">Apple C++</a>. It also comes with OS X on the developer tools CD.</li>
<li> <a href="http://www.bloodshed.net/devcpp.html">Bloodshed Dev-C++</a>. A GCC-based (Mingw) IDE.</li>
<li> <a href="http://www.borland.com/downloads/download_cbuilder.html">Borland C++</a></li>
<li> <a href="http://www.cygwin.com/">Cygwin (GNU C++)</a></li>
<li> <a href="http://www.digitalmars.com/">Digital Mars C++</a></li>
<li> <a href="http://www.mingw.org/">MINGW &#8211; &#8220;Minimalist GNU for Windows&#8221;</a>. Another GCC version for Windows including a free (non-GPL) w32api.</li>
<li> <a href="http://www.delorie.com/djgpp">DJ Delorie&#8217;s C++ development system for DOS/Windows (GNU C++)</a></li>
<li> <a href="http://www.gnu.org/software/gcc/gcc.html">GNU CC source</a></li>
<li> <a href="http://www-949.ibm.com/software/rational/cafe/community/ccpp">IBM C++</a> for IBM power, System Z, Bluegene, and Cell.</li>
<li> <a href="http://www.intel.com/software/products/compilers/clin/noncom.htm">Intel C++ for linux</a></li>
<li> <a href="http://llvm.cs.uiuc.edu/">The LLVM Compiler Infrastructure</a> (based on GCC).</li>
<li> <a href="http://www.microsoft.com/express/vc">Microsoft Visual C++ 2008 Express edition</a>.</li>
<li> <a href="http://developers.sun.com/sunstudio">Sun Studio</a>.</li>
</ul>
<blockquote><p>另外一些是需要付费才可使用的：</p></blockquote>
<ul>
<li> <a href="http://www.borland.com/bcppbuilder/">Borland C++</a></li>
<li> <a href="http://www.metrowerks.com/products/macos/">CodeWarrior C++</a> (formerly Metrowerks), it comes for many platforms.</li>
<li> <a href="http://www.comeaucomputing.com/">Comeau C++</a> for many platforms</li>
<li> <a href="http://www.edg.com/cpp.html">Edison Design Group C++ Front End</a> &#8211; used by <a href="http://www.edg.com/resellers.html">many C++ compiler suppliers</a></li>
<li> <a href="http://www.ghs.com/products/optimizingC++EC++Compilers.html">Green Hills C++</a> for many embedded systems platforms</li>
<li> <a href="http://www.hp.com/go/cpp/">HP C++ for Unix</a> and <a href="http://h71000.www7.hp.com/commercial/cplus/cplus_index.html">HP C++ for OpenVMS</a>.</li>
<li> <a href="http://www.intel.com/software/products/compilers/">Intel C++</a> for Windows, Linux, and some embedded systems.</li>
<li> <a href="http://www.mentorgraphics.com/embedded/compilers/index.html">Mentor Graphics/Microtec Research C++</a> for many embedded systems platforms</li>
<li> <a href="http://msdn.microsoft.com/visualc">Microsoft C++</a></li>
<li> <a href="http://www.devtools.com/">Paradigm C++</a>, for x86 embedded systems</li>
<li> <a href="http://www.pgroup.com/prodworkpgcc.htm">The Portland Group C++</a> (parallization for Pentiums)</li>
<li> <a href="http://www.sgi.com/products/software/irix/tools/c++.html">SGI C++</a>, optimizing compiler</li>
<li> <a href="http://www.sun.com/forte/cplusplus/index.html">Sun C++</a></li>
<li> <a href="http://www.windriver.com/products/">WindRiver&#8217;s Diab C++</a> used in many embedded systems.</li>
</ul>
<p>[tip]This is a translation from <a href="http://www.research.att.com/~bs/compilers.html">Bjarne Stroustroup</a>[/tip]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/05/selection-of-cplusplus-complilers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu9.04 Computer Janitor</title>
		<link>http://www.dutor.net/index.php/2009/04/ubuntu904-computer-janitor/</link>
		<comments>http://www.dutor.net/index.php/2009/04/ubuntu904-computer-janitor/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 04:55:53 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=321</guid>
		<description><![CDATA[

<blockquote>This application helps you find and remove software packages you might not need anymore. It also suggests configuration changes that might benefit you. 这个小软件是在ubuntu新的发布版本里面刚刚加入的，是个不错的家伙。它给你提供了一个清理系统中“软件”的可视化的解决方案。</blockquote>]]></description>
			<content:encoded><![CDATA[<blockquote><p>This application helps you find and remove software packages you might not need anymore. It also suggests configuration changes that might benefit you. 这个小软件是在ubuntu新的发布版本里面刚刚加入的，是个不错的家伙。它给你提供了一个清理系统中“软件”的可视化的解决方案。</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/04/ubuntu904-computer-janitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The firefox restart problem</title>
		<link>http://www.dutor.net/index.php/2009/04/the-firefox-restart-problem/</link>
		<comments>http://www.dutor.net/index.php/2009/04/the-firefox-restart-problem/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 03:49:12 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[程序应用]]></category>
		<category><![CDATA[麻烦]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=291</guid>
		<description><![CDATA[<blockquote>Here I am in the contemporarily latest distribution of ubuntu 9.04. The problem showed up when I updated the firefox to the version 3.0.9, that firefox kept telling me to restart for an update in every tabs in terms of "your browser has been updated and needs to be restarted". While searching the solution online, I found this a bug of firefox, which is caused by a plugin. So I went to the menu: Tools>>Add-ons and disabled the plugin called "ubuntu firefox modification", then after I restarted the firefox, the trouble is gone. 
您的浏览器已经更新，需要重新启动。可能的解决办法：firefox的工具>>附加组件，关闭 Ubuntu Firefox Modification组件，重启浏览器即可。</blockquote>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Here I am in the contemporarily latest distribution of ubuntu 9.04. The problem showed up when I updated the firefox to the version 3.0.9, that firefox kept telling me to restart for an update in every tabs in terms of &#8220;your browser has been updated and needs to be restarted&#8221;. While searching the solution online, I found this a bug of firefox, which is caused by a plugin. So I went to the menu: Tools>>Add-ons and disabled the plugin called &#8220;ubuntu firefox modification&#8221;, then after I restarted the firefox, the trouble is gone.<br />
您的浏览器已经更新，需要重新启动。可能的解决办法：firefox的工具>>附加组件，关闭 Ubuntu Firefox Modification组件，重启浏览器即可。</p></blockquote>
<p>[tip]Good luck buddy![/tip]<br />
[warning]This is <em>original</em> article, you could copy it freely with my site links!<br />此日志为dutor原创，您可以自由转载，添加原文链接我将万分感激！[/warning]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/04/the-firefox-restart-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs 常用快捷键</title>
		<link>http://www.dutor.net/index.php/2009/04/emacs-usual-shortcuts/</link>
		<comments>http://www.dutor.net/index.php/2009/04/emacs-usual-shortcuts/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 23:04:19 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[OS基础]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=248</guid>
		<description><![CDATA[<strong>剪切复制文本区域</strong>
<blockquote>1. 把光标移动到区域的首字符
2. C-@ 设置标记
3. 把光标移动到区域后的第一个字符
4. C-w 剪切，M-w 复制
5. C-y 粘贴</blockquote>]]></description>
			<content:encoded><![CDATA[<p><strong>剪切复制文本区域</strong></p>
<blockquote><p>1. 把光标移动到区域的首字符<br />
2. C-@ 设置标记<br />
3. 把光标移动到区域后的第一个字符<br />
4. C-w 剪切，M-w 复制<br />
5. C-y 粘贴</p></blockquote>
<p><strong>查找替换</strong></p>
<blockquote><p>1. M-%<br />
2. 键入查找字符串，回车<br />
3. 键入替换字符串，回车<br />
4. 根据提示输入需要的操作： y （替换当前的字符串并移动到下一个字符串）， n （不替换当前字符串，直接移动到下一个字符串）， ! （进行全局替换，并要求不再显示）， . （替换当前字符串，然后退出查找替换操作）， q （退出查找替换操作，光标定位到操作开始时的位置）</p></blockquote>
<p><strong>文件操作</strong></p>
<table class="ewiki-table" border="2" cellpadding="5">
<tbody>
<tr>
<td>C-x C-s</td>
<td>保存文件</td>
</tr>
<tr>
<td>C-x C-w</td>
<td>另存文件</td>
</tr>
<tr>
<td>C-x C-f</td>
<td>打开文件</td>
</tr>
<tr>
<td>C-x C-r</td>
<td>只读打开文件</td>
</tr>
<tr>
<td>C-x k</td>
<td>关闭当前缓冲区（即关闭文件）</td>
</tr>
</tbody>
</table>
<p><strong>窗口操作</strong></p>
<table class="ewiki-table" border="2" cellpadding="5">
<tbody>
<tr>
<td>C-x o</td>
<td>移动到其他窗口</td>
</tr>
<tr>
<td>C-x 0</td>
<td>删除当前窗口</td>
</tr>
<tr>
<td>C-x 1</td>
<td>删除除当前窗口外的所有窗口</td>
</tr>
<tr>
<td>C-x 2</td>
<td>水平切分屏幕</td>
</tr>
<tr>
<td>C-x 3</td>
<td>垂直切分屏幕</td>
</tr>
</tbody>
</table>
<p>[warning]注意，对窗口的操作只影响缓冲区的可见性，关闭窗口并没有关闭缓冲区，也就是没有关闭文件。 [/warning]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/04/emacs-usual-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install stardict in ubuntu</title>
		<link>http://www.dutor.net/index.php/2009/04/install-stardict-in-ubuntu/</link>
		<comments>http://www.dutor.net/index.php/2009/04/install-stardict-in-ubuntu/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 06:50:27 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[程序应用]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=74</guid>
		<description><![CDATA[For the safe of convenience, we firstly install the compile environment of stardict version 2.4. 
<pre lang="bash">
# apt-get build-dep stardict
</pre>
Then, we should clear up the previous stardict, if you installed it. (the dicts will be saved). 
<pre lang="bash">
# apt-get remove --purge stardict stardict-common 
</pre>
Other packages that are not necessary, maybe.  
<pre lang="bash">
# apt-get install libenchant-dev libgucharmap-dev gucharmap libespeak-dev
</pre>]]></description>
			<content:encoded><![CDATA[<p>For the safe of convenience, we firstly install the compile environment of stardict version 2.4.</p>

<div class="wp_codebox"><table><tr id="p7421"><td class="code" id="p74code21"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get build-dep stardict</span></pre></td></tr></table></div>

<p>Then, we should clear up the previous stardict, if you installed it. (the dicts will be saved).</p>

<div class="wp_codebox"><table><tr id="p7422"><td class="code" id="p74code22"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get remove --purge stardict stardict-common</span></pre></td></tr></table></div>

<p>Other packages that are not necessary, maybe.</p>

<div class="wp_codebox"><table><tr id="p7423"><td class="code" id="p74code23"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install libenchant-dev libgucharmap-dev gucharmap libespeak-dev</span></pre></td></tr></table></div>

<p>Download the source files from： http://downloads.sourceforge.net/stardict/stardict-3.0.1.tar.bz2</p>

<div class="wp_codebox"><table><tr id="p7424"><td class="code" id="p74code24"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#   wget http://downloads.sourceforge.net/stardict/stardict-3.0.1.tar.bz2</span></pre></td></tr></table></div>

<p>Extract：</p>

<div class="wp_codebox"><table><tr id="p7425"><td class="code" id="p74code25"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># tar xvfj stardict-3.0.1.tar.bz2# cd stardict-3.0.1# ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-festival# make# make install</span></pre></td></tr></table></div>

<p>Here you willbe done,  whereas the compilation will take serveral minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/04/install-stardict-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

