<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/votbar" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/votbar" type="application/rss+xml"></fs:self_link><lastBuildDate>Thu, 07 Jan 2010 14:36:33 GMT</lastBuildDate><title>votbar</title><description>少壮不努力，老大做IT</description><link>http://www.votbar.com</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Thu, 07 Jan 2010 14:36:33 GMT</pubDate><item><title>fishbone[2]</title><link>http://www.votbar.com/archives/53</link><wfw:commentRss>http://www.votbar.com/archives/53/feed</wfw:commentRss><slash:comments>0</slash:comments><description>这空间又要到期了，上帝他爸的空间其实还不错，不过我不想续了
唉，又得搬家了，每次搬家，前面的数据都丢了，也好，重新开始，反正今年懒的很
先把最近的一个ppt发上来&lt;img src=&quot;http://www1.feedsky.com/t1/319844771/votbar/feedsky/s.gif?r=http://www.votbar.com/archives/53&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844771/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844771/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>算法</category><pubDate>Thu, 07 Jan 2010 22:36:33 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/53#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=53</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/53</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844771/5717928</fs:itemid></item><item><title>how to make code in good shape</title><link>http://www.votbar.com/archives/51</link><wfw:commentRss>http://www.votbar.com/archives/51/feed</wfw:commentRss><slash:comments>0</slash:comments><description>以前的一个ppt,
主要讲的是关于项目结构和ant的使用&lt;img src=&quot;http://www1.feedsky.com/t1/319844772/votbar/feedsky/s.gif?r=http://www.votbar.com/archives/51&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844772/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844772/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>算法</category><category>ant</category><category>structure</category><category>java</category><pubDate>Wed, 23 Dec 2009 22:56:46 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/51#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=51</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/51</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844772/5717928</fs:itemid></item><item><title>fishbone[1]</title><link>http://www.votbar.com/archives/46</link><wfw:commentRss>http://www.votbar.com/archives/46/feed</wfw:commentRss><slash:comments>0</slash:comments><description>&lt;img src=&quot;http://www1.feedsky.com/t1/319844773/votbar/feedsky/s.gif?r=http://www.votbar.com/archives/46&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844773/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844773/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>算法</category><category>j2me</category><category>fishbone</category><pubDate>Wed, 23 Dec 2009 22:42:45 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/46#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=46</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/46</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844773/5717928</fs:itemid></item><item><title>用异或求头上的数字</title><link>http://www.votbar.com/archives/41</link><wfw:commentRss>http://www.votbar.com/archives/41/feed</wfw:commentRss><slash:comments>0</slash:comments><description>话说有一个法官，他的监狱里关着100名犯人。。有一次闲着没事呢，就在一次放风的过程中跟着100名犯人说：我现在给你们每人发一顶帽子，帽子上有一个 数字，数字从1-100都有可能，而且可以重复，每个人一个一个过来领帽子～领完帽子以后，每个人需要在一张纸条上猜一个数字，如果100个犯人中只要有 一个人猜出他头上的帽子上的数字，则100个人全部得到释放，否则全部犯人将被杀死。在发帽子以后，犯人之间不得有任何形式的交流。现在的问题是：这 100个犯人应该商讨一个什么样的策略保证其中一个人必然能猜的他头上的数字。也就是说，发帽子以前犯人是可以讨论，题目即寻找一个最佳策略保证其中一个 人必然能猜的他头上的数字。
游戏前，大家按某种顺序给所有人从1到16依次编号。游戏开始后，每个人把自己能看到的15个数与自己的编号一起异或起来，在猜数时报出这个异或的结果。
假设这16个数异或起来的结果为X（显然1 ≤ X ≤ 16），第i个人身上的数记为A_i，那么他猜的数其实就是X xor A_i xor i。因为根据上面的知识X xor A_i就是出除自己外另外15个人背上数的异或值，那么，编号为X的人（此时i等于X）报出的数恰好就是他背上的那个数。
因为1到16异或起来的值是小于16的，所以总存在一个i与X相等&lt;img src=&quot;http://www1.feedsky.com/t1/319844774/votbar/feedsky/s.gif?r=http://www.votbar.com/archives/41&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844774/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844774/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>算法</category><pubDate>Tue, 27 Oct 2009 12:53:54 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/41#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=41</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/41</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844774/5717928</fs:itemid></item><item><title>项目中代码的问题</title><link>http://www.votbar.com/archives/38</link><wfw:commentRss>http://www.votbar.com/archives/38/feed</wfw:commentRss><slash:comments>1</slash:comments><description>ankur帮我们做codereview后，给我们提出了以下应该注意的几个问题：

