<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Snowing in my world</title><link>http://pipitu.org</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/pipitu_blog" /><description>pipitu's BLOG</description><language>en</language><lastBuildDate>Fri, 06 Aug 2010 20:36:08 PDT</lastBuildDate><generator>http://wordpress.org/?v=2.9.1</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/pipitu_blog" /><feedburner:info uri="pipitu_blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><item><title>Gentoo配置手记(10/08/07)</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/za_aURg8tqg/</link><category>折腾</category><category>config</category><category>emerge</category><category>gentoo</category><category>kernel</category><category>Linux</category><category>Python</category><category>udev</category><category>wireless</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Fri, 06 Aug 2010 20:30:45 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=452</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 207<br/><p>我又开始折腾了-___,-</p>
<p><strong>1. 不小心删除了Python</strong><br />
按Gentoo handbook折腾了一天把系统安装好了，于是我就决定emerge一下Python，结果把Python3也给装上了。想删除Python3结果直接把Python2.6一并咔嚓了。彼时还没有认识到问题的严重性，结果后来发现emerge命令执行之后完全没反应，问题严重了。翻开Portage Introduction：</p>
<pre>Portage is completely written in Python and Bash.</pre>
<p>Gentoo的Portage系统是依赖于Python的，so don&#8217;t ever unmerge Python completely!<br />
问题解决方法就是重新编译安装Python：</p>
<pre>
# cd
# tar xzf /usr/portage/distfiles/Python-2.6.5.tgz
# cd Python-2.6.5
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2>/dev/null
# ln -s /usr/bin/python2 /usr/bin/python
</pre>
<p>Reference: <a href="http://forums.gentoo.org/viewtopic.php?t=5746">[Gentoo Forums] I unmerged python&#8230; ensuing problems&#8230;.</a></p>
<p><strong>2. 无线网卡无法识别</strong><br />
首先确定网卡型号及驱动模块是否已加载：</p>
<pre>
# lspci | grep Wireless
03:00.0 Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection
</pre>
<p>搜索该网卡对应的内核模块应为<a href="http://intellinuxwireless.org/">iwlagn</a>，完整的网卡型号与驱动模块对应列表可从 <a href="http://linuxwireless.org/en/users/Drivers">Drivers &#8211; Linux Wireless</a> 获得。</p>
<pre>
# lsmod | grep iwlagn
iwlagn                173410  0
iwlcore               174978  1 iwlagn
mac80211              128158  2 iwlagn,iwlcore
cfg80211              119296  3 iwlagn,iwlcore,mac80211
</pre>
<p>iwlagn已经正确加载，但是无线网卡仍然无法识别(wlan0: device not found)。<br />
原来还有重要的一步没有做: Software Setup &#8211; Installing the microcode files。</p>
<pre>
＃ emerge -av net-wireless/iwl5000-ucode
</pre>
<p>之后无线网卡就可以正确识别了。</p>
<p>Refrence: <a href="http://en.gentoo-wiki.com/wiki/Iwlwifi">Iwlwifi &#8212; Gentoo Linux Wiki</a></p>
<p><strong>3. udev更新问题(2010-08-07)</strong><br />
昨天运行了一下emerge -uDN，今早启动系统的时候报错:</p>
<pre>
* Checking root filesystem...
fsck.ext3: No such file or directory while trying to open /dev/sda6
/dev/sda6:
The superblock could not be read or does not describe a correct ext 2 filessytem.
If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else,
then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
      e2fsck -b 8193 <device> 

* Filesystem coudn't be fixed <img src='http://pipitu.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />
</pre>
<p>这个问题很好解决，只要利用livecd进入chroot（参见Gentoo handbook），downgrade udev到之前的可用版本就OK了。</p>
<pre>
# emerge "<=sys-fs/udev-149"
</pre>
<p>Refrence: <a href="http://forums.gentoo.org/viewtopic-p-6374051.html?sid=aecfa9117c8d91c385ea74838c3527c4">[Gentoo Forums] Installing Gentoo</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=za_aURg8tqg:QdlRUtwgkk8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=za_aURg8tqg:QdlRUtwgkk8:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=za_aURg8tqg:QdlRUtwgkk8:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=za_aURg8tqg:QdlRUtwgkk8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=za_aURg8tqg:QdlRUtwgkk8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=za_aURg8tqg:QdlRUtwgkk8:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=za_aURg8tqg:QdlRUtwgkk8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 207我又开始折腾了-___,-
1. 不小心删除了Python
按Gentoo handbook折腾了一天把系统安装好了，于是我就决定emerge一下Python，结果把Python3也给装上了。想删除Python3结果直接把Python2.6一并咔嚓了。彼时还没有认识到问题的严重性，结果后来发现emerge命令执行之后完全没反应，问题严重了。翻开Portage Introduction：
Portage is completely written in Python and Bash.
Gentoo的Portage系统是依赖于Python的，so don&amp;#8217;t ever unmerge Python completely!
问题解决方法就是重新编译安装Python：

# cd
# tar xzf /usr/portage/distfiles/Python-2.6.5.tgz
# cd Python-2.6.5
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2&gt;/dev/null
# ln -s /usr/bin/python2 /usr/bin/python

Reference: [Gentoo Forums] I unmerged python&amp;#8230; ensuing problems&amp;#8230;.
2. 无线网卡无法识别
首先确定网卡型号及驱动模块是否已加载：

