<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Use You Imagination</title>
	<atom:link href="http://iveney.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iveney.wordpress.com</link>
	<description>Programming, Math, Thoughts, Buzz</description>
	<lastBuildDate>Fri, 23 Dec 2011 07:56:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iveney.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Use You Imagination</title>
		<link>http://iveney.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iveney.wordpress.com/osd.xml" title="Use You Imagination" />
	<atom:link rel='hub' href='http://iveney.wordpress.com/?pushpress=hub'/>
		<item>
		<title>三分鐘熱度?</title>
		<link>http://iveney.wordpress.com/2011/12/23/%e4%b8%89%e5%88%86%e9%90%98%e7%86%b1%e5%ba%a6/</link>
		<comments>http://iveney.wordpress.com/2011/12/23/%e4%b8%89%e5%88%86%e9%90%98%e7%86%b1%e5%ba%a6/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 07:56:06 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/12/23/%e4%b8%89%e5%88%86%e9%90%98%e7%86%b1%e5%ba%a6/</guid>
		<description><![CDATA[今晚與一眾人玩三國殺，水平很菜，玩得一般。主要是興趣不大，一直沒有研究，連哪個武將作甚都記不住。 按道理來說，這種 board game 是比較合我胃口的：做工精美，人物豐富，老少咸宜。但不知怎的就是提不起興趣去玩好。 忽然一驚，以前的自己對這種東西可是很著迷的，睡覺想，上課想，但現在，竟然不 fancy 了。 突然覺得以前大人所說的三分鐘熱度，不是什麼壞東西。世上的東西那麼多，值得研究的千千萬，可以學習的萬萬千。三分鐘熱度，說明你能對一樣東西提起興趣；三分鐘熱度，不至於讓你以生之有涯，去花在學之無涯。最重要的，還是保持對萬事萬物的好奇之心，自己覺得喜歡的，大可不必在意旁人的眼光，而自己決定是否要花時間在上面。沉迷於一樣東西的感覺也是很好很妙的，它可以讓你廢寢忘食，它可以讓你如痴如醉。即使時間很短，但事半功倍，往往效率很高地能在很短時間內達到業餘的水平。最後，把自己的才智與時間花在有興趣的東西上，豈不妙哉？ 三分鐘熱度，可以保持人的敏感性。這樣才能多嘗試不同事物，最終找到不是“三分鐘熱度”而是三年，三十年熱度的東西的幾率也就大大增加了，興趣也就自然廣泛。 希望我繼續多一點三分鐘熱度。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=357&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>今晚與一眾人玩三國殺，水平很菜，玩得一般。主要是興趣不大，一直沒有研究，連哪個武將作甚都記不住。</p>
<p>按道理來說，這種 board game 是比較合我胃口的：做工精美，人物豐富，老少咸宜。但不知怎的就是提不起興趣去玩好。</p>
<p>忽然一驚，以前的自己對這種東西可是很著迷的，睡覺想，上課想，但現在，竟然不 fancy 了。</p>
<p>突然覺得以前大人所說的三分鐘熱度，不是什麼壞東西。世上的東西那麼多，值得研究的千千萬，可以學習的萬萬千。三分鐘熱度，說明你能對一樣東西提起興趣；三分鐘熱度，不至於讓你以生之有涯，去花在學之無涯。最重要的，還是保持對萬事萬物的好奇之心，自己覺得喜歡的，大可不必在意旁人的眼光，而自己決定是否要花時間在上面。沉迷於一樣東西的感覺也是很好很妙的，它可以讓你廢寢忘食，它可以讓你如痴如醉。即使時間很短，但事半功倍，往往效率很高地能在很短時間內達到業餘的水平。最後，把自己的才智與時間花在有興趣的東西上，豈不妙哉？</p>
<p>三分鐘熱度，可以保持人的敏感性。這樣才能多嘗試不同事物，最終找到不是“三分鐘熱度”而是三年，三十年熱度的東西的幾率也就大大增加了，興趣也就自然廣泛。</p>
<p>希望我繼續多一點三分鐘熱度。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=357&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/12/23/%e4%b8%89%e5%88%86%e9%90%98%e7%86%b1%e5%ba%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>Applescript to export your iPhoto albums according to the hierachy</title>
		<link>http://iveney.wordpress.com/2011/12/08/applescript-to-export-your-iphoto-albums-according-to-the-hierachy/</link>
		<comments>http://iveney.wordpress.com/2011/12/08/applescript-to-export-your-iphoto-albums-according-to-the-hierachy/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 04:53:26 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/?p=355</guid>
		<description><![CDATA[iPhoto has one thing that drives me nuts: one cannot export photos in folder/album while keeping the hierarchy! This is very useful when your want to export them to some external device, say, a digital photo frame. I did some search and found that people are using some cumbersome trick, i.e., to batch rename the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=355&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://iveney.files.wordpress.com/2011/12/image.png"><img src="http://iveney.files.wordpress.com/2011/12/image.png?w=450&#038;h=378" alt="" title="image" width="450" height="378" class="alignnone size-full wp-image-356" /></a></p>
<p>iPhoto has one thing that drives me nuts: one cannot export photos in folder/album while keeping the hierarchy!<br />
This is very useful when your want to export them to some external device, say, a digital photo frame.</p>
<p>I did some search and found that people are using some cumbersome trick, i.e., to batch rename the photos with prefix of the event, export, and then move the photos with the same prefix into folders with the prefixes. This is not so elegant because people may want to give meaningful name the photos and this will certainly destroy it.</p>
<p>So I wrote <a href="http://d.pr/EZeL">this</a> little script to make life easier. Extract it and drag to ~/Library/Services. This will add it as an service of iPhoto. Now you can just select an album and choose</p>
<p>&#8216;iPhoto -&gt; Service -&gt; Export Album&#8217;</p>
<p>then select a folder to export to. Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=355&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/12/08/applescript-to-export-your-iphoto-albums-according-to-the-hierachy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>

		<media:content url="http://iveney.files.wordpress.com/2011/12/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>蛋疼了，剛發現 GFW 還是雙向的</title>
		<link>http://iveney.wordpress.com/2011/11/06/%e8%9b%8b%e7%96%bc%e4%ba%86%ef%bc%8c%e5%89%9b%e7%99%bc%e7%8f%be-gfw-%e9%82%84%e6%98%af%e9%9b%99%e5%90%91%e7%9a%84/</link>
		<comments>http://iveney.wordpress.com/2011/11/06/%e8%9b%8b%e7%96%bc%e4%ba%86%ef%bc%8c%e5%89%9b%e7%99%bc%e7%8f%be-gfw-%e9%82%84%e6%98%af%e9%9b%99%e5%90%91%e7%9a%84/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 05:36:36 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/11/06/%e8%9b%8b%e7%96%bc%e4%ba%86%ef%bc%8c%e5%89%9b%e7%99%bc%e7%8f%be-gfw-%e9%82%84%e6%98%af%e9%9b%99%e5%90%91%e7%9a%84/</guid>
		<description><![CDATA[最近訪問 dapenti.com 一直鏈接被重置 (connection refused). 然後做了個測試： 1. dig 查找 dapenti.com 的 IP 為 61.147.103.165 2. ping 可以通 3. wget 61.147.103.165 得到完整的首頁，此時用 IP 在瀏覽器可正常訪問。 4. wget dapenti.com，鏈接被重置。瀏覽器用 IP 也失效。 完整的 log 在這裡：https://gist.github.com/1344235<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=354&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>最近訪問 <a href="http://dapenti.com">dapenti.com</a> 一直鏈接被重置 (connection refused).<br />
然後做了個測試：<br />
1. dig 查找 <a href="http://dapenti.com">dapenti.com</a> 的 IP 為 61.147.103.165<br />
2. ping 可以通<br />
3. wget 61.147.103.165 得到完整的首頁，此時用 IP 在瀏覽器可正常訪問。<br />
4. wget <a href="http://dapenti.com">dapenti.com</a>，鏈接被重置。瀏覽器用 IP 也失效。</p>
<p>完整的 log 在這裡：<a href="https://gist.github.com/1344235">https://gist.github.com/1344235</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/354/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=354&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/11/06/%e8%9b%8b%e7%96%bc%e4%ba%86%ef%bc%8c%e5%89%9b%e7%99%bc%e7%8f%be-gfw-%e9%82%84%e6%98%af%e9%9b%99%e5%90%91%e7%9a%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>最近的一些事</title>
		<link>http://iveney.wordpress.com/2011/10/13/%e6%9c%80%e8%bf%91%e7%9a%84%e4%b8%80%e4%ba%9b%e4%ba%8b/</link>
		<comments>http://iveney.wordpress.com/2011/10/13/%e6%9c%80%e8%bf%91%e7%9a%84%e4%b8%80%e4%ba%9b%e4%ba%8b/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 19:01:32 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/10/13/%e6%9c%80%e8%bf%91%e7%9a%84%e4%b8%80%e4%ba%9b%e4%ba%8b/</guid>
		<description><![CDATA[最近發生的事不少，稍微記錄一下，感慨。 大事： Apple CEO Jobs 辭世 C 語言創始人之一，UNIX 创造者之一 Dennis Ritchie 辭世 以上兩個都不多說了，無法盡言。 瑣碎： 今年忘記關注圖靈獎了。後來發覺 Leslie Valiant 是得獎者。 剛好在上 Machine Learning，有學到他提出的 PAC, 以及一篇影響深遠的paper &#8220;A theory of learnable&#8221;. 之前在做 approximation algorithm 的時候，也拜讀過他關於 network reliability 與 counting 的複雜度文章。 一間 local guitar store 促銷，入了一把 American Standard Stratocaster，我最喜歡的 3-color sunburst! 訂了回國機票。 (完)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=353&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>最近發生的事不少，稍微記錄一下，感慨。</p>
<p>大事：<br />
Apple CEO Jobs 辭世<br />
C 語言創始人之一，UNIX 创造者之一 Dennis Ritchie 辭世<br />
以上兩個都不多說了，無法盡言。</p>
<p>瑣碎：<br />
今年忘記關注圖靈獎了。後來發覺 Leslie Valiant 是得獎者。<br />
剛好在上 Machine Learning，有學到他提出的 PAC, 以及一篇影響深遠的paper &#8220;A theory of learnable&#8221;.<br />
之前在做 approximation algorithm 的時候，也拜讀過他關於 network reliability 與 counting 的複雜度文章。</p>
<p>一間 local guitar store 促銷，入了一把 American Standard Stratocaster，我最喜歡的 3-color sunburst!</p>
<p>訂了回國機票。</p>
<p>(完)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=353&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/10/13/%e6%9c%80%e8%bf%91%e7%9a%84%e4%b8%80%e4%ba%9b%e4%ba%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;哥哥，我想你了&#8221;</title>
		<link>http://iveney.wordpress.com/2011/09/21/%e5%93%a5%e5%93%a5%ef%bc%8c%e6%88%91%e6%83%b3%e4%bd%a0%e4%ba%86/</link>
		<comments>http://iveney.wordpress.com/2011/09/21/%e5%93%a5%e5%93%a5%ef%bc%8c%e6%88%91%e6%83%b3%e4%bd%a0%e4%ba%86/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 19:32:52 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/09/21/%e5%93%a5%e5%93%a5%ef%bc%8c%e6%88%91%e6%83%b3%e4%bd%a0%e4%ba%86/</guid>
		<description><![CDATA[家裡能上網了，想起好幾天沒跟家裡聯系，怕父母在 QQ 上留言給我，於是便登陸了半個月沒上過的 QQ。 他們沒留言給我，倒是我表弟留言給我，說已經在大學城上學了。突然覺得時間過得很快，當年我在北中上學的時候，他還在小學。現在他已然從北中畢業並且上大學了。 隨便說了幾句話，由於他有事要走了，於是便準備道別。最後他說，“哥哥，我想你了”。 雖然是很普通的一句話，不過由於從一個男性口中發出，不由得讓我感到很肉麻…… 但是同時也感到很溫馨。 父母從來都不是善於表達感情的人，潛移默化，我甚至也沒對他們說過一句“想你”的話，更無論其他人。 也許表弟比我更善於表露感情罷了。但換過來想，如果這句話由我口中冒出，也許那已經是我情感近乎崩潰的時候，說出這句話的時候，必然正是淚流滿面。 來美國不知不覺已經一年有餘，果然是人越大越心煩，因為要處理的事情越來越多。特別是在異國他鄉，事無鉅細，都要自己一人包辦。 房租、電話、銀行、網絡、水電、油費、騎車、課程、研究，單單是 name 已經可以 name a few，繼續 enumerate 下去可以嘮叨一天。 於是忙得甚至沒有時間去寫篇 blog，於是忙得週末從來也不出門，於是忙得一星期也沒有彈一次琴打一次球，於是忙得一星期也沒有關心家人一次。 一直很怕跟人 keep in touch 會浪費時間，這也的確如此。我相信五分鐘已經可以讓對方感覺到你在關心他，但理想狀況往往達不到，往往需要半個小時才能把近況說清楚。 而家人與朋友那麼一大把，實在很難勻出時間來分給他們。不是我自私，而是實際情況就是這樣的。感覺給家裡電話、視頻已經是我的極限。 所以我的朋友們，不是我我不關心大家，而是家人已經優先了。 於是朋友大概會越來越少罷。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=352&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>家裡能上網了，想起好幾天沒跟家裡聯系，怕父母在 QQ 上留言給我，於是便登陸了半個月沒上過的 QQ。</p>
<p>他們沒留言給我，倒是我表弟留言給我，說已經在大學城上學了。突然覺得時間過得很快，當年我在北中上學的時候，他還在小學。現在他已然從北中畢業並且上大學了。</p>
<p>隨便說了幾句話，由於他有事要走了，於是便準備道別。最後他說，“哥哥，我想你了”。</p>
<p>雖然是很普通的一句話，不過由於從一個男性口中發出，不由得讓我感到很肉麻…… 但是同時也感到很溫馨。</p>
<p>父母從來都不是善於表達感情的人，潛移默化，我甚至也沒對他們說過一句“想你”的話，更無論其他人。</p>
<p>也許表弟比我更善於表露感情罷了。但換過來想，如果這句話由我口中冒出，也許那已經是我情感近乎崩潰的時候，說出這句話的時候，必然正是淚流滿面。</p>
<p>來美國不知不覺已經一年有餘，果然是人越大越心煩，因為要處理的事情越來越多。特別是在異國他鄉，事無鉅細，都要自己一人包辦。</p>
<p>房租、電話、銀行、網絡、水電、油費、騎車、課程、研究，單單是 name 已經可以 name a few，繼續 enumerate 下去可以嘮叨一天。</p>
<p>於是忙得甚至沒有時間去寫篇 blog，於是忙得週末從來也不出門，於是忙得一星期也沒有彈一次琴打一次球，於是忙得一星期也沒有關心家人一次。</p>
<p>一直很怕跟人 keep in touch 會浪費時間，這也的確如此。我相信五分鐘已經可以讓對方感覺到你在關心他，但理想狀況往往達不到，往往需要半個小時才能把近況說清楚。</p>
<p>而家人與朋友那麼一大把，實在很難勻出時間來分給他們。不是我自私，而是實際情況就是這樣的。感覺給家裡電話、視頻已經是我的極限。</p>
<p>所以我的朋友們，不是我我不關心大家，而是家人已經優先了。</p>
<p>於是朋友大概會越來越少罷。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/352/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=352&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/09/21/%e5%93%a5%e5%93%a5%ef%bc%8c%e6%88%91%e6%83%b3%e4%bd%a0%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>Survey on Network Reliability Problem</title>
		<link>http://iveney.wordpress.com/2011/09/08/survey-on-network-reliability-problem/</link>
		<comments>http://iveney.wordpress.com/2011/09/08/survey-on-network-reliability-problem/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 02:04:13 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/09/08/survey-on-network-reliability-problem/</guid>
		<description><![CDATA[The network reliability problem ask one to determine the survival/failure probability of some terminals in a probabilistic network. In particular, the network is given as a graph, either directed or undirected. Each edge is associated with failure (survival) probability q_e (p_e = 1-q_e), which means it will fail (survive) with probability q_e (p_e). The problem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=351&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The network reliability problem ask one to determine the survival/failure probability of some terminals in a probabilistic network. In particular, the network is given as a graph, either directed or undirected. Each edge is associated with failure (survival) probability q_e (p_e = 1-q_e), which means it will fail (survive) with probability q_e (p_e). The problem ask you to compute the failure/survival rate of some terminals. The simplest version is s-t reliability, where the terminal sets contains only two terminals. Other variants include k-terminal and all-terminal reliability. The problem is known to be hard: it is #P-complete. It remains hard even when the graph is directed acyclic with maximum degree three. No computational effective methods exist unless P=NP. Hence people are interested in finding approximation algorithms.</p>
<p>Last semester I wrote an survey for the problem as a project in Approximation Algorithm course. The article introduces three methods for the problem, all of them utilize Monte-Carlo as the basic framework.</p>
<p>1. R. Karp and M. Luby&#8217;s Monte Carlo [Karp and Luby]<br />
R. Karp and M. Luby showed that Monte Carlo algorithm is an FPRAS (Fully polynomial time randomized approximation scheme) when the number of samples are sufficiently small. Furthermore, the number of samples are linear to the ratio of the size of positive samples and size of the sample space. Hence, how to formulate the sample space becomes the most important problem. They proposed several methods, which includes K-separating cuts, paths and cycles, and finally walks. The first two modeling is straightforward and easy to understand, however it utilized some false assumptions. The last one makes the Monte Carlo truly FPRAS. But personally I found it very hard to follow, and impractical.</p>
<p>2. Karger&#8217;s alpha-Minimum Cut method [Karger FPRAS]<br />
I have to say this is an interesting and clever method. First note that the network breaks only when the failure edges are in one of the cuts. He showed that only small cuts are vital when computing the failure probability. Here `small cuts&#8217; can be interpreted as the set of min cuts and `near&#8217; min cuts. In another Karger&#8217;s paper, he showed that these cuts can be found can be found in polynomial time and the number is polynomial [Karger min cut] (very interesting algorithm, highly recommended). Hence, the problem can be reduced to DNF counting:</p>
<p>We assign a boolean variable xe to each edge e, where xe = true if e fails and false otherwise. For the ith small cut c_i, it disconnects the network if and only if all of its edges fail. Let F_i be the conjunction of all x_e, for all e in c_i. Clearly F_i is true if and only if c_i fails. Hence, the event that some small cuts fail can be written as F = disjunction of all F_i. We want to know the probability that F is true, which is clearly the failure probability of the network. Note that F is in disjunctive normal form, and the number of clauses in F is exactly the number of small cuts, which is a polynomial. There is a FPRAS for the DNF counting problem, which also uses Monte-Carlo. It is straight-forward now.</p>
<p>3. Zenklusen&#8217;s FPRAS for s-t reliability problem on acyclic network [Zenklusen]<br />
This is a relatively new result. The basic idea is, in a DAG, one can compute the mean number of intact path between s and t after the failure process. In a highly unreliable network, this number is a good estimate for the s-t reliability. Monte Carlo is used to estimate the ratio between reliability(s,t) and the mean number of intact s-t paths. He showed that the s-t paths can be sampled in linear time.</p>
<p>[Karp and Luby]: Monte-carlo algorithms for the planar multiterminal network reliability problem.<br />
[Karger FPRAS]: A randomized fully polynomial time approximation scheme for the all-terminal network reliability problem.<br />
[Karger min cut]: An O~(n^2) algorithm for minimum cuts.<br />
[Zenklusen]: Combinatorial methods for analyzing network security and reliability</p>
<p>&#8212;-</p>
<p>I decided to release my manuscript from CS598: Approximation Algorithms, which is a survey on network reliability problem. I am not an expert on approximation algorithm, and my writing may not be so great. For any mysterious or unclear part, please refer to the original papers.</p>
<p>The file can be downloaded from <a href="http://dl.dropbox.com/u/3315210/reliability.pdf">here</a>. The password is &#8216;cs598&#8242;. If this document is of any help, please give appropriate citation in your work.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=351&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/09/08/survey-on-network-reliability-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>Suffix tree: an illustration of the algorithm</title>
		<link>http://iveney.wordpress.com/2011/08/31/suffix-tree-an-illustration-of-the-algorithm/</link>
		<comments>http://iveney.wordpress.com/2011/08/31/suffix-tree-an-illustration-of-the-algorithm/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 15:16:48 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/08/31/suffix-tree-an-illustration-of-the-algorithm/</guid>
		<description><![CDATA[I recently did some study on suffix tree, and found Ukkonen&#8217;s linear time online algorithm quite hard to understand. Mark Nelson has a good article about this, however, in my opinion the writing is not so great and some part is confusing. For example, the active point and end point concepts are very important. It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=350&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently did some study on <a href="http://en.wikipedia.org/wiki/Suffix_tree">suffix tree</a>, and found <a href="http://en.wikipedia.org/wiki/Ukkonen%27s_algorithm">Ukkonen&#8217;s</a> linear time online algorithm quite hard to understand. Mark Nelson has a <a href="http://marknelson.us/1996/08/01/suffix-trees/comment-page-3/#comment-373277">good article</a> about this, however, in my opinion the writing is not so great and some part is confusing.</p>
<p>For example, the active point and end point concepts are very important. It is defined as &#8216;the first non-leaf node&#8217;. However it is not actually a node when you are looking at the tree, because there may be some &#8216;implicit nodes&#8217;, which you cannot find anywhere when you draw a tree. Indeed, it should be viewed from the suffix&#8217;s point.</p>
<p>I have to read his source code to completely understand how it works. To better demonstrate, I designed the following example to illustrate the algorithm.<br />
This is how the algorithm works step by step when the input string is &#8216;cacao&#8217;. Hope this helps.</p>
<p><img src="https://img.skitch.com/20110831-esemmwq7yh2ks751s5atwuw39i.png" alt="20110831-esemmwq7yh2ks751s5atwuw39i.png" title="20110831-esemmwq7yh2ks751s5atwuw39i.png" /></p>
<p>Other useful resource include this<a href="http://www.allisons.org/ll/AlgDS/Tree/Suffix/#demoForm"> tutorial</a> and online suffix tree computation form. Here&#8217;s an <a href="http://illya-keeplearning.blogspot.com/2009/06/suffix-trees-java-applet.html">excellent java applet </a>that can generate the suffix tree on the fly. Finally, another<a href="http://www.cise.ufl.edu/~sahni/dsaaj/enrich/c16/suffix.htm"> detailed tutorial </a>is given by Prof Sartaj Sahni, but I found the presentation introduced lots of symbols and quite hard to follow. A<a href="http://www.cs.ucf.edu/~shzhang/Combio10/lec3.pdf"> lecture note </a>from Prof. Shaojie Zhang is written clearly, though not many details given.</p>
<p>Here is some points that I want to clarify about the algorithm and suffix tree, assuming you know how a suffix tree looks like:<br />
- Intuitively, suffix tree is a compressed trie. You can construct it trivially by inserting each suffix one by one into a trie tree, then compress it. However, this takes quadratic time.<br />
- To speed up, people proposed different approach. A little history from wikipedia:</p>
<blockquote><p>  The concept was first introduced as a position tree by Weiner in 1973, which Donald Knuth subsequently characterized as &quot;Algorithm of the Year 1973&quot;. The construction was greatly simplified by McCreight in 1976, and also by Ukkonen in 1995. Ukkonen provided the first online-construction of suffix trees, now known as Ukkonen&#8217;s algorithm, with running time that matched the then fastest algorithms.</p>
</blockquote>
<p>Ukkonen is the easiest to understand and it is on-line. Most people should be using this one.</p>
<p>- The basic idea of the algorithm is, given an string S[1..n], we process the characters one by one. We extend the previously inserted suffix by adding the current processing character to them. For example, suppose we are given &#8216;cacao&#8217;. When we are processing &#8216;o&#8217;, the existing suffix is &#8216;caca&#8217;, &#8216;aca&#8217;, &#8216;ca&#8217; and &#8216;a&#8217;. We want to append &#8216;o&#8217; to each of them.<br />
- For character S[i+1], the current suffices are S[j..i], where j=1..i. In the current tree we trace a path that contains substring S[j..i]. Note that this path may stop at an edge (implicit node), an explicit node or leaf node. There are basically three case when you want to insert a character for suffix S[j..i],<br />
1. There is already a path from the end of S[j..i] that starts with S[i+1], or S[j..i+1] corresponds to a path. We do nothing. This in fact introduce an implicit node.<br />
2. S[j..i] ends at a leaf, simply append S[i+1].<br />
3. No path from the end of S[j..i] starts with S[i+1]. Split the edge at the branching position, and add a new leaf with S[i+1]. Note that this is the ONLY case that will introduce new leaf.<br />
- However, the above method has to go through all suffices at each iteration, still quadratic time.<br />
- The speed up and memory reduction come from the following important observations and techniques:<br />
1. We only have to consider the suffices between the Active Point and End point at each iteration. It can be shown that suffices outside this range are already at leaf nodes, and hence require do nothing (See Case 1). Furthermore, the end point will be the active point at the next iteration.<br />
2. We introduce a suffix pointer for each internal node (non-leaf non-root) node, which points to a node that contains the Longest Proper Suffix of the current suffix. For example, the longest proper suffix of &quot;cacao&quot; is &quot;acao&quot;. With this technique, we don&#8217;t need to search for the node that contains the next suffix from root every time, instead, we jump from the just processed one to the next one, e.g., from &quot;cacao&quot; to &quot;acao&quot;.<br />
3. We don&#8217;t need to actually store the substrings in the nodes, we just need to know the index of the starting and ending characters. Hence, we actually do nothing when encounters Rule #2.<br />
4. We can use hash table to store the edges, which can help inserting, removing and finding edges in constant time. The details can be found in Mark&#8217;s algorithm implementation, and the comparison in the wiki.<br />
- Intuitively, the active point is the first suffix that requires you to do something, that is, when encounters Rule #3. The end point is the first suffix that you should do nothing again, i.e., when we encounters Rule #1 or Rule #2 again when processing the active point during the iteration.<br />
- To avoid a suffix being a prefix of another suffix, the last character in the string must be unique. In general, we can just append a special character that is not in the vocabulary, e.g., the &#8216;$&#8217; used in the example. For example, &#8216;book&#8217; does not need to append since &#8216;k&#8217; is unique, but &#8216;banana&#8217; needs since &#8216;a&#8217; is not unique. In this case, after the algorithm terminates, there will be exactly |S| + 1 leaves in the tree, one for each suffix, or, all the suffices end at leaf!</p>
<p>Important application of suffix tree includes:<br />
- Find a substring P in S in O(|P|) time. Note that other linear algorithm such as KMP requires O(|P|+|S|). When there are multiple Ps, suffix tree is more efficient.<br />
- Find the longest common substring (LCS) between P and S. We can construct a suffix tree for string P#S$, where &#8216;#&#8217; and &#8216;$&#8217; are two characters that are not in the vocabulary. To find the LCS, we traverse the suffix tree and sum up the number of characters visited for each internal node. Then, an internal node that has the largest sum and has at least one leaf node that represents the suffix of P and S, respectively, is the desired node. This can be done in O(|P|+|S|) time. Note that the typical solution, i.e., dynamic programming, requires O(|P||S|) time. This can be extended to a more general case where there are multiple strings S1, S2, &#8230;, Sn. And the runtime is the sum of the lengths of the strings.<br />
- Find the longest palindrome in S. Here is one <a href="http://blog.csdn.net/g9yuayon/article/details/2574781">excellent article in Chinese</a>. The basic idea is, let P be the reverse of S, construct suffix tree for S#P$. Then for each S[i], find the largest Least Common Ancestor of S[i], S[n-i+1] (even length) and S[i+1], S[n-i+1] (odd length). LCA can be done in linear time using Tarjan&#8217;s algorithm.<br />
- Given a set of strings S1, S2, &#8230;, Sn, find all the Si such that Si contains pattern P. This is a typical application in computational biology. The set of strings are gene banks, the pattern is a gene segment. Let T=S1#S2#&#8230;#Sn$. This is called a multiple string suffix tree. To find all the Si that contains P, we walk down from root according to P. If we cannot complete a path that represents P, no string contains P. Otherwise, we will stop at a node N, then from its leaves we can know what strings Si contains P. A special case is that N is a leaf node, which means only one string contains P. To speed up, we can maintain a list of indices of Si for each node, which lists all the Si that are a start point of the suffices in the leaves.<br />
- Refer to <a href="http://www.cise.ufl.edu/~sahni/dsaaj/enrich/c16/suffix.htm#nifty">this</a> and <a href="http://www.cs.ucf.edu/~shzhang/Combio10/lec3.pdf">this</a> for more detail.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=350&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/08/31/suffix-tree-an-illustration-of-the-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>

		<media:content url="https://img.skitch.com/20110831-esemmwq7yh2ks751s5atwuw39i.png" medium="image">
			<media:title type="html">20110831-esemmwq7yh2ks751s5atwuw39i.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Update 关于 Mac OS X 的 filesystem encoding</title>
		<link>http://iveney.wordpress.com/2011/07/25/update-%e5%85%b3%e4%ba%8e-mac-os-x-%e7%9a%84-filesystem-encoding/</link>
		<comments>http://iveney.wordpress.com/2011/07/25/update-%e5%85%b3%e4%ba%8e-mac-os-x-%e7%9a%84-filesystem-encoding/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 17:25:06 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/07/25/update-%e5%85%b3%e4%ba%8e-mac-os-x-%e7%9a%84-filesystem-encoding/</guid>
		<description><![CDATA[跟上一个问题有关。在 stackoverflow 上问了问题，得到了如下答复 [1]： The problem is that MacOS X&#8217;s default filesystem changes all filenames you give it to an unusual normalization form which does not use precomposed characters. 根据 Python unicodedata 的文档 [2]： The Unicode standard defines various normalization forms of a Unicode string, based on the definition of canonical equivalence and compatibility equivalence. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=349&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>跟上一个问题有关。在 stackoverflow 上问了问题，得到了如下答复 [1]：</p>
<blockquote><p> The problem is that MacOS X&#8217;s default filesystem changes all filenames you give it to an unusual normalization form which does not use precomposed characters.</p>
</blockquote>
<p>根据 Python unicodedata 的文档 [2]：</p>
<blockquote><p> The Unicode standard defines various normalization forms of a Unicode string, based on the definition of canonical equivalence and compatibility equivalence. In Unicode, several characters can be expressed in various way. For example, the character U+00C7 (LATIN CAPITAL LETTER C WITH CEDILLA) can also be expressed as the sequence U+0327 (COMBINING CEDILLA) U+0043 (LATIN CAPITAL LETTER C).</p>
</blockquote>
<p>其中的 U+00C7 是 &#8216;Ç&#8217;</p>
<p>对应的 <a href="https://gist.github.com/1103025">python 源代码</a>我也更新了。</p>
<p>请参考：<br />
[1] <a href="http://stackoverflow.com/questions/6803621/how-to-prevent-the-command-line-argument-from-being-encoded/6809703#6809703">http://stackoverflow.com/questions/6803621/how-to-prevent-the-command-line-argument-from-being-encoded/6809703#6809703</a><br />
[2] <a href="http://docs.python.org/library/unicodedata.html#unicodedata.normalize">http://docs.python.org/library/unicodedata.html#unicodedata.normalize</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=349&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/07/25/update-%e5%85%b3%e4%ba%8e-mac-os-x-%e7%9a%84-filesystem-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>Update 重命名 GBK 乱码文件的 Python 脚本</title>
		<link>http://iveney.wordpress.com/2011/07/24/update-%e9%87%8d%e5%91%bd%e5%90%8d-gbk-%e4%b9%b1%e7%a0%81%e6%96%87%e4%bb%b6%e7%9a%84-python-%e8%84%9a%e6%9c%ac/</link>
		<comments>http://iveney.wordpress.com/2011/07/24/update-%e9%87%8d%e5%91%bd%e5%90%8d-gbk-%e4%b9%b1%e7%a0%81%e6%96%87%e4%bb%b6%e7%9a%84-python-%e8%84%9a%e6%9c%ac/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 20:24:31 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/07/24/update-%e9%87%8d%e5%91%bd%e5%90%8d-gbk-%e4%b9%b1%e7%a0%81%e6%96%87%e4%bb%b6%e7%9a%84-python-%e8%84%9a%e6%9c%ac/</guid>
		<description><![CDATA[详细的问题描述请见之前两个帖子: [1] [2] 写了一个重命名乱码文件的 Python 脚本，在这里。 注意在 Mac OS X 下有点问题，看这里。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=348&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>详细的问题描述请见之前两个帖子: <a href="http://iveney.blogspot.com/2011/07/linux-chrome.html">[1]</a> <a href="http://iveney.blogspot.com/2011/07/update-windows-zip-linux.html">[2]</a> 写了一个重命名乱码文件的 Python 脚本，在<a href="https://gist.github.com/1103025">这里</a>。<br />
注意在 Mac OS X 下有点问题，看<a href="http://stackoverflow.com/questions/6803621/how-to-prevent-the-command-line-argument-from-being-encoded/6804090#6804090">这里</a>。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=348&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/07/24/update-%e9%87%8d%e5%91%bd%e5%90%8d-gbk-%e4%b9%b1%e7%a0%81%e6%96%87%e4%bb%b6%e7%9a%84-python-%e8%84%9a%e6%9c%ac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
		<item>
		<title>Update: 关于迅雷离线下载 以及 Windows 的 zip 在 Linux 下乱码</title>
		<link>http://iveney.wordpress.com/2011/07/23/update-%e5%85%b3%e4%ba%8e%e8%bf%85%e9%9b%b7%e7%a6%bb%e7%ba%bf%e4%b8%8b%e8%bd%bd-%e4%bb%a5%e5%8f%8a-windows-%e7%9a%84-zip-%e5%9c%a8-linux-%e4%b8%8b%e4%b9%b1%e7%a0%81/</link>
		<comments>http://iveney.wordpress.com/2011/07/23/update-%e5%85%b3%e4%ba%8e%e8%bf%85%e9%9b%b7%e7%a6%bb%e7%ba%bf%e4%b8%8b%e8%bd%bd-%e4%bb%a5%e5%8f%8a-windows-%e7%9a%84-zip-%e5%9c%a8-linux-%e4%b8%8b%e4%b9%b1%e7%a0%81/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 22:35:27 +0000</pubDate>
		<dc:creator>iveney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python encoding charset 乱码]]></category>

		<guid isPermaLink="false">http://iveney.wordpress.com/2011/07/23/update-%e5%85%b3%e4%ba%8e%e8%bf%85%e9%9b%b7%e7%a6%bb%e7%ba%bf%e4%b8%8b%e8%bd%bd-%e4%bb%a5%e5%8f%8a-windows-%e7%9a%84-zip-%e5%9c%a8-linux-%e4%b8%8b%e4%b9%b1%e7%a0%81/</guid>
		<description><![CDATA[现在发觉这两个问题其实是同一个问题，而且找到了更方便简洁的方法去做，主要是利用了 encode(&#8216;latin-1&#8242;) 不对 unicode 做任何编码转换而转换为 ascii 字符串。 代码如下： #!/usr/bin/env python import sys for i in sys.argv[1:]: print i.decode(&#8216;utf8&#8242;).encode(&#8216;latin-1&#8242;).decode(&#8216;gbk&#8217;) PS. 不知道为什么我用网上介绍的 convmv 做不出来。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=347&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>现在发觉这两个问题其实是同一个问题，而且找到了更方便简洁的方法去做，主要是利用了 encode(&#8216;latin-1&#8242;) 不对 unicode 做任何编码转换而转换为 ascii 字符串。<br />
代码如下：</p>
<p>#!/usr/bin/env python<br />
import sys<br />
for i in sys.argv[1:]:<br />
print i.decode(&#8216;utf8&#8242;).encode(&#8216;latin-1&#8242;).decode(&#8216;gbk&#8217;)</p>
<p>PS. 不知道为什么我用网上介绍的 convmv 做不出来。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iveney.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iveney.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iveney.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iveney.wordpress.com&amp;blog=1560297&amp;post=347&amp;subd=iveney&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iveney.wordpress.com/2011/07/23/update-%e5%85%b3%e4%ba%8e%e8%bf%85%e9%9b%b7%e7%a6%bb%e7%ba%bf%e4%b8%8b%e8%bd%bd-%e4%bb%a5%e5%8f%8a-windows-%e7%9a%84-zip-%e5%9c%a8-linux-%e4%b8%8b%e4%b9%b1%e7%a0%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80e1a70c8a1b0aee51846eaed587d753?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">iveney</media:title>
		</media:content>
	</item>
	</channel>
</rss>