Do not add comments saying “add by engineer”. Cvs can keep track of who made changes. If you want to add comments please add what the specific snippet of code does.
Avoid hard coded constants if you think the constant might need to be changed for other devices. It is better to avoid them totally, so [...]&lt;img src=&quot;http://www1.feedsky.com/t1/319844775/votbar/feedsky/s.gif?r=http://www.votbar.com/archives/38&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844775/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844775/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>软件工程</category><pubDate>Fri, 26 Jun 2009 09:18:29 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/38#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=38</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/38</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844775/5717928</fs:itemid></item><item><title>关于firefox插件</title><link>http://www.votbar.com/archives/32</link><wfw:commentRss>http://www.votbar.com/archives/32/feed</wfw:commentRss><slash:comments>0</slash:comments><description>最近研究编写firefox插件，发现firefox的架构相当的值得揣摩。
firefox和thunderbird都是运行在xulrunner上，本身类似个插件。底层由xpcom来实现跨平台，它类似ms的com，非常容易扩展；view层是用xul来描述的，xul类似html，是cross platform user interface language的简写；javascript来粘合xpcom和xul的。
如果在j2me平台上，我们利用j2me实现底层的com组件，用类xml的语言来描述界面，用一种脚本来粘合两者，这样作适配只需要在xml层实施，易可视化操作，逻辑由com组件来实现，而且组件易扩展.
firefox扩展制作的相关资源：
extension developer（含有javascript shell）:https://addons.mozilla.org/en-US/firefox/addon/7434
extension wizard:http://ted.mielczarek.org/code/mozilla/extensionwiz/
xul explorer:https://developer.mozilla.org/en/XUL_Explorer&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844776/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844776/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>mozilla</category><pubDate>Wed, 06 May 2009 22:48:18 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/32#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=32</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/32</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844776/5717928</fs:itemid></item><item><title>两个博弈论的数学游戏</title><link>http://www.votbar.com/archives/29</link><wfw:commentRss>http://www.votbar.com/archives/29/feed</wfw:commentRss><slash:comments>0</slash:comments><description>1.蒙提霍尔问题
假設你正在參加一個遊戲節目，你被要求在三扇門中選擇一扇：其中一扇後面有一輛車；其餘兩扇後面則是山羊。你選擇了一道門，假設是一號門，然後知道門後面 有甚麼的主持人，開啟了另一扇後面有山羊的門，假設是三號門。他然後問你：「你想選擇二號門嗎？」轉換你的選擇對你來說是一種優勢嗎？
解答：把选择的和没选的当作一个整体，概率分别是1/3,2/3，然后当主持人开启一扇门之后，转换后可以使的概率变成2/3
或者，选择山羊1，概率1/3,转换是优势
选择山羊2，概率1/3，转换是优势
选择汽车，概率1/3，转换不是优势
所以选择转换的概率是2/3
参考：http://en.wikipedia.org/wiki/Monty_Hall_problem
2.海盗博弈
有五个理性的海盗，A, B, C, D和E，找到了100个金币，需要想办法分配金币。
海盗们有严格的等级制度：A比B职位高，B比C高，C比D高，D比E高。
海盗世界的分配原则是：等级最高的海盗提出一种分配方案。所有的海盗投票决定是否接受分配，包括提议人。并且在票数相同的情况下，提议人有决定权。如果提议通过，那么海盗们按照提议分配金币。如果没有通过，那么提议人将被扔出船外，然后由下一个最高职位的海盗提出新的分配方案。
海盗们基于三个因素来做决定。首先，要能存活下来。其次，自己得到的利益最大化。最后，在所有其他条件相同的情况下，优先选择把别人扔出船外。
解答：

直觉上认为，A海盗会给自己分配很少，以避免被扔出船外。然而这和理论结果相差甚远。
让我们反过来看：如果只剩下D和E，D给自己100个金币，给E 0个。因为D有决定权，所以分配达成。
如果剩下三个人（C，D和E），C知道D下轮会给E 0个金币，所以C这轮给E 1个金币，让E支持自己以使得提议通过。因此如果剩下三个人，结果是C：99，D：0，E：1。
如果B, C, D 和 E 剩下， B 知道上述结果。所以为了避免被扔出去，他只需要给D 1个金币，因为他有决定权，只需要D的支持就足够了。因此他会提议 B：99， C：0， D：1，E：0。有人可能想到提议B：99， C：0， D：0，E：1，因为E知道即使把B扔出去，也不会得到更多了。但由于海盗会优先把别人扔出去，所以E会选择杀死B，然后仍然可以从C的提议中得到相同金 币。
假设A知道所有的一切，他就能选择让C和E来支持他，提议变成：