# lspci &amp;#124; grep Wireless
03:00.0 Network controller: Intel [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/08/07/gentoo%e9%85%8d%e7%bd%ae%e6%89%8b%e8%ae%b0100807/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://pipitu.org/2010/08/07/gentoo%e9%85%8d%e7%bd%ae%e6%89%8b%e8%ae%b0100807/</feedburner:origLink></item><item><title>Setup GDM 2.28 and above</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/ehWqo_jppFg/</link><category>折腾</category><category>config</category><category>gdm</category><category>Linux</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Thu, 27 May 2010 02:48:16 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=409</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 273<br/><p>gdm自从升级到2.28以后就不能设置主题神马的了，而且gdm的background还是一坨非常恶心的绿色，更杯具的是awesome下不知为啥urxvt设置透明背景用的background居然是这个绿色的图，恶心了我很长时间。上次通过设置rc.lua里一个透明选项搞定的，这次awesome升级以后好像又不管用了，一打开urxvt就把我嚇到了&#8230;.</p>
<p>去查了ArchWiki的Gnome 2.28 Changes，找到了这个命令：</p>
<pre>

# gksu -u gdm dbus-launch gnome-appearance-properties
</pre>
<p>终于改过来了。本来想再不行就degrade到2.20的，嗯，可以不用降级了～</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=ehWqo_jppFg:hxE5GKlehhM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=ehWqo_jppFg:hxE5GKlehhM:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=ehWqo_jppFg:hxE5GKlehhM:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=ehWqo_jppFg:hxE5GKlehhM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=ehWqo_jppFg:hxE5GKlehhM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=ehWqo_jppFg:hxE5GKlehhM:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=ehWqo_jppFg:hxE5GKlehhM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 273gdm自从升级到2.28以后就不能设置主题神马的了，而且gdm的background还是一坨非常恶心的绿色，更杯具的是awesome下不知为啥urxvt设置透明背景用的background居然是这个绿色的图，恶心了我很长时间。上次通过设置rc.lua里一个透明选项搞定的，这次awesome升级以后好像又不管用了，一打开urxvt就把我嚇到了&amp;#8230;.
去查了ArchWiki的Gnome 2.28 Changes，找到了这个命令：


# gksu -u gdm dbus-launch gnome-appearance-properties

终于改过来了。本来想再不行就degrade到2.20的，嗯，可以不用降级了～</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/05/27/setup-gdm-2-28-and-above/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://pipitu.org/2010/05/27/setup-gdm-2-28-and-above/</feedburner:origLink></item><item><title>Nexus One入手之软件篇（二）</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/0Kz9caFtyME/</link><category>折腾</category><category>android</category><category>app</category><category>n1</category><category>NexusOne</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Sat, 22 May 2010 06:58:24 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=279</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 691<br/><p>嗯，这次的主题是吐槽，虽然也有一些推荐啦。<br />
<strong><br />
吐槽一：Froyo 今天木OTA更新</strong></p>
<p>Google I/O大会放出了Froyo，偶本来也木有对近期的更新抱太大期望，结果今天早上正在自习的时候看到了@junyu 老师的推说N1的2.2OTA更新出了，搅乱了偶那平静的心湖。偏偏手机发推发没电了，又跑回宿舍充了一个多小时的电，然后骑车去实验室连wifi开同步。结果同步了半天都没有提示我有更新哪。我找到check updates，显示your system is up to date。我不甘心，连上vpn再check，还是那句up to date。我悲愤地暴走了！！！白激动了一个多小时阿～～多浪费感情阿～～～！</p>
<p><strong>吐槽二：软件崩溃引起的故障</strong></p>
<p>这周还出了个妖蛾子。有天运行程序太多了，我正开着evernote同步一个图，结果刚一保存屏幕就黑了，只看得见最上方那个状态栏。我touch了半天，出来一个对话框告诉我seesmic崩溃了，点了force close以后屏幕继续没反应，我急躁地锁屏了，然后开锁就完全没有反应，啥都看不见。</p>
<p>偶想大概死机了，拿实验室电话给手机打电话，轨迹球还亮了，嗡嗡的震动，可是屏幕就是黑的！偶慌了，心想不是屏幕坏了吧，真坏了我就杯具了。连忙发了个推求助，@CJie 同学立刻回复了，万分感谢阿：</p>
<p><a href="http://www.flickr.com/photos/pipitu/4628939358/" title="Flickr 上 pipitu 的 2010-05-22-173050_554x90_scrot"><img src="http://farm4.static.flickr.com/3348/4628939358_3321435266_o.png" width="554" height="90" alt="2010-05-22-173050_554x90_scrot" /></a></p>
<p>我立刻插拔电池重启，果然好了&#8230;.长出一口气阿&#8230;.<br />
android虽然有GC机制管理不活动的activity，但是明显做的不到位，程序一开多了就慢的很。尤其seesmic的用来更新的后台service貌似经常崩溃。所以我觉得在这种不完善的情况下，app是不是最好提供一个exit的菜单让用户可以选择关闭程序而不是在后台运行。不过听说2.2的速度有2-5倍提升，让我们期待一下它的表现会如何吧～</p>
<p>光顾着吐槽，把正题都给忘了。上次推荐了我特别特别喜欢的10个App，这次推的主要是一些还不错但是某些方面还有待改进的app～</p>
<p><strong>1. <a href="http://www.robotcomics.net/android-comic-viewer/">Droid Comics Viewer</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4629245022/" title="Flickr 上 pipitu 的 snap20100515_141518"><img src="http://farm5.static.flickr.com/4063/4629245022_6716e5a740.jpg" width="300" height="500" alt="snap20100515_141518" /></a></p>
<p>一款很优秀的漫画阅读软件，支持多种压缩格式(zip,rar等)，使用轨迹球上下方向或双击缩放图片。要是支持多点触摸缩放就perfect了。不过用手机看漫画真的很不方便，手机屏幕再大也有限度，估计ipad看会比较爽。这个软件还有一个小缺点就是太耗电，看不多长时间就没电了。</p>
<p><strong>2. ShootMe</strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4629309788/" title="Flickr 上 pipitu 的 snap20100515_101808(2)"><img src="http://farm5.static.flickr.com/4040/4629309788_d227cda152.jpg" width="300" height="500" alt="snap20100515_101808(2)" /></a></p>
<p>屏幕截图软件，需要root权限。只要shake一下，当前屏幕的截图就会保存到/sdcard/ShootMe目录下。</p>
<p><strong>3. <a href="http://www.androidtapp.com/astro-file-manager/">ASTRO</a><br />
</strong><br />
<a href="http://www.flickr.com/photos/pipitu/4629245020/" title="Flickr 上 pipitu 的 snap20100515_141635"><img src="http://farm5.static.flickr.com/4005/4629245020_d6c5c427e6.jpg" width="300" height="500" alt="snap20100515_141635" /></a></p>
<p>目前还没有特别满意的file explorer app，ASTRO算是还可以的一个吧。功能比较全，但是缺点是操作比较繁琐。而且目前还没有见到过支持同格式文件批量操作和连续选定操作的app，残念阿。</p>
<p><strong>4. <a href="http://www.androidfreeware.net/download-android-mate.html">Android Mate</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4629245024/" title="Flickr 上 pipitu 的 snap20100515_101938"><img src="http://farm5.static.flickr.com/4021/4629245024_2c6477df5b.jpg" width="300" height="500" alt="snap20100515_101938" /></a></p>
<p>功能比较全面的一个系统管理软件，能够从sdcard上安装apk文件，管理当前运行的service和system进程，管理通过market安装的app，外加file explorer功能。界面方面还可以自定义背景图片。<br />
<strong><br />
5. Gesture search</strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4629245018/" title="Flickr 上 pipitu 的 snap20100515_141807"><img src="http://farm4.static.flickr.com/3409/4629245018_797223d914.jpg" width="300" height="500" alt="snap20100515_141807" /></a></p>
<p>快速手势检索，不过我现在不太用了，觉得画英文字母比打字烦琐&#8230;.</p>
<h4>6. <a href="http://code.google.com/p/market-enabler/">MarketEnabler</a></h4>
<p><a href="http://www.flickr.com/photos/pipitu/4629245012/" title="Flickr 上 pipitu 的 snap20100515_141847"><img src="http://farm5.static.flickr.com/4017/4629245012_a6979d9f49.jpg" width="300" height="500" alt="snap20100515_141847" /></a></p>
<p>这个还用我介绍么，必备阿必备</p>
<p><strong>7. <a href="http://android.dianping.com/">大众点评</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4628678119/" title="Flickr 上 pipitu 的 snap20100522_212630"><img src="http://farm4.static.flickr.com/3388/4628678119_b2b7dd0e93.jpg" width="300" height="500" alt="snap20100522_212630" /></a></p>
<p>大众点评官方app，提供的周边信息准确丰富。上次去UME安贞店看电影前就用它搜了一下附近的好吃的地方，麻里麻里香锅果然不错的说。</p>
<p><strong>8. Simeji</strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4628678115/" title="Flickr 上 pipitu 的 snap20100522_212836"><img src="http://farm4.static.flickr.com/3553/4628678115_48341f14bf.jpg" width="300" height="500" alt="snap20100522_212836" /></a><a href="http://www.flickr.com/photos/pipitu/4628678111/" title="Flickr 上 pipitu 的 snap20100522_212918"><a href="http://www.flickr.com/photos/pipitu/4628678107/" title="Flickr 上 pipitu 的 snap20100522_213113"><img src="http://farm5.static.flickr.com/4064/4628678107_7263e6fc13.jpg" width="300" height="500" alt="snap20100522_213113" /></a></p>
<p>这个日文输入法非常好用，超级好用，特别好用，其实应该五星推荐的，但是估计要用到的人不多，就在这里说一下。Feature包括本地词库查不到的词可以在线找到，输入切换方便，汉字提示准确，还有强大的颜文字库～</p>
<p><strong>吐槽三：鸡肋的app们&#8230;.</strong></p>
<p><strong>1. Gmail</strong><br />
android上的Gmail程序无疑是所有Google出品的APP中最鸡肋的一个，功能过于简单。首先是不支持附件下载，要下载保存附件还得装一个专门的APP，那个APP还老容易崩溃的。第二是对群发邮件会在头部显示所有收件人，让我这种每天收一堆院里的群发邮件的人每次都要拉几次才能拉到邮件正文，情何以堪啊情何以堪！好吧，这是让我最为怨念的两点。其他跟标签相关的功能不好用我觉得主要还是限于手机屏幕，如果是iPad估计就很爽了。<br />
<strong>2. Clock</strong><br />
Clock的界面挺漂亮的，就是alarm功能太弱。我的alarm都已经很多天没响过了&#8230;.<br />
<strong>3. ADouban</strong><br />
豆瓣APP，功能神马的还是挺全滴，还嵌入了barcodeScanner的扫描查找功能。就是“我的收藏“这一块只是简单列出了最近的收藏，感觉有点鸡肋了&#8230;而且电影什么的详细信息的显示格式有点囧阿。<br />
<strong>4. Google Reader</strong><br />
丫的不能出个app版本么，网页版的字也太小了。点击神马的还容易touch错。</p>
<p>吐槽完毕，神清气爽。</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=0Kz9caFtyME:oEpaA8D9paQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=0Kz9caFtyME:oEpaA8D9paQ:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=0Kz9caFtyME:oEpaA8D9paQ:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=0Kz9caFtyME:oEpaA8D9paQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=0Kz9caFtyME:oEpaA8D9paQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=0Kz9caFtyME:oEpaA8D9paQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=0Kz9caFtyME:oEpaA8D9paQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 691嗯，这次的主题是吐槽，虽然也有一些推荐啦。

吐槽一：Froyo 今天木OTA更新
Google I/O大会放出了Froyo，偶本来也木有对近期的更新抱太大期望，结果今天早上正在自习的时候看到了@junyu 老师的推说N1的2.2OTA更新出了，搅乱了偶那平静的心湖。偏偏手机发推发没电了，又跑回宿舍充了一个多小时的电，然后骑车去实验室连wifi开同步。结果同步了半天都没有提示我有更新哪。我找到check updates，显示your system is up to date。我不甘心，连上vpn再check，还是那句up to date。我悲愤地暴走了！！！白激动了一个多小时阿～～多浪费感情阿～～～！
吐槽二：软件崩溃引起的故障
这周还出了个妖蛾子。有天运行程序太多了，我正开着evernote同步一个图，结果刚一保存屏幕就黑了，只看得见最上方那个状态栏。我touch了半天，出来一个对话框告诉我seesmic崩溃了，点了force close以后屏幕继续没反应，我急躁地锁屏了，然后开锁就完全没有反应，啥都看不见。
偶想大概死机了，拿实验室电话给手机打电话，轨迹球还亮了，嗡嗡的震动，可是屏幕就是黑的！偶慌了，心想不是屏幕坏了吧，真坏了我就杯具了。连忙发了个推求助，@CJie 同学立刻回复了，万分感谢阿：

我立刻插拔电池重启，果然好了&amp;#8230;.长出一口气阿&amp;#8230;.
android虽然有GC机制管理不活动的activity，但是明显做的不到位，程序一开多了就慢的很。尤其seesmic的用来更新的后台service貌似经常崩溃。所以我觉得在这种不完善的情况下，app是不是最好提供一个exit的菜单让用户可以选择关闭程序而不是在后台运行。不过听说2.2的速度有2-5倍提升，让我们期待一下它的表现会如何吧～
光顾着吐槽，把正题都给忘了。上次推荐了我特别特别喜欢的10个App，这次推的主要是一些还不错但是某些方面还有待改进的app～
1. Droid Comics Viewer

一款很优秀的漫画阅读软件，支持多种压缩格式(zip,rar等)，使用轨迹球上下方向或双击缩放图片。要是支持多点触摸缩放就perfect了。不过用手机看漫画真的很不方便，手机屏幕再大也有限度，估计ipad看会比较爽。这个软件还有一个小缺点就是太耗电，看不多长时间就没电了。
2. ShootMe

屏幕截图软件，需要root权限。只要shake一下，当前屏幕的截图就会保存到/sdcard/ShootMe目录下。
3. ASTRO


目前还没有特别满意的file explorer app，ASTRO算是还可以的一个吧。功能比较全，但是缺点是操作比较繁琐。而且目前还没有见到过支持同格式文件批量操作和连续选定操作的app，残念阿。
4. Android Mate

功能比较全面的一个系统管理软件，能够从sdcard上安装apk文件，管理当前运行的service和system进程，管理通过market安装的app，外加file explorer功能。界面方面还可以自定义背景图片。

5. Gesture search

快速手势检索，不过我现在不太用了，觉得画英文字母比打字烦琐&amp;#8230;.
6. MarketEnabler

这个还用我介绍么，必备阿必备
7. 大众点评

大众点评官方app，提供的周边信息准确丰富。上次去UME安贞店看电影前就用它搜了一下附近的好吃的地方，麻里麻里香锅果然不错的说。
8. Simeji

这个日文输入法非常好用，超级好用，特别好用，其实应该五星推荐的，但是估计要用到的人不多，就在这里说一下。Feature包括本地词库查不到的词可以在线找到，输入切换方便，汉字提示准确，还有强大的颜文字库～
吐槽三：鸡肋的app们&amp;#8230;.
1. Gmail
android上的Gmail程序无疑是所有Google出品的APP中最鸡肋的一个，功能过于简单。首先是不支持附件下载，要下载保存附件还得装一个专门的APP，那个APP还老容易崩溃的。第二是对群发邮件会在头部显示所有收件人，让我这种每天收一堆院里的群发邮件的人每次都要拉几次才能拉到邮件正文，情何以堪啊情何以堪！好吧，这是让我最为怨念的两点。其他跟标签相关的功能不好用我觉得主要还是限于手机屏幕，如果是iPad估计就很爽了。
2. Clock
Clock的界面挺漂亮的，就是alarm功能太弱。我的alarm都已经很多天没响过了&amp;#8230;.
3. ADouban
豆瓣APP，功能神马的还是挺全滴，还嵌入了barcodeScanner的扫描查找功能。就是“我的收藏“这一块只是简单列出了最近的收藏，感觉有点鸡肋了&amp;#8230;而且电影什么的详细信息的显示格式有点囧阿。
4. Google Reader
丫的不能出个app版本么，网页版的字也太小了。点击神马的还容易touch错。
吐槽完毕，神清气爽。</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/05/22/nexus-one%e5%85%a5%e6%89%8b%e4%b9%8b%e8%bd%af%e4%bb%b6%e7%af%87%ef%bc%88%e4%ba%8c%ef%bc%89/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">23</slash:comments><georss:point xmlns:georss="http://www.georss.org/georss">40.0085766061 116.328456402</georss:point><feedburner:origLink>http://pipitu.org/2010/05/22/nexus-one%e5%85%a5%e6%89%8b%e4%b9%8b%e8%bd%af%e4%bb%b6%e7%af%87%ef%bc%88%e4%ba%8c%ef%bc%89/</feedburner:origLink></item><item><title>给mp3批量嵌入专辑封面</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/kPFx68LPmCI/</link><category>玩意</category><category>api</category><category>douban</category><category>ID3</category><category>mutagen</category><category>Python</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Fri, 14 May 2010 05:42:55 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=293</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 866<br/><p>鉴于本人素ID3 tag严重洁癖者，之前有用easytag手动给几千个mp3改过tag= =    easytag的界面不错，就是不能批量修改，导致那两天改的我手都酸的不行了&#8230;.入了n1以后有一点不爽的就是不管啥音乐软件，听歌的时候就是抓不到一张封面，那个默认的灰色封面实在让我火大，就用python写了个从豆瓣抓封面图片直接嵌入ID3 tag的程序，一劳永逸了～～</p>
<h4><span style="color: #333399;"><strong>读写ID3 tag信息</strong></span></h4>
<p>对ID3信息的读取和修改依赖了<a href="http://code.google.com/mutagen">mutagen</a>库，当然用之前还是要对<a href="http://www.id3.org">ID3标准</a>有一个基本的了解。</p>
<pre name="code" class="python">from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC, error

audio = MP3(self.filename, ID3=ID3)
try:
    audio.add_tags()
except error:
    pass
</pre>
<p>有可能音乐文件一开始并没有tag(虽然机率比较小)，所以调用add_tags()方法初始化一下，一般情况下都会抛出个error，提示已经有tag了。</p>
<pre name="code" class="python">album = self.audio['TALB'][0]
frames = self.audio.tags.getall("APIC")
for frame in frames:
    ext = ".img"
    if frame.mime == "image/jpeg" or frame.mime == "image/jpg":
        ext = ".jpg"
    elif frame.mime == "image/png":
        ext = ".png"
    elif frame.mime == "image/gif":
        ext = ".gif"
</pre>
<p>如果tag中已经包含唱片标题信息，那么audio.keys()的返回结果中就会包含&#8221;TALB&#8221;这一项，其他还有比如&#8221;TLE1&#8243;（表演者)，“TCON”（流派）等等。ID3标准中规定代表唱片封面信息的帧结构如下：</p>
<pre name="code" class="python">audio.tags.add(APIC(encoding = 3,mime = "image/jpeg",type = 3,
desc = u'Cover',data=imagedata))
audio.save()
</pre>
<p>encoding = 3表示utf8编码，mime可以为&#8221;image/jpeg&#8221;(&#8220;image/jpg&#8221;)或者&#8221;image/png&#8221;格式，type=3表示写入的是front cover，desc是描述信息，data是图片的二进制数据，可以从某个uri读取，也可以从本地读取。</p>
<h4><span style="color: #000080;"><strong>从豆瓣抓取封面图片</strong></span></h4>
<p>豆瓣很早就开始提供各种API了，抓取过程很简单，默认是atom，把得到的xml用minidom库解析一下就可以得到封面图片的url了，这个不多说了。</p>
<pre name="code" class="python">req = urllib2.Request(self.site_url+"?"+url_data)
response = urllib2.urlopen(req)
result_xml = response.read()

elements = minidom.parseString(result)
albums = []
for entry in elements.getElementsByTagName("entry"):
    album = {}
    try:
        album["id"] = self.getText(entry.getElementsByTagName("id")[0].childNodes)
        album["title"] = self.getText(entry.getElementsByTagName("title")[0].childNodes)
        album["author"] = self.get_authors(entry.getElementsByTagName("author")     [0].getElementsByTagName("name"))
        album["image"] = self.get_image(entry.getElementsByTagName("link"))
        albums.append(album)
    except IndexError:
        pass
</pre>
<p>这个时候得到的图片的url一般是&#8221;http://t.douban.com/spic/s*.jpg&#8221;的格式，这些图片都比较小分辨率比较低，一般一张2,3k左右。我需要清晰一些，大一些的图片，所以把url中spic换成了lpic，这时得到的图片在20k左右。</p>
<pre name="code" class="python">image_url.replace("spic","lpic",1)
</pre>
<h4><span style="color: #000080;">代码</span></h4>
<p>源码见<a href="http://github.com/pipitu/douban-cover">这里</a>。<br />
必需的命令行参数为-d，后接要处理的目录路径。-r表示递归处理该目录下所有子目录下的所有mp3文件，否则默认只处理指定目录下的文件。</p>
<h4><span style="color: #000080;">成果</span></h4>
<p>我的音乐目录是~/Music，执行python cmd.py -r -d ~/Music递归为该目录下所有mp3文件自动嵌入封面，由于mp3 tag有的有残缺，成功率大约在90%以上。<br />
Amarok播放效果图：<br />
<a href="http://www.flickr.com/photos/pipitu/4607478381/"><img src="http://farm2.static.flickr.com/1054/4607478381_781b5ce451.jpg" alt="2010-05-15-105026_671x276_scrot" width="500" height="206" /></a><br />
Android Music播放效果图：<br />
<a href="http://www.flickr.com/photos/pipitu/4607586981/"><img src="http://farm4.static.flickr.com/3450/4607586981_ce71a1b4d1.jpg" alt="snap20100515_113833" width="300" height="500" /></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=kPFx68LPmCI:tFAyDi34JMs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=kPFx68LPmCI:tFAyDi34JMs:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=kPFx68LPmCI:tFAyDi34JMs:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=kPFx68LPmCI:tFAyDi34JMs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=kPFx68LPmCI:tFAyDi34JMs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=kPFx68LPmCI:tFAyDi34JMs:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=kPFx68LPmCI:tFAyDi34JMs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 866鉴于本人素ID3 tag严重洁癖者，之前有用easytag手动给几千个mp3改过tag= =    easytag的界面不错，就是不能批量修改，导致那两天改的我手都酸的不行了&amp;#8230;.入了n1以后有一点不爽的就是不管啥音乐软件，听歌的时候就是抓不到一张封面，那个默认的灰色封面实在让我火大，就用python写了个从豆瓣抓封面图片直接嵌入ID3 tag的程序，一劳永逸了～～
读写ID3 tag信息
对ID3信息的读取和修改依赖了mutagen库，当然用之前还是要对ID3标准有一个基本的了解。
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC, error

audio = MP3(self.filename, ID3=ID3)
try:
    audio.add_tags()
except error:
    pass

有可能音乐文件一开始并没有tag(虽然机率比较小)，所以调用add_tags()方法初始化一下，一般情况下都会抛出个error，提示已经有tag了。
album = self.audio['TALB'][0]
frames = self.audio.tags.getall("APIC")
for frame in frames:
    ext = ".img"
    if frame.mime == "image/jpeg" or frame.mime == [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/05/14/mp3-id3-embed-cover/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">25</slash:comments><feedburner:origLink>http://pipitu.org/2010/05/14/mp3-id3-embed-cover/</feedburner:origLink></item><item><title>Nexus One入手之软件篇（一）</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/76frLqrEd2k/</link><category>技术</category><category>android</category><category>app</category><category>google</category><category>n1</category><category>NexusOne</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Tue, 04 May 2010 06:34:09 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=232</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 525<br/><p>好吧我承认我懒得更新= =五一在宿舍宅了两天看了一堆电影，我就不忏悔了。昨天夜里11点左右下雨了，下之前还轰隆隆的打了一阵雷，要不是爬上床之后听见雨声我还以为我之前是幻听。这两天实验室正下方不知道施工在干啥，整天的拿电钻钻天花板，时不时的来场震动的惊喜（正写着呢又来了&#8230;）。</p>
<p>废话说完了来进入正题。以下是android app之五星赞美list~</p>
<p><strong>1. Live Wallpaper</strong></p>
<p><a title="Flickr 上 pipitu 的 snap20100407_203736" href="http://www.flickr.com/photos/pipitu/4577977418/"><img src="http://farm5.static.flickr.com/4033/4577977418_66a3231865_m.jpg" alt="snap20100407_203736" width="144" height="240" /></a> <a title="Flickr 上 pipitu 的 snap20100504_173722" href="http://www.flickr.com/photos/pipitu/4577977578/"><img src="http://farm5.static.flickr.com/4018/4577977578_bba9053c34_m.jpg" alt="snap20100504_173722" width="144" height="240" /></a><br />
N1自带的这两个动态壁纸都非常的不错，加上后来更新的gmaps动态壁纸，算起来只有这三款支持触摸反馈。左边是默认的Nexus，触摸时会在触摸点生成新的射线；右边是Water，水面会在触摸点处向外扩散生成波纹。</p>
<p><strong>2. 3D Gallery</strong></p>
<p><a title="Flickr 上 pipitu 的 snap20100504_175805" href="http://www.flickr.com/photos/pipitu/4577379879/"><img src="http://farm5.static.flickr.com/4011/4577379879_5c6ebe584d_m.jpg" alt="snap20100504_175805" width="144" height="240" /></a> <a title="Flickr 上 pipitu 的 snap20100504_175611" href="http://www.flickr.com/photos/pipitu/4577380037/"><img src="http://farm5.static.flickr.com/4029/4577380037_a37d26ef19_m.jpg" alt="snap20100504_175611" width="144" height="240" /></a><br />
Gallery的3D效果基本上和Firefox上的Cooliris差不多，很炫目。我喜欢的几个小特性一是在触摸相册中的某个图片时，整个galley的背景就会变成该图片的模糊化色调；二是长按选定功能。总的来说它确实是一个既美观又实用的app。</p>
<p><strong> 3. Widget</strong></p>
<p>桌面上怎么能少了漂亮又方便的widget呢，我用的widget主要有以下几款：</p>
<ul>
<li>Google search，必备，平时都通过它来启动app或定位文件</li>
<li>Agenda Widget，这个日历widget比默认的Google Calendar更漂亮，并且有多种size可供选择</li>
<li>Google buzz，虽然不常用buzz，但是这个widget做的实在让人流口水啊&#8230;.</li>
<li>Google Latitude，列出最近更新了latitude的好友位置</li>
<li>Digital Clock，默认的Clock widget上面不显示数字的，这是一个iphone风格的数字时钟</li>
<li>Power Control，必备，可控制wifi,gps,sync,bluetooth等的开关</li>
<li>Mini Info Widget，3*1，显示目前系统信息，如电池剩余量，ROM和SD卡使用状况等</li>
<li>Seesmic，Seesmic什么时候开始支持widget的我都不知道，今天才发现= =。</li>
<li>APNDroid，APN开关，控制流量使用</li>
<li>AdvancedTaskKiller，系统缓慢的时候按一下释放内存。</li>
</ul>
<p><a title="Flickr 上 pipitu 的 snap20100504_192453" href="http://www.flickr.com/photos/pipitu/4578177448/"><img src="http://farm5.static.flickr.com/4047/4578177448_45bfce533f_m.jpg" alt="snap20100504_192453" width="144" height="240" /></a> <a title="Flickr 上 pipitu 的 snap20100504_192443" href="http://www.flickr.com/photos/pipitu/4578183164/"><img src="http://farm5.static.flickr.com/4063/4578183164_4891da58a6_m.jpg" alt="snap20100504_192443" width="144" height="240" /></a> <a title="Flickr 上 pipitu 的 snap20100504_192447" href="http://www.flickr.com/photos/pipitu/4577544905/"><img src="http://farm5.static.flickr.com/4002/4577544905_ca9f4c5f05_m.jpg" alt="snap20100504_192447" width="144" height="240" /></a></p>
<p>4. <a href="http://douban.fm/app"><strong>豆瓣电台</strong>(douban.fm)</a></p>
<p><a title="Flickr 上 pipitu 的 snap20100407_202802" href="http://www.flickr.com/photos/pipitu/4577568487/"><img src="http://farm5.static.flickr.com/4013/4577568487_292a82228e.jpg" alt="snap20100407_202802" width="300" height="500" /></a></p>
<p>豆瓣不久前推出了豆瓣电台的iphone版和android版app，特点是界面简洁大方，非常有简约美。上图的界面触摸后有一个翻转效果，背面会显示出专辑的信息和评级。它还支持shake skip特性，直接摇一下手机就可以skip掉当前的歌曲啦。</p>
<p>5. <a href="http://ireader.over-blog.com/"><strong>iReade</strong>r</a></p>
<p><a href="http://www.flickr.com/photos/pipitu/4577600857/" title="Flickr 上 pipitu 的 snap20100504_195610"><img src="http://farm5.static.flickr.com/4003/4577600857_2f7dd0f3c8.jpg" width="500" height="300" alt="snap20100504_195610" /></a></p>
<p>iReader是一款电子书阅读app，我主要用它看小说= =iReader的功能全面，设置项十分丰富。可设置背景，翻页时间动作方向，界面风格，显示等等。支持书签，多种字符编码，搜索，重力感应等特性。最方便的一点就是打开某本书时默认就是上次读到的进度，基本上都不用自己刻意去设置书签。</p>
<p>6. <strong>Ringdroid</strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4578263038/" title="Flickr 上 pipitu 的 snap20100407_203948"><img src="http://farm5.static.flickr.com/4049/4578263038_549782aece.jpg" width="300" height="500" alt="snap20100407_203948" /></a></p>
<p>Ringdroid用于编辑音乐并保存为系统铃声。我主要用它来截断某首歌的前奏（比如《生生世世爱》= .=）。这个app用起来很方便，只要拉动左右两根分界线来截断曲子的某部分就可以了~</p>
<p><strong>7. MovieFinder</strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4577644819/" title="Flickr 上 pipitu 的 snap20100407_203902"><img src="http://farm5.static.flickr.com/4012/4577644819_3eb614e72b_m.jpg" width="144" height="240" alt="snap20100407_203902" /></a> <a href="http://www.flickr.com/photos/pipitu/4577644883/" title="Flickr 上 pipitu 的 snap20100407_203826"><img src="http://farm5.static.flickr.com/4072/4577644883_df8aaf2809_m.jpg" width="144" height="240" alt="snap20100407_203826" /></a> <a href="http://www.flickr.com/photos/pipitu/4577644925/" title="Flickr 上 pipitu 的 snap20100407_203851"><img src="http://farm5.static.flickr.com/4008/4577644925_260eff393c_m.jpg" width="144" height="240" alt="snap20100407_203851" /></a></p>
<p>MovieFinder通过你的Location来收集附近的影院信息，提供正在上映的电影的列表。值得一提的是它的电影的rating使用的是google rating，但是同时在每部电影下附上了豆瓣、google rating和imdb的链接。有些挫电影的google rating可能还不错的，所以还是check一下豆瓣比较保险。每部电影后面都附有附近影院的放映场次，还提供到影院位置和联系方式。这款app从功能到设计都无可挑剔。</p>
<p><strong>8. <a href="http://seesmic.com/seesmic_mobile/android/">Seesmic</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4577674395/" title="Flickr 上 pipitu 的 snap20100407_203655"><img src="http://farm5.static.flickr.com/4015/4577674395_378c1b2539.jpg" width="300" height="500" alt="snap20100407_203655" /></a></p>
<p>其实一开始还是随大流用的<a href="http://twidroid.com">twidroid</a>，不可否认的是twidroid功能的确是最全面最丰富的一个，但是用户体验方面还是有所不足的。有一点让我很不爽就是twidroid的发推按钮十分的小，每回都要多按几次才能发成功，包括刷新按钮也经常按了没反应。这两个按钮偏偏又是最常用的，搞得我很悲愤。</p>
<p>后来陆续试了<a href="http://www.twigee.com/">twigee</a>和<a href="http://seesmic.com/seesmic_mobile/android/">Seesmic</a>。twigee功能比较简单，胜在界面简洁易用。Seesmic的界面设计可以看出是下了功夫的，home,reply,message和profile都是用的tab显示，很醒目很好切换。refresh按钮就在最新推的上方，与list item等宽，百发百中，不存在按不到的情况。并且设想很周到的一点就是按上方的红色横条就直接到达最新推，这样向下回溯旧推完了以后就可以方便地回到最新推的位置了。这几个设计真是太赞了。Seesmic这次更新以后开始支持官方RT，geotag和widget，功能比twidroid是不遑多让，尤其widget是twidroid pro才支持的。</p>
<p>话说最近又出了那啥的官方客户端，悲愤的是不支持API，无福享受啊。</p>
<p><strong>9.<a href="http://googlemobile.blogspot.com/2009/06/places-directory-app-for-android.html">PlacesDirectory</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4578360888/" title="Flickr 上 pipitu 的 snap20100504_205909"><img src="http://farm5.static.flickr.com/4015/4578360888_94393cc53d_m.jpg" width="144" height="240" alt="snap20100504_205909" /></a><a href="http://www.flickr.com/photos/pipitu/4578360750/" title="Flickr 上 pipitu 的 snap20100504_205922"><img src="http://farm5.static.flickr.com/4067/4578360750_eb3043b30f_m.jpg" width="144" height="240" alt="snap20100504_205922" /></a><a href="http://www.flickr.com/photos/pipitu/4578360686/" title="Flickr 上 pipitu 的 snap20100504_205857"><img src="http://farm5.static.flickr.com/4028/4578360686_2305d636df_m.jpg" width="144" height="240" alt="snap20100504_205857" /></a><a href="http://www.flickr.com/photos/pipitu/4577729377/" title="Flickr 上 pipitu 的 snap20100504_210031"><img src="http://farm5.static.flickr.com/4030/4577729377_77f19f160c_m.jpg" width="144" height="240" alt="snap20100504_210031" /></a></p>
<p>介个就是Google的Places Directory，涵盖了附近所有场所的位置、图片、联系方式等信息，加上GPS精确定位，简直就是户外神器啊。不过Maps比较耗流量，非联通3G包月用户在非wifi环境下慎用。</p>
<p><strong>10.<a href="http://www.wordmate.net/w/">WordMate</a></strong></p>
<p><a href="http://www.flickr.com/photos/pipitu/4578360630/" title="Flickr 上 pipitu 的 snap20100407_204157"><img src="http://farm5.static.flickr.com/4051/4578360630_22e1cd84e6.jpg" width="300" height="500" alt="snap20100407_204157" /></a></p>
<p>WordMate是一款字典软件，自带DictDownloader可以下载很多字典。重要的是它支持stardict使用的字典格式，是不是意味可以直接从stardict官网下载一些dictdownloader中没有的字典用，这个还没试验过~字典list里面居然还有个Dict of Computing，囧，上图就是Python的解释。</p>
<p>该赞美的赞美的差不多了，今天写不完全部了，下次写四星推荐和三星鸡肋~</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=76frLqrEd2k:9byuUGMgWBo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=76frLqrEd2k:9byuUGMgWBo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=76frLqrEd2k:9byuUGMgWBo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=76frLqrEd2k:9byuUGMgWBo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=76frLqrEd2k:9byuUGMgWBo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=76frLqrEd2k:9byuUGMgWBo:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=76frLqrEd2k:9byuUGMgWBo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 525好吧我承认我懒得更新= =五一在宿舍宅了两天看了一堆电影，我就不忏悔了。昨天夜里11点左右下雨了，下之前还轰隆隆的打了一阵雷，要不是爬上床之后听见雨声我还以为我之前是幻听。这两天实验室正下方不知道施工在干啥，整天的拿电钻钻天花板，时不时的来场震动的惊喜（正写着呢又来了&amp;#8230;）。
废话说完了来进入正题。以下是android app之五星赞美list~
1. Live Wallpaper
 
N1自带的这两个动态壁纸都非常的不错，加上后来更新的gmaps动态壁纸，算起来只有这三款支持触摸反馈。左边是默认的Nexus，触摸时会在触摸点生成新的射线；右边是Water，水面会在触摸点处向外扩散生成波纹。
2. 3D Gallery
 
Gallery的3D效果基本上和Firefox上的Cooliris差不多，很炫目。我喜欢的几个小特性一是在触摸相册中的某个图片时，整个galley的背景就会变成该图片的模糊化色调；二是长按选定功能。总的来说它确实是一个既美观又实用的app。
 3. Widget
桌面上怎么能少了漂亮又方便的widget呢，我用的widget主要有以下几款：

Google search，必备，平时都通过它来启动app或定位文件
Agenda Widget，这个日历widget比默认的Google Calendar更漂亮，并且有多种size可供选择
Google buzz，虽然不常用buzz，但是这个widget做的实在让人流口水啊&amp;#8230;.
Google Latitude，列出最近更新了latitude的好友位置
Digital Clock，默认的Clock widget上面不显示数字的，这是一个iphone风格的数字时钟
Power Control，必备，可控制wifi,gps,sync,bluetooth等的开关
Mini Info Widget，3*1，显示目前系统信息，如电池剩余量，ROM和SD卡使用状况等
Seesmic，Seesmic什么时候开始支持widget的我都不知道，今天才发现= =。
APNDroid，APN开关，控制流量使用
AdvancedTaskKiller，系统缓慢的时候按一下释放内存。

  
4. 豆瓣电台(douban.fm)

豆瓣不久前推出了豆瓣电台的iphone版和android版app，特点是界面简洁大方，非常有简约美。上图的界面触摸后有一个翻转效果，背面会显示出专辑的信息和评级。它还支持shake skip特性，直接摇一下手机就可以skip掉当前的歌曲啦。
5. iReader

iReader是一款电子书阅读app，我主要用它看小说= =iReader的功能全面，设置项十分丰富。可设置背景，翻页时间动作方向，界面风格，显示等等。支持书签，多种字符编码，搜索，重力感应等特性。最方便的一点就是打开某本书时默认就是上次读到的进度，基本上都不用自己刻意去设置书签。
6. Ringdroid

Ringdroid用于编辑音乐并保存为系统铃声。我主要用它来截断某首歌的前奏（比如《生生世世爱》= .=）。这个app用起来很方便，只要拉动左右两根分界线来截断曲子的某部分就可以了~
7. MovieFinder
  
MovieFinder通过你的Location来收集附近的影院信息，提供正在上映的电影的列表。值得一提的是它的电影的rating使用的是google rating，但是同时在每部电影下附上了豆瓣、google rating和imdb的链接。有些挫电影的google rating可能还不错的，所以还是check一下豆瓣比较保险。每部电影后面都附有附近影院的放映场次，还提供到影院位置和联系方式。这款app从功能到设计都无可挑剔。
8. Seesmic

其实一开始还是随大流用的twidroid，不可否认的是twidroid功能的确是最全面最丰富的一个，但是用户体验方面还是有所不足的。有一点让我很不爽就是twidroid的发推按钮十分的小，每回都要多按几次才能发成功，包括刷新按钮也经常按了没反应。这两个按钮偏偏又是最常用的，搞得我很悲愤。
后来陆续试了twigee和Seesmic。twigee功能比较简单，胜在界面简洁易用。Seesmic的界面设计可以看出是下了功夫的，home,reply,message和profile都是用的tab显示，很醒目很好切换。refresh按钮就在最新推的上方，与list item等宽，百发百中，不存在按不到的情况。并且设想很周到的一点就是按上方的红色横条就直接到达最新推，这样向下回溯旧推完了以后就可以方便地回到最新推的位置了。这几个设计真是太赞了。Seesmic这次更新以后开始支持官方RT，geotag和widget，功能比twidroid是不遑多让，尤其widget是twidroid pro才支持的。
话说最近又出了那啥的官方客户端，悲愤的是不支持API，无福享受啊。
9.PlacesDirectory

介个就是Google的Places Directory，涵盖了附近所有场所的位置、图片、联系方式等信息，加上GPS精确定位，简直就是户外神器啊。不过Maps比较耗流量，非联通3G包月用户在非wifi环境下慎用。
10.WordMate

WordMate是一款字典软件，自带DictDownloader可以下载很多字典。重要的是它支持stardict使用的字典格式，是不是意味可以直接从stardict官网下载一些dictdownloader中没有的字典用，这个还没试验过~字典list里面居然还有个Dict of Computing，囧，上图就是Python的解释。
该赞美的赞美的差不多了，今天写不完全部了，下次写四星推荐和三星鸡肋~</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/05/04/nexus-one%e5%85%a5%e6%89%8b%e4%b9%8b%e8%bd%af%e4%bb%b6%e7%af%87%ef%bc%88%e4%b8%80%ef%bc%89/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">20</slash:comments><feedburner:origLink>http://pipitu.org/2010/05/04/nexus-one%e5%85%a5%e6%89%8b%e4%b9%8b%e8%bd%af%e4%bb%b6%e7%af%87%ef%bc%88%e4%b8%80%ef%bc%89/</feedburner:origLink></item><item><title>Nexus One入手一月小记——硬件篇</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/RMU4wmswNQo/</link><category>技术</category><category>android</category><category>n1</category><category>NexusOne</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Wed, 07 Apr 2010 05:04:19 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=200</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 390<br/><p>N1入手快一个月了，对入手过程感兴趣的童鞋请看<a href="http://pipitu.org/1tg">这里</a>。想必大家都比较关心使用情况，我就分以下几个方面说一说吧～</p>
<ol>
<li><strong>触摸屏</strong><br />
在入手之前最关心的就是触摸屏问题了，估计大家对N1屏幕的负面新闻已经能倒背如流了= =<br />
入手之后第一件事情就是给它贴膜，对于几种贴膜的好坏机锋网论坛上有讨论，综合个方面因素选择了BENKS的AR膜，前面和后边镜头都贴上了，当然不贴估计也没啥问题，这个看个人习惯了。<br />
从灵敏度上来说，N1的屏幕真的是perfect，基本上轻轻一touch就ok了，而且屏又大，touch起来真的不是一般的爽，多点触摸也很正常，没有网上传的这样那样的问题。对于传说中的屏幕漂移（就是touch到屏幕边上会反飘到另一边)，我只在一种情况下经历过，就是躺床上玩机的时候。说到卧着玩N1，我真的是不推荐，理由有如下几个：1. N1真的是太大了，平时站着单手玩都嫌费劲，不要谈躺着了，但是躺着双手玩，必定有一只胳膊会很酸，这个实在是没有办法&gt; &lt; 2. 躺着的情况下屏幕灵敏度会降低很多，经常出现touch半天没反应的状况。经过我多次把玩发现，N1的屏幕不仅对接触到面上touch的力度敏感，它对整机的握力也很敏感，躺着玩的时候，必定在机身边缘会多着力，在这种情况下触屏的功能就明显受到影响，屏幕漂移只是其中表现的比较明显的一个问题而已，重力感应也经常不起作用。当然如果你直接趴着玩是不会有什么问题的= =<br />
那么站着玩N1是否屏幕就百分百没有失常的时候了呢？答案是否定的，在某些时候会出现touch感应下漂的状况，比如你按的明明是上边一个icon，它给感应成下边那个了，这时候只要锁屏再解锁就ok了。但是我想强调一下这种情况只是偶然发生，并不影响正常使用。</li>
<li><strong>轨迹球</strong><br />
平时基本不用轨迹球，但是看电子书翻页的时候用它还是很方便的。结果有几天用多了，然后向下的那个方向不灵光了，囧。然后某天由于解锁bootloader和取Root权限的时候长按了几下，结果发现轨迹球又回复正常了，大囧。所以大家如果发现不灵光了可以试试长按这个办法&#8230;.</li>
<li><strong>耳机</strong><br />
这个耳机+线控真的很鸡肋，不过好在是通用的3.5mm插孔，所以大家可以随便配自己喜欢的耳机就OK啦。不过我真的不明白为什么线控没有调节音量功能（听说G3的也没有），还有就是话筒为什么是分离开来的，那个话筒那么小，也太容易丢失了，所以我直接搁盒子里没有用过。</li>
</ol>
<p>总体来说对于硬件方面还算满意，尤其是屏幕尺寸，因为偶的手比较大，所以就想要一个屏大的，厚度也很薄，虽说颜色不太适合MM用，不过就当作别样的帅气好啦，而且白色也容易脏的说。就是虚拟键盘不太习惯，我一般打字的时候还是喜欢横屏，因为横屏的键比竖屏的时候要大一些，不容易按错，其实还是因为手大=.=</p>
<p>今天先就写硬件篇吧，敬请期待软件篇^^</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=RMU4wmswNQo:dshyl7pEcmY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=RMU4wmswNQo:dshyl7pEcmY:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=RMU4wmswNQo:dshyl7pEcmY:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=RMU4wmswNQo:dshyl7pEcmY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=RMU4wmswNQo:dshyl7pEcmY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=RMU4wmswNQo:dshyl7pEcmY:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=RMU4wmswNQo:dshyl7pEcmY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 390N1入手快一个月了，对入手过程感兴趣的童鞋请看这里。想必大家都比较关心使用情况，我就分以下几个方面说一说吧～

触摸屏
在入手之前最关心的就是触摸屏问题了，估计大家对N1屏幕的负面新闻已经能倒背如流了= =
入手之后第一件事情就是给它贴膜，对于几种贴膜的好坏机锋网论坛上有讨论，综合个方面因素选择了BENKS的AR膜，前面和后边镜头都贴上了，当然不贴估计也没啥问题，这个看个人习惯了。
从灵敏度上来说，N1的屏幕真的是perfect，基本上轻轻一touch就ok了，而且屏又大，touch起来真的不是一般的爽，多点触摸也很正常，没有网上传的这样那样的问题。对于传说中的屏幕漂移（就是touch到屏幕边上会反飘到另一边)，我只在一种情况下经历过，就是躺床上玩机的时候。说到卧着玩N1，我真的是不推荐，理由有如下几个：1. N1真的是太大了，平时站着单手玩都嫌费劲，不要谈躺着了，但是躺着双手玩，必定有一只胳膊会很酸，这个实在是没有办法&amp;#62; &amp;#60; 2. 躺着的情况下屏幕灵敏度会降低很多，经常出现touch半天没反应的状况。经过我多次把玩发现，N1的屏幕不仅对接触到面上touch的力度敏感，它对整机的握力也很敏感，躺着玩的时候，必定在机身边缘会多着力，在这种情况下触屏的功能就明显受到影响，屏幕漂移只是其中表现的比较明显的一个问题而已，重力感应也经常不起作用。当然如果你直接趴着玩是不会有什么问题的= =
那么站着玩N1是否屏幕就百分百没有失常的时候了呢？答案是否定的，在某些时候会出现touch感应下漂的状况，比如你按的明明是上边一个icon，它给感应成下边那个了，这时候只要锁屏再解锁就ok了。但是我想强调一下这种情况只是偶然发生，并不影响正常使用。
轨迹球
平时基本不用轨迹球，但是看电子书翻页的时候用它还是很方便的。结果有几天用多了，然后向下的那个方向不灵光了，囧。然后某天由于解锁bootloader和取Root权限的时候长按了几下，结果发现轨迹球又回复正常了，大囧。所以大家如果发现不灵光了可以试试长按这个办法&amp;#8230;.
耳机
这个耳机+线控真的很鸡肋，不过好在是通用的3.5mm插孔，所以大家可以随便配自己喜欢的耳机就OK啦。不过我真的不明白为什么线控没有调节音量功能（听说G3的也没有），还有就是话筒为什么是分离开来的，那个话筒那么小，也太容易丢失了，所以我直接搁盒子里没有用过。

