﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Dark Angle</title><link>http://www.cppblog.com/niewenlong/</link><description /><language>zh-cn</language><lastBuildDate>Fri, 10 Oct 2008 18:36:45 GMT</lastBuildDate><pubDate>Fri, 10 Oct 2008 18:36:45 GMT</pubDate><ttl>60</ttl><item><title>中国最无耻的十大企业!</title><link>http://www.cppblog.com/niewenlong/archive/2008/09/16/61944.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Tue, 16 Sep 2008 02:18:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/09/16/61944.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/61944.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/09/16/61944.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/61944.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/61944.html</trackback:ping><description><![CDATA[第一位,中国移动：中国移动(国有完全垄断企业)作为全球最赚钱的电信公司，中国移动绝对不是国人的骄傲，因为移动的钱不是赚的，他是从国人身上一刀一刀割的。从北美的洛杉矶打倒中国的上海，每60秒钟大约三美分，而从中国的北京打倒50公里外的廊坊，每60秒钟需要九毛钱。从美国的东海岸的纽约漫游到西海岸的旧金山，漫游费是0，而从中国的上海漫游到三十公里外的昆山，漫游费是一分钟一块三。堂堂十三亿人口的全球第一人口大国，因为行政垄断竟然仅仅只有两家移动公司，而另一家联通还是移动的同胞兄弟。所以移动公司只要紧紧握住"国有垄断"这把锋利的砍刀，无论我们多么愤慨和无奈也只能是垄断公司刀下待宰的羔羊。 　　 <br>　　　　 <br>　　　　二，中国石油天然气集团(国有完全垄断企业)中国石油终于超过了丰田汽车，荣赝亚洲最赚钱公司的桂冠。可是恐怕全世界没有一个人认为中石油可以和丰田相提并论。当丰田制造的汽车跑遍了中国大街小巷的时候，中石油在japan连一滴汽油也卖不出去。但是这并不妨碍中石油可以在国内呼风唤雨横行霸道。中石油从大庆开采的石油，每桶成本不到十美元。中石化从波斯湾进口的石油每桶大约六十美元，可是中石油竟然能够把从大庆开采的石油卖到和波斯湾进口的石油一样的价格。每升五块钱的汽油甚至比美国加了资源税和燃油税的价格都高。看看一天天往上暴涨的油价，再看看中石油半年赚了一千亿的银子，除了苦笑和愤怒，我们也只能乖乖的给人家掏钱。谁教人家是国有的呢？ 　　　　 <br>　　　　 <br>　　　　三，中国工商(农业)银行(国有垄断企业)服务是中国特色，收费和国际接轨，贷款利率是中国特色，存款利率和国际接轨，赔钱的时候告诉国人说，自己是全民所有制企业，财政部就手忙脚乱拿着纳税人的银子，给工商银行动辄几千亿的坏帐买单。赚钱的时候告诉国人说自己是海外上市企业，然后将大把大把从国人腰包里搜刮来的银子奉献给国外的同行。 　　　　 <br>　　　　 <br>　　　　四，一汽集团(国有垄断企业)五十年前，一汽制造出第一辆解放卡车的时候，韩国人连手扶拖拉机也造不出来。五十年后，当韩国人的现代占领了整个首都机场的时候，一汽的红旗还在顶着奥迪几十年前那个老壳招摇撞骗。二十年前，国家为了迅速提高国产汽车的制造水平，本着"市场换技术"的战略，为一汽引进了大众和丰田等世界顶尖的汽车公司。二十年后，大众丰田叱咤风云横行中国的时候，这个不争气的败家子儿不但什么也没学会，还把自己的老本给丢了。甚至直到现在那个破破烂烂的红旗竟然用的还是日产的发动机。十年前的奇瑞和吉利还没有出生，一汽的红旗就是国人唯一的骄傲和希望。十年后的今天，奇瑞和吉利奋发图强茁壮成长。一个月的产量比红旗三年的产量加在一起都多。而那个破破烂烂的红旗早已经成了国人的耻辱。更加让人气愤的是，一汽为了敷衍国人对于自己不争的指责，把丰田皇冠的商标给拆了，告诉我们这是红旗3。给马自达6换一个外壳告诉我们这是奔腾。活脱脱一个败家子儿加大骗子。　　　　 <br>　　　　 <br>　　　　 五，中国人保集团(国有垄断企业)人保公司一部普通五座汽车的强制险成本不到200元，一年的保费征收大约要1000元，人保交强险的毛利可以达到400，人保公司一份航空意外险的成本不到一元，但是旅客的购买成本是20元，考虑到一些发行费用，人保的意外险净利可以达到700，马克思曾经说过，"如果有100的利润，资本家们会挺而走险；如果有200的利润，资本家们会藐视法律；如果有300的利润，那么资本家们便会践踏世间的一切"不知道这个口口声声代表国家利益和全民利益的人民保险公司为什么比"践踏世间一切"的资本家还要心狠手辣？ <br>　　　　 <br>　　　　　　六，国家邮政局(国家完全垄断机构)我曾经到邮局邮寄几本书，邮局的工作人员仔细的检查我的书后，把一页夹在书中的信纸给抽出来，告诉我这一页纸不允许夹在书中，必须要通过信件才能寄出。我问为什么，人家说是规定。我再问，人家连理我都不理我。我还曾经到邮局寄过一些笔记本，当拜托工作人员用纸箱给我包装时，工作人员告诉我，笔记本不能寄包裹，只能当信件寄。我问为什么，人家说是规定。可怜我几十本的笔记要被按克数计费，而且每个"信件"还不能超过两公斤。每次和邮局打交道的过程都让人身心疲惫不堪回首，恶劣的服务态度，匪夷所思的内部规定，僵硬扭曲的教条主义。没办法，谁教人家头顶顶着"国家"两个字呢, 　　　　 <br>　　　　 <br>　　　　七，华北高速公路(国有垄断企业)海南的香蕉一毛五分钱一斤，烂在地里无人问津，北京的香蕉两块五一斤，昂贵的价格同样无人问津，昂贵的高速公路收费把海南和北京隔绝在了两个遥远的星球。事实上目前全世界90的收费公路都在我国境内，而且收费的金额高到让人难以承受的地步。从北京到上海的过路费大约六七百元，基本和一张机票相当。要知道就是在比我们富裕的多的美国，从纽约到华盛顿的过路费也不到区区十个美元，而且美国的高路公路百分之九十都是完全免费。没办法，此路是我开，此站是我载，要想从此过，留下买路财！　　　 <br>　　　　 <br>　　　　八，东风汽车(国有垄断企业)如果说一汽集团在委身大众的时候，还知道留下一个破破烂烂的红旗敷衍众口。那么东风在投靠日产的时候基本已经彻底的放弃了自己的责任。他的老总理直气壮的说，"中国汽车工业发展的最终方向，就是融入全球的六加三等九大集团"，在和日产全盘合资后，马上就停产了东风小王子，解散了东风研究院。辞退了研究开发人员，心甘情愿的做起了日产和标志的傀儡。带头开始了对民族汽车工业的绞杀。当东风卡车的装备的发动机已经全部变成了康明思和日产柴的时候，你还期望他能拥有一颗民族心吗？　　　　 <br>　　　　 <br>　　　　九，国家电网,号称中国第一资本集团,一个电工 年薪就有上10万,赚了多少钱了,电费就没降过多少。　　　　 <br>　　　　 <br>　　　　十，中国各大学国家每年投入多少钱,什么重大成果都没有。 
<img src ="http://www.cppblog.com/niewenlong/aggbug/61944.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-09-16 10:18 <a href="http://www.cppblog.com/niewenlong/archive/2008/09/16/61944.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC++大杂烩</title><link>http://www.cppblog.com/niewenlong/archive/2008/08/28/60279.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Thu, 28 Aug 2008 08:48:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/28/60279.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/60279.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/28/60279.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/60279.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/60279.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如何获取系统日期CTime tm = CTime :: GetCurrentTime();CString strTime = tm.Format(_TEXT(&#8220;%Y-%M-%d %H:%M:%S));MessageBox(strTime);&nbsp;2.&nbsp;&nbsp...&nbsp;&nbsp;<a href='http://www.cppblog.com/niewenlong/archive/2008/08/28/60279.html'>阅读全文</a><img src ="http://www.cppblog.com/niewenlong/aggbug/60279.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-28 16:48 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/28/60279.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Linux]使linux默认从文本界面启动 </title><link>http://www.cppblog.com/niewenlong/archive/2008/08/24/59752.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Sat, 23 Aug 2008 22:58:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/24/59752.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/59752.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/24/59752.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/59752.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/59752.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1.shell下键入vi /etc/inittab<br>2.将 id:5:initdefault 中的5改为3，那么默认的启动方式会改为文本模式。<br>注：<br>0 关机<br>1 单用户模式<br>2 多用户模式，但是不支持网络访问<br>3 多用户模式，文本模式启动<br>4 无定义的<br>5 图形化界面<br>6 重启&nbsp;&nbsp;<a href='http://www.cppblog.com/niewenlong/archive/2008/08/24/59752.html'>阅读全文</a><img src ="http://www.cppblog.com/niewenlong/aggbug/59752.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-24 06:58 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/24/59752.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql数据文件破坏后的修复方法</title><link>http://www.cppblog.com/niewenlong/archive/2008/08/19/59336.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Tue, 19 Aug 2008 05:57:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/19/59336.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/59336.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/19/59336.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/59336.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/59336.html</trackback:ping><description><![CDATA[<div id=article_main _element_extended_="true"><span>由于临时断电，使用<span>kill&nbsp;-9</span>中止<span>MySQL</span>服务进程，所有的这些都可能会毁坏<span>MySQL</span>的数据文件。如果在被干扰时，服务正在改变文件，文件可能会留下错误的或不一致的状态。因为这样的毁坏有时是不容易被发现的，当你发现这个错误时可能是很久以后的事了。于是，当你发现这个问题时，也许所有的备份都有同样的错误。<span>&nbsp;<br><br>MySQL</span>参考手册的第十五章讲述了<span>MySQL</span>自带的<span>myisamchk</span>的功能，以及如何使用它检查和修复你的<span>MySQL</span>数据文件。虽然这一章对于每个想要搭建一个强壮的<span>MySQL</span>服务的人都是推荐阅读的，我们还是有必要在这里对其中的要点进行讨论。<span><br><br></span>在我们继续之前，你必须意识到<span>myisamchk</span>程序对用来检查和修改的<span>MySQL</span>数据文件的访问应该是唯一的。如果<span>MySQL</span>服务正在使用某一文件，并对<span>myisamchk</span>正在检查的文件进行修改，<span>myisamchk</span>会误以为发生了错误，并会试图进行修复<span>--</span>这将导致<span>MySQL</span>服务的崩溃！这样，要避免这种情况的发生，通常我们需要在工作时关闭<span>MySQL</span>服务。作为选择，你也可以暂时关闭服务以制作一个文件的拷贝，然后在这个拷贝上工作。当你做完了以后，重新关闭服务并使用新的文件取代原来的文件<span>(</span>也许你还需要使用期间的变更日志<span>)</span>。<span><br>MySQL</span>数据目录不是太难理解的。每一个数据库对应一个子目录，每个子目录中包含了对应于这个数据库中的数据表的文件。每一个数据表对应三个文件，它们和表名相同，但是具有不同的扩展名。<span>tblName.frm</span>文件是表的定义，它保存了表中包含的数据列的内容和类型。<span>tblName.MYD</span>文件包含了表中的数据。<span>tblName.MYI</span>文件包含了表的索引<span>(</span>例如，它可能包含<span>lookup</span>表以帮助提高对表的主键列的查询<span>)</span>。<span><br><br></span>要检查一个表的错误，只需要运行<span>myisamchk(</span>在<span>MySQL</span>的<span>bin</span>目录下<span>)</span>并提供文件的位置和表名，或者是表的索引文件名：</span><span>&nbsp;myisamchk&nbsp;/usr/local/mysql/var/dbName/tblName<br>&nbsp;myisamchk&nbsp;/usr/local/mysql/var/dbName/tblName.MYI</span><span><br><br></span><span>上面的两个命令都可以执行对指定表的检查。要检查数据库中所有的表，可以使用通配符：</span><span>&nbsp;myisamchk&nbsp;/usr/local/mysql/var/dbName/*.MYI&nbsp;</span><span><br></span><span>要检查所有数据库中的所有表，可以使用两个通配符：</span><span>&nbsp;myisamchk&nbsp;/usr/local/mysql/var/*/*.MYI&nbsp;</span><span><br></span><span>如果不带任何选项，<span>myisamchk</span>将对表文件执行普通的检查。如果你对一个表有怀疑，但是普通的检查不能发现任何错误，你可以执行更彻底的检查<span>(</span>但是也更慢！<span>)</span>，这需要使用<span>--extend-check</span>选项：<span><br>&nbsp; </span></span><span>myisamchk&nbsp;--extend-check&nbsp;/path/to/tblName</span>
<p><span><br></span><span>对错误的检查是没有破坏性的，这意味着你不必担心执行对你的数据文件的检查会使已经存在的问题变得更糟。另一方面，修复选项，虽然通常也是安全的，但是它对你的数据文件的更改是无法撤消的。因为这个原因，我们强烈推荐你试图修复一个被破坏的表文件时首先做个备份，并确保在制作这个备份之前你的<span>MySQL</span>服务是关闭的。<span><br><br></span>当你试图修复一个被破坏的表的问题时，有三种修复类型。如果你得到一个错误信息指出一个临时文件不能建立，删除信息所指出的文件并再试一次<span>--</span>这通常是上一次修复操作遗留下来的。<span><br></span>这三种修复方法如下所示：<span><br><br>&nbsp;myisamchk&nbsp;--recover&nbsp;--quick&nbsp;/path/to/tblName<br>&nbsp;myisamchk&nbsp;--recover&nbsp;/path/to/tblName<br>&nbsp;myisamchk&nbsp;--safe-recover&nbsp;/path/to/tblName<br>&nbsp;<br><br></span>第一种是最快的，用来修复最普通的问题；而最后一种是最慢的，用来修复一些其它方法所不能修复的问题。<span><br><br></span><strong>检查和修复<span>MySQL</span>数据文件</strong><span><br></span>如果上面的方法无法修复一个被损坏的表，在你放弃之前，你还可以试试下面这两个技巧：<span><br></span>如果你怀疑表的索引文件<span>(*.MYI)</span>发生了不可修复的错误，甚至是丢失了这个文件，你可以使用数据文件<span>(*.MYD)</span>和数据格式文件<span>(*.frm)</span>重新生成它。首先制作一个数据文件<span>(tblName.MYD)</span>的拷贝。重启你的<span>MySQL</span>服务并连接到这个服务上，使用下面的命令删除表的内容：<span>&nbsp;<br>mysql&nbsp;DELETE&nbsp;FROM&nbsp;tblName;<br></span>在删除表的内容的同时，会建立一个新的索引文件。退出登录并重新关闭服务，然后用你刚才保存的数据文件<span>(tblName.MYD)</span>覆盖新的<span>(</span>空<span>)</span>数据文件。最后，使用<span>myisamchk</span>执行标准的修复<span>(</span>上面的第二种方法<span>)</span>，根据表的数据的内容和表的格式文件重新生成索引数据。<span><br><br></span>如果你的表的格式文件<span>(tblName.frm)</span>丢失了或者是发生了不可修复的错误，但是你清楚如何使用相应的<span>CREATE&nbsp;TABLE</span>语句来重新生成这张表，你可以重新生成一个新的<span>.frm</span>文件并和你的数据文件和索引文件<span>(</span>如果索引文件有问题，使用上面的方法重建一个新的<span>)</span>一起使用。首先制作一个数据和索引文件的拷贝，然后删除原来的文件<span>(</span>删除数据目录下有关这个表的所有记录<span>)</span>。<span><br><br></span>启动<span>MySQL</span>服务并使用当初的<span>CREATE&nbsp;TABLE</span>文件建立一个新的表。新的<span>.frm</span>文件应该可以正常工作了，但是最好你还是执行一下标准的修复<span>(</span>上面的第二种方法<span>)</span>。</span></p>
</div>
<p><br>&nbsp;</p>
<p><br><span class=tpc_content><font size=2>可以使用mysql语句,用 CHECK TABLE $table; &nbsp; //其中$table代表数据表的名字，检测表是否损坏，如果损坏可以REPAIR TABLE $table 来修复，如果一次不行，可以多修复几次！<br><br>如果使用WIN服务器,可以先登陆DB服务器，进入此路径，不用进mysql里<br>D:\CD MYSQL<br><br>D:\mysql&gt;CD BIN<br><br>D:\mysql\bin&gt;MYISAMCHK -r d:\mysql\data\guild\msg_table.myi(msg_table)<br>- check key delete-chain<br>- check record delete-chain<br>- recovering (with sort) MyISAM-table 'd:\mysql\data\guild\msg_table.myi'<br>Data records: 23<br>- Fixing index 1<br><br><br>D:\mysql\bin&gt;MYISAMCHK --safe-recover d:\mysql\data\guild\msg_table.myi<br>- recovering (with keycache) MyISAM-table 'd:\mysql\data\guild\msg_table.myi'<br>Data records: 89<br><br>D:\mysql\bin&gt;<br><br>当不知道哪个表坏了，可以进入mysql数据库:<br>use guild;<br>desc msg_table; 看msg_table有没有坏<br><br>修复好了进入MYSQL数据库中打命令检查：show table;</font></span><br><!----></p>
<p><br>&nbsp;</p>
<p>&nbsp;</p>
<!-- google_ad_section_end -->
<img src ="http://www.cppblog.com/niewenlong/aggbug/59336.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-19 13:57 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/19/59336.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Mysql日期和时间函数不求人</title><link>http://www.cppblog.com/niewenlong/archive/2008/08/15/58900.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Thu, 14 Aug 2008 16:28:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/15/58900.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/58900.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/15/58900.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/58900.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/58900.html</trackback:ping><description><![CDATA[<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">对于每个类型拥有的值范围以及并且指定日期何时间值的有效格式的描述见7.3.6 日期和时间类型。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">这里是一个使用日期函数的例子。下面的查询选择了所有记录，其date_col的值是在最后30天以内：&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">mysql&gt; SELECT something FROM table&nbsp; <br>WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) &lt;= 30;&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DAYOFWEEK(date)&nbsp; <br>返回日期date的星期索引(1=星期天，2=星期一, &#8230;&#8230;7=星期六)。这些索引值对应于ODBC标准。&nbsp; <br>mysql&gt; select DAYOFWEEK('1998-02-03');&nbsp; <br>-&gt; 3&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">WEEKDAY(date)&nbsp; <br>返回date的星期索引(0=星期一，1=星期二, &#8230;&#8230;6= 星期天)。&nbsp; <br>mysql&gt; select WEEKDAY('1997-10-04 22:23:00');&nbsp; <br>-&gt; 5&nbsp; <br>mysql&gt; select WEEKDAY('1997-11-05');&nbsp; <br>-&gt; 2&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DAYOFMONTH(date)&nbsp; <br>返回date的月份中日期，在1到31范围内。&nbsp; <br>mysql&gt; select DAYOFMONTH('1998-02-03');&nbsp; <br>-&gt; 3&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DAYOFYEAR(date)&nbsp; <br>返回date在一年中的日数, 在1到366范围内。&nbsp; <br>mysql&gt; select DAYOFYEAR('1998-02-03');&nbsp; <br>-&gt; 34&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">MONTH(date)&nbsp; <br>返回date的月份，范围1到12。&nbsp; <br>mysql&gt; select MONTH('1998-02-03');&nbsp; <br>-&gt; 2&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DAYNAME(date)&nbsp; <br>返回date的星期名字。&nbsp; <br>mysql&gt; select DAYNAME("1998-02-05");&nbsp; <br>-&gt; 'Thursday'&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">MONTHNAME(date)&nbsp; <br>返回date的月份名字。&nbsp; <br>mysql&gt; select MONTHNAME("1998-02-05");&nbsp; <br>-&gt; 'February'&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">QUARTER(date)&nbsp; <br>返回date一年中的季度，范围1到4。&nbsp; <br>mysql&gt; select QUARTER('98-04-01');&nbsp; <br>-&gt; 2&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">WEEK(date)&nbsp; <br>　&nbsp; <br>WEEK(date,first)&nbsp; <br>对于星期天是一周的第一天的地方，有一个单个参数，返回date的周数，范围在0到52。2个参数形式WEEK()允许 <br>你指定星期是否开始于星期天或星期一。如果第二个参数是0，星期从星期天开始，如果第二个参数是1， <br>从星期一开始。&nbsp; <br>mysql&gt; select WEEK('1998-02-20');&nbsp; <br>-&gt; 7&nbsp; <br>mysql&gt; select WEEK('1998-02-20',0);&nbsp; <br>-&gt; 7&nbsp; <br>mysql&gt; select WEEK('1998-02-20',1);&nbsp; <br>-&gt; 8&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">YEAR(date)&nbsp; <br>返回date的年份，范围在1000到9999。&nbsp; <br>mysql&gt; select YEAR('98-02-03');&nbsp; <br>-&gt; 1998&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">HOUR(time)&nbsp; <br>返回time的小时，范围是0到23。&nbsp; <br>mysql&gt; select HOUR('10:05:03');&nbsp; <br>-&gt; 10&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">MINUTE(time)&nbsp; <br>返回time的分钟，范围是0到59。&nbsp; <br>mysql&gt; select MINUTE('98-02-03 10:05:03');&nbsp; <br>-&gt; 5&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SECOND(time)&nbsp; <br>回来time的秒数，范围是0到59。&nbsp; <br>mysql&gt; select SECOND('10:05:03');&nbsp; <br>-&gt; 3&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">PERIOD_ADD(P,N)&nbsp; <br>增加N个月到阶段P（以格式YYMM或YYYYMM)。以格式YYYYMM返回值。注意阶段参数P不是日期值。&nbsp; <br>mysql&gt; select PERIOD_ADD(9801,2);&nbsp; <br>-&gt; 199803&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">PERIOD_DIFF(P1,P2)&nbsp; <br>返回在时期P1和P2之间月数，P1和P2应该以格式YYMM或YYYYMM。注意，时期参数P1和P2不是日期值。&nbsp; <br>mysql&gt; select PERIOD_DIFF(9802,199703);&nbsp; <br>-&gt; 11&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DATE_ADD(date,INTERVAL expr type)&nbsp; <br>　&nbsp; <br>DATE_SUB(date,INTERVAL expr type)&nbsp; <br>　&nbsp; <br>ADDDATE(date,INTERVAL expr type)&nbsp; <br>　&nbsp; <br>SUBDATE(date,INTERVAL expr type)&nbsp; <br>这些功能执行日期运算。对于MySQL 3.22，他们是新的。ADDDATE()和SUBDATE()是DATE_ADD()和DATE_SUB()的同义词。 <br>在MySQL 3.23中，你可以使用+和-而不是DATE_ADD()和DATE_SUB()。（见例子）date是一个指定开始日期的 <br>DATETIME或DATE值，expr是指定加到开始日期或从开始日期减去的间隔值一个表达式，expr是一个字符串；它可以以 <br>一个&#8220;-&#8221;开始表示负间隔。type是一个关键词，指明表达式应该如何被解释。EXTRACT(type FROM date)函数从日期 <br>中返回&#8220;type&#8221;间隔。下表显示了type和expr参数怎样被关联： type值 含义 期望的expr格式&nbsp; <br>SECOND 秒 SECONDS&nbsp; <br>MINUTE 分钟 MINUTES&nbsp; <br>HOUR 时间 HOURS&nbsp; <br>DAY 天 DAYS&nbsp; <br>MONTH 月 MONTHS&nbsp; <br>YEAR 年 YEARS&nbsp; <br>MINUTE_SECOND 分钟和秒 "MINUTES:SECONDS"&nbsp; <br>HOUR_MINUTE 小时和分钟 "HOURS:MINUTES"&nbsp; <br>DAY_HOUR 天和小时 "DAYS HOURS"&nbsp; <br>YEAR_MONTH 年和月 "YEARS-MONTHS"&nbsp; <br>HOUR_SECOND 小时, 分钟， "HOURS:MINUTES:SECONDS"&nbsp; <br>DAY_MINUTE 天, 小时, 分钟 "DAYS HOURS:MINUTES"&nbsp; <br>DAY_SECOND 天, 小时, 分钟, 秒 "DAYS HOURS:MINUTES:SECONDS"&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">MySQL在expr格式中允许任何标点分隔符。表示显示的是建议的分隔符。如果date参数是一个DATE值并且你的计算仅仅 <br>包含YEAR、MONTH和DAY部分(即，没有时间部分)，结果是一个DATE值。否则结果是一个DATETIME值。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">mysql&gt; SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;&nbsp; <br>-&gt; 1998-01-01 00:00:00&nbsp; <br>mysql&gt; SELECT INTERVAL 1 DAY + "1997-12-31";&nbsp; <br>-&gt; 1998-01-01&nbsp; <br>mysql&gt; SELECT "1998-01-01" - INTERVAL 1 SECOND;&nbsp; <br>-&gt; 1997-12-31 23:59:59&nbsp; <br>mysql&gt; SELECT DATE_ADD("1997-12-31 23:59:59",&nbsp; <br>INTERVAL 1 SECOND);&nbsp; <br>-&gt; 1998-01-01 00:00:00&nbsp; <br>mysql&gt; SELECT DATE_ADD("1997-12-31 23:59:59",&nbsp; <br>INTERVAL 1 DAY);&nbsp; <br>-&gt; 1998-01-01 23:59:59&nbsp; <br>mysql&gt; SELECT DATE_ADD("1997-12-31 23:59:59",&nbsp; <br>INTERVAL "1:1" MINUTE_SECOND);&nbsp; <br>-&gt; 1998-01-01 00:01:00&nbsp; <br>mysql&gt; SELECT DATE_SUB("1998-01-01 00:00:00",&nbsp; <br>INTERVAL "1 1:1:1" DAY_SECOND);&nbsp; <br>-&gt; 1997-12-30 22:58:59&nbsp; <br>mysql&gt; SELECT DATE_ADD("1998-01-01 00:00:00",&nbsp; <br>INTERVAL "-1 10" DAY_HOUR);&nbsp; <br>-&gt; 1997-12-30 14:00:00&nbsp; <br>mysql&gt; SELECT DATE_SUB("1998-01-02", INTERVAL 31 DAY);&nbsp; <br>-&gt; 1997-12-02&nbsp; <br>mysql&gt; SELECT EXTRACT(YEAR FROM "1999-07-02");&nbsp; <br>-&gt; 1999&nbsp; <br>mysql&gt; SELECT EXTRACT(YEAR_MONTH FROM "1999-07-02 01:02:03");&nbsp; <br>-&gt; 199907&nbsp; <br>mysql&gt; SELECT EXTRACT(DAY_MINUTE FROM "1999-07-02 01:02:03");&nbsp; <br>-&gt; 20102&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">如果你指定太短的间隔值(不包括type关键词期望的间隔部分)，MySQL假设你省掉了间隔值的最左面部分。例如， <br>如果你指定一个type是DAY_SECOND，值expr被希望有天、小时、分钟和秒部分。如果你象"1:10"这样指定值， <br>MySQL假设日子和小时部分是丢失的并且值代表分钟和秒。换句话说，"1:10" DAY_SECOND以它等价于"1:10" MINUTE_SECOND <br>的方式解释，这对那MySQL解释TIME值表示经过的时间而非作为一天的时间的方式有二义性。如果你使用确实不正确的日期， <br>结果是NULL。如果你增加MONTH、YEAR_MONTH或YEAR并且结果日期大于新月份的最大值天数，日子在新月用最大的天调整。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">mysql&gt; select DATE_ADD('1998-01-30', Interval 1 month);&nbsp; <br>-&gt; 1998-02-28&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">注意，从前面的例子中词INTERVAL和type关键词不是区分大小写的。&nbsp; <br>TO_DAYS(date)&nbsp; <br>给出一个日期date，返回一个天数(从0年的天数)。&nbsp; <br>mysql&gt; select TO_DAYS(950501);&nbsp; <br>-&gt; 728779&nbsp; <br>mysql&gt; select TO_DAYS('1997-10-07');&nbsp; <br>-&gt; 729669&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TO_DAYS()不打算用于使用格列高里历(1582)出现前的值。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">FROM_DAYS(N)&nbsp; <br>给出一个天数N，返回一个DATE值。&nbsp; <br>mysql&gt; select FROM_DAYS(729669);&nbsp; <br>-&gt; '1997-10-07'&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TO_DAYS()不打算用于使用格列高里历(1582)出现前的值。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DATE_FORMAT(date,format)&nbsp; <br>根据format字符串格式化date值。下列修饰符可以被用在format字符串中： %M 月名字(January&#8230;&#8230;December)&nbsp; <br>%W 星期名字(Sunday&#8230;&#8230;Saturday)&nbsp; <br>%D 有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。）&nbsp; <br>%Y 年, 数字, 4 位&nbsp; <br>%y 年, 数字, 2 位&nbsp; <br>%a 缩写的星期名字(Sun&#8230;&#8230;Sat)&nbsp; <br>%d 月份中的天数, 数字(00&#8230;&#8230;31)&nbsp; <br>%e 月份中的天数, 数字(0&#8230;&#8230;31)&nbsp; <br>%m 月, 数字(01&#8230;&#8230;12)&nbsp; <br>%c 月, 数字(1&#8230;&#8230;12)&nbsp; <br>%b 缩写的月份名字(Jan&#8230;&#8230;Dec)&nbsp; <br>%j 一年中的天数(001&#8230;&#8230;366)&nbsp; <br>%H 小时(00&#8230;&#8230;23)&nbsp; <br>%k 小时(0&#8230;&#8230;23)&nbsp; <br>%h 小时(01&#8230;&#8230;12)&nbsp; <br>%I 小时(01&#8230;&#8230;12)&nbsp; <br>%l 小时(1&#8230;&#8230;12)&nbsp; <br>%i 分钟, 数字(00&#8230;&#8230;59)&nbsp; <br>%r 时间,12 小时(hh:mm:ss [AP]M)&nbsp; <br>%T 时间,24 小时(hh:mm:ss)&nbsp; <br>%S 秒(00&#8230;&#8230;59)&nbsp; <br>%s 秒(00&#8230;&#8230;59)&nbsp; <br>%p AM或PM&nbsp; <br>%w 一个星期中的天数(0=Sunday &#8230;&#8230;6=Saturday ）&nbsp; <br>%U 星期(0&#8230;&#8230;52), 这里星期天是星期的第一天&nbsp; <br>%u 星期(0&#8230;&#8230;52), 这里星期一是星期的第一天&nbsp; <br>%% 一个文字&#8220;%&#8221;。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">所有的其他字符不做解释被复制到结果中。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">mysql&gt; select DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');&nbsp; <br>-&gt; 'Saturday October 1997'&nbsp; <br>mysql&gt; select DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');&nbsp; <br>-&gt; '22:23:00'&nbsp; <br>mysql&gt; select DATE_FORMAT('1997-10-04 22:23:00',&nbsp; <br>'%D %y %a %d %m %b %j');&nbsp; <br>-&gt; '4th 97 Sat 04 10 Oct 277'&nbsp; <br>mysql&gt; select DATE_FORMAT('1997-10-04 22:23:00',&nbsp; <br>'%H %k %I %r %T %S %w');&nbsp; <br>-&gt; '22 22 10 10:23:00 PM 22:23:00 00 6'&nbsp; <br>MySQL3.23中，在格式修饰符字符前需要%。在MySQL更早的版本中，%是可选的。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TIME_FORMAT(time,format)&nbsp; <br>这象上面的DATE_FORMAT()函数一样使用，但是format字符串只能包含处理小时、分钟和秒的那些格式修饰符。 <br>其他修饰符产生一个NULL值或0。&nbsp; <br>CURDATE()&nbsp; <br>　&nbsp; <br>CURRENT_DATE&nbsp; <br>以'YYYY-MM-DD'或YYYYMMDD格式返回今天日期值，取决于函数是在一个字符串还是数字上下文被使用。&nbsp; <br>mysql&gt; select CURDATE();&nbsp; <br>-&gt; '1997-12-15'&nbsp; <br>mysql&gt; select CURDATE() + 0;&nbsp; <br>-&gt; 19971215&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">CURTIME()&nbsp; <br>　&nbsp; <br>CURRENT_TIME&nbsp; <br>以'HH:MM:SS'或HHMMSS格式返回当前时间值，取决于函数是在一个字符串还是在数字的上下文被使用。&nbsp; <br>mysql&gt; select CURTIME();&nbsp; <br>-&gt; '23:50:26'&nbsp; <br>mysql&gt; select CURTIME() + 0;&nbsp; <br>-&gt; 235026&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">NOW()&nbsp; <br>　&nbsp; <br>SYSDATE()&nbsp; <br>　&nbsp; <br>CURRENT_TIMESTAMP&nbsp; <br>以'YYYY-MM-DD HH:MM:SS'或YYYYMMDDHHMMSS格式返回当前的日期和时间，取决于函数是在一个字符串还是在数字的 <br>上下文被使用。&nbsp; <br>mysql&gt; select NOW();&nbsp; <br>-&gt; '1997-12-15 23:50:26'&nbsp; <br>mysql&gt; select NOW() + 0;&nbsp; <br>-&gt; 19971215235026&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">UNIX_TIMESTAMP()&nbsp; <br>　&nbsp; <br>UNIX_TIMESTAMP(date)&nbsp; <br>如果没有参数调用，返回一个Unix时间戳记(从'1970-01-01 00:00:00'GMT开始的秒数)。如果UNIX_TIMESTAMP()用一 <br>个date参数被调用，它返回从'1970-01-01 00:00:00' GMT开始的秒数值。date可以是一个DATE字符串、一个DATETIME <br>字符串、一个TIMESTAMP或以YYMMDD或YYYYMMDD格式的本地时间的一个数字。&nbsp; <br>mysql&gt; select UNIX_TIMESTAMP();&nbsp; <br>-&gt; 882226357&nbsp; <br>mysql&gt; select UNIX_TIMESTAMP('1997-10-04 22:23:00');&nbsp; <br>-&gt; 875996580&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">当UNIX_TIMESTAMP被用于一个TIMESTAMP列，函数将直接接受值，没有隐含的&#8220;string-to-unix-timestamp&#8221;变换。&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">FROM_UNIXTIME(unix_timestamp)&nbsp; <br>以'YYYY-MM-DD HH:MM:SS'或YYYYMMDDHHMMSS格式返回unix_timestamp参数所表示的值，取决于函数是在一个字符串 <br>还是或数字上下文中被使用。&nbsp; <br>mysql&gt; select FROM_UNIXTIME(875996580);&nbsp; <br>-&gt; '1997-10-04 22:23:00'&nbsp; <br>mysql&gt; select FROM_UNIXTIME(875996580) + 0;&nbsp; <br>-&gt; 19971004222300&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">FROM_UNIXTIME(unix_timestamp,format)&nbsp; <br>返回表示 Unix 时间标记的一个字符串，根据format字符串格式化。format可以包含与DATE_FORMAT()函数列出的条 <br>目同样的修饰符。&nbsp; <br>mysql&gt; select FROM_UNIXTIME(UNIX_TIMESTAMP(),&nbsp; <br>'%Y %D %M %h:%i:%s %x');&nbsp; <br>-&gt; '1997 23rd December 03:43:30 x'&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SEC_TO_TIME(seconds)&nbsp; <br>返回seconds参数，变换成小时、分钟和秒，值以'HH:MM:SS'或HHMMSS格式化，取决于函数是在一个字符串还是在数字 <br>上下文中被使用。&nbsp; <br>mysql&gt; select SEC_TO_TIME(2378);&nbsp; <br>-&gt; '00:39:38'&nbsp; <br>mysql&gt; select SEC_TO_TIME(2378) + 0;&nbsp; <br>-&gt; 3938&nbsp; </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TIME_TO_SEC(time)&nbsp; <br>返回time参数，转换成秒。&nbsp; <br>mysql&gt; select TIME_TO_SEC('22:23:00');&nbsp; <br>-&gt; 80580&nbsp; <br>mysql&gt; select TIME_TO_SEC('00:39:38');&nbsp; <br>-&gt; 2378 </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</p>
<img src ="http://www.cppblog.com/niewenlong/aggbug/58900.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-15 00:28 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/15/58900.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC中Combo Box控件使用大全</title><link>http://www.cppblog.com/niewenlong/archive/2008/08/09/58363.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Fri, 08 Aug 2008 18:48:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/09/58363.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/58363.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/09/58363.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/58363.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/58363.html</trackback:ping><description><![CDATA[<p>一、如何添加/删除Combo Box内容<br>1，在Combo Box控件属性的Data标签里面添加，一行表示Combo Box下拉列表中的一行。换行用ctrl+回车。<br>2，在程序初始化时动态添加<br>如：&nbsp;//控件内容初始化<br>&nbsp;CString strTemp;<br>&nbsp;((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;ResetContent();//消除现有所有内容<br>&nbsp;for(int i=1;i&lt;=100;i++)<br>&nbsp;{<br>&nbsp;&nbsp;strTemp.Format("%d",i);<br>&nbsp;&nbsp;((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;AddString(strTemp);<br>&nbsp;}<br>3，下拉的时候添加<br>如：&nbsp;CString strTemp;<br>&nbsp;int iCount=((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;GetCount();//取得目前已经有的行数<br>&nbsp;if(iCount&lt;1)//防止重复多次添加<br>&nbsp;{<br>&nbsp;&nbsp;((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;ResetContent();<br>&nbsp;&nbsp;for(int i=1;i&lt;=100;i++)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;strTemp.Format("%d",i);<br>&nbsp;&nbsp;&nbsp;((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;AddString(strTemp);<br>&nbsp;&nbsp;}<br>&nbsp;}<br>4，删除<br>DeleteString( UINT nIndex )//删除指定行，<br>5，插入<br>InsertString( int nIndex, LPCTSTR lpszItem )//将行插入到指定位置<br>6，查找<br>FindString( int nStartAfter, LPCTSTR lpszItem )//可以在当前所有行中查找指定的字符传的位置，nStartAfter指明从那一行开始进行查找。 <br>int SelectString( int nStartAfter, LPCTSTR lpszItem )//可以选中包含指定字符串的行<br>二、如何控制Combo Box的下拉长度</p>
<p>1，首先要知道两点：一、那就是在设计界面里，点击一下Combo Box的下拉箭头，此时出现的调整框就是Combo Box的下拉调整框。<br>2，二、属性里有个 No integral height 钩选项，表示最大长度为设计长度，如果实际内容比设计长度多，就出现滚动条，少就以实际长度显示。</p>
<p>三、选择其中的某行<br>1，选中：<br>int iPos=((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;GetCurSel();//当前选中的行。<br>2，设置<br>((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;SetCurSel(n)//设置第n行内容为显示的内容。</p>
<p>四、取得Combo Box框内容<br>1取当前内容<br>((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;GetWindowText(strTemp);<br><br>2取其他行内容<br>((CComboBox*)GetDlgItem(IDC_COMBO_CF))-&gt;GetLBText(n,strTemp);</p>
<img src ="http://www.cppblog.com/niewenlong/aggbug/58363.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-09 02:48 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/09/58363.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Beyond Compare V3.0</title><link>http://www.cppblog.com/niewenlong/archive/2008/08/01/57732.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Fri, 01 Aug 2008 03:27:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/08/01/57732.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/57732.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/08/01/57732.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/57732.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/57732.html</trackback:ping><description><![CDATA[<p>Beyond Compare 是一款不可多得的专业级的文件夹和文件对比工具。使用他可以很方便的对比出两个文件夹或者文件的不同之处。并把相差的每一个字节用颜色加以表示，查看方便。并且支持多种规则对比。对软件汉化者来说，这绝对是一款不可多得的工具。<br></p>
<p><font color=#ff0000>注册码:urKH3mXZVDiTNgCKQnFnfvaQB5tTtahv tUr5HqwT9YZu50+b3T9bkzYKwKsfjhhi DgzR9Dr5qbmJ2EmNzYfSAq4ocM7E8B0D kDvyvawgHd0gV-nFnVNBsqMgnxcKoJfZ 6WrrQotEiqs6H14Jk9Wjz+SLvovnUksb gT5K1ey7T7AV2C32NLt4gjavcM5tzDR0 GUbvAou+MKzhMHebccC+3fB0wwwKNPs0 fwCz3Xh16S6yB4xxeD2bS6JFV9JPZwkA</font></p>
<img src ="http://www.cppblog.com/niewenlong/aggbug/57732.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-08-01 11:27 <a href="http://www.cppblog.com/niewenlong/archive/2008/08/01/57732.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>安装JAVA</title><link>http://www.cppblog.com/niewenlong/archive/2008/07/27/57299.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Sun, 27 Jul 2008 06:46:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/07/27/57299.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/57299.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/07/27/57299.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/57299.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/57299.html</trackback:ping><description><![CDATA[<p style="FONT-FAMILY: Verdana"><br>jdk-6u10-beta-linux-i586-rpm.bin<br>[root@localhost java]# chmod a+x jdk-6u10-beta-linux-i586-rpm.bin<br>[root@localhost java]# ./jdk-6u10-beta-linux-i586-rpm.bin<br>Pre-Release Software Evaluation Agreement</p>
<p style="FONT-FAMILY: Verdana">SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE<br>THE JAVA SE DEVELOPMENT KIT (JDK), VERSION 6<br>PRE-RELEASE SOFTWARE TO LICENSEE ONLY UPON THE<br>CONDITION THAT LICENSEE ACCEPTS ALL OF THE TERMS<br>CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT").<br>PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT<br>CAREFULLY. BY DOWNLOADING OR INSTALLING THIS SOFTWARE,<br>LICENSEE ACCEPTS THE TERMS AND CONDITIONS OF THIS<br>LICENSE AGREEMENT. INDICATE ACCEPTANCE BY SELECTING<br>THE "ACCEPT" BUTTON AT THE BOTTOM OF THIS AGREEMENT.<br>IF LICENSEE IS NOT WILLING TO BE BOUND BY ALL THE<br>TERMS, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF<br>THE AGREEMENT AND THE DOWNLOAD OR INSTALL PROCESS WILL<br>NOT CONTINUE.</p>
<p style="FONT-FAMILY: Verdana">1.0 DEFINITIONS "Licensed Software" means the Java SE<br>Development Kit (JDK), Version 6 pre-release software<br>in binary and/or source code forms, any other machine<br>readable materials (including, but not limited to,<br>libraries, source files, header files, and data<br>files), Feedback (as defined in Section 5.0), any user<br>manuals, programming guides and other documentation<br>provided to Licensee by Sun under this Agreement.</p>
<p style="FONT-FAMILY: Verdana">2.0 LIMITED LICENSE</p>
<p style="FONT-FAMILY: Verdana">2.1 Source Code. Sun grants to Licensee, a<br>non-exclusive, non-transferable, royalty-free and<br>limited license to view the source code portions of<br>the Licensed Software internally for the purposes of<br>evaluation only.</p>
<p style="FONT-FAMILY: Verdana">2.2 Binary Code. Sun grants to Licensee, a<br>non-exclusive, non-transferable, royalty-free and<br>limited license to use the binary code portions of the<br>Licensed Software internally for the purposes of<br>evaluation only.</p>
<p style="FONT-FAMILY: Verdana">2.3 No licenses are granted to Licensee for any other<br>purposes, Licensee may not sell, rent, loan or<br>otherwise encumber or transfer Licensed Software in<br>whole or in part, to any third party.</p>
<p style="FONT-FAMILY: Verdana">3.0 LICENSE RESTRICTIONS</p>
<p style="FONT-FAMILY: Verdana">3.1 Licensee may not duplicate Licensed Software other<br>than for a single copy of Licensed Software for<br>archival purposes only. Licensee agrees to reproduce<br>any copyright and other proprietary right notices on<br>any such copy.</p>
<p style="FONT-FAMILY: Verdana">3.2 Licensed Software is "Confidential Information".<br>Licensee may not disclose or use Confidential<br>Information, except for the purposes specified in this<br>Agreement. Licensee will protect the Confidential<br>Information with the same degree of care, as Licensee<br>uses to protect its own Confidential Information.</p>
<p style="FONT-FAMILY: Verdana">3.3 Except as otherwise provided by law, Licensee may<br>not modify or create derivative works of the Licensed<br>Software, or reverse engineer, disassemble or<br>decompile binary portions of the Licensed Software, or<br>otherwise attempt to derive the source code from such<br>portions.</p>
<p style="FONT-FAMILY: Verdana">3.4 No right, title, or interest in or to Licensed<br>Software, any trademarks, service marks, or trade<br>names of Sun or Sun's licensors is granted under this<br>Agreement.</p>
<p style="FONT-FAMILY: Verdana">3.5 Licensee shall have no right to use the Licensed<br>Software for productive or commercial use.</p>
<p style="FONT-FAMILY: Verdana">3.6&nbsp; Notwithstanding sections 3.1 and 3.3, and as a<br>special exception thereto, Licensee may use the files<br>from the Licensed Software with a virtual machine ("VM")<br>derived from the HotSpot Virtual Machine source code<br>("HotSpot") found at openjdk.dev.java.net.&nbsp; This<br>exception is subject to and conditioned upon the<br>following: (i) The VM was created in accordance with<br>the license terms governing "HotSpot";&nbsp; (ii) Any<br>activity under this exception is conducted solely<br>internally and for evaluation purposes only; and<br>(iii) Licensee is in compliance with all other terms<br>of this License.</p>
<p style="FONT-FAMILY: Verdana">4.0 NO SUPPORT Sun is under no obligation to support<br>Licensed Software or to provide Licensee with updates<br>or error corrections (collectively "Software<br>Updates"). If Sun, at its sole option, supplies<br>Software Updates to Licensee, the Software Updates<br>will be considered part of Licensed Software, and<br>subject to the terms of this Agreement.</p>
<p style="FONT-FAMILY: Verdana">5.0 LICENSEE DUTIES Licensee agrees to evaluate and<br>test the Software for use in Licensee's software<br>environment and provide feedback to Sun in a manner<br>reasonably requested by Sun. Any and all test results,<br>error data, reports or other information, feedback or<br>materials made or provided by Licensee relating to<br>Software (collectively, "Feedback") are the exclusive<br>property of Sun and Licensee hereby assigns all<br>Feedback to Sun at no cost to Sun. Sun may use such<br>Feedback in any manner and for any purpose, without<br>limitation, liability or obligation to Licensee.</p>
<p style="FONT-FAMILY: Verdana">6.0 TERM AND TERMINATION OF AGREEMENT</p>
<p style="FONT-FAMILY: Verdana">6.1 This Agreement will commence on the date on which<br>Licensee receives Licensed Software (the "Effective<br>Date") and will expire twelve (12) months from the<br>Effective Date, unless terminated earlier as provided<br>herein.</p>
<p style="FONT-FAMILY: Verdana">6.2 Either party may terminate this Agreement upon ten<br>(10) days' written notice to the other party. However,<br>Sun may terminate this Agreement immediately should<br>any Licensed Software become, or in Sun's opinion be<br>likely to become, the subject of a claim of<br>infringement of a patent, trade secret or copyright.</p>
<p style="FONT-FAMILY: Verdana">6.3 Sun may terminate this Agreement immediately<br>should Licensee materially breach any of its<br>provisions or take any action in derogation of Sun's<br>rights to the Confidential Information licensed to<br>Licensee.</p>
<p style="FONT-FAMILY: Verdana">6.4 Upon termination or expiration of this Agreement,<br>Licensee will immediately cease use of and destroy<br>Licensed Software, any copies thereof.</p>
<p style="FONT-FAMILY: Verdana">6.5 Rights and obligations under this Agreement which<br>by their nature should survive, will remain in effect<br>after termination or expiration hereof.</p>
<p style="FONT-FAMILY: Verdana">7.0 INSTALLATION AND AUTO-UPDATE.</p>
<p style="FONT-FAMILY: Verdana">The Software's installation and auto-update processes<br>transmit a limited amount of data to Sun (or its<br>service provider) about those specific processes to<br>help Sun understand and optimize them.&nbsp; Sun does not<br>associate the data with personally identifiable<br>information.&nbsp; You can find more information about the<br>data Sun collects at <a href="http://java.com/data/">http://java.com/data/</a>.</p>
<p style="FONT-FAMILY: Verdana">8.0 DISCLAIMER OF WARRANTY</p>
<p style="FONT-FAMILY: Verdana">8.1 Licensee acknowledges that Licensed Software may<br>contain errors and is not designed, licensed, or<br>intended for use in the design, construction,<br>operation or maintenance of any nuclear facility<br>("HighRisk Activities"). Sun disclaims any express or<br>implied warranty of fitness for such uses. Licensee<br>represents and warrants to Sun that it will not use,<br>distribute or license the Licensed Software for High<br>Risk Activities.</p>
<p style="FONT-FAMILY: Verdana">8.2 LICENSED SOFTWARE IS PROVIDED "AS IS". ALL EXPRESS<br>OR IMPLIED CONDITIONS, REPRESENTATIONS, AND<br>WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF<br>MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A<br>PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE<br>DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS<br>ARE HELD TO BE LEGALLY INVALID.</p>
<p style="FONT-FAMILY: Verdana">9.0 LIMITATION OF LIABILITY</p>
<p style="FONT-FAMILY: Verdana">9.1 Licensee acknowledges that the Licensed Software<br>may be experimental and that the Licensed Software may<br>have defects or deficiencies, which cannot or will not<br>be corrected by Sun. Licensee will hold Sun harmless<br>from any claims based on Licensee's use of the<br>Licensed Software for any purposes other than those of<br>internal evaluation, and from any claims that later<br>versions or releases of any Licensed Software<br>furnished to Licensee are incompatible with the<br>Licensed Software provided to Licensee under this<br>Agreement.</p>
<p style="FONT-FAMILY: Verdana">9.2 To the extent not prohibited by law, in no event<br>will Sun be liable for any indirect, punitive,<br>special, incidental or consequential damage in<br>connection with or arising out of this Agreement<br>(including loss of business, revenue, profits, use,<br>data or other economic advantage), however it arises,<br>whether for breach or in tort, even if Sun has been<br>previously advised of the possibility of such damage.</p>
<p style="FONT-FAMILY: Verdana">10.0 U.S. GOVERNMENT RESTRICTED RIGHTS If this Software<br>is being acquired by or on behalf of the U.S.<br>Government or by a U.S. Government prime contractor or<br>subcontractor (at any tier), then the Government's<br>rights in the Software and accompanying documentation<br>shall be only as set forth in this license; this is in<br>accordance with 48 C.F.R. 227.7202-4 (for Department<br>of Defense (DOD) acquisitions) and with 48 C.F.R.<br>2.101 and 12.212 (for non-DOD acquisitions).</p>
<p style="FONT-FAMILY: Verdana">11.0 GENERAL TERMS</p>
<p style="FONT-FAMILY: Verdana">11.1 Any action relating to or arising out of this<br>Agreement will be governed by California law and<br>controlling U.S. federal law. The U.N. Convention for<br>the International Sale of Goods and the choice of law<br>rules of any jurisdiction will not apply.</p>
<p style="FONT-FAMILY: Verdana">11.2 Licensed Software and technical data delivered<br>under this Agreement are subject to U.S. export<br>control laws and may be subject to export or import<br>regulations in other countries. Licensee agrees to<br>comply strictly with all such laws and regulations and<br>acknowledges that it has the responsibility to obtain<br>such licenses to export, re-export or import as may be<br>required after delivery to Licensee.</p>
<p style="FONT-FAMILY: Verdana">11.3 It is understood and agreed that, notwithstanding<br>any other provision of this Agreement, Licensee's<br>breach of this Agreement will cause Sun irreparable<br>damage for which recovery of money damages would be<br>inadequate, and that Sun will therefore be entitled to<br>seek timely injunctive relief to protect Sun's rights<br>under this Agreement in addition to any and all<br>remedies available at law.</p>
<p style="FONT-FAMILY: Verdana">11.4 Neither party may assign or otherwise transfer<br>any of its rights or obligations under this Agreement,<br>without the prior written consent of the other party,<br>except that Sun may assign this Agreement to an<br>affiliated company.</p>
<p style="FONT-FAMILY: Verdana">11.5 This Agreement is the parties' entire agreement<br>relating to its subject matter. It supersedes all<br>prior or contemporaneous oral or written<br>communications, proposals, conditions, representations<br>and warranties and prevails over any conflicting or<br>additional terms of any quote, order, acknowledgment,<br>or other communication between the parties relating to<br>its subject matter, including any Binary Code<br>Licenses, Supplemental Terms, or other licenses<br>contained within Licensed Software. No modification to<br>this Agreement will be binding, unless in writing and<br>signed by an authorized representative of each party.<br>(LFI#151319/Form ID#011801)</p>
<p style="FONT-FAMILY: Verdana"><br>Do you agree to the above license terms? [yes or no]</p>
<p style="FONT-FAMILY: Verdana">&nbsp;</p>
<p style="FONT-FAMILY: Verdana">&nbsp;</p>
<p style="FONT-FAMILY: Verdana">&nbsp;</p>
<p style="FONT-FAMILY: Verdana">&nbsp;</p>
<p style="FONT-FAMILY: Verdana"><br>yes<br>Unpacking...<br>Checksumming...<br>Extracting...<br>UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#90;&#105;&#112;&#45;&#66;&#117;&#103;&#115;&#64;&#108;&#105;&#115;&#116;&#115;&#46;&#119;&#107;&#117;&#46;&#101;&#100;&#117;">Zip-Bugs@lists.wku.edu</a>).<br>&nbsp; inflating: jdk-6u10-beta-linux-i586.rpm<br>&nbsp; inflating: sun-javadb-common-10.4.1-3.1.i386.rpm<br>&nbsp; inflating: sun-javadb-core-10.4.1-3.1.i386.rpm<br>&nbsp; inflating: sun-javadb-client-10.4.1-3.1.i386.rpm<br>&nbsp; inflating: sun-javadb-demo-10.4.1-3.1.i386.rpm<br>&nbsp; inflating: sun-javadb-docs-10.4.1-3.1.i386.rpm<br>&nbsp; inflating: sun-javadb-javadoc-10.4.1-3.1.i386.rpm<br>Preparing...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [100%]<br>&nbsp;&nbsp; 1:jdk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [100%]<br>Unpacking JAR files...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rt.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jsse.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charsets.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tools.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localedata.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; javaws.jar...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deploy.jar...<br>Installing JavaDB<br>Preparing...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [100%]<br>&nbsp;&nbsp; 1:sun-javadb-common&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [ 17%]<br>&nbsp;&nbsp; 2:sun-javadb-core&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [ 33%]<br>&nbsp;&nbsp; 3:sun-javadb-client&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [ 50%]<br>&nbsp;&nbsp; 4:sun-javadb-demo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [ 67%]<br>&nbsp;&nbsp; 5:sun-javadb-docs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [ 83%]<br>&nbsp;&nbsp; 6:sun-javadb-javadoc&nbsp;&nbsp;&nbsp;&nbsp; ########################################### [100%]</p>
<p style="FONT-FAMILY: Verdana">Done.<br>[root@localhost java]# vi /etc/profile<br>[root@localhost java]# source /etc/profile</p>
<p style="FONT-FAMILY: Verdana">[root@localhost java]#<br>[root@localhost java]# env<br>KDE_MULTIHEAD=false<br>SSH_AGENT_PID=5201<br>HOSTNAME=localhost.localdomain<br>TERM=xterm<br>SHELL=/bin/bash<br>HISTSIZE=1000<br>GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/root/.gtkrc-2.0:/root/.kde/share/config/gtkrc-2.0<br>KDE_NO_IPV6=1<br>GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc:/root/.kde/share/config/gtkrc<br>GS_LIB=/root/.fonts<br>WINDOWID=37748743<br>QTDIR=/usr/lib/qt-3.3<br>QTINC=/usr/lib/qt-3.3/include<br>KDE_FULL_SESSION=true<br>USER=root<br>LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:<br>SSH_AUTH_SOCK=/tmp/ssh-JCjHpF5168/agent.5168<br>KDEDIR=/usr<br>SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/5379<br>XDG_CONFIG_DIRS=/etc/kde/xdg:/etc/xdg<br>KONSOLE_DCOP=DCOPRef(konsole-5629,konsole)<br>MAIL=/var/spool/mail/root<br>PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java/jdk1.6.0_10/bin<br>DESKTOP_SESSION=kde<br>QT_IM_MODULE=scim<br>GDM_XSERVER_LOCATION=local<br>KONSOLE_DCOP_SESSION=DCOPRef(konsole-5629,session-1)<br>INPUTRC=/etc/inputrc<br>PWD=/usr/local/java<br>JAVA_HOME=/usr/java/jdk1.6.0_10<br><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#88;&#77;&#79;&#68;&#73;&#70;&#73;&#69;&#82;&#83;&#61;&#64;&#105;&#109;&#61;&#83;&#67;&#73;&#77;">XMODIFIERS=@im=SCIM</a><br>KDE_IS_PRELINKED=1<br>LANG=zh_CN.UTF-8<br>GDMSESSION=kde<br>XERCESCROOT=/home/soft/xerces-c-src_2_8_0<br>SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass<br>SHLVL=3<br>HOME=/root<br>XCURSOR_THEME=default<br>LOGNAME=root<br>QTLIB=/usr/lib/qt-3.3/lib<br>CVS_RSH=ssh<br>CLASSPATH=/usr/java/jdk1.6.0_10/lib:.<br>DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-FGw3oIRYzq,guid=7c118c48fd191781b3038c562a018700<br>LESSOPEN=|/usr/bin/lesspipe.sh %s<br>DISPLAY=:0.0<br>GTK_IM_MODULE=scim-bridge<br>G_BROKEN_FILENAMES=1<br>COLORTERM=<br>XAUTHORITY=/tmp/.gdmYVAKEU<br>_=/bin/env<br>[root@localhost java]# java -version<br>java version "1.4.2"<br>gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)</p>
<p style="FONT-FAMILY: Verdana">Copyright (C) 2006 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions.&nbsp; There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>[root@localhost java]#&nbsp;&nbsp;&nbsp;&nbsp; </p>
<img src ="http://www.cppblog.com/niewenlong/aggbug/57299.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-07-27 14:46 <a href="http://www.cppblog.com/niewenlong/archive/2008/07/27/57299.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序调试的利器GDB</title><link>http://www.cppblog.com/niewenlong/archive/2008/07/27/57270.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Sat, 26 Jul 2008 18:51:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/07/27/57270.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/57270.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/07/27/57270.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/57270.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/57270.html</trackback:ping><description><![CDATA[无论是多么优秀的程序员，都难以保证自己在编写代码时不会出现任何错误，因此调试是软件开发过程中的一个必不可少的组成部分。当程序完成编译之后，它很可能无法正常运行，或者会彻底崩溃，或者不能实现预期的功能。此时如何通过调试找到问题的症结所在，就变成了摆在开发人员面前最严峻的问题。通常说来，软件项目的规模越大，调试起来就会越困难，越需要一个强大而高效的调试器作为后盾。对于Linux程序员来讲，目前可供使用的调试器非常多，GDB（GNU DeBugger）就是其中较为优秀的。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>初识GDB</strong> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;GDB是自由软件基金会（Free Software Foundation，FSF）的软件工具之一。它的作用是协助程序员找到代码中的错误。如果没有GDB的帮助，程序员要想跟踪代码的执行流程，唯一的办法就是添加大量的语句来产生特定的输出。但这一手段本身就可能会引入新的错误，从而也就无法对那些导致程序崩溃的错误代码进行分析。GDB的出现减轻了开发人员的负担，他们可以在程序运行的时候单步跟踪自己的代码，或者通过断点暂时中止程序的执行。此外，他们还能够随时察看变量和内存的当前状态，并监视关键的数据结构是如何影响代码运行的。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>调试方法</strong> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;如果想对程序进行调试，必须先在用GCC编译源代码时加上-g选项，以便产生GDB所需要的调试符号信息。例如，debugme.c是一个存在错误程序，可以使用如下的命令对其进行编译，同时产生调试符号：<br>&nbsp;&nbsp;&nbsp;&nbsp;# gcc -g debugme.c -o debugme <br><br>&nbsp;&nbsp;&nbsp;&nbsp;如果愿意的话，还可以在编译时使用&#8220;-ggdb&#8221;选项来生成更多的调试信息。由于这些调试信息中的相当一部分是GDB所特有的，所以生成的代码将无法在其它调试器中正常调试。对于大多数情况来说，普通的-g选项就足够了。需要注意的是，GCC虽然允许同时使用-g(调试)和-o(优化)选项，但优化会影响最终生成的代码，导致程序源代码和二进制代码之间的关系变得复杂起来。如果不想为调试制造障碍，建议不要将-g和-o选项一同使用，并且只在程序彻底调试完后才开始进行代码优化。这样调试过程将变得相对轻松和愉快。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>基本应用</em> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;现在可以启动GDB来调试已经生成的可执行程序debugme，命令如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code># gdb debugme
            GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
            &#8230;&#8230;
            (gdb)</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;如果一切正常，GDB将被启动并在屏幕上输出版权信息，但如果使用了-q或--quiet选项则不会显示它们。启动GDB时另外一个有用的命令行选项是&#8220;-d dirname&#8221;，其中dirname是一个目录名。该目录名告诉GDB应该到哪里去寻找源代码。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;一旦出现GDB的命令提示符(gdb)，就表明GDB已经准备好接收来自用户的各种调试命令了。如果想在调试环境下运行这个程序，可以使用GDB提供的&#8220;run&#8221;命令，而程序在正常运行时所需的各种参数可以作为&#8220;run&#8221;命令的参数传入，或者使用单独的&#8220;set args&#8221;命令进行设置。如果在执行&#8220;run&#8221;命令时没有给出任何参数，GDB将使用上一次&#8220;run&#8221;或&#8220;set args&#8221;命令指定的参数。如果想取消上次设置的参数，可以执行不带任何参数的&#8220;set args&#8221;命令。下面尝试在调试器中运行这个程序： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) run
            &#8230;&#8230;
            Program received signal SIGSEGV, Segmentation fault.
            0x4000c6ac in _dl_fini () from /lib/ld-linux.so.2</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;最后一行输出表明程序在调用动态链接库/lib/ld-linux.so.2中的_dl_fini()函数时出现了错误，地址是0x4000c6ac。这些对调试是非常重要的线索。另外还有一种信息对调试也很重要，就是错误发生时的函数调用层级关系，可以通过执行&#8220;backtrace&#8221;命令来获得。在使用GDB调试命令时，用户可以不必输入完整的命令名称，使用任何惟一的缩写都可以。例如&#8220;backtrace&#8221;命令就可以缩写成&#8220;back&#8221;甚至&#8220;bt&#8221;。GDB还支持很多常用的Shell命令编辑特征，比如可以像在bash或tcsh中那样按Tab键补齐命令。如果相关命令不惟一的话，则列出所有可能的匹配项。此外键盘上的方向键可用来翻动历史命令。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;GDB是一个源代码级的调试器，使用&#8220;list&#8221;命令可以查看当前调试对象的源代码。该命令的通用格式为&#8220;list [m,n]&#8221;，表示显示从m行开始到n行结束的代码段，而不带任何参数的&#8220;list&#8221;命令将显示最近10行源代码。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>设置断点</em><br>&nbsp;&nbsp;&nbsp;&nbsp;在调试有问题的代码时，在某一点停止运行往往很管用。这样程序运行到此外时会暂时挂起，等待用户的进一步输入。GDB允许在几种不同的代码结构上设置断点，包括行号和函数名等，并且还允许设置条件断点，让程序只有在满足一定的条件时才停止执行。要根据行号设置断点，可以使用&#8220; break linenum&#8221;命令。要根据函数名设置断点，则应该使用&#8220;break funcname&#8221;命令。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在以上两种情况中，GDB将在执行指定的行号或进入指定的函数之前停止执行程序。此时可以使用&#8220;print&#8221;显示变量的值，或者使用&#8220;list&#8221;查看将要执行的代码。对于由多个源文件组成的项目，如果想在执行到非当前源文件的某行或某个函数时停止执行，可以使用如下形式的命令： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code># break 20041126110727.htm:linenum
            # break 20041126110727.htm:funcname</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;条件断点允许当一定条件满足时暂时停止程序的执行。它对于调试来讲非常有用。设置条件断点的正确语法如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>break linenum if expr
            break funcname if expr</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;其中expr是一个逻辑表达式。当该表达式的值为真时，程序将在该断点处暂时挂起。例如，下面的命令将在debugme程序的第38行设置一个条件断点。当程序运行到该行时，如果count的值等于3，就将暂时停止执行：<br>&nbsp;&nbsp;&nbsp;&nbsp;(gdb) break 38 if count==3 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;设置断点是调试程序时最常用到的一种手段。它可以中断程序的运行，给程序员一个单步跟踪的机会。使用命令&#8220; break main&#8221;在main函数上设置断点可以在程序启动时就开始进行跟踪。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;接下去使用&#8220;continue&#8221;命令继续执行程序，直到遇到下一个断点。如果在调试时设置了很多断点，可以随时使用&#8220;info breakpoints&#8221;命令来查看设置的断点。此外，开发人员还可以使用&#8220;delete&#8221;命令删除断点，或者使用&#8220;disable&#8221;命令来使设置的断点暂时无效。被设置为无效的断点在需要的时候可以用&#8220;enable&#8221;命令使其重新生效。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>观察变量</em><br>&nbsp;&nbsp;&nbsp;&nbsp;GDB最有用的特性之一是能够显示被调试程序中几乎任何表达式、变量或数组的类型和值，并且能够用编写程序所用的语言打印出任何合法表达式的值。查看数据最简单的办法是使用&#8220;print&#8221;命令，只需在&#8220;print&#8221;命令后面加上变量表达式，就可以打印出此变量表达式的当前值，示例如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) print str
            $1 = 0x40015360 "Happy new year!\n"</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;从输出信息中可以看出，输入字符串被正确地存储在了字符指针str所指向的内存缓冲区中。除了给出变量表达式的值外，&#8220;print&#8221;命令的输出信息中还包含变量标号($1)和对应的内存地址(0x40015360)。变量标号保存着被检查数值的历史记录，如果此后还想访问这些值，就可以直接使用别名而不用重新输入变量表达式。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;如果想知道变量的类型，可以使用&#8220;whatis&#8221;命令，示例如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) whatis str
            type = char *</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;对于第一次调试别人的代码，或者面对的是一个异常复杂的系统时，&#8220;whatis&#8221;命令的作用不容忽视。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<em>单步执行</em><br>&nbsp;&nbsp;&nbsp;&nbsp;为了单步跟踪代码，可以使用单步跟踪命令&#8220;step&#8221;，它每次执行源代码中的一行。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在GDB中可以使用许多方法来简化操作，除了可以将&#8220;step&#8221;命令简化为&#8220;s&#8221;之外，还可以直接输入回车键来重复执行前面一条命令。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;除了可以用&#8220;step&#8221;命令来单步运行程序之外，GDB还提供了另外一条单步调试命令&#8220;next&#8221;。两者功能非常相似，差别在于如果将要被执行的代码行中包含函数调用，使用step命令将跟踪进入函数体内，而使用next命令则不进入函数体内。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在进入下一部分之前，使用下面的命令退出GDB：<br>&nbsp;&nbsp;&nbsp;&nbsp;(gdb) quit <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>分析核心（core）文件</strong> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在程序发生崩溃时，有时可能无法直接运行GDB来进行调试。比如程序可能是在另外一台机器上运行的，或者因为程序对时间比较敏感，所以手动跟踪调试会产生无法接受的延迟等。遇到这些情况，就只能等到程序运行结束后才能判断崩溃的原因了。这时需要用到Linux提供的core dump机制。当程序中出现内存操作错误时，会发生崩溃并产生核心文件。使用GDB可以对产生的核心文件进行分析，找出程序是在什么时候崩溃的和在崩溃之前程序都做了些什么。当然，如果要用GDB来分析核心文件，也必须在编译时加上-g选项来产生调试符号表。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在分析核心文件之前必须确认系统是否允许生成核心文件，很多Linux发行版在默认时禁止生成核心文件。为了生成核心文件，首先必须执行下面的命令：<br>&nbsp;&nbsp;&nbsp;&nbsp;# ulimit -c unlimited <br><br>&nbsp;&nbsp;&nbsp;&nbsp;然后就可以生成核心文件了。这里仍以前面的debugme程序为例，再次执行下面命令将产生核心文件： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code># ./debugme
            Enter a string to count words:Happy new year!
            The number of words is 3.
            Segmentation fault (core dumped)</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;生成的核心文件名根据系统配置的不同会有所差异。要在GDB中分析核心文件，除了要给出核心文件的文件名外，还必须给出生成该核心文件的可执行程序的名称，示例如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>#gdb debugme core.547
            &#8230;&#8230;
            Program terminated with signal 11, Segmentation fault.
            Reading symbols from /lib/libc.so.6...done.
            &#8230;&#8230;</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;从GDB的输出信息中可以看出，产生这个核心文件的原因是因为程序收到了序号为11的信号。如果想知道程序在崩溃之前运行到了哪里，可以使用&#8220;backtrace&#8221;或&#8220;info stack&#8221;命令查看一下堆栈的历史记录。示例如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) info stack
            #0 0x4000c6ac in _dl_fini () from /lib/ld-linux.so.2
            #1 0x40057940 in exit () from /lib/libc.so.6
            #2 0x4004291f in _libc_start_main () from /lib/libc.so.6</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;由上可知，程序崩溃时正处于_dl_fini()函数之中。但很多时候程序员感兴趣的可能并不是这个，而是exit()或_libc_start_main()函数，因为它们才可能是问题真正的症结所在。GDB提供的&#8220;frame&#8221;命令可以用来在不同的调用上下文中切换。例如下面的命令可以查看exit()函数在执行时的状况： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) frame 1
            #1 0x40057940 in exit () from /lib/libc.so.6</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;此外还可以用&#8220;up&#8221;或&#8220;down&#8221;命令在不同的函数调用上下文中切换。开发人员使用这三条命令可以很轻松地实现调用栈的遍历。在分析核心文件时，通过将遍历栈的命令和检查变量值的&#8220;print&#8221;命令结合起来，就能够复原程序运行时的全部景象。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;<strong>调试其它进程</strong> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;有时会遇到一种很特殊的调试需求，对当前正在运行的其它进程进行调试。这种情况有可能发生在那些无法直接在调试器中运行的进程身上，例如有的进程只能在系统启动时运行。另外如果需要对进程产生的子进程进行调试的话，也只能采用这种方式。GDB可以对正在执行的程序进行调度，它允许开发人员中断程序并查看其状态，之后还能让这个程序正常地继续执行。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;GDB提供了两种方式来调试正在运行的进程：一种是在GDB命令行上指定进程的PID，另一种是在GDB中使用&#8220;attach&#8221;命令。例如，开发人员可以先启动debugme程序，让其开始等待用户的输入。示例如下： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>#./debugme
            Enter a string to count words:</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;接下去在另一个虚拟控制台中用下面的命令查出该进程对应的进程号： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code># ps -ax | grep debugme
            555 pts/1 S 0:00 ./debugme</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;得到进程的PID后，就可以使用GDB对其进行调试了： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code># gdb debugme 555
            GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
            Attaching to program: /home/xiaowp/debugme, process 555
            Reading symbols from /lib/libc.so.6...done.
            &#8230;&#8230;</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;在上面的输出信息中，以Attaching to program开始的行表明GDB已经成功地附加在PID为555的进程上了。另外一种连接到其它进程的方法是先用file命令加载调试时所需的符号表，然后再通过&#8220;attach&#233;&#8221;命令进行连接： <br><br><ccid_nobr>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width=400 align=center borderColorLight=black border=1>
    <tbody>
        <tr>
            <td class=code style="FONT-SIZE: 9pt" bgColor=#e6e6e6>
            <pre><ccid_code>(gdb) file /home/xiaowp/debugme
            Reading symbols from /home/xiaowp/debugme...done.
            (gdb) attach 555
            &#8230;&#8230;</ccid_code></pre>
            </td>
        </tr>
    </tbody>
</table>
</ccid_nobr><br><br>&nbsp;&nbsp;&nbsp;&nbsp;如果想知道程序现在运行到了哪里，同样可以使用&#8220;backtrace&#8221;命令。当然也可以使用&#8220;step&#8221;命令对程序进行单步调试。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;在完成调试之后，不要忘记用detach命令断开连接，让被调试的进程可以继续正常运行： <br><br>&nbsp;&nbsp;&nbsp;&nbsp;GDB是Linux下一个最基本的调试器，其功能非常丰富。完整地介绍GDB的功能可能需要几百页，本文只涵盖了GDB的一些最常见的用法。作为一个合格的Linux程序员，花在GDB上的功夫和时间越多，从调试中获得的益处就越多。
<img src ="http://www.cppblog.com/niewenlong/aggbug/57270.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-07-27 02:51 <a href="http://www.cppblog.com/niewenlong/archive/2008/07/27/57270.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Centos 快速yum 安装程序</title><link>http://www.cppblog.com/niewenlong/archive/2008/07/17/56445.html</link><dc:creator>聂文龙</dc:creator><author>聂文龙</author><pubDate>Thu, 17 Jul 2008 08:41:00 GMT</pubDate><guid>http://www.cppblog.com/niewenlong/archive/2008/07/17/56445.html</guid><wfw:comment>http://www.cppblog.com/niewenlong/comments/56445.html</wfw:comment><comments>http://www.cppblog.com/niewenlong/archive/2008/07/17/56445.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/niewenlong/comments/commentRss/56445.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/niewenlong/services/trackbacks/56445.html</trackback:ping><description><![CDATA[<p>　　仅仅适用于 centos 5.0 以上系统(5.0下我没有测试)</p>
<p>　　因为Centos 5.0 的yum 版本已经上升到3,所以yum有个插件名叫</p>
<p>　　yum-fastestmirror</p>
<p>　　这个插件能检查到你机器最快的镜像</p>
<p>　　这个插件安装也很简单</p>
<p>　　yum -y install yum-fastestmirror</p>
<p>　　然后你再使用yum安装其他软件就会发现速度快多了</p>
<p><br>&nbsp;</p>
<img src ="http://www.cppblog.com/niewenlong/aggbug/56445.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/niewenlong/" target="_blank">聂文龙</a> 2008-07-17 16:41 <a href="http://www.cppblog.com/niewenlong/archive/2008/07/17/56445.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>