A: 98金币
B: 0金币
C: 1金币
D: 0金币
E: 1金币

同样的 A：98，B：0，C：0，D：1，E：1 或者其他的提议都不是最好的，因为D会选择把A扔出去，然后从B那里得到相同的金币。


参考：http://en.wikipedia.org/wiki/Pirate_game&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844777/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844777/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>博弈</category><category>随想</category><category>数学</category><pubDate>Thu, 16 Apr 2009 23:15:08 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/29#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=29</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/29</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844777/5717928</fs:itemid></item><item><title>openssh访问问题</title><link>http://www.votbar.com/archives/27</link><wfw:commentRss>http://www.votbar.com/archives/27/feed</wfw:commentRss><slash:comments>0</slash:comments><description>在自己的机子上装上了openssh，开启/usr/sbin/sshd时，总是：
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
到自己的/etc/ssh下发现没有上面两个文件，后来
/etc/rc.s/sshd start
启动服务成功，并且在/etc/ssh下生成了上面不存在的文件了
但自己的ssh localhost总是失败：
ssh_exchange_identification: Connection closed by remote host
检查了/etc/hosts.allow和/etc/hosts.deny发现在/etc/hosts.deny中有
ALL：ALL:DENY
把这行注释掉，就OK了
enjoy it!&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844778/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844778/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>linux</category><pubDate>Sat, 04 Apr 2009 23:21:26 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/27#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=27</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/27</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844778/5717928</fs:itemid></item><item><title>程序设计风格（二）</title><link>http://www.votbar.com/archives/23</link><wfw:commentRss>http://www.votbar.com/archives/23/feed</wfw:commentRss><slash:comments>0</slash:comments><description>接上程序设计风格（一）

一致性和习惯性
注释

3.一致性和习惯性
一致性高于习惯又来自习惯。
习惯性：各种语言的习惯写法，层次多的时候用花括号，if-else的缩进，switch的break和default
函数宏：副作用，效率低，易出错，所以少用函数宏
魔法数：常量（不是宏）。灵活性写法：用函数，宏&amp;#8230;&amp;#8230;&amp;#8230;
4.注释
注释应当简练概括，与代码相辅相成。一般全局变量，常量，函数，结构/类型需要注释。
当注释过于复杂，说明代码需要修改/重写了。&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844779/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844779/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>风格</category><category>program</category><pubDate>Tue, 03 Mar 2009 22:31:17 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/23#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=23</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/23</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844779/5717928</fs:itemid></item><item><title>程序设计风格（一）</title><link>http://www.votbar.com/archives/21</link><wfw:commentRss>http://www.votbar.com/archives/21/feed</wfw:commentRss><slash:comments>0</slash:comments><description>最近在看&amp;#60;程序设计实践&amp;#62;，很是受用，故记下之。
好的程序设计的风格具有以下几点：

具有功能说明性的名字
直接了当的逻辑和自然的表达式
一致性和习惯性
注释

这篇写前两点。
1.具有功能说明性的名字
名字应该简单，并且说明它的功能性。一般全局变量具有足够长，足够的说明性，而局部变量则可简短些。
命名约定：numPending/num_pending,看个人喜好，个人喜欢前种用于函数名/结构性的名字，后者用于变量名.
名字也可以加上类型和功能方面的文字，全局变量可以以大写字母开头，局部变量以小写开头，常量则全部大写。
如局部变量中：i,j作为循环变量，p,q作为指针，s,t作为字符串变量，pch表示字符指针&amp;#8230;&amp;#8230;..
在有命名空间的语言里，名字更应当注意上下文，简练，但又不失功能性说明。
函数名，最好用动词＋名词，返回布尔型值的函数，is＊,in＊等名字就很不错。
2. 直接了当的逻辑和自然的表达式
缩进。
运算符的优先级，多使用（）。
逻辑简明。如，测试中的否定看是否能改进。
慎用三元运算符。
当心副作用。如++,&amp;#8211;等运算的与副作用有关执行顺序；函数参数求值的顺序。&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/votbar/319844780/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/votbar/319844780/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>风格</category><category>program</category><pubDate>Sat, 28 Feb 2009 23:45:41 +0800</pubDate><author>supern</author><comments>http://www.votbar.com/archives/21#comments</comments><guid isPermaLink="false">http://www.votbar.com/?p=21</guid><dc:creator>supern</dc:creator><fs:srclink>http://www.votbar.com/archives/21</fs:srclink><fs:srcfeed>http://www.votbar.com/feed</fs:srcfeed><fs:itemid>feedsky/votbar/~7608826/319844780/5717928</fs:itemid></item></channel></rss>