总体来说对于硬件方面还算满意，尤其是屏幕尺寸，因为偶的手比较大，所以就想要一个屏大的，厚度也很薄，虽说颜色不太适合MM用，不过就当作别样的帅气好啦，而且白色也容易脏的说。就是虚拟键盘不太习惯，我一般打字的时候还是喜欢横屏，因为横屏的键比竖屏的时候要大一些，不容易按错，其实还是因为手大=.=
今天先就写硬件篇吧，敬请期待软件篇^^</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/04/07/nexus-one-a-month-hardware/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://pipitu.org/2010/04/07/nexus-one-a-month-hardware/</feedburner:origLink></item><item><title>Wifi Setup under Archlinux</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/wyxFcXk4JOw/</link><category>技术</category><category>ArchLinux</category><category>Linux</category><category>netcfg</category><category>wifi</category><category>wpa</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Sun, 28 Mar 2010 23:17:10 PDT</pubDate><guid isPermaLink="false">http://pipitu.org/?p=186</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 335<br/><p>实验室有wifi，上次以为是wep加密，结果弄了半天都invalid arguments，这次仔细看了下原来是WPA，参照<a href="http://wiki.archlinux.org/index.php/WPA_Supplicant">ArchWiki</a>搞定。<br />
1. Check wpa_supplicant</p>
<pre>
# wpa_supplicant
...
drivers:
  wext = Linux wireless extensions (generic)
  nl80211 = Linux nl80211/cfg80211
  wired = wpa_supplicant wired Ethernet driver
