weakish的鲜果推荐 http://xianguo.com/service/sharerss/8691 weakish的鲜果推荐 BY PHP 5.2.6 Fri, 03 Jul 2009 10:32:39 +0800 article zh-cn service@topgene.net 593228473 让 ibus pinyin 输入法使用 Ctrl 来切换中英文输入状态 <p>实验室的机器自从升级以后,Xorg 似乎已经可以完全无视 <code>/etc/X11/xorg.conf</code> 的内容配置了,所以我在里面写了交换 Caps Lock 和 Ctrl 也没有任何效果,虽然我可以通过 xmodmap 来做映射,但是这样好像 fcitx 又不认,不能用 ctrl 来切换中英文输入状态了,这个问题我很久很久以前做过 patch ,不过后来 fcitx 的版本似乎有些乱,时而能用时而不能,很诡异。鉴于现在已经完全不像以前那样爱折腾了(在实验室电脑上用了一个完全安装的 Ubuntu 就是一个最好的证明),所以就先忍着。结果这两天 fcitx 干脆连输入状态条都不见了,终于忍无可忍,装了一个 ibus 输入法。</p> <p>第一感觉是 ibus 输入法还不错!至少在现在 Linux 下的各种输入法当中算很不错的了吧!只是有两个问题:</p> <ol> <li>打开模糊音之后巨卡,反应及其迟钝,这个我一时也没有办法,对于输入法的算法并不了解,所以只好关掉模糊音,忍一忍了。</li> <li>中英文切换是使用 Shift ,并且不可配置。当然,很多人都习惯这个快捷键,不过还有另外很大一部分人(包括我)喜欢用 Ctrl 来切换。搜索了一下发现一个 <a href="http://code.google.com/p/ibus/issues/detail?id=187" target="_blank">Issue</a> ,说明确实有不少人需要这个功能,不过作者最近似乎有点忙,一时没法改这个。所以我就决定看看能不能改一下。</li> </ol> <p><span id="more-322"></span>把 ibus pinyin 的代码下载回来,看到代码量似乎还是很少的,简单地浏览了一下并用关键字 <code>shift</code>、<code>switch</code> 等定位了一下,很快就在 <code>engine/pinyin.py</code> 里找到了这一段:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Match mode switch hotkey</span> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.__match_hotkey<span style="color: black;">(</span>key, keysyms.<span style="color: black;">Shift_L</span>, modifier.<span style="color: black;">SHIFT_MASK</span> + modifier.<span style="color: black;">RELEASE_MASK</span><span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">or</span> \ <span style="color: #008000;">self</span>.__match_hotkey<span style="color: black;">(</span>key, keysyms.<span style="color: black;">Shift_R</span>, modifier.<span style="color: black;">SHIFT_MASK</span> + modifier.<span style="color: black;">RELEASE_MASK</span><span style="color: black;">)</span>: <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.__candidates <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.__is_input_english<span style="color: black;">(</span><span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">and</span> PinYinEngine.__shift_select_canidates: index = <span style="color: #008000;">self</span>.__lookup_table.<span style="color: black;">get_current_page_start</span><span style="color: black;">(</span><span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">if</span> key.<span style="color: #dc143c;">code</span> == keysyms.<span style="color: black;">Shift_L</span>: index += <span style="color: #ff4500;">1</span> <span style="color: #ff7700;font-weight:bold;">else</span>: index += <span style="color: #ff4500;">2</span> result = <span style="color: #008000;">self</span>.__commit_candidate<span style="color: black;">(</span>index<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">if</span> result: <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.__committed_special_phrase: <span style="color: #008000;">self</span>.<span style="color: black;">commit_string</span><span style="color: black;">(</span><span style="color: #008000;">self</span>.__committed_special_phrase<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">else</span>: commit_phrases = <span style="color: #008000;">self</span>.__committed_phrases.<span style="color: black;">get_phrases</span><span style="color: black;">(</span><span style="color: black;">)</span> commit_string = <span style="color: #008000;">self</span>.__committed_phrases.<span style="color: black;">get_string</span><span style="color: black;">(</span><span style="color: black;">)</span> <span style="color: #008000;">self</span>.<span style="color: black;">commit_string</span><span style="color: black;">(</span>commit_string + <span style="color: #008000;">self</span>.__user_input.<span style="color: black;">get_invalid_string</span><span style="color: black;">(</span><span style="color: black;">)</span><span style="color: black;">)</span>   <span style="color: #808080; font-style: italic;"># adjust phrase freq and create new phrase</span> <span style="color: #ff7700;font-weight:bold;">try</span>: <span style="color: #008000;">self</span>.__pydb.<span style="color: black;">commit_phrases</span><span style="color: black;">(</span>commit_phrases<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">(</span>commit_phrases<span style="color: black;">)</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">1</span>: <span style="color: #008000;">self</span>.__pydb.<span style="color: black;">new_phrase</span><span style="color: black;">(</span>commit_phrases<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">except</span>: <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">"Can not inster phrases in db"</span> <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span> <span style="color: #ff7700;font-weight:bold;">else</span>: <span style="color: #008000;">self</span>.<span style="color: black;">property_activate</span><span style="color: black;">(</span><span style="color: #483d8b;">"status"</span><span style="color: black;">)</span> <span style="color: #008000;">self</span>.<span style="color: black;">reset</span><span style="color: black;">(</span><span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span></pre></div></div> <p>虽然 <code>property_activate("status")</code> 和 <code>reset()</code> 似乎跟切换中英文看起来不太相关,但是就这段代码最可疑了。本来还想修改一下定制面板,加一个选项,可以选是用 shift 还是用 control 来切换,但是我发现我对于 ibus 输入法的开发环境配置根本一无所知,特别是修改代码之后怎样在本地跑起一个输入法来?我总不至于改一下代码要测试的时候又把它拷贝到系统目录下去,然后 log out &amp;&amp; log in 看看修改效果如何吧?所以想了一下,还是直接最简单地 hack 一下,可以用就行了。于是先找到系统中对应的文件的位置:</p> <pre> $ dpkg -L ibus-pinyin | grep pinyin.py /usr/share/ibus-pinyin/engine/pinyin.py </pre> <p>然后直接打开,找到之前提到的那一段,在后面加上:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Make Left Control switch Chinese/English mode</span> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.__match_hotkey<span style="color: black;">(</span>key, keysyms.<span style="color: black;">Control_L</span>, modifier.<span style="color: black;">CONTROL_MASK</span> + modifier.<span style="color: black;">RELEASE_MASK</span><span style="color: black;">)</span>: <span style="color: #008000;">self</span>.<span style="color: black;">property_activate</span><span style="color: black;">(</span><span style="color: #483d8b;">"status"</span><span style="color: black;">)</span> <span style="color: #008000;">self</span>.<span style="color: black;">reset</span><span style="color: black;">(</span><span style="color: black;">)</span></pre></div></div> <p>添加了左边 Ctrl 切换的支持,然后注销、重新登录,果然就 OK 了!有这个需求的朋友可以做类似的修改,包括用右 ctrl 、屏蔽 shift 的中英文切换等。这个 hack 虽然有点 dirty ,但是反正他原来也是硬编码的 shift 切换呢。 <img src="http://blog.pluskid.org/wp-content/plugins/smilies-themer/adiumicons/tongue.png" alt=":p" class="wp-smiley" /> 不过还是期待作者加入正式的支持,并在 GUI 上加一个选项可供选择。</p> http://blog.pluskid.org/?p=322 http://blog.pluskid.org/?p=322 Fri, 22 May 2009 07:17:23 +0000 pluskid 593218358 Symbian 踩上 netbook?有可能喔! <p>Filed under: <a href="http://cn.engadget.com/category/laptops/" rel="tag" target="_blank">膝上电脑</a></p><a href="http://www.techradar.com/news/phone-and-communications/mobile-phones/symbian-powered-netbooks-move-closer-600269" target="_blank"><img hspace="4" border="0" vspace="4" src="http://www.blogcdn.com/www.engadgetmobile.com/media/2009/04/symbian-atom.jpg" alt="" /></a><br /><br /><a href="http://www.engadget.com/2009/04/16/symbian-ports-its-platform-to-atom-just-for-the-heck-of-it/" target="_blank">Symbian OS 在采用 Atom 处理器的计算机上面执行</a>,早先咱们就已经见识过了,只不过『可以执行』不并代表就一定会有人拿来用;但最近 <a href="http://search.cn.aol.com/aol/search?invocationType=advancedSearch&amp;as_sitesearch=cn.engadget.com&amp;query=Symbian%2BFoundation&amp;sa=AOL%2B%E6%90%9C%E7%B4%A2" target="_blank">Symbian Foundation</a> 的头头 Tim Holbrow 则是开了金口,表示将来说不定会有采用 Symbian OS 的类笔电产品出现。<br /><br />根据 TechRadar 报导,当 Holbrow 被问及是否可能在 netbook 上面看到 Symbian OS,他本人表示:『我想这有可能。』,不过他认为真正的关键是在于『netbook 还会是 netbook 吗?』<br /><br />之所以会有这样的回答,因为他对于<a href="http://cn.engadget.com/search/?q=netbook%20" target="_blank">netbook </a>的未来,有一个新的想法;他觉得将来 netbook 可能演化成一台让使用者方便携带,同时用来从不同来源读取数据的『单一处理器』,人们只要让 netbook 连接上一个无线键盘,然后将画面透过电视来显示,同时操作系统的使用者接口会也随之调整(随外接上的环境),这也就是 Holbrow 口中的『超整合』(Superconvergence),而 Symbian 就很适合作为这样系统的作业核心。<br /><br />而未来这样形式的移动装置,也很有可能取代笔电、以及现在所谓 netbook 的地位,变成未来行动装置的主流。<br /><br />[<a href="http://www.engadget.com/2009/05/20/symbian-foundation-boss-talks-up-symbian-for-netbooks-and-more/" target="_blank">原文连接</a>]<h6 style="clear: both; padding: 8px 0 0 0; height: 2px; font-size: 1px; border: 0; margin: 0; padding: 0;"></h6><a href="http://www.techradar.com/news/phone-and-communications/mobile-phones/symbian-powered-netbooks-move-closer-600269" target="_blank">Read</a> | <a href="http://cn.engadget.com/2009/05/22/symbian-foundation-boss-talks-up-symbian-for-netbooks-and-more/" rel="bookmark" title="Permanent link to this entry" target="_blank">Permalink</a> | <a href="http://cn.engadget.com/forward/1553511/" title="Send this entry to a friend via email" target="_blank">Email this</a> | <a href="http://cn.engadget.com/2009/05/22/symbian-foundation-boss-talks-up-symbian-for-netbooks-and-more/#comments" title="View reader comments on this entry" target="_blank">Comments</a> http://cn.engadget.com/2009/05/22/symbian-foundation-boss-talks-up-symbian-for-netbooks-and-more/ http://cn.engadget.com/2009/05/22/symbian-foundation-boss-talks-up-symbian-for-netbooks-and-more/ Fri, 22 May 2009 03:50:00 EST Casper Kao 593296468 “江苏高等学校图书馆通用借书证”领证通知   凡在图书馆登记办理09年第1期“江苏高等学校图书馆通用借书证”的读者,请携带本人有效证件到您所登记的领证地点领取借书证。      具体地点及联系人:随园校区西山图书馆一楼办证处    夏帆(15150587102)            仙林校区敬文图书馆五楼东现刊阅览室 夏碧(15150587079)   领证时间:周一至周五8:00-12:00,13:30-17:00                        图书馆                        2009年5月22日 http://202.119.108.115/news.asp?id=524 http://202.119.108.115/news.asp?id=524 Fri, 22 May 2009 00:00:00 +0800 593338460 如此科技胸罩,敦促美女赶紧寻找真爱 <p>Filed under: <a href="http://cn.engadget.com/category/peripherals/" rel="tag" target="_blank">外围设备</a>, <a href="http://cn.engadget.com/category/wearables/" rel="tag" target="_blank">佩戴产品</a></p><img hspace="4" border="1" vspace="4" src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-l9-hun.jpg" alt="" /><br /><br />胸罩的科技也是无奇不有,这个日本新推出的黛安芬胸罩可谓之婚姻胸罩,中间有一个倒计时的LED显示灯,如果你想让它停止,只能在心型位置放入一枚结婚戒指,这时候会有费利克斯·门德尔松的《婚礼进行曲》放送给你听,当然,侧边还配有一把笔和一个印章小袋子,敦促你用来签婚约哦,只是不知道会有多少人会戴着这种胸罩,但在日本可能有必要,日本34岁以下日本女子近57%的尚未结婚,这对于那些OL来说是个心灵礼物。<br /><br /><div class="postgallery"><p><strong>Gallery: <a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/" target="_blank">marriage hunting cool bra</a></strong></p><a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/2029537/" target="_blank"><img src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-p4_thumbnail.jpg" alt="" title="" /></a><a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/2029536/" target="_blank"><img src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-l14_thumbnail.jpg" alt="" title="" /></a><a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/2029535/" target="_blank"><img src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-l13_thumbnail.jpg" alt="" title="" /></a><a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/2029534/" target="_blank"><img src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-l9_thumbnail.jpg" alt="" title="" /></a><a href="http://cn.engadget.com/photos/marriage-hunting-cool-bra/2029533/" target="_blank"><img src="http://www.blogcdn.com/cn.engadget.com/media/2009/05/trd0905131151008-p11_thumbnail.jpg" alt="" title="" /></a></div><h6 style="clear: both; padding: 8px 0 0 0; height: 2px; font-size: 1px; border: 0; margin: 0; padding: 0;"></h6><a href="http://sankei.jp.msn.com/life/trend/090513/trd0905131151008-n1.htm" target="_blank">Read</a> | <a href="http://cn.engadget.com/2009/05/22/marriage-hunting-cool-bra/" rel="bookmark" title="Permanent link to this entry" target="_blank">Permalink</a> | <a href="http://cn.engadget.com/forward/1552833/" title="Send this entry to a friend via email" target="_blank">Email this</a> | <a href="http://cn.engadget.com/2009/05/22/marriage-hunting-cool-bra/#comments" title="View reader comments on this entry" target="_blank">Comments</a> http://cn.engadget.com/2009/05/22/marriage-hunting-cool-bra/ http://cn.engadget.com/2009/05/22/marriage-hunting-cool-bra/ Fri, 22 May 2009 06:49:00 EST Bin Chen 593414205 Google 产品中文论坛改版了 <span class="byline-author">发表人:南熙</span><br /><br />自 Google 产品中文论坛成立以来,尽管论坛在界面,功能上存在很多有待完善的地方,仍然积聚了不少的人气 —— 就在几个星期之前,我们的注册用户人数刚刚突破一万人!这和大家的理解和支持是分不开的,我们深表感谢。为了更加方便大家的使用,我们现已决定将此论坛转移到一个新的平台上。在这个新的平台上,我们加入了很多新的功能,其中有一些是大家长期期待的,例如用户激励体系(积分和升级系统),插入图片或视频功能等等。我们希望通过这个新平台的启用,能为大家的交流互动创造更多的便利。<br /><br />需要提醒大家的是,由于功能的限制,原有论坛上的成员将不会被自动转移到新论坛中,因此您需要在新论坛上重新注册。请放心,这一程序将极其简单。您现在就可以进入<a target="_blank" href="http://www.google.com/support/forum?hl=zh-CN">论坛</a>进行注册。另外,在新论坛正式启用之后,我们原有的论坛将改为只读形式,大家仍然可以查询以往的帖子,但不能发新贴及回复。<br /><br />再次感谢大家的支持和鼓励。我们在新版 <a target="_blank" href="http://www.google.com/support/forum?hl=zh-CN">Google 产品中文论坛</a> 不见不散! <div class="blogger-post-footer"><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/20904277-4032815236617848925?l=googlechinablog.com" /></div> http://googlechinablog.com/2009/05/google.html tag:blogger.com,1999:blog-20904277.post-4032815236617848925 2009-05-22T20:27:00.003+08:00 joydandan 593417467 2009台北新一代设计展:电子书 (8 回應) <p>分类: <a href="http://cn.engadget.com/category/displays/" rel="tag" target="_blank">显示产品</a></p><div>[撰文:<a target="_blank" href="http://www.pdart.tw/">意大利蔬菜汤</a>]</div> <div><br /></div> <div><br /></div> <img hspace="4" border="1" vspace="4" alt="" src="http://www.blogcdn.com/chinese.engadget.com/media/2009/05/ebook_newdesign01.jpg" /> <div><br /></div> <div>电子书的产品设计在近几年的新一代设计展几乎是必到的一项类别,<wbr></wbr>产品发展也是因为目前实际技术能力而突破缓慢,<wbr></wbr>但这怎么难的倒学生天马行空的想象力呢。</div> <div><br /></div> <div>上图是明志科大学生的概念作品,不只是电子书,<wbr></wbr>还包含了操作系统。</div><p><br /></p><p class="continueReading"><a href="http://cn.engadget.com/2009/05/21/2009--young-designner-exhibition-ebook/" rel="bookmark" target="_blank">继续阅读全文 <em>2009台北新一代设计展:电子书</em></a></p><h6 style="clear: both; padding: 8px 0 0 0; height: 2px; font-size: 1px; border: 0; margin: 0; padding: 0;"></h6><a href="http://cn.engadget.com/2009/05/21/2009--young-designner-exhibition-ebook/" rel="bookmark" title="Permanent link to this entry" target="_blank">此文章网址</a> | <a href="http://cn.engadget.com/forward/1552667/" title="Send this entry to a friend via email" target="_blank">转寄此文章</a> | <a href="http://cn.engadget.com/2009/05/21/2009--young-designner-exhibition-ebook/#comments" title="View reader comments on this entry" target="_blank">回应</a><hr size="1"></hr> http://cn.engadget.com/2009/05/21/2009--young-designner-exhibition-ebook/ http://cn.engadget.com/2009/05/21/2009--young-designner-exhibition-ebook/ Thu, 21 May 2009 09:01:00 EST J Chiang 593454004 crontab 啊 <p>这么多年了,才发现没看过man 5 crontab<br /> 可以设置路径的哦。<br /> 可以设置用户的哦。<br /> <code>☎ cl<br /> # m h dom mon dow command<br /> SHELL=/bin/bash<br /> PATH=/home/exp/应用/脚本/:/usr/local/bin:/bin:/usr/bin<br /> */30 * * * * msg 抽烟了,其他时间禁止吸烟。<br /> 50 17 * * 1-5 msg 下班了。<br /> 0 21 * * * msg 记账。<br /> </code></p> http://eexpress.blog.ubuntu.org.cn/2009/05/22/crontab-%e5%95%8a/ http://eexpress.blog.ubuntu.org.cn/2009/05/22/crontab-%e5%95%8a/ Fri, 22 May 2009 12:39:59 +0000 eexpress 593463085 由gmbox发现了一个python文档的bug <p>今天lerosua还是说<a href="http://code.google.com/p/gmbox" target="_blank">gmbox</a>在他电脑上运行不了,我终于觉得不对劲了,因为在我机器上,已经是没有问题的了.<br /> 稍微分析了一下,发现错误是这样的:</p> <div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> File "/home/leros/work/gmbox/src/lib/parser.py", line 49, in handle_starttag if v[n.index('title')]==u'下载': AttributeError: 'tuple' object has no attribute 'index'</pre></div></div> <p>这附近的代码是这样的:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"> <span style="color: black;">(</span>n,v<span style="color: black;">)</span>=<span style="color: #008000;">zip</span><span style="color: black;">(</span><span style="color: #66cc66;">*</span>attrs<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">if</span> v<span style="color: black;">[</span>n.<span style="color: black;">index</span><span style="color: black;">(</span><span style="color: #483d8b;">'title'</span><span style="color: black;">)</span><span style="color: black;">]</span>==u<span style="color: #483d8b;">'下载'</span>:</pre></div></div> <p>所以,首先想到的自然是zip这个自建函数,它返回的n和v到底是什么呢?tuple还是list?<br /> 于是去查了下<a href="http://docs.python.org/library/functions.html?highlight=zip#zip" target="_blank">官方文档</a>,就发现不对劲了,文档中的例子:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> x = <span style="color: black;">[</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">3</span><span style="color: black;">]</span> <span style="color: #66cc66;">&gt;&gt;&gt;</span> y = <span style="color: black;">[</span><span style="color: #ff4500;">4</span>, <span style="color: #ff4500;">5</span>, <span style="color: #ff4500;">6</span><span style="color: black;">]</span> <span style="color: #66cc66;">&gt;&gt;&gt;</span> zipped = <span style="color: #008000;">zip</span><span style="color: black;">(</span>x, y<span style="color: black;">)</span> <span style="color: #66cc66;">&gt;&gt;&gt;</span> zipped <span style="color: black;">[</span><span style="color: black;">(</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">4</span><span style="color: black;">)</span>, <span style="color: black;">(</span><span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">5</span><span style="color: black;">)</span>, <span style="color: black;">(</span><span style="color: #ff4500;">3</span>, <span style="color: #ff4500;">6</span><span style="color: black;">)</span><span style="color: black;">]</span> <span style="color: #66cc66;">&gt;&gt;&gt;</span> x2, y2 = <span style="color: #008000;">zip</span><span style="color: black;">(</span><span style="color: #66cc66;">*</span>zipped<span style="color: black;">)</span> <span style="color: #66cc66;">&gt;&gt;&gt;</span> x == x2, y == y2 <span style="color: #008000;">True</span></pre></div></div> <p>按这样的描述,返回的x2和x应该都是list,但是实践了一下,发现返回的却是tuple…这不乱了吗?于是又跑了一下这个例子,最后一行却不是True,而是(False, False)…就这样发现了文档的一个小错误.<br /> 可怜我之前一直非常崇拜python的文档,认为它简直就是文档的典范,详细,可读性也好.现在,突然发现一点瑕疵,不免有些失望呢,TX说也有相同的感觉,哈哈.不过,想想自己能给最喜欢的文档提个bug倒也蛮有成就感的.<br /> python开发也很是活跃,<a href="http://bugs.python.org/issue6084" target="_blank">这个bug</a>提交上去以后,仅仅用了15分钟,Georg Brandl就已经把它给干掉了~哈哈,新的文档,最后那里改成了:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> x == <span style="color: #008000;">list</span><span style="color: black;">(</span>x2<span style="color: black;">)</span> <span style="color: #ff7700;font-weight:bold;">and</span> y == <span style="color: #008000;">list</span><span style="color: black;">(</span>y2<span style="color: black;">)</span> <span style="color: #008000;">True</span></pre></div></div> <p>于是我也学者这个样子,给我的gmbox加了一行:</p> <div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"> n,v=<span style="color: #008000;">list</span><span style="color: black;">(</span>n<span style="color: black;">)</span>,<span style="color: #008000;">list</span><span style="color: black;">(</span>v<span style="color: black;">)</span></pre></div></div> <p>问题就解决了.<br /> 最后,还有一个疑问,为什么之前那样,在python2.5下不行,但是在python2.6下却又不报错呢?<br /> 呵呵,答案就是:python2.6给tuple也加了个类似list的index方法…于是歪打正着,在py2.6下,就正确了.</p> http://li2z.cn/2009/05/22/python_doc_bug/ http://li2z.cn/?p=746 Fri, 22 May 2009 12:05:42 +0000 bones7456 593731944 Comment on 2HOST - $5 Xen VPS with 512MB by Rob Weir <p>Order confirmation arrived with the invoice, setup was about 25 minutes after payment receipt. While they offer no choice of distribution at set up time (and you get CentOS), you can install Debian from the HyperVM control panel thing (and it appears to be working fine).</p> http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/comment-page-1/#comment-1096 http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/#comment-1096 Fri, 22 May 2009 08:24:57 +0000 Rob Weir 593731991 Comment on 2HOST - $5 Xen VPS with 512MB by xisxon <p>login details sent about 15 minutes.<br /> and 3 hours later, suddenly…</p> <p>The Resource List could not gathered….no_socket_connect_to_server</p> <p>and on hypervm</p> <p>Alert: Could not Connect to the server localhost. Please login and restart hypervm service on this server. On Linux, login via ssh and run this: /script/restart </p> <p>how about that, eh?</p> http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/comment-page-1/#comment-1097 http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/#comment-1097 Fri, 22 May 2009 14:13:24 +0000 xisxon 593817580 2HOST – $5 Xen VPS with 512MB <p><img src="http://www.lowendbox.com/media/images/2host.jpg" width="300" height="188" alt="2host" class="screenshot" /> Via <a href="http://www.webhostingtalk.com/showthread.php?t=863204" target="_blank">this WHT offer</a>. <a href="http://www.2host.com/" target="_blank">2HOST</a>, a hosting company that <a href="http://www.2host.com/about.html" target="_blank">claimed to have 7 years of experience</a> (and with a domain that has been registered since 2001), is offering a “try us out” 512MB Xen VPS for <b>$5/month</b> — this week only (via <a href="http://www.2host.com/wht.php" target="_blank">this order link</a>). You get:</p> <ul> <li>512MB memory/1024MB swap</li> <li>10GB storage</li> <li>300GB/month data transfer</li> <li>HyperVM</li> </ul> <p>Again from their about page, they have their own DC and their servers are in St. Louis MO. My immediate response is the same as the comments in the dicussion thread — “why come it’s so cheap?” According to their response it’s “because they can” and they would want to scale to 200 servers. According <a href="http://web.archive.org/web/%2A/2host.com/" target="_blank">Wayback Machine</a> the domain used to be owned by a CA company with servers in Chicago so I guess the ownership might have been changed, which has been <a href="http://www.webhostingtalk.com/showthread.php?t=682194" target="_blank">confirmed by this WHT thread</a>.</p> <p>Well. It’s just $5/month…</p> http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/ http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/ Fri, 22 May 2009 00:37:32 +0000 LowEndAdmin 593817646 RockMyWeb – $6.50 OpenVZ VPS <p><img src="http://www.lowendbox.com/media/images/rockmyweb.jpg" width="300" height="185" alt="RockMyWeb.net" class="screenshot" /> Via <a href="http://www.webhostingtalk.com/showthread.php?t=862973" target="_blank">this WHT offer</a>. When I first saw <a href="http://www.rockmyweb.net/" target="_blank">RockMyWeb</a>’s offer, I was thinking “hey it’s weird”. You need to <em>pay</em> yearly fee for a membership so (1) you can see the pricing (2) can order VPS. However with the WHT offer, you can get free recurring membership (code <b>FREEMEMBER</b>) and it tells you the pricing in the post. For $6.50/month you can get:</p> <ul> <li>256MB guaranteed/512MB burstable memory</li> <li>10GB storage</li> <li>100GB/month data transfer (in Scranton PA), or 200GB/month (in Portland OR)</li> <li>OpenVZ/LxAdmin</li> </ul> <p>Yes you can choose between Scranton PA or Portland OR, depending on whether West or East is your preference. They have been around for a while so it’s a relatively safe bet.</p> http://www.lowendbox.com/blog/rockmyweb-650-openvz-vps/ http://www.lowendbox.com/blog/rockmyweb-650-openvz-vps/ Fri, 22 May 2009 01:10:18 +0000 LowEndAdmin 593819038 version 3.13 <p>News for ikiwiki 3.13:</p><p>The <code>ikiwiki-transition deduplinks</code> command introduced in the last release was buggy. If you followed the NEWS file instructions and ran it, you should run <code>ikiwiki -setup</code> to rebuild your wiki to fix the problem.</p><p>ikiwiki 3.13 released with <a class="toggle" href="http://ikiwiki.info/news/#news-version-3.13.default" target="_blank">these changes</a></p><div class="toggleable" id="news-version-3.13.default"></div><ul><li>ikiwiki-transition: If passed a nonexistant srcdir, or one not containing .ikiwiki, abort with an error rather than creating it.</li><li>Allow underlaydir to be overridden without messing up inclusion of other underlays via add_underlay.</li><li>More friendly display of markdown, textile in edit form selector (jmtd)</li><li>Allow curly braces to be used in pagespecs, and avoid a whole class of potential security problems, by avoiding performing any string interpolation on user-supplied data when translating pagespecs.</li><li>ikiwiki-transition: Allow setup files to be passed to all subcommands that need a srcdir.</li><li>ikiwiki-transition: deduplinks was broken and threw away all metadata stored by plugins in the index. Fix this bug.</li><li>listdirectives: Avoid listing _comment directives and generally assume any directive starting with _ is likewise internal.</li></ul><div class="toggleableend"></div> http://ikiwiki.info/news/version_3.13/ http://ikiwiki.info/news/version_3.13/ Fri, 22 May 2009 14:31:47 -0400 594458983 highlight <p><span class="infobox"> Plugin: highlight<br /> Author: <a href="http://ikiwiki.info/users/joey/" target="_blank">Joey</a><br /> Included in ikiwiki: yes<br /> Enabled by default: no<br /> Included in <a href="http://ikiwiki.info/plugins/goodstuff/" target="_blank">goodstuff</a>: no<br /> Currently enabled: no<br /></span></p><p>This plugin allows ikiwiki to syntax highlight source code, using a fast syntax highlighter that supports over a hundred programming languages and file formats.</p><h2>prerequisites</h2><p>You will need to install the perl bindings to the <a href="http://www.andre-simon.de/" target="_blank">highlight library</a>, which in Debian are in the <a href="http://packages.debian.org/libhighlight%2Dperl" target="_blank">libhighlight-perl</a> package.</p><h2>embedding highlighted code</h2><p>To embed highlighted code on a page, you can use the <a href="http://ikiwiki.info/plugins/format/" target="_blank">format</a> plugin.</p><p>For example:</p><pre><code>[[!format c """ void main () { printf("hello, world!"); } """]] [[!format diff """ -bar +foo """]] </code></pre><p>You can do this for any extension or language name supported by the <a href="http://www.andre-simon.de/" target="_blank">highlight library</a> -- basically anything you can think of should work.</p><h2>highlighting entire source files</h2><p>To enable syntax highlighting of entire standalone source files, use the <code>tohighlight</code> setting in your setup file to control which files should be syntax highlighted. Here is a typical setting for it, enabling highlighting for files with the extensions .c, etc, and also for any files named "Makefile".</p><pre><code>tohighlight =&gt; ".c .h .cpp .pl .py Makefile:make", </code></pre><p>It knows what language to use for most filename extensions (see <code>/etc/highlight/filetypes.conf</code> for a partial list), but if you want to bind an unusual filename extension, or any file without an extension (such as a Makefile), to a language, you can do so by appending a colon and the name of the language, as illustrated for Makefiles above.</p><p>With the plugin configured this way, source files become full-fledged wiki pages, which means they can include <a href="http://ikiwiki.info/ikiwiki/wikilink/" target="_blank">WikiLinks</a> and <a href="http://ikiwiki.info/ikiwiki/directive/" target="_blank">directives</a> like any other page can, and are also affected by the <a href="http://ikiwiki.info/plugins/smiley/" target="_blank">smiley</a> plugin, if it is enabled. This can be annoying if your code accidentially contains things that look like those.</p><p>On the other hand, this also allows your syntax highlighed source code to contain markdown formatted comments and hyperlinks to other code files, like this:</p><pre><code>/* \[[!format mdwn """ This comment will be formatted as *markdown*! See [[bar.h]]. ""]] */ </code></pre><p>Finally, bear in mind that this lets anyone who can edit a page in your wiki also edit source code files that are in your wiki. Use appropriate caution.</p><h2>colors</h2><p>The colors etc used for the syntax highlighting are entirely configurable by CSS. See ikiwiki's <a href="http://ikiwiki.info/style.css" target="_blank">style.css</a> for the defaults.</p> http://ikiwiki.info/plugins/highlight/ http://ikiwiki.info/plugins/highlight/ Fri, 22 May 2009 22:58:10 -0400 594519780 Comment on SliceBox - $3.99 128MB OpenVZ VPS by Chuck Findlay <p>chuck@rum:~$ uptime<br /> 20:19:53 up 47 days, 19:39, 1 user, load average: 0.00, 0.00, 0.00</p> <p>Haven’t had a problem with them yet. Uptime would be near 60 days if I hadn’t rebooted the VPS for software installation reasons.</p> http://www.lowendbox.com/blog/slicebox-399-128mb-openvz-vps/comment-page-1/#comment-1099 http://www.lowendbox.com/blog/slicebox-399-128mb-openvz-vps/#comment-1099 Fri, 22 May 2009 20:22:06 +0000 Chuck Findlay 594603285 电击枪护身 (14 回應) <p>分类: <a href="http://cn.engadget.com/category/misc-gadgets/" rel="tag" target="_blank">精彩杂录</a></p><div align="center"><img hspace="4" border="1" vspace="4" alt="" src="http://www.blogcdn.com/chinese.engadget.com/media/2009/05/taser800_1.jpg" /><br /> <div style="text-align: left;"><br />在晚上独自回家时,特别女士们,是不是很想有支电击枪旁身呢?这支Taser 800就最适合不过了!<br /><br />因为它配备的1800KV电压,绝对可以暂时停止他人的攻击。加上24 x 55 x 105 mm的细小体积,轻巧之余又方便携带,它的价钱为$29.58美金,约RMB202元。</div> </div><p><br /></p><p class="continueReading"><a href="http://cn.engadget.com/2009/05/23/tesater-800-illegal/" rel="bookmark" target="_blank">继续阅读全文 <em>电击枪护身</em></a></p><h6 style="clear: both; padding: 8px 0 0 0; height: 2px; font-size: 1px; border: 0; margin: 0; padding: 0;"></h6><a href="http://www.2dayblog.com/2009/05/21/taser-800/" target="_blank">引用来源</a> | <a href="http://cn.engadget.com/2009/05/23/tesater-800-illegal/" rel="bookmark" title="Permanent link to this entry" target="_blank">此文章网址</a> | <a href="http://cn.engadget.com/forward/1553773/" title="Send this entry to a friend via email" target="_blank">转寄此文章</a> | <a href="http://cn.engadget.com/2009/05/23/tesater-800-illegal/#comments" title="View reader comments on this entry" target="_blank">回应</a><hr size="1"></hr> http://cn.engadget.com/2009/05/23/tesater-800-illegal/ http://cn.engadget.com/2009/05/23/tesater-800-illegal/ Sat, 23 May 2009 03:00:00 EST FunMakr Media 595053476 Comment on 2HOST - $5 Xen VPS with 512MB by Lincoln <p>I signed up and mine was activated quickly. I bumped to 1.5 GB RAM during ordering and it was deployed with that plus 3 GB swap.</p> http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/comment-page-1/#comment-1102 http://www.lowendbox.com/blog/2host-5-xen-vps-with-512mb/#comment-1102 Sat, 23 May 2009 13:10:14 +0000 Lincoln 595635267 Nokia N97 3D?? (0 回應) <p>分类: <a href="http://cn.engadget.com/category/mobilephones/" rel="tag" target="_blank">移动电话</a></p><div style="text-align: center;"><img hspace="4" border="1" vspace="4" src="http://www.blogcdn.com/chinese.engadget.com/media/2009/05/nokia_n97_090522.jpg" alt="" /><br /><br /> <div style="text-align: left;">??<a href="http://cn.engadget.com/tag/N97/" target="_blank">Nokia N97?????</a>????????????????????????????3D?????????????????????N97??????????????<br /><br />????????????</div> </div><p><br /></p><p class="continueReading"><a href="http://cn.engadget.com/2009/05/23/nokia-n97--vr-campaign-site/" rel="bookmark" target="_blank">继续阅读全文 <em>Nokia N97 3D??</em></a></p><h6 style="clear: both; padding: 8px 0 0 0; height: 2px; font-size: 1px; border: 0; margin: 0; padding: 0;"></h6><a href="http://www.t3.com/reviews/phones/smartphones/360-video-nokia-n97" target="_blank">引用来源</a> | <a href="http://cn.engadget.com/2009/05/23/nokia-n97--vr-campaign-site/" rel="bookmark" title="Permanent link to this entry" target="_blank">此文章网址</a> | <a href="http://cn.engadget.com/forward/1553784/" title="Send this entry to a friend via email" target="_blank">转寄此文章</a> | <a href="http://cn.engadget.com/2009/05/23/nokia-n97--vr-campaign-site/#comments" title="View reader comments on this entry" target="_blank">回应</a><hr size="1"></hr> http://cn.engadget.com/2009/05/23/nokia-n97--vr-campaign-site/ http://cn.engadget.com/2009/05/23/nokia-n97--vr-campaign-site/ Sat, 23 May 2009 22:00:00 EST Annti Yang 595755048 真高兴阿 <p>前天去了山里玩。一群人都带着小水彩盒子,走到哪画到哪。我画手稿很差的,但是也像个小孩一样兴奋的画来画去。好多年不画手稿,画材也发生了很大的进步!越来越好用。并不需要在家大费周折的表纸什么的。一个小水彩盒子一个小喷壶就可以走到哪画到哪。</p> <p>找到了好多年前在网上一张张画涂鸦的快乐。大家好像一群写生的学生一样。每画一笔都很快乐。</p> <p>晚上回来去看了《化》现场的演出。他们的演出好快乐!键盘手张张是那么的表情丰富。还有一个吉他手。到他solo的时候他就笑着很享受自己弹出的每个音符。我被他们那种享受音乐的态度打动了。忽然觉得其实我们和他们是一样的。画画和音乐对于我们来说,就是好玩的事情,我们画和弹的时候,就已经收获了快乐。</p> <p>好高兴,怎么办才好。画画真好玩。</p> <p>对于我来说,也许自由就是随心所欲的画画吧,被大家欣赏也就更好了。现在觉得,有时候不被很多人欣赏,只被那些我爱的人们看到也很满足阿!</p> <p>另外发现某位同学是非常有绘画天赋的!她从来没有学过画画!下面是她画的我!!</p> <p><img src="http://jidi622.blogbus.com/files/12431354070.jpg" border="0" alt="" /></p> <p>“原来我非不快乐,只我一人未发觉。” 岂止不快乐,简直开心死了。</p> <p><a href="http://jidi622.blogbus.com/files/s/12431368750.jpg" target="_blank"><img src="http://jidi622.blogbus.com/files/12431368750.jpg" border="0" alt="" /></a></p> <p> </p> <p>011妹妹画的大家!大家可以根据上下图找到哪个是我!!!</p> <p>高兴得滚来滚去。</p> <p>-----------------------------</p> <p>放一首完全不搭调但又触动我一下的歌词。</p> <p><span style="color: #008080;">美丽在心头</span></p> <p><span style="color: #008080;">(又是林夕!)</span></p> <p><span style="line-height: 20px;"><span style="color: #008080;">微笑有什么理由<br />好开心我不用想太久<br />回忆中的镜头期待中的温柔<br />还有然后还有<br />快乐有很多理由<br />最快乐是懂得遗漏<br />什么都想追求什么都可放手<br />然后还有然后<br />谁都想贪新不忘旧<br />谁不是一路上一边看一边走<br />不错过任何挑逗<br />也不为任何人等候<br />谁都是一去不回头<br />丑陋留给尘埃</span><span style="color: #c60a00;"><span style="color: #008080;">美丽在心头</span></span><span style="color: #008080;"><br />花花世界有我的海市蜃楼</span></span></p><div class="relpost"><br /><h3>随机文章:</h3><div><a href="http://jidi622.blogbus.com/logs/36227885.html" target="_blank">转〈陈绮贞语录〉 看到很多有共鸣的话</a> 2009年03月07日</div><div><a href="http://jidi622.blogbus.com/logs/36097393.html" target="_blank">慢两拍</a> 2009年03月05日</div><div><a href="http://jidi622.blogbus.com/logs/32515780.html" target="_blank">祝大家高考顺利!</a> 2008年06月04日</div><div><a href="http://jidi622.blogbus.com/logs/32515825.html" target="_blank">转过来的文章<给我妹妹和那些早熟敏感的孩子></a> 2007年12月18日</div><div><a href="http://jidi622.blogbus.com/logs/32515985.html" target="_blank">Wonderwall</a> 2006年05月23日</div></div><div class="addfav"><br />收藏到:<span><a href="http://delicious.com/save?url=http%3A%2F%2Fjidi622.blogbus.com%2Flogs%2F39868202.html&amp;title=%E7%9C%9F%E9%AB%98%E5%85%B4%E9%98%BF" target="_blank">Del.icio.us</a></span></div> http://jidi622.blogbus.com/logs/39868202.html http://jidi622.blogbus.com/logs/39868202.html Sun, 24 May 2009 11:13:24 +0800 寂地 508375368 CGI/ssh Upgrade <p>This is just a short note to reflect a couple of upgrades.</p> <p>First, we have upgraded the ssh environment to more powerful hardware in order to allow for continued growth and to make sure scheduled tasks (<i>still</i> coming soon) will have enough resources to run without driving anybody’s site into the ground.</p> <p>Second, we have updated Perl in the CGI/ssh environment from 5.8.8 to 5.8.9. Despite being a minor-version upgrade, this required the rebuild of nearly 1,000 CPAN modules and dozens of supporting libraries. Thus, we wanted to let people know to be on the lookout for resulting weirdness or incompatibilities. A few CPAN modules bought the farm on this upgrade, and we’ll list those below.<br /> <span id="more-81"></span><br /> Two modules have been permanently removed. The first is Apache::Test, which can’t build because Apache isn’t actually present in the CGI environment. The second is Weather::Google. It seems the API used by Weather::Google is intended for desktop “widget” use and they don’t really want it used from other sites; they’ve blocked our entire network from using it. (This is speculation on our part, as there is little public information other than that this is an “unofficial” API for widgets to use, and so far we haven’t gotten a definitive response to our inquiries about it.)</p> <p>Four other modules have been temporarily removed because they’re too badly broken to function in their current incarnation. They are:</p> <ul> <li>Catalyst::Engine::Test (fails its own tests)</li> <li>LWP::Parallel (appears to be badly out of date compared to LWP)</li> <li>Template::Alloy::XS (also appears out of date or obsolete)</li> <li>WWW::HostipInfo (fails its own tests, looks <i>really</i> broken)</li> </ul> <p>We’ll keep all four of these modules on our list. If they start working in the future with new releases, they’ll reappear.</p> <p>if you have any problems arising from either upgrade, please let us know via a <a href="https://members.nearlyfreespeech.net/support/request" target="_blank">Secure Support Request</a>.</p> http://blog.nearlyfreespeech.net/2009/02/13/cgissh-upgrade/ http://blog.nearlyfreespeech.net/?p=81 Fri, 13 Feb 2009 20:18:49 +0000 jdw