﻿<?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++博客-天下大事， 必作于细</title><link>http://www.cppblog.com/hongyoulee/</link><description /><language>zh-cn</language><lastBuildDate>Sat, 04 Apr 2026 06:56:57 GMT</lastBuildDate><pubDate>Sat, 04 Apr 2026 06:56:57 GMT</pubDate><ttl>60</ttl><item><title>LINUX核心</title><link>http://www.cppblog.com/hongyoulee/archive/2009/07/27/91365.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Mon, 27 Jul 2009 09:42:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/07/27/91365.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/91365.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/07/27/91365.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/91365.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/91365.html</trackback:ping><description><![CDATA[<a href="http://net.pku.edu.cn/~yhf/lyceum/linuxK/tlk.html">http://net.pku.edu.cn/~yhf/lyceum/linuxK/tlk.html</a>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/91365.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-07-27 17:42 <a href="http://www.cppblog.com/hongyoulee/archive/2009/07/27/91365.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>strlen源码剖析</title><link>http://www.cppblog.com/hongyoulee/archive/2009/07/25/91126.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Sat, 25 Jul 2009 07:29:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/07/25/91126.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/91126.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/07/25/91126.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/91126.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/91126.html</trackback:ping><description><![CDATA[<a href="http://www.cppblog.com/ant/archive/2007/10/12/32886.html">http://www.cppblog.com/ant/archive/2007/10/12/32886.html</a><br><a href="http://www.cppblog.com/ant/archive/2007/10/12/32886.html">http://www.cppblog.com/ant/archive/2007/10/12/32886.html</a>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/91126.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-07-25 15:29 <a href="http://www.cppblog.com/hongyoulee/archive/2009/07/25/91126.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>real user ID, effective user ID,saved set-user-ID</title><link>http://www.cppblog.com/hongyoulee/archive/2009/07/23/90976.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Thu, 23 Jul 2009 14:54:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/07/23/90976.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/90976.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/07/23/90976.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/90976.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/90976.html</trackback:ping><description><![CDATA[<a href="http://hi.baidu.com/051156/blog/item/9813f7460452c6016a63e554.html">http://hi.baidu.com/051156/blog/item/9813f7460452c6016a63e554.html</a><br><a href="http://hi.baidu.com/051156/blog/item/9813f7460452c6016a63e554.html">http://hi.baidu.com/051156/blog/item/9813f7460452c6016a63e554.html</a><br><a href="http://sunlit.javaeye.com/blog/400898">http://sunlit.javaeye.com/blog/400898</a><br><br>
<p>Unix中，每个进程都包含三个ID：<strong>real user ID，effective user ID，saved set user ID</strong>。<br><br><strong>real user ID</strong>表示的是实际上进程的执行者是谁。<br><strong>effective user ID</strong>主要用于校验该进程在执行时所获得的文件访问权限,也就是说当进程需要访问文件，系统检查权限时实际上检查的该进程的"effective user ID"，或者是effective user ID 告诉系统，该进程在对资源访问时，具有等同于哪个用户的权限。<br><strong>saved set-user-ID</strong> 仅在effective user ID发生改变时保存。（这个看了后面的例子就明白了^_^）<br><br>一般情况下,real user ID就是进程的effective user ID,但是当要运行的可执行程序设置了"<span class=docEmphasis>set-user-ID</span>"位之后,进程的effective user ID变成该文件的属主用户id,同时该进程的"saved set-user-ID"变成此时进程的"effective user ID",也就是该可执行程序的属主用户ID,该进程在执行一些与文件访问权限相关的操作时系统检查的是进程的effective user ID.<br><br>为什么需要一个"saved set-user-ID"?因为当进程没有超级用户权限的时候,进程在设置"effective user ID"时需要将需要设置的ID和该进程的"real user ID"或者"saved set-user-ID"进行比较.<br><br>APUE2中进行的解释是:<br>1)If the process has superuser privileges, the setuid function sets the real user ID, effective user ID, and saved set-user-ID to uid.</p>
<p>2)If the process does not have superuser privileges, but uid equals either the real user ID or the saved set-user-ID, setuid sets only the effective user ID to uid. The real user ID and the saved set-user-ID are not changed.</p>
<p>3)If neither of these two conditions is true, errno is set to EPERM, and 1 is returned<br>也就是说:<br>1)当用户具有超级用户权限的时候,setuid 函数设置的id对三者都起效.<br>2)否则,仅当该id为real user ID 或者saved set-user-ID时,该id对effective user ID起效.<br>3)否则,setuid函数调用失败.<br><br>也就是说,这个saved set-user-ID更多的作用是在进程切换自己的effective user ID起作用.<br><br>需要特别提醒的是:并没有任何的API可以获取到进程的saved set-user-ID,它仅仅是系统在调用setuid函数时进行比较而起作用的.<br>APUE2中关于此事的原话如下:<br>Note that we can obtain only the current value of the real user ID and the effective user ID with the functions <tt><font face=NSimsun>getuid</font></tt> and <tt><font face=NSimsun>geteuid</font></tt> from Section 8.2. We can't obtain the current value of the saved set-user-ID.</p>
<p><br>举一个例子说明问题,假设这样的一种情况,系统中有两个用户A,B,还有一个由B创建的可执行程序proc,该可执行程序的set-<br>user-id位已经进行了设置.<br><br>当A用户执行程序proc时,<br>程序的real user ID = A的用户ID,effective user ID = B的用户ID, saved set-user-ID=B的用户ID.<br><br>假如在该进程结束了对某些限制只能由用户B访问的文件操作后,程序将effective user ID设置回A,也就是说此时:<br>程序的real user ID = A的用户ID,effective user ID = A的用户ID, saved set-user-ID=B的用户ID.<br><br>这个改动之所以能成功,原因在于上面列举出的情况2):该ID为进程的real user ID.<br><br>最后,假设由于种种原因进程需要再次切换effective user ID为B,可是因为不能通过API获取进程的saved set-user-ID(该值为B的用户ID),所以只能通过两种途径获得(可能还有别的途径):<br>a)在设置effective user ID变回A之前保存effective user ID,它的值为B的用户ID.<br>b)调用函数getpwnam( "B"),在返回的struct passwd *指针中成员pw_uid存放的就是用户B的ID.<br>这样,这个调用setuid(B的用户ID)就会成功,原因也在于上面说的情况2):该ID与进程的saved set-user-ID相同.</p>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/90976.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-07-23 22:54 <a href="http://www.cppblog.com/hongyoulee/archive/2009/07/23/90976.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>系统学习Linux系列之Linux系统编程</title><link>http://www.cppblog.com/hongyoulee/archive/2009/07/06/89356.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Mon, 06 Jul 2009 05:41:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/07/06/89356.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/89356.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/07/06/89356.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/89356.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/89356.html</trackback:ping><description><![CDATA[<a href="http://blog.csdn.net/yy_msdn/category/391487.aspx">http://blog.csdn.net/yy_msdn/category/391487.aspx</a>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/89356.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-07-06 13:41 <a href="http://www.cppblog.com/hongyoulee/archive/2009/07/06/89356.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>福州大学ACM资源</title><link>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88642.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Sat, 27 Jun 2009 07:54:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88642.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/88642.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88642.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/88642.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/88642.html</trackback:ping><description><![CDATA[<a href="http://ds.fzu.edu.cn/(eqzuqc45qxg0xe45tdp3pn55)/discuss.aspx">http://ds.fzu.edu.cn/(eqzuqc45qxg0xe45tdp3pn55)/discuss.aspx</a><br><br><a href="http://ds.fzu.edu.cn/(eqzuqc45qxg0xe45tdp3pn55)/default.aspx">http://ds.fzu.edu.cn/(eqzuqc45qxg0xe45tdp3pn55)/default.aspx</a>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/88642.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-06-27 15:54 <a href="http://www.cppblog.com/hongyoulee/archive/2009/06/27/88642.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>正则表达式30分钟入门教程(正则表达式和sscanf)</title><link>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88633.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Sat, 27 Jun 2009 03:21:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88633.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/88633.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88633.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/88633.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/88633.html</trackback:ping><description><![CDATA[<p><a href="http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm">http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/28hw3sce.aspx">http://msdn.microsoft.com/en-us/library/28hw3sce.aspx</a><br><a href="http://msdn.microsoft.com/zh-cn/library/system.text.regularexpressions.regex.aspx">http://msdn.microsoft.com/zh-cn/library/system.text.regularexpressions.regex.aspx</a><br><a href="http://www.regular-expressions.info/">http://www.regular-expressions.info/</a><br><a href="http://weblogs.asp.net/whaggard/archive/2005/02/20/377025.aspx">http://weblogs.asp.net/whaggard/archive/2005/02/20/377025.aspx</a><br><a href="http://www.oreilly.com/catalog/regex2/">http://www.oreilly.com/catalog/regex2/</a></p>
<p>在看这篇文章之前建议你先了解一下什么是正则表达式，具体不重复了，google一下能出一大堆，不过这篇文章比较好，贴个url <a href="http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm">http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm</a>，作者说30分钟能看完的不是地球人，但是我15分钟就看完了还记住了90%以上，好吧我来自火星，玩笑到此结束，下面切入正题。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 本文的命题源自于这样的一个url，protocol://ip:port/chn/mode，比如说，dv://192.168.1.253:65001/1/1。如果我要解析出来各个部分，并把它们保存到各自的变量里面要怎么做？传统的C程序员会说用strtok慢慢取得各个部分，对于要转成int的用atoi，部分C++程序员也许会放弃strtok转用std::string当中的find系列成员函数（find/find_first_of...）。是的，我以前也是这么干的，两种方法都用过，当然也包括MFC里的CString的相关成员函数。现在，一种全新的方法源自于sscanf这个C语言函数。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 无论你用C还是C++，sscanf和scanf这两个函数都不会太陌生，%d %s %f甚至%02d %.2f这些东西你也很熟，看了上面我说的正则表达式，也许你会写出这么一个正则表达式：[a-zA-Z]+://(\d{1,3}\.){3}(\d{1,3}):\d{1,5}/\d{1,}/\d，没错，这个正则表达式的IP部分有点问题，但是为了描述简单，暂时就这么用了。激动人心的时候到了，我要告诉你的是scanf以及sscanf实际上是支持部分正则表达式的，当然即使是到现在我依旧不敢肯定这个部分是否是ANSI的一部分，但是我的VS2005上没有问题，朋友的VS2003上也没有问题，至于VC6实在太古老暂时找不到测试。但是顺便说一句，VS2005上你用sscanf或者scanf他会出警告的，他说这两个函数不安全建议你用sscanf_s和scanf_s，我试了下推荐的两个函数又不支持这个功能了，比较囧了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 好了，具体说说sscanf的这个扩展功能吧（暂且这么叫）。sscanf提供的这个扩展功能其实并不能真正称为正则表达式，因为他的书写还是离不开%，而且也很局限。但是作为处理我上面说的url已经是绰绰有余了。sscanf的这个扩展功能支持[]表示支付范围，{}表示重复次数，^表示取非，*表示跳过。所以上面这个url的解析可以写成下面这个样子：</p>
<p>char url[] = "dv://192.168.1.253:65001/1/1"</p>
<p>sscanf(url,"%[^://]%*c%*c%*c%[^:]%*c%d%*c%d%*c%d",protocol,ip,port,chn,type);</p>
<p>解释一下</p>
<p>先取得一个最长的字符串，但不包括字串://，于是protocol="dv\0";</p>
<p>然后跳过三个字符（%*c），其实就是跳过://</p>
<p>接着取一个字符串不包括字符串:，于是ip=192.168.1.253，这里简化处理了，IP就当个字符串来弄，而且不做检查</p>
<p>然后跳过冒号取端口到port，再跳过/取通道号到chn，再跳过/取码流类型到type。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 是不是觉得还不过瘾？我也觉得，接着举例。</p>
<p>sscanf("Phil\nChang","%[^\n]%*c%s",first_name,last_name);</p>
<p>解释：跳过一个换行符，取first_name和last_name</p>
<p>类似上面的sscanf("<a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#112;&#104;&#105;&#108;&#50;&#51;&#54;&#48;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;&#34;&#44;&#34;&#37;&#91;&#94;&#64;&#93;&#37;&#42;&#99;&#37;&#115;&#34;&#44;&#117;&#115;&#101;&#114;&#95;&#110;&#97;&#109;&#101;&#44;&#104;&#111;&#115;&#116;'>phil2360@gmail.com","%[^@]%*c%s",user_name,host</a>);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 基本上，这个东西用的不多，但是有时候很实用，让你的代码会很简洁，但是相比正则表达式，功能又显得简陋很多，怎么用，就看个人而定了，还是那句话，不是很确定这东西是不是ANSI的，所以不考虑移植又觉得很简洁那么用吧，考虑移植那么请三思，至于正则表达式，用regex或者boost库吧，哦，我说的是C++，C#本来就带了的！</p>
<p>&nbsp;</p>
<p>本文来自CSDN博客，转载请标明出处：<a href="http://blog.csdn.net/phil2036/archive/2009/05/27/4221704.aspx">http://blog.csdn.net/phil2036/archive/2009/05/27/4221704.aspx</a><br></p>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/88633.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-06-27 11:21 <a href="http://www.cppblog.com/hongyoulee/archive/2009/06/27/88633.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ACM在线答题(Judge Online)网站</title><link>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88632.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Sat, 27 Jun 2009 03:19:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88632.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/88632.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88632.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/88632.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/88632.html</trackback:ping><description><![CDATA[<div>
<p style="TEXT-INDENT: 2em">北大内部 <a href="http://ai.pku.cn/JudgeOnline"><font color=#6aa50d>http://ai.pku.cn/JudgeOnline</font></a></p>
<p style="TEXT-INDENT: 2em">北京大学（PKU） <a href="http://acm.pku.edu.cn/JudgeOnline/"><font color=#6aa50d>http://acm.pku.edu.cn/JudgeOnline/</font></a> </p>
<p style="TEXT-INDENT: 2em">北京邮电大学（BUPT） <a href="http://acm.cs.bupt.cn/onlinejudge/"><font color=#6aa50d>http://acm.cs.bupt.cn/onlinejudge/</font></a> </p>
<p style="TEXT-INDENT: 2em">福建师范大学（FJNU） <a href="http://acm.fjnu.edu.cn/"><font color=#6aa50d>http://acm.fjnu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">福州大学（FZU） <a href="http://acm.fzu.edu.cn/"><font color=#6aa50d>http://acm.fzu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">哈尔滨工业大学（HIT） <a href="http://acm.hit.edu.cn/"><font color=#6aa50d>http://acm.hit.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">哈工程大 <a href="http://acm.hrbeu.edu.cn/"><font color=#6aa50d>http://acm.hrbeu.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">杭州电子科技大学(HDU) <a href="http://acm.hziee.edu.cn/"><font color=#6aa50d>http://acm.hziee.edu.cn/</font></a> (<a href="http://acm.hdu.edu.cn/"><font color=#6aa50d>http://acm.hdu.edu.cn/</font></a>)</p>
<p style="TEXT-INDENT: 2em">合肥工大 <a href="http://acm.tdzl.net:83/JudgeOnline"><font color=#6aa50d>http://acm.tdzl.net:83/JudgeOnline</font></a></p>
<p style="TEXT-INDENT: 2em">湖南大学（HNU） <a href="http://acm.hnu.cn:8080/online/"><font color=#6aa50d>http://acm.hnu.cn:8080/online/</font></a> </p>
<p style="TEXT-INDENT: 2em">华东师范大学（ECNU） <a href="http://acm.cs.ecnu.edu.cn/"><font color=#6aa50d>http://acm.cs.ecnu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">华中科技大学（HUST） <a href="http://acm.hust.edu.cn/JudgeOnline"><font color=#6aa50d>http://acm.hust.edu.cn/JudgeOnline</font></a></p>
<p style="TEXT-INDENT: 2em">吉林大学（JLU） <a href="http://acm.jlu.edu.cn/joj/"><font color=#6aa50d>http://acm.jlu.edu.cn/joj/</font></a> </p>
<p style="TEXT-INDENT: 2em">兰州大学 <a href="http://acm.sundayclub.cn/JudgeOnline/problemlist"><font color=#6aa50d>http://acm.sundayclub.cn/JudgeOnline/problemlist</font></a></p>
<p style="TEXT-INDENT: 2em">南方航空航天大学 <a href="http://acm.nuaa.edu.cn/"><font color=#6aa50d>http://acm.nuaa.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">南开大学 <a href="http://acm.nankai.edu.cn/"><font color=#6aa50d>http://acm.nankai.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">宁波大学 <a href="http://218.0.7.99:8080/JudgeOnline/"><font color=#6aa50d>http://218.0.7.99:8080/JudgeOnline/</font></a> </p>
<p style="TEXT-INDENT: 2em">宁波理工（NIT） <a href="http://acm.nit.net.cn/"><font color=#6aa50d>http://acm.nit.net.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">汕头大学（STU） <a href="http://acm.stu.edu.cn/"><font color=#6aa50d>http://acm.stu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">上海大学（SHU） <a href="http://acmoj.shu.edu.cn/"><font color=#6aa50d>http://acmoj.shu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">上海交通大学 <a href="http://acm.sjtu.edu.cn/"><font color=#6aa50d>http://acm.sjtu.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">四川大学（SCU） <a href="http://acm.scu.edu.cn/"><font color=#6aa50d>http://acm.scu.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">天津大学（TJU） <a href="http://acm.tju.edu.cn/toj/"><font color=#6aa50d>http://acm.tju.edu.cn/toj/</font></a> </p>
<p style="TEXT-INDENT: 2em">同济大学（TJU） <a href="http://acm.tongji.edu.cn/"><font color=#6aa50d>http://acm.tongji.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">武汉大学 <a href="http://acm.whu.edu.cn/oak/"><font color=#6aa50d>http://acm.whu.edu.cn/oak/</font></a></p>
<p style="TEXT-INDENT: 2em">西南科技大学（SWUST）<a href="http://acm.swust.edu.cn:8080/JudgeOnline/"><font color=#6aa50d>http://acm.swust.edu.cn:8080/JudgeOnline/</font></a> </p>
<p style="TEXT-INDENT: 2em">厦门大学（XMU） <a href="http://acm.xmu.edu.cn/JudgeOnline/"><font color=#6aa50d>http://acm.xmu.edu.cn/JudgeOnline/</font></a> </p>
<p style="TEXT-INDENT: 2em">浙江大学（ZJU） <a href="http://acm.zju.edu.cn/"><font color=#6aa50d>http://acm.zju.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">浙江工商大学 <a href="http://acm.hzic.edu.cn/"><font color=#6aa50d>http://acm.hzic.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">浙江工业大学（ZJUT） <a href="http://acm.zjut.edu.cn/"><font color=#6aa50d>http://acm.zjut.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">浙江师范大学（ZJNU） <a href="http://acm.zjnu.cn/"><font color=#6aa50d>http://acm.zjnu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">中国地质大学（CUG）<a href="http://lab.cug.edu.cn/COJ/"><font color=#6aa50d>http://lab.cug.edu.cn/COJ/</font></a> </p>
<p style="TEXT-INDENT: 2em">中国科技大学（USTC） <a href="http://acm.ustc.edu.cn/"><font color=#6aa50d>http://acm.ustc.edu.cn/</font></a> </p>
<p style="TEXT-INDENT: 2em">中山大学 <a href="http://202.116.77.69/sicily"><font color=#6aa50d>http://202.116.77.69/sicily</font></a></p>
<p style="TEXT-INDENT: 2em">暨南大学（JNU） <a href="http://202.116.24.78/JudgeOnline"><font color=#6aa50d>http://202.116.24.78/JudgeOnline</font></a></p>
<p style="TEXT-INDENT: 2em">湖南省第四界程序设计大赛 <a href="http://2008hncpc.usc.edu.cn/"><font color=#6aa50d>http://2008hncpc.usc.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em"><font color=#6aa50d></font></p>
<p style="TEXT-INDENT: 2em">华东师范大学（ECNU）：<a href="http://acm.cs.ecnu.edu.cn/"><font color=#6aa50d>http://acm.cs.ecnu.edu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">浙江师范大学（ZJNU）：<a href="http://acm.zjnu.cn/"><font color=#6aa50d>http://acm.zjnu.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">西安交大ACM ICPC 网站 <a href="http://acm.eeyes.net/"><font color=#6aa50d>http://acm.eeyes.net/</font></a></p>
<p style="TEXT-INDENT: 2em">高效信息学在线判题系统(一个中学生做的) <a href="http://www.vijos.cn/"><font color=#6aa50d>http://www.vijos.cn/</font></a></p>
<p style="TEXT-INDENT: 2em">国外的:</p>
<p style="TEXT-INDENT: 2em">西班牙</p>
<p style="TEXT-INDENT: 2em">Valladolid大学 瓦拉杜利德大学</p>
<p style="TEXT-INDENT: 2em"><a href="http://online-judge.uva.es/problemset/"><font color=#6aa50d>http://online-judge.uva.es/problemset/</font></a></p>
<p style="TEXT-INDENT: 2em"><a href="http://acm.uva.es/"><font color=#6aa50d>http://acm.uva.es/</font></a></p>
<p style="TEXT-INDENT: 2em">俄罗斯Ural立大学 <a href="http://acm.timus.ru/"><font color=#6aa50d>http://acm.timus.ru/</font></a></p>
<p style="TEXT-INDENT: 2em">UsacoGate <a href="http://ace.delos.com/usacogate"><font color=#6aa50d>http://ace.delos.com/usacogate</font></a></p>
<p style="TEXT-INDENT: 2em">萨拉托夫大学 Saratov State University <a href="http://acm.sgu.ru/"><font color=#6aa50d>http://acm.sgu.ru/</font></a></p>
<p style="TEXT-INDENT: 2em">EL Judge(MIPT): <a href="http://acm.mipt.ru/judge/problems.pl"><font color=#6aa50d>http://acm.mipt.ru/judge/problems.pl</font></a></p>
<p style="TEXT-INDENT: 2em">波兰</p>
<p style="TEXT-INDENT: 2em">SPOJ：<a href="http://www.spoj.pl/"><font color=#6aa50d>http://www.spoj.pl/</font></a></p>
<p style="TEXT-INDENT: 2em">吉尔吉斯斯坦</p>
<p style="TEXT-INDENT: 2em">KRSU: <a href="http://www.olymp.krsu.edu.kg/GeneralProblemset.aspx"><font color=#6aa50d>http://www.olymp.krsu.edu.kg/GeneralProblemset.aspx</font></a></p>
<p style="TEXT-INDENT: 2em">巴别诺瓦 <a href="http://babelnova.net/node/317"><font color=#6aa50d>http://babelnova.net/node/317</font></a></p>
</div>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/88632.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-06-27 11:19 <a href="http://www.cppblog.com/hongyoulee/archive/2009/06/27/88632.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux目录名和常见后缀的渊源</title><link>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88615.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Fri, 26 Jun 2009 16:26:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88615.html</guid><wfw:comment>http://www.cppblog.com/hongyoulee/comments/88615.html</wfw:comment><comments>http://www.cppblog.com/hongyoulee/archive/2009/06/27/88615.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hongyoulee/comments/commentRss/88615.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hongyoulee/services/trackbacks/88615.html</trackback:ping><description><![CDATA[Unix已经有35年历史了。许多人认为它开始于中世纪，这个中世纪是相对于计算机技术的产生和发展来说的。在过去的时间里，Unix和它的子分支Linux收集有许多的历史和一些完全古老的语言。在这篇技巧文章中，我们将介绍一少部分古老的语言和它们的目的和作用，以及它们真正的来源。 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　RC &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　在Linux中，最为常用的缩略语也许是&#8220;rc&#8221;，它是&#8220;runcomm&#8221;的缩写――即名词&#8220;run &nbsp; command&#8221;(运行命令)的简写。今天，&#8220;rc&#8221;是任何脚本类文件的后缀，这些脚本通常在程序的启动阶段被调用，通常是Linux系统启动时。如 &nbsp; /etc/rs是Linux启动的主脚本，而.bashrc是当Linux的bash &nbsp; shell启动后所运行的脚本。.bashrc的前缀&#8220;.&#8221;是一个命名标准，它被设计用来在用户文件中隐藏那些用户指定的特殊文件;&#8220;ls&#8221;命令默认情况下不会列出此类文件，&#8220;rm&#8221;默认情况下也不会删除它们。许多程序在启动时，都需要&#8220;rc&#8221;后缀的初始文件或配置文件，这对于Unix的文件系统视图来说，没有什么神秘的。 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　ETC &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　在&#8220;etc/bin&#8221;中的&#8220;etc&#8221;真正代表的是&#8220;etcetera&#8221;(附加物)。在早期的Unix系统中，最为重要的目录是&#8220;bin&#8221;目录 &nbsp; (&#8220;bin&#8221;是&#8220;binaries&#8221;二进制文件――编译后的程序的缩写)，&#8220;etc&#8221;中则包含琐碎的程序，如启动、关机和管理。运行一个Linux必须的东西的列表是:一个二进制程序，etcetera，etcetera――换句话说，是一个底层的重要项目，通常添加一些次等重要的零碎事物。今天， &nbsp; &#8220;etc&#8221;包含了广泛的系统配置文件，这些配置文件几乎包含了系统配置的方方面面，同样非常重要。 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　Bin &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　今天，许多在Linux上运行的大型子系统，如GNOME或Oracle，所编译成的程序使用它们自己的&#8220;bin&#8221;目录(或者是 &nbsp; /usr/bin，或者是/usr/local/bin)作为标准的存放地。同样，现在也能够在这些目录看到脚本文件，因为&#8220;bin&#8221;目录通常添加到用户的PATH路径中，这样他们才能够正常的使用程序。因此运行脚本通常在bin中运行良好。 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　TTY &nbsp; <br>&nbsp; &nbsp; <br><clk style="FONT-SIZE: 12px">&nbsp; 　　在Linux中，TTY也许是跟终端有关系的最为混乱的术语。TTY是TeleTYpe的一个老缩写。Teletypes，或者 &nbsp; teletypewriters，原来指的是电传打字机，是通过串行线用打印机键盘通过阅读和发送信息的东西，和古老的电报机区别并不是很大。之后，当计算机只能以批处理方式运行时(当时穿孔卡片阅读器是唯一一种使程序载入运行的方式)，电传打字机成为唯一能够被使用的&#8220;实时&#8221;输入/输出设备。最终，电传打字机被键盘和显示器终端所取代，但在终端或 &nbsp; TTY接插的地方，操作系统仍然需要一个程序来监视串行端口。一个getty&#8220;Get &nbsp; TTY&#8221;的处理过程是:一个程序监视物理的TTY/终端接口。对一个虚拟<nobr oncontextmenu="return false" onmousemove=$cE.MoW() id=clickeyekey1 onmouseover=$cE.s(event,1) style="FONT-SIZE: 12px; COLOR: #6600ff; BORDER-BOTTOM: #6600ff 1px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick='$cE.defer(this);$cE.c(event,1,"",1)' onmouseout=$cE.OuK()>网络</nobr>沮丧服务器(VNC)来说，一个伪装的TTY(Pseudo-TTY，即家猫的TTY，也叫做&#8220;PTY&#8221;)是等价的终端。当你运行一个xterm(终端仿真程序)或GNOME终端程序时，PTY对虚拟的用户或者如xterm一样的伪终端来说，就像是一个TTY在运行。&#8220;Pseudo&#8221;的意思是&#8220;duplicating &nbsp; in &nbsp; a &nbsp; fake &nbsp; way&#8221;(用伪造的方法复制)，它相比&#8220;virtual&#8221;或&#8220;emulated&#8221;更能真实的说明问题。而在现在的计算中，它却处于被放弃的阶段。 &nbsp; </clk><br>&nbsp; &nbsp; <br>&nbsp; 　　Dev &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 　　从TTY留下的命令有&#8220;stty&#8221;，是&#8220;set &nbsp; tty&#8221;(设置TTY)的缩写，它能够生成一个配置文件/etc/initab(&#8220;initialization &nbsp; table&#8221;，初始表)，以配置gettys使用哪一个串口。在现代，直接附加在Linux窗口上的唯一终端通常是控制台，由于它是特殊的TTY，因此被命名为&#8220;console&#8221;。当然，一旦你启动X11，&#8220;console&#8221;TTY就会消失，再也不能使用串口协议。所有的TTY都被储存在&#8220;/dev&#8221;目录，它是&#8220;[physical] &nbsp; devices&#8221;([物理]设备)的缩写。以前，你必须在电脑后面的串口中接入一个新的终端时，手工修改和配置每一个设备文件。现在，Linux(和 &nbsp; Unix)在安装过程中就在此目录中创建了它所能向导的每一个设备的文件。这就是说，你很少需要自己创建它。&nbsp;&nbsp; 
<img src ="http://www.cppblog.com/hongyoulee/aggbug/88615.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2009-06-27 00:26 <a href="http://www.cppblog.com/hongyoulee/archive/2009/06/27/88615.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>每周一题(2007.4.1)</title><link>http://www.cppblog.com/hongyoulee/archive/2007/04/01/21049.html</link><dc:creator>友哥</dc:creator><author>友哥</author><pubDate>Sun, 01 Apr 2007 08:31:00 GMT</pubDate><guid>http://www.cppblog.com/hongyoulee/archive/2007/04/01/21049.html</guid><description><![CDATA[题目：(可以把解题思路和程序发到我的邮箱<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#72;&#111;&#110;&#103;&#121;&#111;&#117;&#76;&#101;&#101;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">HongyouLee@gmail.com</a>，大家一起讨论)<br><font size=4>从1到N(100000)中任意拿掉两个数，把剩下的99998个数顺序打乱，并且放入数组A中。要求只扫描一遍数组，把这两个数找出来。可以使用最多不超过5个局部变量，不能用数组变量，并且不能改变原数组的值。</font><br>
<img src ="http://www.cppblog.com/hongyoulee/aggbug/21049.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hongyoulee/" target="_blank">友哥</a> 2007-04-01 16:31 <a href="http://www.cppblog.com/hongyoulee/archive/2007/04/01/21049.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>