</pre>
<p>2. Configure WPA with ssid(here mywireless) and key(here secretpassphrase)</p>
<pre>
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original
# wpa_passphrase mywireless "secretpassphrase" > /etc/wpa_supplicant.conf
# vim /etc/wpa_supplicant.conf
network={
        ssid="mywireless"
        #psk="secretpassphrase"
        psk=****************************
}
</pre>
<p>Add this line to the conf file</p>
<pre>
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
</pre>
<p>3. Start WLAN</p>
<pre>
# ifconfig wlan0 up
# iwconfig wlan0 essid mywireless
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
# dhcpcd wlan0
</pre>
<p>4. Check wlan0</p>
<pre>
# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:22:FA:5F:7F:66
          inet addr:192.168.1.122  Bcast:255.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:576  Metric:1
          RX packets:73529 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59186 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:39228330 (37.4 Mb)  TX bytes:6663024 (6.3 Mb)
</pre>
<p>然后ping外面ping不通，发现是从eth0 ping出去的，执行/etc/rc.d/network stop把eth0上的网络关掉就可以了.</p>
<p>@————————————————我是泪的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;@</p>
<p>在<a href="http://streamedfish.org">SteamedFish</a>童鞋的教导下，我学习了netcfg的用法，深深地认识到了自己的错误。。。。</p>
<p>1. 创建netcfg profile</p>
<pre>
# cp /etc/network.d/examples/wireless-wpa /etc/network.d/
# vim /etc/network.d
CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection'
INTERFACE='wlan0'
SECURITY='wpa'
ESSID='mywireless'
KEY='secretpassphrase'
IP='dhcp'
# move /etc/network.d/wireless-wpa /etc/network.d/[profilename]
</pre>
<p>2. Start network</p>
<pre>
# netcfg [profilename]
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=wyxFcXk4JOw:Eg-jqZrCQCA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=wyxFcXk4JOw:Eg-jqZrCQCA:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=wyxFcXk4JOw:Eg-jqZrCQCA:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=wyxFcXk4JOw:Eg-jqZrCQCA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=wyxFcXk4JOw:Eg-jqZrCQCA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=wyxFcXk4JOw:Eg-jqZrCQCA:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=wyxFcXk4JOw:Eg-jqZrCQCA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 335实验室有wifi，上次以为是wep加密，结果弄了半天都invalid arguments，这次仔细看了下原来是WPA，参照ArchWiki搞定。
1. Check wpa_supplicant

# wpa_supplicant
...
drivers:
  wext = Linux wireless extensions (generic)
  nl80211 = Linux nl80211/cfg80211
  wired = wpa_supplicant wired Ethernet driver

2. Configure WPA with ssid(here mywireless) and key(here secretpassphrase)

# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original
# wpa_passphrase mywireless "secretpassphrase" &gt; /etc/wpa_supplicant.conf
# vim /etc/wpa_supplicant.conf
network={
        ssid="mywireless"
   [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/03/29/wifi-setup-under-archlinux/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://pipitu.org/2010/03/29/wifi-setup-under-archlinux/</feedburner:origLink></item><item><title>Nexus One 飘洋过海入手记</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/OMrz16kJZ48/</link><category>人生</category><category>android</category><category>DIY</category><category>google</category><category>n1</category><category>NexusOne</category><category>onenow</category><category>phone</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Tue, 09 Mar 2010 21:10:52 PST</pubDate><guid isPermaLink="false">http://pipitu.org/?p=159</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 592<br/><p>觊觎小机器人系统很久了，这次主要在Hero和Nexus One之间纠结了一把，最后选择Nexus One的原因，一是现在Hero翻新机很多了，去实体店买怕被骗（基于偶的属性，这个还是很可能发生的……），而在Google web store下单订n1就不用担心这个了，二是Nexus One整体配置比Hero高了一大截，价格上多了1K，性价比来说还是选Nexus One，看Desire的价格就知道了。虽然n1好像也爆出了很多问题，俺们本着对Google品牌的信赖和Linus大神的推介，狠狠心，咬咬牙，下手了=w=</p>
<p>能省则省，参照N1 DIY购买攻略，一步一步完成下单过程。</p>
<p><strong>Google Checkout记录</strong></p>
<ul>
<li> Feb 27  You placed an order with Google Phone Webstore on Feb 27</li>
<li> Feb 28  Google Phone Webstore charged your VISA for $529.00. &#8220;GOOGLE *Nexus One&#8221; will appear on your billing statement.</li>
<li> Feb 28  Google Phone Webstore has added new tracking data to your order.</li>
<li> Google Phone Webstore shipped your order.</li>
</ul>
<p><strong></p>
<p>Fedex 追踪</strong><br />
<a href="http://www.flickr.com/photos/pipitu/4421812666/" title="Flickr 上 pipitu 的 fedex tracking"><img src="http://farm5.static.flickr.com/4017/4421812666_1c9ce04a03_o.png" width="712" height="331" alt="fedex tracking" /></a></p>
<p><strong>OneNow 追踪</strong></p>
<ul>
<li><strong>New waybill No.:顺丰 &#8211; ********</strong>*</li>
<li>2010/3/6 8:48:50 	Departing from Portland warehouse</li>
<li>2010/3/9 11:57:50 	Arrive Beijing, Customs clearance</li>
<li>2010/3/9 16:12:09 	Out for delivery</li>
</ul>
<p>估计他们没有小盒子了，给我弄的这个盒子比较大，算体积重量是3kg，比别人的1.5kg多了1.5kg，结果多花了20刀的运费。用的是招行young卡，总共花费人民币(529+51.74)*汇率*(1+1.5%)，差不多4000多一点。就是这样还是比代购要便宜的。<br />
今天早上九点多拿到手，刚刚充电完毕，哈哈。下面奉送开箱照数枚～<br />
<a href="http://www.flickr.com/photos/pipitu/4421851222/" title="Flickr 上 pipitu 的 图像0220"><img src="http://farm5.static.flickr.com/4068/4421851222_5da5728144_m.jpg" width="180" height="240" alt="图像0220" /></a><a href="http://www.flickr.com/photos/pipitu/4421851114/" title="Flickr 上 pipitu 的 图像0219"><img src="http://farm3.static.flickr.com/2706/4421851114_9bcc24267d_m.jpg" width="180" height="240" alt="图像0219" /></a><br />
<a href="http://www.flickr.com/photos/pipitu/4421085009/" title="Flickr 上 pipitu 的 图像0215"><img src="http://farm5.static.flickr.com/4049/4421085009_c9ffa1a2a1_m.jpg" width="180" height="240" alt="图像0215" /></a><a href="http://www.flickr.com/photos/pipitu/4421085059/" title="Flickr 上 pipitu 的 图像0216"><img src="http://farm5.static.flickr.com/4037/4421085059_eb6fbdceeb_m.jpg" width="180" height="240" alt="图像0216" /></a><br />
<a href="http://www.flickr.com/photos/pipitu/4421850968/" title="Flickr 上 pipitu 的 图像0217"><img src="http://farm5.static.flickr.com/4043/4421850968_7308295c7c_m.jpg" width="180" height="240" alt="图像0217" /></a><a href="http://www.flickr.com/photos/pipitu/4421085209/" title="Flickr 上 pipitu 的 图像0218"><img src="http://farm5.static.flickr.com/4007/4421085209_cfc6b1e40b_m.jpg" width="180" height="240" alt="图像0218" /></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=OMrz16kJZ48:xxf5V1gS_ko:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=OMrz16kJZ48:xxf5V1gS_ko:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=OMrz16kJZ48:xxf5V1gS_ko:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=OMrz16kJZ48:xxf5V1gS_ko:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=OMrz16kJZ48:xxf5V1gS_ko:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=OMrz16kJZ48:xxf5V1gS_ko:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=OMrz16kJZ48:xxf5V1gS_ko:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 592觊觎小机器人系统很久了，这次主要在Hero和Nexus One之间纠结了一把，最后选择Nexus One的原因，一是现在Hero翻新机很多了，去实体店买怕被骗（基于偶的属性，这个还是很可能发生的……），而在Google web store下单订n1就不用担心这个了，二是Nexus One整体配置比Hero高了一大截，价格上多了1K，性价比来说还是选Nexus One，看Desire的价格就知道了。虽然n1好像也爆出了很多问题，俺们本着对Google品牌的信赖和Linus大神的推介，狠狠心，咬咬牙，下手了=w=
能省则省，参照N1 DIY购买攻略，一步一步完成下单过程。
Google Checkout记录

 Feb 27  You placed an order with Google Phone Webstore on Feb 27
 Feb 28  Google Phone Webstore charged your VISA for $529.00. &amp;#8220;GOOGLE *Nexus One&amp;#8221; will appear on your billing statement.
 Feb 28  Google Phone Webstore has added new [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/03/10/nexus-one-%e9%a3%98%e6%b4%8b%e8%bf%87%e6%b5%b7%e5%85%a5%e6%89%8b%e8%ae%b0/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">22</slash:comments><feedburner:origLink>http://pipitu.org/2010/03/10/nexus-one-%e9%a3%98%e6%b4%8b%e8%bf%87%e6%b5%b7%e5%85%a5%e6%89%8b%e8%ae%b0/</feedburner:origLink></item><item><title>Linux下教育网访问国外网站</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/MsxQJW3fSvI/</link><category>技术</category><category>ipv6</category><category>Linux</category><category>Opera</category><category>sixxs.org</category><category>代理</category><category>国外网</category><category>搜狗</category><category>教育网</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Sat, 27 Feb 2010 16:35:04 PST</pubDate><guid isPermaLink="false">http://pipitu.org/?p=124</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 378<br/><p>开学了，又回到了教育网，访问国外网站的问题依然头疼。下面介绍几种在Linux下轻松访问国外网的方法。</p>
<ol>
<li>
<h4><a href="http://ie.sogou.com">搜狗浏览器</a></h4>
<p>最广为使用的就是搜狗浏览器的全网加速功能了，当然，在Linux下必须要使用wine运行搜狗浏览器。然后设置代理服务器为127.0.0.1:8081就可以使用搜狗浏览器的教育网代理来访问国外网站了。<br />
该方法的优点是支持https加密连接，缺点是速度慢，天生不兼容于Linux环境，容易死机等等。</li>
<li>
<h4>ipv6 + google cache</h4>
<p>教育网默认是开通了ipv6的，Linux下ipv6配置见 <a href="http://tldp.org/HOWTO/Linux+IPv6-HOWTO/ ">Linux IPV6 HowTo</a>。使用<a href="http://ipv6.google.com">http://ipv6.google.com</a>访问google，搜索结果的页面可以直接从网页快照中读取，在搜索一些问题的答案时十分方便。</li>
<li>
<h4>ipv6 gateway &#8212; sixxs.org</h4>
<p>配置好ipv6后即可直接访问<a href="http://www.sixxs.net/gateway/">sixxs.net/gateway</a>,找到How to use IPV6 gateway，在此处<br />
<a title="Flickr 上 pipitu 的 sixxs ipv6 gateway" href="http://www.flickr.com/photos/pipitu/4393650598/"><img src="http://farm5.static.flickr.com/4059/4393650598_478abf006a_o.png" alt="sixxs ipv6 gateway" width="468" height="54" /></a><br />
输入要访问的网址即可。需要注意的是该方法并不支持https。</li>
<li>
<h4>Opera Turbo</h4>
<p><a href="http://www.opera.com/browser/">Opera10.10</a>及以后版本开始提供Opera Turbo功能。 无论是教育网还是联通电信，Opera Turbo 都通过服务器压缩提速，加快网络体验。由于国内有Opera Turbo服务器，因此开启Turbo之后可以直接访问国外网站。开启方法是点击左下方的Opera Turbo图标，设置Turbo状态为On。<br />
<a title="Flickr 上 pipitu 的 opera turbo" href="http://www.flickr.com/photos/pipitu/4392882527/"><img src="http://farm5.static.flickr.com/4046/4392882527_4a20f55379_o.png" alt="opera turbo" width="527" height="547" /></a><br />
由于对图片进行压缩，因此在加快浏览速度的同时图片分辨率会变小，此时右击图片，选择Reload Image in Full Quality即可浏览原始图片了。<br />
此方法由于采用Turbo技术压缩数据，访问速度非常快，但遗憾的是也不支持https。</li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=MsxQJW3fSvI:bvnPf_2E210:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=MsxQJW3fSvI:bvnPf_2E210:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=MsxQJW3fSvI:bvnPf_2E210:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=MsxQJW3fSvI:bvnPf_2E210:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=MsxQJW3fSvI:bvnPf_2E210:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=MsxQJW3fSvI:bvnPf_2E210:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=MsxQJW3fSvI:bvnPf_2E210:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 378开学了，又回到了教育网，访问国外网站的问题依然头疼。下面介绍几种在Linux下轻松访问国外网的方法。


搜狗浏览器
最广为使用的就是搜狗浏览器的全网加速功能了，当然，在Linux下必须要使用wine运行搜狗浏览器。然后设置代理服务器为127.0.0.1:8081就可以使用搜狗浏览器的教育网代理来访问国外网站了。
该方法的优点是支持https加密连接，缺点是速度慢，天生不兼容于Linux环境，容易死机等等。

ipv6 + google cache
教育网默认是开通了ipv6的，Linux下ipv6配置见 Linux IPV6 HowTo。使用http://ipv6.google.com访问google，搜索结果的页面可以直接从网页快照中读取，在搜索一些问题的答案时十分方便。

ipv6 gateway &amp;#8212; sixxs.org
配置好ipv6后即可直接访问sixxs.net/gateway,找到How to use IPV6 gateway，在此处

输入要访问的网址即可。需要注意的是该方法并不支持https。

Opera Turbo
Opera10.10及以后版本开始提供Opera Turbo功能。 无论是教育网还是联通电信，Opera Turbo 都通过服务器压缩提速，加快网络体验。由于国内有Opera Turbo服务器，因此开启Turbo之后可以直接访问国外网站。开启方法是点击左下方的Opera Turbo图标，设置Turbo状态为On。

由于对图片进行压缩，因此在加快浏览速度的同时图片分辨率会变小，此时右击图片，选择Reload Image in Full Quality即可浏览原始图片了。
此方法由于采用Turbo技术压缩数据，访问速度非常快，但遗憾的是也不支持https。</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/02/28/linux-edu-international/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://pipitu.org/2010/02/28/linux-edu-international/</feedburner:origLink></item><item><title>List performance: Python vs Java</title><link>http://feedproxy.google.com/~r/pipitu_blog/~3/hUmyNeXQbqI/</link><category>技术</category><category>Java</category><category>list</category><category>performance</category><category>Python</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pipitu</dc:creator><pubDate>Sat, 20 Feb 2010 02:57:04 PST</pubDate><guid isPermaLink="false">http://pipitu.org/?p=74</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Number of View: 502<br/><p>这篇post的主要由来是某次算法作业误用Python做了无用功，性能完全达不到要求，后来换用Java才搞定。作业是一个经典的算法问题：求最近点对，要求的输入数量级达到百万。Java做出来的结果大约是5秒左右，Python的话就完全废了，原因是其中涉及到庞大的list的new操作。</p>
<h4>Python list VS Java array</h4>
<p>首先做一个简单的实验，分别计算用Python和Java新建一个list的时间。</p>
<p>Python代码：</p>
<pre name="code" class="python">li = []
for i in range(size):
    li.append(0)
</pre>
<p>Java代码:</p>
<pre name="code" class="python">int[] li = new int[size];
</pre>
<p>结果对比如下：<br />

<table id="wp-table-reloaded-id-1-no-2" class="wp-table-reloaded wp-table-reloaded-id-1">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">size</th><th class="column-2">Python(ms)</th><th class="column-3">Java(ms)</th>
	</tr>
</thead>
<tbody class="row-hover">
	<tr class="row-2 even">
		<td class="column-1">10</td><td class="column-2">0.012</td><td class="column-3">0.002</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">100</td><td class="column-2">0.045</td><td class="column-3">0.002</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">1000</td><td class="column-2">0.347</td><td class="column-3">0.005</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">10000</td><td class="column-2">4.011</td><td class="column-3">0.034</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">100000</td><td class="column-2">34.541</td><td class="column-3">0.304</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">1000000</td><td class="column-2">353.420</td><td class="column-3">3.749</td>
	</tr>
</tbody>
</table>
<br />
二者的时间复杂度都是O(n)，但在常数上相差两个数量级。究其原因，<br />
The time needed to append an item to the list is “amortized constant”; whenever the list needs to allocate more memory, it allocates room for a few items more than it actually needs, to avoid having to reallocate on each call (this assumes that the memory allocator is fast; for huge lists, the allocation overhead may push the behaviour towards O(n*n)).<br />
也就是说，Python中list的append操作仅当空间不够时才另分配一块新的空间，根据平摊分析(Amortized Analysis)原理,创建一个长度为n的list的时间为c*n（c为平摊常数）。而Java的数组的new操作是一次分配一整快空间，这就不难解释为何两者的性能差异如此之大了。</p>
<h4>For loop vs List comprehension</h4>
<p>实际上，Python提供了另一种更快地创建list的方法：List Comprehension。List comprehensions run a bit faster than equivalent for-loops (unless you&#8217;re just going to throw away the result).</p>
<pre name="code" class="python">li = [ 0 for i in range(size) ]
</pre>

<table id="wp-table-reloaded-id-2-no-2" class="wp-table-reloaded wp-table-reloaded-id-2">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">size</th><th class="column-2">append(ms)</th><th class="column-3">list comprehension(ms)</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">10</td><td class="column-2">0.012</td><td class="column-3">0.009</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">100</td><td class="column-2">0.045</td><td class="column-3">0.026</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">1000</td><td class="column-2">0.347</td><td class="column-3">0.214</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">10000</td><td class="column-2">4.011</td><td class="column-3">2.228</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">100000</td><td class="column-2">34.541</td><td class="column-3">21.701</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">1000000</td><td class="column-2">353.420</td><td class="column-3">221.127</td>
	</tr>
</tbody>
</table>

<h4>Python list vs Java Vector</h4>
<p>Python的list与Java的Vector有些类似，再做一个对比：</p>
<pre name="code" class="python">
Vector list = new Vector();
for(int i=0;i&lt;size;i++)
    list.add(i)
</pre>
<p>
<table id="wp-table-reloaded-id-3-no-2" class="wp-table-reloaded wp-table-reloaded-id-3">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">size</th><th class="column-2">Python list(ms)</th><th class="column-3">Java Vector(ms)</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">10</td><td class="column-2">0.012</td><td class="column-3">0.741</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">100</td><td class="column-2">0.045</td><td class="column-3">0.778</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">1000</td><td class="column-2">0.347</td><td class="column-3">1.1108</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">10000</td><td class="column-2">4.011</td><td class="column-3">3.6601</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">100000</td><td class="column-2">34.541</td><td class="column-3">21.008</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">1000000</td><td class="column-2">353.420</td><td class="column-3">81.820</td>
	</tr>
</tbody>
</table>
<br />
在默认构造函数中，Vector的初始存储能力是10个元素，如果新元素加入时存储能力不足，则以后存储能力每次加倍。每次扩展存储能力时，所有现有的元素都要复制到新的存储空间之中。add操作有可能做了额外的优化，因为时间复杂度曲线并非纯线性的。</p>
<p>总之，在注重性能并需要多次创建较大的list的应用中，Python并不适用。</p>
<p>注：实验环境：<br />
软件：Archlinux(Kernel2.6.32)+Python2.6.4<br />
硬件：CPU 2Ghz*2，RAM 2GB</p>
<p>Refrence:<br />
1. <a href="http://effbot.org/zone/python-list.htm">An Introduction to Python Lists</a><br />
2. <a href="http://wiki.python.org/moin/PythonSpeed/PerformanceTips">PythonSpeed/PerformanceTips</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://pipitu.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=hUmyNeXQbqI:ayzl-nuPn-s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=hUmyNeXQbqI:ayzl-nuPn-s:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=hUmyNeXQbqI:ayzl-nuPn-s:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=hUmyNeXQbqI:ayzl-nuPn-s:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?i=hUmyNeXQbqI:ayzl-nuPn-s:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=hUmyNeXQbqI:ayzl-nuPn-s:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/pipitu_blog?a=hUmyNeXQbqI:ayzl-nuPn-s:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/pipitu_blog?d=qj6IDK7rITs" border="0"></img></a>
</div>]]></content:encoded><description>Number of View: 502这篇post的主要由来是某次算法作业误用Python做了无用功，性能完全达不到要求，后来换用Java才搞定。作业是一个经典的算法问题：求最近点对，要求的输入数量级达到百万。Java做出来的结果大约是5秒左右，Python的话就完全废了，原因是其中涉及到庞大的list的new操作。
Python list VS Java array
首先做一个简单的实验，分别计算用Python和Java新建一个list的时间。
Python代码：
li = []
for i in range(size):
    li.append(0)

Java代码:
int[] li = new int[size];

结果对比如下：



	
		sizePython(ms)Java(ms)
	


	
		100.0120.002
	
	
		1000.0450.002
	
	
		10000.3470.005
	
	
		100004.0110.034
	
	
		10000034.5410.304
	
	
		1000000353.4203.749
	



二者的时间复杂度都是O(n)，但在常数上相差两个数量级。究其原因，
The time needed to append an item to the list is “amortized constant”; whenever the list needs to allocate more memory, it allocates room for a few items more than it actually needs, to avoid [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pipitu.org/2010/02/20/list-performance-python-vs-java/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">12</slash:comments><feedburner:origLink>http://pipitu.org/2010/02/20/list-performance-python-vs-java/</feedburner:origLink></item></channel></rss>
