<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5171781364921802522</id><updated>2024-08-30T15:01:47.020+08:00</updated><category term="转载"/><category term="生活杂记"/><category term="Linux"/><category term="计算机技术"/><category term="推荐"/><category term="原创"/><category term="岁月如歌"/><category term="blogger心得"/><category term="Words"/><category term="trackback"/><category term="Programming"/><category term="电影"/><category term="Firefox"/><category term="LaTex"/><category term="TeX"/><category term="广东饮食"/><category term="正则表达式"/><category term="GFW"/><category term="KDE"/><category term="daily blog posting"/><category term="del.icio.us"/><category term="feed"/><category term="lambda"/><category term="literate programming"/><category term="rss"/><category term="scheme"/><category term="space"/><category term="tomcat"/><category term="web技术"/><category term="中国IT巨人"/><category term="搞笑"/><category term="许巍"/><category term="Adblock"/><category term="BlogDay"/><category term="Eclipse"/><category term="Fedora"/><category term="HKUST"/><category term="Java"/><category term="LFS"/><category term="Python"/><category term="QTerm"/><category term="comic"/><category term="comp231"/><category term="experience"/><category term="fun"/><category term="google api"/><category term="pac"/><category term="rmail"/><category term="ruby"/><category term="tor"/><category term="vim"/><category term="wikipedia"/><category term="广告"/><category term="拔丝"/><category term="时间管理"/><category term="春光乍泄"/><category term="校内"/><category term="河蟹"/><category term="清廉战士"/><category term="西米露"/><title type='text'>青春的岁月，我们身不由己</title><subtitle type='html'>有一些希望和理想，总在心中是最美的旋律。&#xa;可如今这真实的生活，却演奏着那纷乱的节奏。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>654</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-8680353048475340333</id><published>2017-08-07T10:01:00.001+08:00</published><updated>2017-08-07T10:01:29.818+08:00</updated><title type='text'>夏威夷遊記（四） 吃吃喝喝</title><content type='html'>&lt;p&gt;網上很多（華人的）遊記都提到一個問題，就是夏威夷的餐廳比較少。但根據我們的10天經歷，卻並不這麼覺得。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vuvhmI&quot;&gt;&lt;/figure&gt;&lt;p&gt;夏威夷有很多日本人，所以非常適合我們——無論是壽司、刺身、定食、Poke，我們都吃了個爽。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vcyuo9&quot; alt=&quot;Omusubi Gaba 傳說中的 Gaba 飯糰。這間小店是日本人開的，yelp 評價非常好。&quot;&gt;&lt;figcaption&gt;Omusubi Gaba 傳說中的 Gaba 飯糰。這間小店是日本人開的，yelp 評價非常好。&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vvKtQq&quot; alt=&quot;最近我們非常喜歡吃的一種東西——Poke。圖爲 South Maui Fish Company 供應的 Poke&quot;&gt;&lt;figcaption&gt;最近我們非常喜歡吃的一種東西——Poke。圖爲 South Maui Fish Company 供應的 Poke&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vcVGTh&quot; alt=&quot;Ramen Nakamura，Waikiki 一間非常火的拉麪店，很正宗。&quot;&gt;&lt;figcaption&gt;Ramen Nakamura，Waikiki 一間非常火的拉麪店，很正宗。&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vuvhTK&quot; alt=&quot;Omakase，亦即『廚師發辦』。攝於位於茂宜基黑的 Koiso Sushi Bar。店面很小，我們去了之後才發覺一般需要預訂。但我們運氣很好剛好有一桌人沒來。來這裏就餐的似乎主要都是日本人，店主和師傅跟他們都是日本交流的。Omakase 大約要 $50-$60 一個人。&quot;&gt;&lt;figcaption&gt;Omakase，亦即『廚師發辦』。攝於位於茂宜基黑的 Koiso Sushi Bar。店面很小，我們去了之後才發覺一般需要預訂。但我們運氣很好剛好有一桌人沒來。來這裏就餐的似乎主要都是日本人，店主和師傅跟他們都是日本交流的。Omakase 大約要 $50-$60 一個人。&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vcBL6S&quot; alt=&quot;Lahaina Fish Co.，食物其實一般。要推薦的是這裏的地理位置，如果能坐到比較靠近窗邊的位置能看着日落享用晚餐。&quot;&gt;&lt;figcaption&gt;Lahaina Fish Co.，食物其實一般。要推薦的是這裏的地理位置，如果能坐到比較靠近窗邊的位置能看着日落享用晚餐。&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vvKuUu&quot; alt=&quot;在酒店做的牛扒。來之前害怕如網上所說害怕飲食成問題，所以專門定的 studio 式旅店，偶爾自己做一下還是健康又省錢的~&quot;&gt;&lt;figcaption&gt;在酒店做的牛扒。來之前害怕如網上所說害怕飲食成問題，所以專門定的 studio 式旅店，偶爾自己做一下還是健康又省錢的~&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;至此，夏威夷遊記系列暫告一段落。下一次估計就是去大島觀看火山國家公園了。&lt;/p&gt; &lt;h2 id=&quot;夏威夷遊記系列&quot;&gt;夏威夷遊記系列&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;http://bit.ly/2ucVour&quot;&gt;夏威夷遊記（一） 瓦胡島&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;http://bit.ly/2vBzHHW&quot;&gt;夏威夷遊記（二） 茂宜島 Road to Hana, Ahihi-Kinau, Lahaina&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;http://bit.ly/2uexMWf&quot;&gt;夏威夷遊記（三） 茂宜島 Molokini Snorkelling&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;http://bit.ly/2uhheBa&quot;&gt;夏威夷遊記（四） 吃吃喝喝&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2uhheBa&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/8680353048475340333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/8680353048475340333?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/8680353048475340333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/8680353048475340333'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/08/blog-post_7.html' title='夏威夷遊記（四） 吃吃喝喝'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6601826085405321482</id><published>2017-08-07T04:02:00.001+08:00</published><updated>2017-08-07T04:02:21.025+08:00</updated><title type='text'>夏威夷遊記（三） 茂宜島 Molokini Snorkelling</title><content type='html'>&lt;p&gt;此文爲夏威夷茂宜島遊記的下部分。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ueCmUd&quot; alt=&quot;Haleakala 上的雲海&quot;&gt;&lt;figcaption&gt;Haleakala 上的雲海&lt;/figcaption&gt;&lt;/figure&gt;&lt;h3 id=&quot;第3天&quot;&gt;第3天&lt;/h3&gt; &lt;p&gt;今天終於到了去大名鼎鼎的月亮灣(molokini)浮潛的日子。月亮灣是 maui 西邊的一個小島，因爲長得像一輪彎月而得名。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vDrhjb&quot; alt=&quot;月亮灣&quot;&gt;&lt;figcaption&gt;月亮灣&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;我們早上6:30am集合，7點就出發。上文提到，這間公司雖然貴點，但是人少出發早；並且提供了一頓早餐和午飯。它們的潛水服和浮潛用具也是包括在內的。&lt;/p&gt; &lt;div class=&quot;embed-video-container&quot;&gt;   &lt;/div&gt; &lt;p&gt;我們一共浮潛了以下幾個地方：&lt;/p&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;月亮灣正面。這是大家都會來的一個地方。水非常清澈，能看到海面幾十米以下的海底。&lt;/li&gt; &lt;li&gt;月亮灣背面。這裏的海浪沿着月亮灣直入海底的懸崖直起直落，彷彿在坐升降機一般。&lt;/li&gt; &lt;li&gt;La Perouse Bay 某處的珊瑚礁。這裏是觀看熔岩入海點的。&lt;/li&gt; &lt;li&gt;看海龜。&lt;/li&gt; &lt;/ol&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ueCnrf&quot; alt=&quot;路線&quot;&gt;&lt;figcaption&gt;路線&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vDDcNQ&quot; alt=&quot;與魚共舞&quot;&gt;&lt;figcaption&gt;與魚共舞&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ueLHvk&quot; alt=&quot;海龜與魚&quot;&gt;&lt;figcaption&gt;海龜與魚&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;embed-video-container&quot;&gt;   &lt;/div&gt; &lt;p&gt;總的來說，這個 trip 是第一次來茂宜的人必來的。比較意外的是，這幾個地方其實魚類的多樣性以及密度其實都不如我們昨天去的 Ahihi Kinau，但是深海浮潛的好處是能看到許多在岸邊看不到的景色，以及非常清晰的能見度。這一次的經歷讓我喜歡上了浮潛，下次如果有機會來的話，會想去&lt;a href=&quot;http://bit.ly/2vDiNbJ&quot;&gt;這裏&lt;/a&gt;提到的 Coral Garden 以及 Black Rock。&lt;/p&gt; &lt;h3 id=&quot;第4天&quot;&gt;第4天&lt;/h3&gt; &lt;p&gt;我們把最後一天的行程定在了哈雷阿卡那山。這裏有一個小插曲。我們本來是打算按照網上的介紹，凌晨3點出發趕去看日出的。但是臨行前晚上，卻不幸地發現從2017年2月起，必須通過 nps 預約才能進入公園。每天只有大概 150 張票。這麼熱門的景點，當然早早就訂完了，包括旅行社。我們只能臨時決定改去看日落。這麼算起來，中午出發就足夠了，所以我們早上先去了浮潛。經過了昨天的經歷，我們今天浮潛有了更多的經驗。並且昨天我們已經幾下了海龜所在的地方，發覺就在我們家不遠處，於是決定再去觀看一回。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ueCoLP&quot; alt=&quot;大概在這兩點就能看到海龜，離岸邊有點距離，不推薦給水性不好或者第一次浮潛的新手&quot;&gt;&lt;figcaption&gt;大概在這兩點就能看到海龜，離岸邊有點距離，不推薦給水性不好或者第一次浮潛的新手&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;中午回來休息後，開始向 Haleakala 出發。這裏是當地人心中的聖山，除了被開發爲旅遊區外，還一直充當着夏威夷本地人進行宗教活動的場所。一路順利，我們很快便到達。進入公園的是一條盤山公路。隨着海拔越來越高，我們看到的景色越來越壯闊。到達山頂時，我們見到了非常漂亮的雲海。但是由於一下提升了3000多米的海拔，我們都感到了一點高原反應…… 公園的牌子也提示說，走路行動要悠着點。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vDESac&quot; alt=&quot;我們主要參觀的景點&quot;&gt;&lt;figcaption&gt;我們主要參觀的景點&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ueb3cU&quot; alt=&quot;瞭望遠方&quot;&gt;&lt;figcaption&gt;瞭望遠方&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vDrfYB&quot; alt=&quot;我把這張圖片叫做冰與火之歌，因爲站在山脈上，一邊是潮溼而雲霧瀰漫的熱帶雨林；一遍是乾燥而清澈可見的廣袤大地。&quot;&gt;&lt;figcaption&gt;我把這張圖片叫做冰與火之歌，因爲站在山脈上，一邊是潮溼而雲霧瀰漫的熱帶雨林；一遍是乾燥而清澈可見的廣袤大地。&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;等我們把前面幾個景點參觀得差不多後，我們來到了山頂。雖然我們已經提早了45分鐘，但山頂的停車場早已水泄不通（怪不得早上需要預訂，否則必須是一團亂）。等我們停下車後，已經是時間觀賞日落了。可以說這次日落是我在美國看過最好的一次，的確與衆不同。由於這裏特殊的地勢與氣候，氣象幾乎是瞬息萬變的。在太陽的光輝下，浮動的雲不停地變換與閃耀着，甚是讓人心馳神往。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2uerztw&quot; alt=&quot;日暮下的天文臺&quot;&gt;&lt;figcaption&gt;日暮下的天文臺&lt;/figcaption&gt;&lt;/figure&gt;&lt;div class=&quot;embed-video-container&quot;&gt;   &lt;/div&gt; &lt;p&gt;日落完後，大家開始陸續離開。按照網上推薦，我們決定繼續留待一會，因爲據說這裏的星空也是絕美的。可惜今晚月亮不是新月，非常光亮，天氣狀況也稍微有點多雲。我們沒有看到特別多的星星或者銀河。&lt;/p&gt; &lt;h3 id=&quot;第5天&quot;&gt;第5天&lt;/h3&gt; &lt;p&gt;至此，我們的夏威夷行程告一段落。這裏距離三藩要飛近5個小時，但是已經基本算是距離美國大陸最近的地方。也難怪不少人都稱這裏是加州人民的後花園。夏威夷主要的島嶼還有 Kauai 以及 Hawaii (big island)，留待下一次再相遇。&lt;/p&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2uexMWf&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6601826085405321482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6601826085405321482?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6601826085405321482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6601826085405321482'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/08/molokini-snorkelling.html' title='夏威夷遊記（三） 茂宜島 Molokini Snorkelling'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-1358824413531313871</id><published>2017-08-06T15:02:00.003+08:00</published><updated>2017-08-06T15:02:14.746+08:00</updated><title type='text'>夏威夷遊記（一） 瓦胡島</title><content type='html'>&lt;p&gt;借着 CVPR 2017 的機會，終於去了一趟嚮往已久的夏威夷。主要是參觀了瓦胡（oahu）島以及茂宜（maui）島。非常喜歡，嚴格來說是我第一次去&quot;度假&quot;。美好的自然風光非常愜意。趁在在飛機上有時間，可以寫一些流水帳。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBOxyg&quot; alt=&quot;Oahu 一景&quot;&gt;&lt;figcaption&gt;Oahu 一景&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;夏威夷有好幾個島，其中一般遊客會去的島有 Oahu, Hawaii (大島，big island)，Maui，Kauai。一般會有兩種玩法：Island Hopping，或者集中參觀1-2個島。由於這次的假期包括開會在內大概只有7天左右，所以我安排了2天 Oahu 以及5天 Maui。這次行程的規劃（以及施行）還算不錯，算是比較深度地玩了兩個島。路線大概是：&lt;/p&gt; &lt;h2 id=&quot;oahu&quot;&gt;Oahu&lt;/h2&gt; &lt;p&gt;主要是參觀了幾個主要景點以及環島自駕。住在 Honululu。到 Waikiki 的 Avis （Sheraton 裏面）租了敞篷跑車。&lt;/p&gt; &lt;h3 id=&quot;第0天&quot;&gt;第0天&lt;/h3&gt; &lt;p&gt;SFO - HNL，入住在 Waikiki Marina Resort。這是一個 condo 型的旅店，與隔壁似乎比較高級的 Ilikai 酒店 share 同一個 building，但是因爲是 condo 型的其實我們覺得住得也算很舒服，因爲沒有人管你（包括 house keeping），樓下就有各種超市，下樓就是海灘，每層都有洗衣機和乾衣機自給自足。當然最主要還是有廚房，我們可以偶爾自己做飯，一來健康，而來省錢 :)&lt;/p&gt; &lt;h3 id=&quot;第1天&quot;&gt;第1天&lt;/h3&gt; &lt;p&gt;環島自駕。主要是從 Waikiki Beach 開始，逆時針地繞着島轉了一圈。沒有去西邊，而是從北邊直接開回來的。一天如果早點出發是完全足夠的，只是我們比較 laid back 所以到後來有點倉促，從 north shore 開始開回來時已經天黑了。值得一提的是環島遊租敞篷真的很爽！雖然我們租的時候可能算是旺季，價格特別貴大概80一天，但我們還是不後悔的，因爲實在是太過癮了：夏威夷的氣候非常適合敞篷，溫度不冷不熱，風吹過來是一種很涼爽的感覺，而不像北加那樣是冰涼冰涼的，或者像別的內陸城市那樣風也是熱的（其實 Maui 也是潮溼悶熱）。另外一定要做好防曬。租車是在 Waikiki Avis，本來預訂了一部基本的 Mustang，Agent 問我要不要加一點錢 Upgrade 成 GT。當時還是蠻興奮的，結果他說弄錯了，GT 以及租出去了… 但還是 Upgrade 成了一部配置好一點的 Mustang。&lt;/p&gt; &lt;p&gt;環島遊很棒，我們從 Waikiki 開始，經過了 Diamond Head State Beach (不是 park，這個是在南邊的沙灘)，恐龍灣，然後一直繞着海岸線直到 north shore。路上風光非常漂亮，以至於我們停在了太多地方拍照而後面太趕。其中恐龍灣我們並沒有去浮潛，而是進去就出來了，因爲要收門票 :/ 我們打算第二天才去，所以直接 skip 了。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2udbqEx&quot; alt=&quot;環島路線，主要參考了這篇&quot;&gt;&lt;figcaption&gt;環島路線，主要參考了&lt;a href=&quot;http://bit.ly/2vBJluh&quot;&gt;這篇&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1lr2&quot; alt=&quot;租的 Mustang&quot;&gt;&lt;figcaption&gt;租的 Mustang&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBYqf7&quot; alt=&quot;Diamond Head State Beach&quot;&gt;&lt;figcaption&gt;Diamond Head State Beach&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ucVp1t&quot; alt=&quot;Makupuu Lighthouse&quot;&gt;&lt;figcaption&gt;Makupuu Lighthouse&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBNXAz&quot; alt=&quot;在飛機上拍的 Waikiki Beach&quot;&gt;&lt;figcaption&gt;在飛機上拍的 Waikiki Beach&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ucLYzb&quot; alt=&quot;忘了是哪……但很漂亮&quot;&gt;&lt;figcaption&gt;忘了是哪……但很漂亮&lt;/figcaption&gt;&lt;/figure&gt;&lt;video width=&quot;400&quot; preload=&quot;metadata&quot;&gt;&lt;/video&gt;&lt;h3 id=&quot;第2天&quot;&gt;第2天&lt;/h3&gt; &lt;p&gt;參觀幾個主要的景點，包括珍珠港，鑽石頭山 Hiking，以及恐龍灣浮潛。&lt;/p&gt; &lt;p&gt;珍珠港想必不用我多提。最出名的景點是 USS Arizona 號，是日軍偷襲珍珠港當天直接炸沉的一艘戰艦，穿上近千人直接喪生！這艘船的殘骸一直留在珍珠港，部分還露出水面。政府在上面建了一個類似紀念堂的小建築，需要從珍珠港做船前往。值得一提的是這個船是可以提前預訂的。門票免費，只是收一點手續費。但是由於太 popular，一般早早就預訂完了。不過，提早 24 小時還會有一批票放出，我們就是提早一天搶到的票。當然也有一定的 walk in 名額，但可能會很浪費時間。&lt;/p&gt; &lt;p&gt;在上船前，我們會在一個劇院觀看大概10分鐘的歷史回顧。個人認爲，這段視頻拍得非常好，引用了大量的照片與視頻還原了原來的歷史事件，並且沒有加入太多愛國主義或者主觀感情，而是以客觀的態度回顧歷史，讓人感慨戰爭的殘酷。根據太太說，現場有不少男士都流下了眼淚——也包括我。現在每每想起來，也總是覺得眼眶溼潤。真正參觀紀念館時，倒是沒有那麼觸動。只是想到陣亡將士的屍骨至今扔留在深海，心裏不免會沉重。&lt;/p&gt; &lt;p&gt;珍珠港比較出名的還有密蘇里號。當時日本投降時，天皇就是在這裏寫下的降書。別的還有一些博物館以及潛艇，但我們沒有具體參觀。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1mv6&quot; alt=&quot;USS Arizona&quot;&gt;&lt;figcaption&gt;USS Arizona&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBRu1J&quot; alt=&quot;模型，可以看到這個紀念館是建在殘骸上的&quot;&gt;&lt;figcaption&gt;模型，可以看到這個紀念館是建在殘骸上的&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1ydW&quot; alt=&quot;部分殘骸露出了水面&quot;&gt;&lt;figcaption&gt;部分殘骸露出了水面&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBCfpA&quot; alt=&quot;陣亡將士紀念館里的石碑，他們的名字被銘記在這裏……&quot;&gt;&lt;figcaption&gt;陣亡將士紀念館里的石碑，他們的名字被銘記在這裏……&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1yKY&quot; alt=&quot;USS Bowfin&quot;&gt;&lt;figcaption&gt;USS Bowfin&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;下午我們爬了鑽石頭山。這裏能俯瞰整個 Oahu 島，特別是 Waikiki。這其實是比較累的一段 Hike，因爲幾乎都是 unpaved road，elevation 也不低，並且中間還有幾段沒有燈的 tunnel。山上風光異常漂亮，就是那種你會在視頻，文章裏面會看到的那種熱帶風光。而這個鑽石頭山，本身的 highlight 是作爲一個火山爆發形成的 Crater，倒是比較 unimpressive，可能是因爲這個高度並不是特別能看出它的地貌。不過，後來我們在 HNL - OGG 的飛機上，有幸錄到了一段視頻而得以一窺它的全貌，這時大自然的鬼斧神工，老天爺的饋贈，才得以呈現。&lt;/p&gt; &lt;video preload=&quot;metadata&quot;&gt;&lt;/video&gt;&lt;p&gt;最後的行程是恐龍灣浮潛。說來慚愧，這是我的第一次浮潛，所以並沒有任何經驗。但是根據接下來幾天的浮潛經歷來看，我認識到恐龍灣的確是一個非常漂亮的浮潛聖地。因爲它的礁石就在岸邊，連新手如我都能一窺究竟。比起 Maui 基本上中午開始就狂風大浪，恐龍灣的浪是只要會游泳的人就能接受的。可惜的是，我們還是太拖沓，到了恐龍灣大概已經是5點，而真正到沙灘前又先要排隊觀看一個介紹視頻，並且還要步行一段距離，浪費了至少30-45分鐘。這時太陽能照耀到的海面，基本上已經不多了，能看到的景色自然遜色了點。加上我第一次浮潛，基本是在學習而沒怎麼觀察景色。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1zi0&quot; alt=&quot;Hanauma bay&quot;&gt;&lt;figcaption&gt;Hanauma bay&lt;/figcaption&gt;&lt;/figure&gt;&lt;h3 id=&quot;第3天&quot;&gt;第3天&lt;/h3&gt; &lt;p&gt;這天我們乘坐了 Island Air 的小飛機前往 Maui。有趣的是，這班飛機在 HNL 里是被認爲『commuter』，是在 commuter terminal 里登機的，對於通勤的島民來說簡直是打飛的上班。行程非常短，只飛了大概30分鐘就到達茂宜。來之前並不清楚茂宜這個島，來了後，才發覺自己太喜歡它了！&lt;/p&gt; &lt;p&gt;茂宜行程，寫在了&lt;a href=&quot;http://bit.ly/2vBzHHW&quot;&gt;下一篇&lt;/a&gt;。&lt;/p&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2ucVour&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/1358824413531313871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/1358824413531313871?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1358824413531313871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1358824413531313871'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/08/blog-post.html' title='夏威夷遊記（一） 瓦胡島'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-1229265313156730358</id><published>2017-08-06T15:02:00.001+08:00</published><updated>2017-08-06T15:02:10.981+08:00</updated><title type='text'>夏威夷遊記（二） 茂宜島 Road to Hana, Ahihi-Kinau, Lahaina</title><content type='html'>&lt;p&gt;茂宜島：陽光沙灘與海，雲海聖山與樹，城市人羣與浮潛，茂宜島 has it all! 瓦胡島的行程參見&lt;a href=&quot;http://bit.ly/2ucVour&quot;&gt;上篇&lt;/a&gt;。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud5ACZ&quot; alt=&quot;OGG 機場&quot;&gt;&lt;figcaption&gt;OGG 機場&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 id=&quot;maui&quot;&gt;Maui&lt;/h2&gt; &lt;p&gt;茂宜島的經歷讓人難忘。沒有來之前，總覺得 5 天是不是太長了。而最終證明，如果你不是特別 hardcore，其實只是剛好而已！ 我們大概的行程安排是：&lt;/p&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;Road to Hana&lt;/li&gt; &lt;li&gt;早上去 Ahihi-Kinau 浮潛，晚上去 Lahaina 商業街就餐與參觀。&lt;/li&gt; &lt;li&gt;月亮灣浮潛，下午休息（因爲被曬傷了 &amp;gt;.&amp;lt;）&lt;/li&gt; &lt;li&gt;早上去浮潛看海龜，中午去Haleakala National Park。沒有看日出是因爲……見下文&lt;/li&gt; &lt;/ol&gt; &lt;h3 id=&quot;第0天&quot;&gt;第0天&lt;/h3&gt; &lt;p&gt;嚴格來說我們只呆了 4.5 天，因爲第一天是 HNL - OGG。我們到達後，機場租車，然後開去 Walmart 買了一些生活用品以及浮潛用具。我們住在 Kihei，是一個比起西邊少商業化很多的地方，並且跟在瓦胡一樣，也是 condo。但是事實證明，這個地方非常適合我們：恰到好處的商店與人流，門口就是海灘，並且離好幾個浮潛的地方都很近，非常方便。&lt;/p&gt; &lt;p&gt;我們當天下午悠哉悠哉地歇到傍晚才出門與了附近的一個沙灘，結果被告知，在 maui 的最佳浮潛時間，是早上 7am-11am；過了這個時間，狂風大作，海浪太大，一來危險並且海浪把沙都捲起來了，能見度很差，二來魚兒是早上活躍，這時候很難看到什麼好景觀了。於是只好作罷 :(&lt;/p&gt; &lt;p&gt;月亮灣浮潛是當地最火最簡單的一個浮潛項目，於是我們定下了 Redline rafting 這個公司，每人大概 140 這樣子。比起其他的公司貴了不少，但是好處是，我們乘坐的是小船，不超過20人，有比較 personalized service，並且我們早上是第一班出發的，能幹在別人前面把景點都玩了，並且我們這個 trip 會去好幾個地方，包括月亮灣與海龜鎮等。當然，這個主要是他們的說法，我們也沒有跟別的比較。&lt;/p&gt; &lt;h3 id=&quot;第1天&quot;&gt;第1天&lt;/h3&gt; &lt;p&gt;Road to Hana 是大家必玩的一個行程。這條路大家一般是從 Paia 出發，順時針玩的。其中以 Haleakala NP 爲分界線，或者玩一半，或者玩整圈。很多網上攻略都說後半段路很難開，租車公司協議規定不能開 unpaved road 之類的。但其實這都是一些 rumor。詳細的解釋並且後半段的攻略看&lt;a href=&quot;http://bit.ly/2vBsOX1&quot;&gt;這裏&lt;/a&gt;。對於前半段，我們主要參考的是&lt;a href=&quot;http://bit.ly/2ud5ATv&quot;&gt;這篇&lt;/a&gt;。最後證明，只要早上按時間出發並且不要在景點停留太久，一天轉一圈是完全沒問題的。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBYXO7&quot; alt=&quot;Road to Hana full loop (map)&quot;&gt;&lt;figcaption&gt;Road to Hana full loop (&lt;a href=&quot;http://bit.ly/2ud9Nqd&quot;&gt;map&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;老實說，這段路非常 unimpressed，比起我們開過的幾段 scenic road，比如 CA-1, Keywest, Columbia Gorge， 差遠了。前面那段的熱帶雨林氣候，非常泥濘溼熱，讓人很不舒服。路上的一些瀑布，比起別的地方的瀑布遜色不少；如果你不想着下去游泳的話，則更沒意思了……反倒是後面那段山路，有海岸，有峽谷，有落日，我們還比較喜歡（網上也確實不少人喜歡）。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBJldL&quot; alt=&quot;彩虹樹&quot;&gt;&lt;figcaption&gt;彩虹樹&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud1meA&quot; alt=&quot;黑沙灘&quot;&gt;&lt;figcaption&gt;黑沙灘&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBCf94&quot; alt=&quot;某瀑布&quot;&gt;&lt;figcaption&gt;某瀑布&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ucHEQd&quot; alt=&quot;葉子雪糕店，還蠻好吃的&quot;&gt;&lt;figcaption&gt;葉子雪糕店，還蠻好吃的&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBzMve&quot; alt=&quot;後半段的一景，視野開闊&quot;&gt;&lt;figcaption&gt;後半段的一景，視野開闊&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ucHMiD&quot; alt=&quot;這裏竟然有個中山公園！&quot;&gt;&lt;figcaption&gt;這裏竟然有個中山公園！&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vC8CEB&quot; alt=&quot;日落&quot;&gt;&lt;figcaption&gt;日落&lt;/figcaption&gt;&lt;/figure&gt;&lt;h3 id=&quot;第2天&quot;&gt;第2天&lt;/h3&gt; &lt;p&gt;這裏&lt;a href=&quot;http://bit.ly/2ud7jbB&quot;&gt;推薦&lt;/a&gt;了不少浮潛的好地方。因爲 Ahihi-Kinau 離我們很近，並且不少攻略都推薦，於是我們選擇了這裏。這次是第一次正式地浮潛，我們連 fin 都準備好了。綜合我們後面幾次的浮潛，這裏的確是一個好地方，無論是魚類的數目以及多樣性都非常好（只是沒經驗沒看到海龜），鄭重推薦。&lt;/p&gt; &lt;p&gt;由於當時沒有考慮到想要拍照，所以並沒有準備好。回來查了一下，發覺要在水裏面拍照，一般有幾個方法：&lt;/p&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;傳統的一次性水下相機。比如 http://amzn.to/2hyaQPQ。缺點是像素低，評價也普遍不好。不推薦。&lt;/li&gt; &lt;li&gt;專用的水下攝像機，或者 gopro 之類的，比如：http://amzn.to/2v8AC1Q。這個應該是質量最好的，但是偏貴，使用頻率不高（除非是 go pro）。&lt;/li&gt; &lt;li&gt;手機防水套，比如 http://amzn.to/2hyXyml。這個比較實用，雖然後來試用發現水下還是光線不夠，手機容易排虛。但是如果只是想拍一下人，還是能拍出來的。而且非常便宜。比如這款在 amazon 只需要5刀。如果是臨時去島上的 ABC store 買，那款當時花了我 20 刀！&lt;/li&gt; &lt;/ol&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vC8DbD&quot; alt=&quot;剛下水就能看到非常多這種銀色的魚。來源&quot;&gt;&lt;figcaption&gt;剛下水就能看到非常多這種銀色的魚。&lt;a href=&quot;http://bit.ly/2ud7kwb&quot;&gt;來源&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBTMxI&quot; alt=&quot;這種小黃魚也很多，很有熱帶氣息。來源&quot;&gt;&lt;figcaption&gt;這種小黃魚也很多，很有熱帶氣息。&lt;a href=&quot;http://bit.ly/2ud7l3d&quot;&gt;來源&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;早上浮潛是自己認真的第一次（恐龍灣那次算是試水），所以比較累。下午休息後想去西邊，主要是 Lahaina 和 Banyan tree。但是發覺下午交通非常差，原來只需要 30 分鐘的路程，要開 1 個小時！根據後來的觀察，似乎這是常態，因爲到了那邊後，只有 1-lane，只要有一部車開得慢，後面就全堵上了。&lt;/p&gt; &lt;p&gt;Lahaina 跟我們設想的差不多，非常商業化，跟 Waikiki 差不多。對於更希望接觸自然，有不一樣風情的我們來說，並沒有太吸引。而且本身出門就遲，我們到達後，剛好趕上日落，我們便隨便找了家餐廳吃飯。雖然去得晚，並且很少停車位，幸運的是在那邊的正規餐廳似乎都能爲顧客在旁邊的一個 outlet 提供 3 個小時的 free parking。&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2vBYrjb&quot; alt=&quot;Lahaina 日落&quot;&gt;&lt;figcaption&gt;Lahaina 日落&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;晚飯後我們散步到了 Lahaina Banyan Court。這裏有一棵美國最大的 Banyan tree，非常讓人震驚。這棵樹的樹枝垂下鬚根接觸到地面後，又會長出粗壯的樹幹支撐樹枝本身，並且汲取水分。只用普通相機根本無法表現出現場那種獨木成林的神祕氣息……&lt;/p&gt; &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2ud7ljJ&quot; alt=&quot;網上找的一張圖片，注意這裏面所有的樹都是同一棵。你們感受一下……&quot;&gt;&lt;figcaption&gt;網上找的一張圖片，注意這裏面所有的&quot;樹&quot;都是同一棵。你們感受一下……&lt;/figcaption&gt;&lt;/figure&gt;&lt;hr&gt; &lt;p&gt;茂宜島接下來的兩天的遊記(浮潛 + Haleakala)見&lt;a href=&quot;#&quot;&gt;此篇&lt;/a&gt;。&lt;/p&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2vBzHHW&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/1229265313156730358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/1229265313156730358?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1229265313156730358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1229265313156730358'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/08/road-to-hana-ahihi-kinau-lahaina.html' title='夏威夷遊記（二） 茂宜島 Road to Hana, Ahihi-Kinau, Lahaina'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-5737470476816041127</id><published>2017-08-02T13:50:00.001+08:00</published><updated>2017-08-02T13:50:24.203+08:00</updated><title type='text'>美國租車陷阱：Toll Charges</title><content type='html'>&lt;p&gt;今天收到了一張大概兩個月前的 bill，說我欠款 $30 美金……&lt;/p&gt;  &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2tYBSll&quot;&gt;&lt;/figure&gt;&lt;p&gt;兩個月前，我因爲&lt;a href=&quot;http://bit.ly/2vmGxAS&quot;&gt;車子被 flying debris 刮傷 hood&lt;/a&gt;，而拿去了修車店修理。同時保險公司也 cover 我租車的費用。於是，在 Hertz 租了一輛小車。&lt;/p&gt; &lt;p&gt;由於我上班下班都會經過 Dumbarton bridge，所以單程會被收取 $5 費用。由於我自己有 fastrak，所以都是過橋時拿出來使用。但是有一次過橋忘記了。當時想着，也許跟之前一樣，會寄賬單到家，所以也沒多想。直到今天看到賬單，才大吃一驚：你收取我原價 $5 的過路費，我認了。但是由於我只是一次沒有交，而收取我整個 rental period 的 service charge，每天 $4.95，封頂 $24.75。這多收的服務費，都已經是我的過路費的5倍了。這未免太坑了點？？&lt;/p&gt; &lt;p&gt;仔細想想，這家名爲 PlatePass 的公司，實在是太陰險毒辣了。賬單在我結束租車後近兩個月後才寄出，此時早已經過了保險 claim 完成的日子。這間狠毒的公司，說白了就是躺着就把錢給賺了。&lt;/p&gt; &lt;p&gt;仔細上網搜搜，我不是第一個人。網上早已經有&lt;a href=&quot;http://bit.ly/2tYBSSn&quot;&gt;N多的抱怨&lt;/a&gt;。不少的&lt;a href=&quot;http://cour.at/2vmYhMF&quot;&gt;文章&lt;/a&gt;也&lt;a href=&quot;http://bit.ly/2tYBTpp&quot;&gt;披露&lt;/a&gt;了這些公司無賴的行徑。可惜的是，我並沒有看到操作性太強的 argue 方法。只能吃一塹，長一智，以後一定要廣而告之，揭發這些無恥商家的醜惡行徑。文章裏面給出的建議是：&lt;/p&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;遇到 toll bridge/road，不要走快速通道，走現金通道。&lt;/li&gt; &lt;li&gt;自帶 toll transponder&lt;/li&gt; &lt;li&gt;設 gps 時，avoid toll roads。&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;希望下次大家不要再犯這樣的錯誤了。&lt;/p&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2uXKZ6T&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/5737470476816041127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/5737470476816041127?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5737470476816041127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5737470476816041127'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/08/toll-charges.html' title='美國租車陷阱：Toll Charges'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-2560061998795454273</id><published>2017-04-04T17:58:00.001+08:00</published><updated>2017-04-04T17:58:10.191+08:00</updated><title type='text'>Migrating from dropbox public folder</title><content type='html'>&lt;p&gt;Dropbox recently removed its public folder feature, which was used to host my blog&#39;s images. I have to figure out a solution to host and fix the paths to these images…&lt;/p&gt;    &lt;p&gt;Dropbox &lt;a href=&quot;http://bit.ly/2nXfTL2&quot;&gt;announced&lt;/a&gt; that &lt;em&gt;As of March 15, 2017 the Public folder in your Dropbox account has been converted into a standard folder.&lt;/em&gt; Sad, all my previous links are hosted on Dropbox, and they all become invalid URLs.&lt;/p&gt;  &lt;p&gt;I figured that I have to use another image hosting service. After some searching online, &lt;a href=&quot;http://bit.ly/2oU6KAy&quot;&gt;Cloundinary&lt;/a&gt; seems to be a good option. One design of my hosted images are that they are organized in sub-folders under a &#39;blog&#39; folder. This means that if I want to seamlessly convert the links, I need to preserve the folder structure too.&lt;/p&gt;  &lt;p&gt;Cloudinary seems to suggest they support auto-creating folders. Unfortunately that does not quite work for me.&lt;/p&gt;  &lt;figure&gt;&lt;img src=&quot;http://bit.ly/2nXezHS&quot; alt=&quot;settings&quot;&gt;&lt;figcaption&gt;settings&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;In fact, I wrote a small script to do this.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;figure class=&quot;code&quot;&gt;&lt;figcaption&gt;&lt;span&gt;Upload a folder to cloudinary&lt;/span&gt;  &lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;  &lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;  &lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;16&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;17&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;18&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;19&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;20&lt;/span&gt;  &lt;/pre&gt;  &lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;  &lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;cloudinary&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;cloudinary.uploader&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;cloudinary.api&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Upload the folder in rootdir to cloudinary, preserving the file structure&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;cloudinary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;n&quot;&gt;cloud_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&amp;lt;name&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;n&quot;&gt;api_key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&amp;lt;your key&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;n&quot;&gt;api_secret&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&amp;lt;your secret&amp;gt;&quot;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;rootdir&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;blog&#39;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;subs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;files&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;walk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rootdir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;n&quot;&gt;cloudinary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;uploader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;upload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;            &lt;span class=&quot;n&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;            &lt;span class=&quot;n&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;use_filename&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;            &lt;span class=&quot;n&quot;&gt;unique_filename&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;resource_type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;auto&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;/figure&gt;  &lt;/div&gt;  &lt;p&gt;With that, I did a simple sed run on all my post sources:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;figure class=&quot;code&quot;&gt;&lt;figcaption&gt;&lt;span&gt;Upload a folder to cloudinary&lt;/span&gt;  &lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;  &lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;  &lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;/pre&gt;  &lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;  &lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;s/&amp;lt;dropbox base url&amp;gt;/&amp;lt;cloundinary base url&amp;gt;/&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;markdown&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;/figure&gt;  &lt;/div&gt;  &lt;p&gt;then rake preview. Boom! All the images are shown again!&lt;/p&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2nz9VMZ&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/2560061998795454273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/2560061998795454273?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2560061998795454273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2560061998795454273'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/04/migrating-from-dropbox-public-folder.html' title='Migrating from dropbox public folder'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-7292932686806483704</id><published>2017-04-03T17:58:00.001+08:00</published><updated>2017-04-03T17:58:12.682+08:00</updated><title type='text'>在美國換輪胎的經歷</title><content type='html'>&lt;p&gt;最近給車換了輪胎，發覺學問非常大，決定把經歷記錄下來。&lt;/p&gt;  &lt;h2 id=&quot;背景&quot;&gt;背景&lt;/h2&gt; &lt;p&gt;我開的車是 MB-C300。買完後才發現，自己的輪胎是所謂的 &quot;runflat&quot;。這東西的好處是，即使是爆胎了，它的 sidewall&lt;a href=&quot;#fn1&quot; class=&quot;footnoteRef&quot; id=&quot;fnref1&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; 足夠堅硬，所以可以支持已經失去氣壓的輪胎在 50mph 的速度以內再走 50 miles。而壞處就是…… 幾乎沒法修，一旦損毀，基本上只能馬上趕去修車店，而且由於算是比較新的技術，不一定馬上有貨；而且造價一般也比較貴。由於 sidewall 硬，一般也會使得駕駛非常 bumpy （這點我深有同感，車子開起來非常顛簸，感覺一直在抖，但是好處是感覺非常敏感抓地，飆起來時很有 sporty 的感覺）。最後，一般帶了 runflat 的車子，都不會再配給備胎，所以如果爆胎了，那麼只能乖乖去修車店了，當然，好處就是少帶了一個備胎，trunk 可以省出很多空間。除了以上這些，根據我對我自己輪胎的觀察，還發現一到冬天，胎壓降得特別快，基本上2個月就要去打一次氣。&lt;/p&gt; &lt;p&gt;上面說的那些，在我開了五年的舊車上從來沒有體驗過，因爲一般我都定期半年保養，而胎壓什麼的都應該在保養時搞定了。這也間接導致了我對輪胎非常小白，因爲舊車的輪胎似乎非常耐擦，我只是在買回來後換過一次，接下來五年關於輪胎的問題真的一次沒遇過。&lt;/p&gt; &lt;h2 id=&quot;runflats&quot;&gt;Runflats&lt;/h2&gt; &lt;p&gt;說起 runflat，可真是多牢騷。由於我的車買的是運動版，配了 19&#39; 的 wheel 以及 Pirelli P-Zero Summer runflats。開車至今一年半，我的左前胎就壞過兩次[^flat tire]。好在都在保修期內，所以基本上只花了幾十塊免費換新胎&lt;a href=&quot;#fn2&quot; class=&quot;footnoteRef&quot; id=&quot;fnref2&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;。但是這一來一去也是非常花時間的，還不能開車上班。&lt;/p&gt; &lt;p&gt;最近，我發現我的右前胎的外側基本上已經磨平了。剛發現那會非常震驚，因爲我的車才開了 15k miles 不到，竟然就快掛了。後來經過種種網上的研究，這款胎的確壽命就是很短！因爲 Pirelli 是意大利專給跑車做 performance tires 的…… 所以比較 prestigious，而這一款又是特別的薄，所以網上很多人都說甚至不到 10k 就要換了。&lt;/p&gt; &lt;h2 id=&quot;選擇新輪胎&quot;&gt;選擇新輪胎&lt;/h2&gt; &lt;p&gt;網上做了大量功課，發現原配 runflat 的車裝 non-runflat 也是可以的。想起之前的種種麻煩，斷然決定還是入手 non-runflat。在 &lt;a href=&quot;tirerack.com&quot;&gt;tireack&lt;/a&gt; 上做了功課，基本上瞭解了有幾個考慮：&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Summer vs. All season: summer tires。 適合在溫度不低於結冰的地區使用，在乾溼的路上，防滑與操縱都很好。其實，基本上就是加州這種地方。但是，在雪地上會非常危險。All season 顧名思義，犧牲了在普通路面行走的性能，使得可以在雪地上行走。&lt;/li&gt; &lt;li&gt;壽命。根據 UTQG&lt;a href=&quot;#fn3&quot; class=&quot;footnoteRef&quot; id=&quot;fnref3&quot;&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt; 的定義，我原車胎的 treadwear 才 220! 而大衆喜聞樂見那些輪胎，則一般都能上到 500，也怪不得我以前那部車開了那麼就一點問題也沒有。&lt;/li&gt; &lt;li&gt;價格。這個其實問題不大，因爲我原裝的輪胎一個要上 $400 … 基本上任何輪胎都會比它便宜。&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;tirerack 的界面做得很好。在它的幫助下，我基本上鎖定了以下這幾款：&lt;/p&gt; &lt;ul&gt; &lt;li&gt;MICHELIN PILOT SUPER SPORT (PSS)。這是大家有口皆碑的 performance summer tires。基本上對車有追求的都會推薦這款。缺點是可能太 sporty，並且 treadwear 比較低。&lt;/li&gt; &lt;li&gt;MICHELIN PILOT SPORT A/S 3+。根據網上評論，跟 PSS 其實差別不大，會稍微舒適一點。而且很 tricky 的一點是，雖然評級是 all season，但是性能跟 summer tire 很接近。最大的優點是，treadwear 非常好。&lt;/li&gt; &lt;li&gt;Continental EXTREMECONTACT DWS 06。也是評價很不錯的，但是比起上面那兩款來說則是比較中規中矩沒有太多兩點。&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;優劣很明顯了，我很快就決定了入手 PS3+。這裏要再表揚一下 tirerack，線下功能也做得非常好。選好了 tire 後，還能寄到指定的 tire shop 進行安裝，並且價格也是有保證的。根據它的推薦，我很快發現了 &lt;a href=&quot;http://bit.ly/2nvOagK&quot;&gt;Nielsen Automotive&lt;/a&gt;。這家店在 yelp 是100+的五星級review。而且後來也證實，他們的服務非常靠譜！（見下節）&lt;/p&gt; &lt;h2 id=&quot;網上購買輪胎與比價&quot;&gt;網上購買輪胎與比價&lt;/h2&gt; &lt;p&gt;tirerack 給定的價格還是非常好的。我一套輪胎下來，才不到 800 刀。相對來說，costco 的價格更低，但是仔細研究後發覺，他們的 service 口碑非常差。這也是我最終決定選擇 tirerack 的原因。&lt;/p&gt; &lt;p&gt;一切準備就緒後，我就在網上下了 order，讓他們寄到 Nielsen Automotive。這裏有兩個小插曲：&lt;/p&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;我的車原配輪胎是 front 225 rear 255 的 (tire width)，而這款輪胎的推薦配置是 225 + 245，或 235 + 255。tirerack 的 salesagent 電話專門跟我確認後，決定還是要 225 + 255 的&lt;/li&gt; &lt;li&gt;電話裏，sales rep 還跟我提到如果我 hold order 兩天，那麼將會 qualify 原廠的一個 rebate，價值 $70 的 prepaid card。tirerack 又再次立功了，這點我非常感激。&lt;/li&gt; &lt;/ol&gt; &lt;h2 id=&quot;安裝輪胎&quot;&gt;安裝輪胎&lt;/h2&gt; &lt;p&gt;輪胎是從 NV 寄過來的，週三寄出週四就到了。週四下午我接到 Nielsen Automotive 的電話後，約好週五下午去修。他們的報價是 $100，比 tirerack 上推薦的還要便宜 $20!&lt;/p&gt; &lt;p&gt;週五去到店裏，發覺是一個外表非常老舊的店。修車的也都是老頭子。但是！老頭子們都非常非常 nice &amp;amp; gentle，讓我感覺非常好，沒有那種普通修車店那種笑里藏刀的感覺。我一開頭還不相信，知道最後面修好車發現，他們是真真正正的 nice，一點也沒坑我。說好了一個小時最後其實花了兩個小時，修車技師 Chris 主動給我道歉並解釋說這個系列的車比較難，有一個地方他總也搞不定，所以花費了更多的時間。老先生很誠懇，我當然也不好意思多說什麼。開出去走了一圈，發現輪胎氣壓不是非常對稱，讓 Chris 再幫忙 balance 一下，也是二話不說就幫我弄好了。當我準備給他一點小費時，他還非常禮貌地拒絕了。不收小費，這我在美國還真是第一次見到。&lt;/p&gt; &lt;p&gt;吐血推薦這間 tire shop。地址是 888 El Camino Real, San Carlos, CA 94070。&lt;/p&gt; &lt;h2 id=&quot;總結&quot;&gt;總結&lt;/h2&gt; &lt;p&gt;經歷過這次讓我對輪胎的維護與保養有了比較深的認識。tirerack 價錢合理並且服務也好，更重要的是上面有大量的科普文章，非常有營養。&lt;/p&gt; &lt;section class=&quot;footnotes&quot;&gt;&lt;hr&gt; &lt;ol&gt; &lt;li id=&quot;fn1&quot;&gt;&lt;p&gt;指的就是輪胎的側面，起的支撐作用。 [^flat tire]: 當然，部份原因也是由於我保養不善……此去不表&lt;a href=&quot;#fnref1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt; &lt;li id=&quot;fn2&quot;&gt;&lt;p&gt;一般輪胎都自帶 warranty，比如一年內，以及車輪磨損在接受範圍以內，遇到任何 road hazard 以及質量原因，廠家包換。&lt;a href=&quot;#fnref2&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt; &lt;li id=&quot;fn3&quot;&gt;&lt;p&gt;Uniform Tire Quality Grade&lt;a href=&quot;#fnref3&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt; &lt;/ol&gt;&lt;/section&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/2o1FVNu&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/7292932686806483704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/7292932686806483704?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/7292932686806483704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/7292932686806483704'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2017/04/blog-post.html' title='在美國換輪胎的經歷'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-3110576134267739427</id><published>2015-05-15T11:54:00.001+08:00</published><updated>2015-05-15T11:54:46.420+08:00</updated><title type='text'>美国留学：学生保险拔智齿</title><content type='html'>&lt;img src=&quot;http://bit.ly/1RMm7F5&quot; alt=&quot;Wisdom Teeth (source)&quot; style=&quot;&quot;&gt;Wisdom Teeth (&lt;a href=&quot;http://bit.ly/1EJBoMN&quot;&gt;source&lt;/a&gt;)&lt;p&gt;在快奔三的年纪，终于长出了最后一颗智齿。本来想着说这辈子不用拔智齿的——因为我25岁前就已经长完了三颗智齿，并且都 align 得非常好，并没有阻生。之前在中国时的医生也告诉我，没有必要拔掉，因为他们出来得迟，因此比起其他牙齿也会掉得迟。所以以后牙齿掉完后，他们还会在那里，可以做到固定镶牙的用途。当然我在美国没有听到有医生这样提起的，而且美国的习惯是 4 颗一起全部拔掉，一了百了！听起来有点 scary，只是他们的考虑也不是没有道理：智齿一般会长歪，即使没有长歪，也可能引发各种疾病，比如由于长得比较靠里，比较难清洁到，因此很容易蛀牙。更甚的是，蛀牙后，会引起正常的牙齿也蛀牙！这个情况就发生了在我身上：我的下面两颗支持都有蛀牙，并且引起了旁边的蛀牙！为了这个问题，我已经补过两次牙齿。这成为了我这次拔掉他们的最大原因。&lt;/p&gt;   &lt;p&gt;我的最后一颗智齿是左上那颗，长歪了，好在不是顶着别的牙齿，而是横向的生长，朝着舌头方向长出来了。所以舌头蹭到很不舒服。大概5个多月前刚长出来时去检查过，还拍了 panarama 的 x-ray （学校的 dental delta 保险三年只 cover 一次，这次只能自费，花了大概 70 刀）。但由于只是刚长成，并不清楚趋势，因此我也带着侥幸的心理没有理他（考虑到别的三颗都乖乖的直直地长了出来！）。最近终于把找工、TA、论文的事情忙得差不多，感觉不拔不行了，赶紧联系医生。可惜之前去的 dental clinic 不能做 oral surgery，于是医生 refer 我去当地最大的 local hospital：carle。总结起来，大概 timeline 是这样的：&lt;/p&gt; &lt;p&gt;12月份看的牙医，拍 X-ray，医生诊断需要拔智齿，开 referal paper 让我去 carl 做『oral surgery』。我偷懒没有马上去做。&lt;/p&gt; &lt;p&gt;5月初打电话给 carle schedule 了一个 appointment。护士告诉我让 clinic 发 x-ray 给他们。于是我打电话让 clinic 发，他们说会在我 appointment 前发过去（结果后来没发！）&lt;/p&gt; &lt;p&gt;过了一个星期去做了 examination，竟然是免费的。护士帮我一检查，发觉 x-ray 竟然没发过来。于是我马上电话过去让他们发。护士和医生很好人，说如果他们不发，给我免费做一个。等了好久，终于给我发了过来。医生也是顺理成章地问了下我情况，问我要不要做 sedation，全身麻醉 (anesthesia，Dental IV)，还是做 local 的局部麻醉。作为一个小白，当然是咨询医生意见。医生说大家都做 IV，睡一觉醒来就拔好了。于是我就说好我也要（只是没想到后来麻醉竟然要 375）。由于我以为我保险马上要过期，于是眼泪汪汪地让他给我这周马上做手术。他们非常 accomodating，愣是给我 schedule 到了第二天。拔智齿在美国算是小手术了，因此要签一张 paper，类似于 disclosure。走之前，我拿着手术清单去 patient account 查价 （check against insurance），但是前台阿姨说不能马上知道结果，只能给我第二天打电话。回到家后，我对着 bill 大概估算了一下，一颗牙 285 x 4 = 1140 + 麻醉 375 = 1515，而保险的 upper limit 是 1000，即使 100% cover 也要自付 515。感觉还是太贵，于是打电话问他们能不能取消掉。得到的答复是，我必须跟医生商量。但是医生一直 busy，一直没有给我答复。直到他们下班前，护士才电话我说，第二天跟医生讲就好。整个流程持续了大概 2 个多小时，花了 3 刀 parking。&lt;/p&gt; &lt;p&gt;第二天早上收到医院电话，得到具体 insurance 的信息以及bill。我掐指一算：一颗牙 285 x 4 = 1140 + 麻醉 375 = 1515，但是保险 upper limit 是 1000，而且不！包！麻！醉！这样 quote 下来我的价格是 (285x4 - 45) * 30% + 375 + 45 = 748.5，其中 45 是保险的 deductible。并且由于 carle 不属于 delta dental 的 network，保险只 cover 70%，which means I pay 30%! 太贵了。于是我果断选择了只做局部麻醉，因为是免费的。这样下来就是我的 out of pocket 是 373.5, which is not too bad。果然穷人多受罪…… 不过换个角度想，全身麻醉怎么说还是比较伤身的，没用也好。不过为了预防万一，我还是做好了全身麻醉的准备。根据给我的资料，全身麻醉需要在术前8小时不能进食，任何水、candy、gum都不能吃！（据说是为了防止你大小便失禁？）由于我手术是下午1:45开始，那么算起来我最迟也要在凌晨 5 点时吃东西……要那么早爬起来准备+吃，还是算了吧。我昨天晚上是8点吃的晚饭，这样算起来我有将近 18 小时滴！水！未！进！T_T 并且由于全麻带来的作用，术后人会不清醒，还必须有人带你去医院负责把你运回家，非常严肃，当然也非常麻烦。&lt;/p&gt; &lt;p&gt;下午开车到了位于 champaign 的医院（carle 在 urbana 和 champaign 各有一间，医生轮岗）。check-in ，乖乖地贡献 373.5 后等了半小时进手术室。总的来说护士们都很 caring，会一直跟我聊天，也很详细地给我解释术后的一些注意事项。不久后，医生助手进来给我打麻药。老实说，整个过程中最痛的其实是这个环节，因为他们会给智齿附近的 gum 打针，扎进去恐怖+疼的感觉，一半一半吧。整个人也会不自觉地绷紧了，双手牢牢地按住自己大腿。不过其实局部麻醉对我来说也是常事了，之前补牙时也做过，所以多少有点心理准备。不久后，整个嘴麻了，连吞口水也感觉有点困难。&lt;/p&gt; &lt;p&gt;医生进来后手术正式开始。新出来的那颗（左上），我估计 5 秒就拔出来了，一点感觉都没有。医生会 count：this is one。我当时心里一阵窃喜，原来这么水啊！可惜如意算盘打错了，拔下面那颗时，我感觉整颗死死地嵌在牙腔里，怎么也拔不出来，牙根处有点隐隐作疼，但更疼的，是我的下巴。因为作用力太大，我感觉整个下巴都要被扯起来了…… 也许是因为太牢固，也许是因为补过牙，医生决定把它钻开再拔。于是就听到了钻头在口腔里巨大的声音。钻好后，医生估计是一片一片地拔出来的，其实我感觉不到具体手法，只知道他们一直在里面捣鼓。期间医生也会预警：你接下来会听到一些碎裂的声音…… 右上的智齿虽然也是 fully erupted，但是比起下面的好拔多了，虽然不如左上的容易，但是不需要钻就拔了出来。右下的是最 hard core 的，不仅要钻，而且钻完了也花了好大功夫才解决。估计下面的开口比较严重，所以医生都给我缝合了。没感觉到他给我穿针，但是能感觉到他拉线和打结时把牙肉缝起来。其实真正拔牙的整个流程估计不超过10分钟？老实说也没有网上写的那么恐怖，可能是我身体素质比较好吧 :)&lt;/p&gt; &lt;p&gt;完了后做起来歇息了一下便走了（说到这，我都佩服我自己了，没有过敏，没有烟酒，没有遗传病，没有重大病史，各种指标正常，拔牙不叫不闹，估计医生也喜欢我这种病人吧…… 感谢上天感谢爹娘给我的强壮体魄~）。回家后一直要咬着纸巾止血。大概3-4个小时候麻药效果过去了。根据护士说法，我可以服用一些 ibuprofen （美国常见止疼药）来止疼。把纸巾取出来后的大概半个小时，真的很疼。小时候牙疼的那种感觉又回来了。不过好在半小时过后就没怎么疼了，也许是止疼药功效上来了，也可能伤口愈合得好。总的来说，还是没什么大问题。&lt;/p&gt; &lt;p&gt;接下来要做的，就是看它恢复得如何了。刚拔完自然是不敢吃比较硬的食物的。乖乖地给自己熬了粥喝。希望身体赶紧回复过来，一周后还要去 DC 和 NY 旅行呢~&lt;/p&gt; &lt;div class=&quot;references&quot;&gt;  &lt;/div&gt; &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1EJBmEB&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/3110576134267739427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/3110576134267739427?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3110576134267739427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3110576134267739427'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2015/05/blog-post.html' title='美国留学：学生保险拔智齿'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6805924884318880870</id><published>2015-05-05T03:38:00.001+08:00</published><updated>2015-05-05T03:38:32.120+08:00</updated><title type='text'>Popular watches under $150</title><content type='html'>&lt;img src=&quot;http://bit.ly/1GKWV9d&quot; style=&quot;&quot;&gt;&lt;p&gt;I&#39;ve been looking around entry-level watches for some time. Recently, I answered a &lt;a href=&quot;http://bit.ly/1GKWV9f&quot;&gt;question&lt;/a&gt; in Zhihu (Chinese Quora), and I feel like to transcribe this collection in my blog.&lt;/p&gt;      &lt;h2 id=&quot;dress-watch&quot;&gt;Dress Watch&lt;/h2&gt;  &lt;img src=&quot;http://bit.ly/1ESnnRx&quot; alt=&quot;Rodina R005, $119 via Amazon&quot; style=&quot;&quot;&gt;Rodina R005, $119 via Amazon&lt;p&gt;This watch is discussed in my previous &lt;a href=&quot;http://bit.ly/1xjCxgW&quot;&gt;blog post&lt;/a&gt;. It is a bit debatable as some people think it completely ripoff the NOMOS Tangente. However, considering there so many Rolex Submariner homages, this should also considered a homage. It uses a Seagull ST1701 movement, sapphire crystal, and display case back. At this price point, it is really a good deal. Get in on &lt;a href=&quot;http://amzn.to/1GKWTye&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1cenvQF&quot; alt=&quot;Orient Bambino, $130 via Amazon&quot; style=&quot;&quot;&gt;Orient Bambino, $130 via Amazon&lt;p&gt;I&#39;ve always like the ORIENT logo, much more than SEIKO&#39;s. This watch features Roman literals, blue hands and white classic dial. &lt;a href=&quot;http://amzn.to/1JlPUyz&quot;&gt;Amazon&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src=&quot;http://bit.ly/1cenvQH&quot; alt=&quot;Daniel Wellington, $120 Men&quot; style=&quot;&quot;&gt;&lt;img src=&quot;http://bit.ly/1JlPUyD&quot; alt=&quot;$85 Women&quot; style=&quot;&quot;&gt;&lt;/p&gt;  &lt;p&gt;This has been quite popular in China, due to their successful marketing campaign. It is a quartz (Japanese) watch with multiple variation, and looks really good. Get the best looking ones &lt;a href=&quot;http://amzn.to/1cenuw9&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://amzn.to/1JlPUyH&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;h2 id=&quot;divers-watch&quot;&gt;Diver&#39;s Watch&lt;/h2&gt;  &lt;p&gt;Now moves to my favorite category. Rolex designed the true classic look of today&#39;s diver&#39;s watch. However, the retail price for a submariner is probably too high for lots of people. Fortunately, Japanese brands SEIKO and ORIENT provide some affordable options here.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1cenvQN&quot; alt=&quot;SEIKO skx007&quot; style=&quot;&quot;&gt;SEIKO skx007&lt;p&gt;A very popular one. Considered as a poor man&#39;s Rolex. You can get it around $180 at &lt;a href=&quot;http://amzn.to/1JlPV5C&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1cenw73&quot; alt=&quot;Orient Ray&quot; style=&quot;&quot;&gt;Orient Ray&lt;p&gt;Also a very popular one. As I said, I really like Orient&#39;s LOGO. I find it far more interesting to see the lions and shields rather than just the word &quot;SEIKO&quot;. $130 at &lt;a href=&quot;http://amzn.to/1JlPXu9&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1cenw75&quot; alt=&quot;Orient Mako&quot; style=&quot;&quot;&gt;Orient Mako&lt;p&gt;Ray&#39;s brother, Mako. The watch face is slightly different, thinner hands, arabic numbers at 6, 9 and 12 o&#39;clock. Also around $130 at &lt;a href=&quot;http://amzn.to/1JlPV5I&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;h2 id=&quot;fieldflightpilot-watch&quot;&gt;Field/Flight/Pilot Watch&lt;/h2&gt;  &lt;p&gt;&lt;img src=&quot;http://bit.ly/1cenuMt&quot; alt=&quot;Seiko SNZG13&quot; style=&quot;&quot;&gt;&lt;img src=&quot;http://bit.ly/1JlPXud&quot; style=&quot;&quot;&gt;&lt;/p&gt;  &lt;p&gt;One of my favorite. It&#39;s lume is fantastic and got countless compliments. Only $100 at &lt;a href=&quot;http://amzn.to/1cenw79&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img src=&quot;http://bit.ly/1JlPXuh&quot; alt=&quot;Orient FER2A001B0 Pilot Watch&quot; style=&quot;&quot;&gt;&lt;img src=&quot;http://bit.ly/1cenw7d&quot; style=&quot;&quot;&gt;&lt;/p&gt;  &lt;p&gt;This is my favorite style. Look at the beautifully designed digits! It&#39;s lume is also awesome: lumes at all numbers! When it&#39;s on sale you can &lt;a href=&quot;http://amzn.to/1GCsWQG&quot;&gt;get it at $125&lt;/a&gt;.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1cenuMx&quot; alt=&quot;SEIKO SNK 809&quot; style=&quot;&quot;&gt;SEIKO SNK 809&lt;p&gt;Bestseller in Amazon. Come with various colors (&lt;a href=&quot;http://amzn.to/1HY92E4&quot;&gt;black&lt;/a&gt;, &lt;a href=&quot;http://amzn.to/1EVJrMP&quot;&gt;green&lt;/a&gt;, &lt;a href=&quot;http://amzn.to/1bJZXCj&quot;&gt;blue&lt;/a&gt;, &lt;a href=&quot;http://amzn.to/1GCtCpo&quot;&gt;beige&lt;/a&gt;). It&#39;s so cheap ($50) that people are getting all colors and rotate everyday. Also, since it&#39;s so affordable, it will become your workhorse. You won&#39;t treat it like million dollar watch that only put in your locker.&lt;/p&gt;  &lt;h2 id=&quot;skeleton-watch&quot;&gt;Skeleton Watch&lt;/h2&gt;  &lt;img src=&quot;http://bit.ly/1JlPVlX&quot; alt=&quot;Seagull M182SK&quot; style=&quot;&quot;&gt;Seagull M182SK&lt;p&gt;Quite popular in watchuseek forum. Very nice seagull movement with a complete see-through design. That said, it might be too busy to see the hands. $135 at &lt;a href=&quot;http://amzn.to/1cenuMz&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1JlPXuj&quot; alt=&quot;Fossil Grant&quot; style=&quot;&quot;&gt;Fossil Grant&lt;p&gt;This skeleton is cleaner than the Seagull&#39;s. Nevertheless, Seagull is more reputable than Fossil in watch making. &lt;a href=&quot;http://amzn.to/1HYa178&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;  &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;So there you have it. These watches are very affordable and have the great quality that earn them reputation. You can see them in nearly every watch forums. If you just started watch collecting, consider getting one of them. Let me know if you have any other suggestions.&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1JlPUP4&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6805924884318880870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6805924884318880870?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6805924884318880870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6805924884318880870'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2015/05/popular-watches-under-150.html' title='Popular watches under $150'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-3316177400625173180</id><published>2015-05-05T03:31:00.001+08:00</published><updated>2015-05-05T03:31:24.346+08:00</updated><title type='text'>Popular Watches Under Slash $150</title><content type='html'>body {    width: 45em;    border: 1px solid #ddd;    outline: 1300px solid #fff;    margin: 16px auto;  }    body .markdown-body  {    padding: 30px;  }    @font-face {    font-family: fontawesome-mini;    src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYHqhde9jbWFwAAAB6AAAAFIAAAFa4azkLWN2dCAAAAI8AAAAKAAAACgFgwioZnBnbQAAAmQAAAGxAAACZVO0L6dnYXNwAAAEGAAAAAgAAAAIAAAAEGdseWYAAAQgAAAFDgAACMz7eroHaGVhZAAACTAAAAAwAAAANgWEOEloaGVhAAAJYAAAAB0AAAAkDGEGa2htdHgAAAmAAAAAEwAAADBEgAAQbG9jYQAACZQAAAAaAAAAGgsICJBtYXhwAAAJsAAAACAAAAAgASgBD25hbWUAAAnQAAACZwAABOD4no+3cG9zdAAADDgAAABsAAAAmF+yXM9wcmVwAAAMpAAAAC4AAAAusPIrFAAAAAEAAAAAyYlvMQAAAADLVHQgAAAAAM/u9uZ4nGNgZGBg4ANiCQYQYGJgBEJuIGYB8xgABMMAPgAAAHicY2Bm42OcwMDKwMLSw2LMwMDQBqGZihmiwHycoKCyqJjB4YPDh4NsDP+BfNb3DIuAFCOSEgUGRgAKDgt4AAB4nGNgYGBmgGAZBkYGEAgB8hjBfBYGCyDNxcDBwMTA9MHhQ9SHrA8H//9nYACyQyFs/sP86/kX8HtB9UIBIxsDXICRCUgwMaACRoZhDwA3fxKSAAAAAAHyAHABJQB/AIEAdAFGAOsBIwC/ALgAxACGAGYAugBNACcA/wCIeJxdUbtOW0EQ3Q0PA4HE2CA52hSzmZDGe6EFCcTVjWJkO4XlCGk3cpGLcQEfQIFEDdqvGaChpEibBiEXSHxCPiESM2uIojQ7O7NzzpkzS8qRqnfpa89T5ySQwt0GzTb9Tki1swD3pOvrjYy0gwdabGb0ynX7/gsGm9GUO2oA5T1vKQ8ZTTuBWrSn/tH8Cob7/B/zOxi0NNP01DoJ6SEE5ptxS4PvGc26yw/6gtXhYjAwpJim4i4/plL+tzTnasuwtZHRvIMzEfnJNEBTa20Emv7UIdXzcRRLkMumsTaYmLL+JBPBhcl0VVO1zPjawV2ys+hggyrNgQfYw1Z5DB4ODyYU0rckyiwNEfZiq8QIEZMcCjnl3Mn+pED5SBLGvElKO+OGtQbGkdfAoDZPs/88m01tbx3C+FkcwXe/GUs6+MiG2hgRYjtiKYAJREJGVfmGGs+9LAbkUvvPQJSA5fGPf50ItO7YRDyXtXUOMVYIen7b3PLLirtWuc6LQndvqmqo0inN+17OvscDnh4Lw0FjwZvP+/5Kgfo8LK40aA4EQ3o3ev+iteqIq7wXPrIn07+xWgAAAAABAAH//wAPeJyFlctvG1UUh+/12DPN1B7P3JnYjj2Ox4/MuDHxJH5N3UdaEUQLqBIkfQQioJWQ6AMEQkIqsPGCPwA1otuWSmTBhjtps2ADWbJg3EpIXbGouqSbCraJw7kzNo2dRN1cnXN1ZvT7zuuiMEI7ncizyA0URofRBJpCdbQuIFShYY+GZRrxMDVtih5TwQPHtXDFFSIKoWIbuREBjLH27Ny4MsbVx+uOJThavebgVrNRLAiYx06rXsvhxLgWx9xpfHdrs/ekc2Pl2cpPCVEITQpwbj8VQhfXSq2m+Wxqaq2D73Kne5e3NjHqQNj3CRYlJlgUl/jRNP+2Gs2pNYRQiOnmUaQDqm30KqKiTTWPWjboxnTWpvgxjXo0KrtZXAHt7hwIz0YVcj88JnKlJKi3NPAwLyDwZudSmJSMMJFDYaOkaol6XtESx3Gt1VTytdZJ3DCLeaVhVnCBH1fycHTxFXwPX+l2e3d6H/TufGGmMTLTnbSJUdo00zuBswMO/nl3YLeL/wnu9/limCuD3vC54h5NBVz6Li414AI8Vx3iiosKcQXUbrvhFFiYb++HN4DaF4XzFW0fIN4XDWJ3a3XQoq9V8WiyRmdsatV9xUcHims1JloH0YUa090G3Tro3mC6c01f+YwCPquINr1PTaCP6rVTOOmf0GE2dBc7zWIhji3/5MchSuBHgDbU99RMWt3YUNMZMJmx92YP6NsHx/5/M1yvInpnkIOM3Z8fA3JQ2lW1RFC1KaBPDFXNAHYYvGy73aYZZZ3HifbeuiVZCpwA3oQBs0wGPYJbJfg60xrKEbKiNtTe1adwrpBRwlAuQ3q3VRaX0QmQ9a49BTSCuF1MLfQ6+tinOubRBZuWPNoMevGMT+V41KitO1is3D/tpMcq1JHZqDHGs8DoYGDkxJgKjHROeTCmhZvzPm9pod+ltKm4PN7Dyvvldlpsg8D+4AUJZ3F/JBstZz7cbFRxsaAGV6yX/dkcycWf8eS3QlQea+YLjdm3yrOnrhFpUyKVvFE4lpv4bO3Svx/6F/4xmiDu/RT5iI++lko18mY1oX+5UGKR6kmVjM/Zb76yfHtxy+h/SyQ0lLdpdKy/lWB6szatetQJ8nZ80A2Qt6ift6gJeavU3BO4gtxs/KCtNPVibCtYCWY3SIlSBPKXZALXiIR9oZeJ1AuMyxLpHIy/yO7vSiSE+kZvk0ihJ30HgHfzZtEMmvV58x6dtqns0XTAW7Vdm4HJ04OCp/crOO7rd9SGxQAE/mVA9xRN+kVSMRFF6S9JFGUtthkjBA5tFCWc2l4V43Ex9GmUP3SI37Jjmir9KqlaDJ4S4JB3vuM/jzyH1+8MuoZ+QGzfnvPoJb96cZlWjMcKLfgDwB7E634JTY+asjsPzS5CiVnEWY+KsrsIN5rn3mAPjqmQBxGjcGKB9f9ZxY3mYC2L85CJ2FXIxKKyHk+dg0FHbuEc7D5NzWUX32WxFcWNGRAbvwSx0RmIXVDuYySafluQBmzA/ssqJAMLnli+WIC90Gw4lm85wcp0qjArEDPJJV/sSx4P9ungTpgMw5gVC1XO4uULq0s3v1rqLi0vX/z65vlH50f8T/RHmSPTk5xxWBWOluMT6WiOy+tdvWxlV/XQb3o3c6Ssr+r6I708GsX9/nzp1tKFh0s3v7m4vAy/Hnb/KMOvc1wump6Il48K6mGDy02X9Yd65pa+nQIjk76lWxCkG8NBCP0HQS9IpAAAeJxjYGRgYGBhcCrq214Qz2/zlUGenQEEzr/77oug/zewFbB+AHI5GJhAogBwKQ0qeJxjYGRgYH3/P46BgZ0BBNgKGBgZUAEPAE/7At0AAAB4nGNngAB2IGYjhBsYBAAIYADVAAAAAAAAAAAAAFwAyAEeAaACCgKmAx4DggRmAAAAAQAAAAwAagAEAAAAAAACAAEAAgAWAAABAAChAAAAAHiclZI7bxQxFIWPd/JkUYQChEhIyAVKgdBMskm1QkKrRETpQiLRUczueB/K7HhlOxttg8LvoKPgP9DxFxANDR0tHRWi4NjrPIBEgh1p/dm+vufcawNYFWsQmP6e4jSyQB2fI9cwj++RE9wTjyPP4LYoI89iWbyLPIe6+Bh5Hs9rryMv4GbtW+RF3EhuRa7jbrIbeQkPkjdUETOLnL0Kip4FVvAhco1RXyMnSPEz8gzWxE7kWTwUp5HnsCLeR57HW/El8gJWa58iL+JO7UfkOh4l9yMv4UnyEtvQGGECgwF66MNBooF1bGCL1ELB/TYU+ZBRlvsKQ44Se6jQ4a7hef+fh72Crv25kp+8lNWGmeKoOI5jJLb1aGIGvb6TjfWNLdkqdFvJw4l1amjlXtXRZqRN7lSRylZZyhBqpVFWmTEXgWfUrpi/hZOQXdOd4rKuXOtEWT3k5IArPRzTUU5tHKjecZkTpnVbNOnt6jzN8240GD4xtikvZW56043rPMg/dS+dlOceXoR+WPbJ55Dsekq1lJpnypsMUsYOdCW30o103Ytu/lvh+5RWFLfBjm9/N8hJntPhvx92rnoE/kyHdGasGy754kw36vsVf/lFeBi+0COu+cfgQr42G3CRpeLoZ53gmfe3X6rcKt5oVxnptHR9JS8ehVUd5wvvahN2uqxOOpMXapibI5k7Zwbt4xBSaTfoKBufhAnO/uqNcfK8OTs0OQ6l7JIqFjDhYj5WcjevCnI/1DDiI8j4ndWb/5YzDZWh79yomWXeXj7Nnw70/2TIeFPTrlSh89k1ObOSRVZWZfgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format(&amp;#8216;woff&amp;#8217;);  }    @font-face {    font-family: octicons-anchor;    src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format(&amp;#8216;woff&amp;#8217;);  }    .markdown-body {    font-family: sans-serif;    -ms-text-size-adjust: 100%;    -webkit-text-size-adjust: 100%;    color: #333333;    overflow: hidden;    font-family: &amp;#8220;Helvetica Neue&amp;#8221;, Helvetica, &amp;#8220;Segoe UI&amp;#8221;, Arial, freesans, sans-serif;    font-size: 16px;    line-height: 1.6;    word-wrap: break-word;  }    .markdown-body a {    background: transparent;  }    .markdown-body a:active,  .markdown-body a:hover {    outline: 0;  }    .markdown-body b,  .markdown-body strong {    font-weight: bold;  }    .markdown-body mark {    background: #ff0;    color: #000;    font-style: italic;    font-weight: bold;  }    .markdown-body sub,  .markdown-body sup {    font-size: 75%;    line-height: 0;    position: relative;    vertical-align: baseline;  }  .markdown-body sup {    top: -0.5em;  }  .markdown-body sub {    bottom: -0.25em;  }    .markdown-body h1 {    font-size: 2em;    margin: 0.67em 0;  }    .markdown-body img {    border: 0;  }    .markdown-body hr {    -moz-box-sizing: content-box;    box-sizing: content-box;    height: 0;  }    .markdown-body pre {    overflow: auto;  }    .markdown-body code,  .markdown-body kbd,  .markdown-body pre,  .markdown-body samp {    font-family: monospace, monospace;    font-size: 1em;  }    .markdown-body input {    color: inherit;    font: inherit;    margin: 0;  }    .markdown-body html input[disabled] {    cursor: default;  }    .markdown-body input {    line-height: normal;  }    .markdown-body input[type=&amp;#8221;checkbox&amp;#8221;] {    box-sizing: border-box;    padding: 0;  }    .markdown-body table {    border-collapse: collapse;    border-spacing: 0;  }    .markdown-body td,  .markdown-body th {    padding: 0;  }    .markdown-body .codehilitetable {    border: 0;    border-spacing: 0;  }    .markdown-body .codehilitetable tr {    border: 0;  }    .markdown-body .codehilitetable pre,  .markdown-body .codehilitetable div.codehilite {    margin: 0;  }    .markdown-body .linenos,  .markdown-body .code,  .markdown-body .codehilitetable td {    border: 0;    padding: 0;  }    .markdown-body td:not(.linenos) .linenodiv {    padding: 0 !important;  }    .markdown-body .code {    width: 100%;  }    .markdown-body .linenos div pre,  .markdown-body .linenodiv pre,  .markdown-body .linenodiv {    border: 0;    -webkit-border-radius: 0;    -moz-border-radius: 0;    border-radius: 0;    -webkit-border-top-left-radius: 3px;    -webkit-border-bottom-left-radius: 3px;    -moz-border-radius-topleft: 3px;    -moz-border-radius-bottomleft: 3px;    border-top-left-radius: 3px;    border-bottom-left-radius: 3px;  }    .markdown-body .code div pre,  .markdown-body .code div {    border: 0;    -webkit-border-radius: 0;    -moz-border-radius: 0;    border-radius: 0;    -webkit-border-top-right-radius: 3px;    -webkit-border-bottom-right-radius: 3px;    -moz-border-radius-topright: 3px;    -moz-border-radius-bottomright: 3px;    border-top-right-radius: 3px;    border-bottom-right-radius: 3px;  }    .markdown-body * {    -moz-box-sizing: border-box;    box-sizing: border-box;  }    .markdown-body input {    font: 13px Helvetica, arial, freesans, clean, sans-serif, &amp;#8220;Segoe UI Emoji&amp;#8221;, &amp;#8220;Segoe UI Symbol&amp;#8221;;    line-height: 1.4;  }    .markdown-body a {    color: #4183c4;    text-decoration: none;  }    .markdown-body a:hover,  .markdown-body a:focus,  .markdown-body a:active {    text-decoration: underline;  }    .markdown-body hr {    height: 0;    margin: 15px 0;    overflow: hidden;    background: transparent;    border: 0;    border-bottom: 1px solid #ddd;  }    .markdown-body hr:before,  .markdown-body hr:after {    display: table;    content: &amp;#8221; &amp;#8220;;  }    .markdown-body hr:after {    clear: both;  }    .markdown-body h1,  .markdown-body h2,  .markdown-body h3,  .markdown-body h4,  .markdown-body h5,  .markdown-body h6 {    margin-top: 15px;    margin-bottom: 15px;    line-height: 1.1;  }    .markdown-body h1 {    font-size: 30px;  }    .markdown-body h2 {    font-size: 21px;  }    .markdown-body h3 {    font-size: 16px;  }    .markdown-body h4 {    font-size: 14px;  }    .markdown-body h5 {    font-size: 12px;  }    .markdown-body h6 {    font-size: 11px;  }    .markdown-body blockquote {    margin: 0;  }    .markdown-body ul,  .markdown-body ol {    padding: 0;    margin-top: 0;    margin-bottom: 0;  }    .markdown-body ol ol,  .markdown-body ul ol {    list-style-type: lower-roman;  }    .markdown-body ul ul ol,  .markdown-body ul ol ol,  .markdown-body ol ul ol,  .markdown-body ol ol ol {    list-style-type: lower-alpha;  }    .markdown-body dd {    margin-left: 0;  }    .markdown-body code,  .markdown-body pre,  .markdown-body samp {    font-family: Consolas, &amp;#8220;Liberation Mono&amp;#8221;, Menlo, Courier, monospace;    font-size: 12px;  }    .markdown-body pre {    margin-top: 0;    margin-bottom: 0;  }    .markdown-body kbd {    background-color: #e7e7e7;    background-image: -moz-linear-gradient(#fefefe, #e7e7e7);    background-image: -webkit-linear-gradient(#fefefe, #e7e7e7);    background-image: linear-gradient(#fefefe, #e7e7e7);    background-repeat: repeat-x;    border-radius: 2px;    border: 1px solid #cfcfcf;    color: #000;    padding: 3px 5px;    line-height: 10px;    font: 11px Consolas, &amp;#8220;Liberation Mono&amp;#8221;, Menlo, Courier, monospace;    display: inline-block;  }    .markdown-body&gt;*:first-child {    margin-top: 0 !important;  }    .markdown-body&gt;*:last-child {    margin-bottom: 0 !important;  }    .markdown-body .headeranchor-link {    position: absolute;    top: 0;    bottom: 0;    left: 0;    display: block;    padding-right: 6px;    padding-left: 30px;    margin-left: -30px;  }    .markdown-body .headeranchor-link:focus {    outline: none;  }    .markdown-body h1,  .markdown-body h2,  .markdown-body h3,  .markdown-body h4,  .markdown-body h5,  .markdown-body h6 {    position: relative;    margin-top: 1em;    margin-bottom: 16px;    font-weight: bold;    line-height: 1.4;  }    .markdown-body h1 .headeranchor,  .markdown-body h2 .headeranchor,  .markdown-body h3 .headeranchor,  .markdown-body h4 .headeranchor,  .markdown-body h5 .headeranchor,  .markdown-body h6 .headeranchor {    display: none;    color: #000;    vertical-align: middle;  }    .markdown-body h1:hover .headeranchor-link,  .markdown-body h2:hover .headeranchor-link,  .markdown-body h3:hover .headeranchor-link,  .markdown-body h4:hover .headeranchor-link,  .markdown-body h5:hover .headeranchor-link,  .markdown-body h6:hover .headeranchor-link {    height: 1em;    padding-left: 8px;    margin-left: -30px;    line-height: 1;    text-decoration: none;  }    .markdown-body h1:hover .headeranchor-link .headeranchor,  .markdown-body h2:hover .headeranchor-link .headeranchor,  .markdown-body h3:hover .headeranchor-link .headeranchor,  .markdown-body h4:hover .headeranchor-link .headeranchor,  .markdown-body h5:hover .headeranchor-link .headeranchor,  .markdown-body h6:hover .headeranchor-link .headeranchor {    display: inline-block;  }    .markdown-body h1 {    padding-bottom: 0.3em;    font-size: 2.25em;    line-height: 1.2;    border-bottom: 1px solid #eee;  }    .markdown-body h2 {    padding-bottom: 0.3em;    font-size: 1.75em;    line-height: 1.225;    border-bottom: 1px solid #eee;  }    .markdown-body h3 {    font-size: 1.5em;    line-height: 1.43;  }    .markdown-body h4 {    font-size: 1.25em;  }    .markdown-body h5 {    font-size: 1em;  }    .markdown-body h6 {    font-size: 1em;    color: #777;  }    .markdown-body p,  .markdown-body blockquote,  .markdown-body ul,  .markdown-body ol,  .markdown-body dl,  .markdown-body table,  .markdown-body pre,  .markdown-body .admonition {    margin-top: 0;    margin-bottom: 16px;  }    .markdown-body hr {    height: 4px;    padding: 0;    margin: 16px 0;    background-color: #e7e7e7;    border: 0 none;  }    .markdown-body ul,  .markdown-body ol {    padding-left: 2em;  }    .markdown-body ul ul,  .markdown-body ul ol,  .markdown-body ol ol,  .markdown-body ol ul {    margin-top: 0;    margin-bottom: 0;  }    .markdown-body li&gt;p {    margin-top: 16px;  }    .markdown-body dl {    padding: 0;  }    .markdown-body dl dt {    padding: 0;    margin-top: 16px;    font-size: 1em;    font-style: italic;    font-weight: bold;  }    .markdown-body dl dd {    padding: 0 16px;    margin-bottom: 16px;  }    .markdown-body blockquote {    padding: 0 15px;    color: #777;    border-left: 4px solid #ddd;  }    .markdown-body blockquote&gt;:first-child {    margin-top: 0;  }    .markdown-body blockquote&gt;:last-child {    margin-bottom: 0;  }    .markdown-body table {    display: block;    width: 100%;    overflow: auto;    word-break: normal;    word-break: keep-all;  }    .markdown-body table th {    font-weight: bold;  }    .markdown-body table th,  .markdown-body table td {    padding: 6px 13px;    border: 1px solid #ddd;  }    .markdown-body table tr {    background-color: #fff;    border-top: 1px solid #ccc;  }    .markdown-body table tr:nth-child(2n) {    background-color: #f8f8f8;  }    .markdown-body img {    max-width: 100%;    -moz-box-sizing: border-box;    box-sizing: border-box;  }    .markdown-body code,  .markdown-body samp {    padding: 0;    padding-top: 0.2em;    padding-bottom: 0.2em;    margin: 0;    font-size: 85%;    background-color: rgba(0,0,0,0.04);    border-radius: 3px;  }    .markdown-body code:before,  .markdown-body code:after {    letter-spacing: -0.2em;    content: &amp;#8220;\00a0&amp;#8221;;  }    .markdown-body pre&gt;code {    padding: 0;    margin: 0;    font-size: 100%;    word-break: normal;    white-space: pre;    background: transparent;    border: 0;  }    .markdown-body .codehilite {    margin-bottom: 16px;  }    .markdown-body .codehilite pre,  .markdown-body pre {    padding: 16px;    overflow: auto;    font-size: 85%;    line-height: 1.45;    background-color: #f7f7f7;    border-radius: 3px;  }    .markdown-body .codehilite pre {    margin-bottom: 0;    word-break: normal;  }    .markdown-body pre {    word-wrap: normal;  }    .markdown-body pre code {    display: inline;    max-width: initial;    padding: 0;    margin: 0;    overflow: initial;    line-height: inherit;    word-wrap: normal;    background-color: transparent;    border: 0;  }    .markdown-body pre code:before,  .markdown-body pre code:after {    content: normal;  }    /* Admonition */  .markdown-body .admonition {    -webkit-border-radius: 3px;    -moz-border-radius: 3px;    position: relative;    border-radius: 3px;    border: 1px solid #e0e0e0;    border-left: 6px solid #333;    padding: 10px 10px 10px 30px;  }    .markdown-body .admonition table {    color: #333;  }    .markdown-body .admonition p {    padding: 0;  }    .markdown-body .admonition-title {    font-weight: bold;    margin: 0;  }    .markdown-body .admonition&gt;.admonition-title {    color: #333;  }    .markdown-body .attention&gt;.admonition-title {    color: #a6d796;  }    .markdown-body .caution&gt;.admonition-title {    color: #d7a796;  }    .markdown-body .hint&gt;.admonition-title {    color: #96c6d7;  }    .markdown-body .danger&gt;.admonition-title {    color: #c25f77;  }    .markdown-body .question&gt;.admonition-title {    color: #96a6d7;  }    .markdown-body .note&gt;.admonition-title {    color: #d7c896;  }    .markdown-body .admonition:before,  .markdown-body .attention:before,  .markdown-body .caution:before,  .markdown-body .hint:before,  .markdown-body .danger:before,  .markdown-body .question:before,  .markdown-body .note:before {    font: normal normal 16px fontawesome-mini;    -moz-osx-font-smoothing: grayscale;    -webkit-user-select: none;    -moz-user-select: none;    -ms-user-select: none;    user-select: none;    line-height: 1.5;    color: #333;    position: absolute;    left: 0;    top: 0;    padding-top: 10px;    padding-left: 10px;  }    .markdown-body .admonition:before {    content: &amp;#8220;\f056\00a0&amp;#8221;;    color: 333;  }    .markdown-body .attention:before {    content: &amp;#8220;\f058\00a0&amp;#8221;;    color: #a6d796;  }    .markdown-body .caution:before {    content: &amp;#8220;\f06a\00a0&amp;#8221;;    color: #d7a796;  }    .markdown-body .hint:before {    content: &amp;#8220;\f05a\00a0&amp;#8221;;    color: #96c6d7;  }    .markdown-body .danger:before {    content: &amp;#8220;\f057\00a0&amp;#8221;;    color: #c25f77;  }    .markdown-body .question:before {    content: &amp;#8220;\f059\00a0&amp;#8221;;    color: #96a6d7;  }    .markdown-body .note:before {    content: &amp;#8220;\f040\00a0&amp;#8221;;    color: #d7c896;  }    .markdown-body .admonition::after {    content: normal;  }    .markdown-body .attention {    border-left: 6px solid #a6d796;  }    .markdown-body .caution {    border-left: 6px solid #d7a796;  }    .markdown-body .hint {    border-left: 6px solid #96c6d7;  }    .markdown-body .danger {    border-left: 6px solid #c25f77;  }    .markdown-body .question {    border-left: 6px solid #96a6d7;  }    .markdown-body .note {    border-left: 6px solid #d7c896;  }    .markdown-body .admonition&gt;*:first-child {    margin-top: 0 !important;  }    .markdown-body .admonition&gt;*:last-child {    margin-bottom: 0 !important;  }    /* progress bar*/  .markdown-body .progress {    display: block;    width: 300px;    margin: 10px 0;    height: 24px;    -webkit-border-radius: 3px;    -moz-border-radius: 3px;    border-radius: 3px;    background-color: #ededed;    position: relative;    box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);  }    .markdown-body .progress-label {    position: absolute;    text-align: center;    font-weight: bold;    width: 100%; margin: 0;    line-height: 24px;    color: #333;    text-shadow: 1px 1px 0 #fefefe, -1px -1px 0 #fefefe, -1px 1px 0 #fefefe, 1px -1px 0 #fefefe, 0 1px 0 #fefefe, 0 -1px 0 #fefefe, 1px 0 0 #fefefe, -1px 0 0 #fefefe, 1px 1px 2px #000;    -webkit-font-smoothing: antialiased !important;    white-space: nowrap;    overflow: hidden;  }    .markdown-body .progress-bar {    height: 24px;    float: left;    -webkit-border-radius: 3px;    -moz-border-radius: 3px;    border-radius: 3px;    background-color: #96c6d7;    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .1);    background-size: 30px 30px;    background-image: -webkit-linear-gradient(      135deg, rgba(255, 255, 255, .4) 27%,      transparent 27%,      transparent 52%, rgba(255, 255, 255, .4) 52%,      rgba(255, 255, 255, .4) 77%,      transparent 77%, transparent    );    background-image: -moz-linear-gradient(      135deg,      rgba(255, 255, 255, .4) 27%, transparent 27%,      transparent 52%, rgba(255, 255, 255, .4) 52%,      rgba(255, 255, 255, .4) 77%, transparent 77%,      transparent    );    background-image: -ms-linear-gradient(      135deg,      rgba(255, 255, 255, .4) 27%, transparent 27%,      transparent 52%, rgba(255, 255, 255, .4) 52%,      rgba(255, 255, 255, .4) 77%, transparent 77%,      transparent    );    background-image: -o-linear-gradient(      135deg,      rgba(255, 255, 255, .4) 27%, transparent 27%,      transparent 52%, rgba(255, 255, 255, .4) 52%,      rgba(255, 255, 255, .4) 77%, transparent 77%,      transparent    );    background-image: linear-gradient(      135deg,      rgba(255, 255, 255, .4) 27%, transparent 27%,      transparent 52%, rgba(255, 255, 255, .4) 52%,      rgba(255, 255, 255, .4) 77%, transparent 77%,      transparent    );  }    .markdown-body .progress-100plus .progress-bar {    background-color: #a6d796;  }    .markdown-body .progress-80plus .progress-bar {    background-color: #c6d796;  }    .markdown-body .progress-60plus .progress-bar {    background-color: #d7c896;  }    .markdown-body .progress-40plus .progress-bar {    background-color: #d7a796;  }    .markdown-body .progress-20plus .progress-bar {    background-color: #d796a6;  }    .markdown-body .progress-0plus .progress-bar {    background-color: #c25f77;  }    .markdown-body .candystripe-animate .progress-bar{    -webkit-animation: animate-stripes 3s linear infinite;    -moz-animation: animate-stripes 3s linear infinite;    animation: animate-stripes 3s linear infinite;  }    @-webkit-keyframes animate-stripes {    0% {      background-position: 0 0;    }      100% {      background-position: 60px 0;    }  }    @-moz-keyframes animate-stripes {    0% {      background-position: 0 0;    }      100% {      background-position: 60px 0;    }  }    @keyframes animate-stripes {    0% {      background-position: 0 0;    }      100% {      background-position: 60px 0;    }  }    .markdown-body .gloss .progress-bar {    box-shadow:      inset 0 4px 12px rgba(255, 255, 255, .7),      inset 0 -12px 0 rgba(0, 0, 0, .05);  }    /* Multimarkdown Critic Blocks */  .markdown-body .critic_mark {    background: #ff0;  }    .markdown-body .critic_delete {    color: #c82829;    text-decoration: line-through;  }    .markdown-body .critic_insert {    color: #718c00 ;    text-decoration: underline;  }    .markdown-body .critic_comment {    color: #8e908c;    font-style: italic;  }    .markdown-body .headeranchor {    font: normal normal 16px octicons-anchor;    line-height: 1;    display: inline-block;    text-decoration: none;    -webkit-font-smoothing: antialiased;    -moz-osx-font-smoothing: grayscale;    -webkit-user-select: none;    -moz-user-select: none;    -ms-user-select: none;    user-select: none;  }    .headeranchor:before {    content: &amp;#8216;\f05c&amp;#8217;;  }    .markdown-body .task-list-item {    list-style-type: none;  }    .markdown-body .task-list-item+.task-list-item {    margin-top: 3px;  }    .markdown-body .task-list-item input {    margin: 0 4px 0.25em -20px;    vertical-align: middle;  }    /* Media */  @media only screen and (min-width: 480px) {    .markdown-body {      font-size:14px;    }  }    @media only screen and (min-width: 768px) {    .markdown-body {      font-size:16px;    }  }    @media print {    .markdown-body * {      background: transparent !important;      color: black !important;      filter:none !important;      -ms-filter: none !important;    }      .markdown-body {      font-size:12pt;      max-width:100%;      outline:none;      border: 0;    }      .markdown-body a,    .markdown-body a:visited {      text-decoration: underline;    }      .markdown-body .headeranchor-link {      display: none;    }      .markdown-body a[href]:after {      content: &amp;#8221; (&amp;#8221; attr(href) &amp;#8220;)&amp;#8221;;    }      .markdown-body abbr[title]:after {      content: &amp;#8221; (&amp;#8221; attr(title) &amp;#8220;)&amp;#8221;;    }      .markdown-body .ir a:after,    .markdown-body a[href^=&amp;#8221;javascript:&amp;#8221;]:after,    .markdown-body a[href^=&amp;#8221;#&amp;#8221;]:after {      content: &amp;#8220;&amp;#8221;;    }      .markdown-body pre {      white-space: pre;      white-space: pre-wrap;      word-wrap: break-word;    }      .markdown-body pre,    .markdown-body blockquote {      border: 1px solid #999;      padding-right: 1em;      page-break-inside: avoid;    }      .markdown-body .progress,    .markdown-body .progress-bar {      -moz-box-shadow: none;      -webkit-box-shadow: none;      box-shadow: none;    }      .markdown-body .progress {      border: 1px solid #ddd;    }      .markdown-body .progress-bar {      height: 22px;      border-right: 1px solid #ddd;    }      .markdown-body tr,    .markdown-body img {      page-break-inside: avoid;    }      .markdown-body img {      max-width: 100% !important;    }      .markdown-body p,    .markdown-body h2,    .markdown-body h3 {      orphans: 3;      widows: 3;    }      .markdown-body h2,    .markdown-body h3 {      page-break-after: avoid;    }  }  &lt;title&gt;2015-05-04-popular-watches-under-slash-$150&lt;/title&gt;&lt;hr&gt;&lt;p&gt;layout: post&lt;br&gt;  title: &quot;Popular watches under \$150&quot;&lt;br&gt;  date: 2015-05-04 13:24:35 -0500&lt;br&gt;  comments: true&lt;br&gt;  categories: [watches]&lt;/p&gt;  &lt;hr&gt;&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://bit.ly/1GKWV9d&quot; style=&quot;&quot;&gt;&lt;/p&gt;  &lt;p&gt;I&#39;ve been looking around entry-level watches for some time. Recently,&lt;br&gt;  I answered a &lt;a href=&quot;http://bit.ly/1GKWV9f&quot;&gt;question&lt;/a&gt; in Zhihu (Chinese Quora), and I feel like to &lt;br&gt;  transcribe this collection in my blog. &lt;/p&gt;  &lt;h2 id=&quot;dress-watch&quot;&gt;  &lt;a name=&quot;user-content-dress-watch&quot; href=&quot;#dress-watch&quot; class=&quot;headeranchor-link&quot;&gt;&lt;span class=&quot;headeranchor&quot;&gt;&lt;/span&gt;&lt;/a&gt;Dress Watch&lt;/h2&gt;  &lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://bit.ly/1ESnnRx&quot; style=&quot;&quot;&gt;&lt;/p&gt;  &lt;p&gt;This watch is discussed in my previous &lt;a href=&quot;#&quot;&gt;blog post&lt;/a&gt;. It is a bit debatable as some people think it completely&lt;br&gt;  ripoff the NOMOS Tangente. However, considering there so many Rolex Submariner&lt;br&gt;  homages, this should also considered a homage. It uses a Seagull ST1701 movement,&lt;br&gt;  sapphire crystal, and display case back. At this price point, it is really&lt;br&gt;  a good deal. Get in on &lt;a href=&quot;http://amzn.to/1GKWTye&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1ESnlZZ&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/3316177400625173180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/3316177400625173180?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3316177400625173180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3316177400625173180'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2015/05/popular-watches-under-slash-150.html' title='Popular Watches Under Slash $150'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6486094118330815811</id><published>2015-03-27T14:23:00.001+08:00</published><updated>2015-03-27T14:23:37.614+08:00</updated><title type='text'>Watch Review: Rodina R005GB</title><content type='html'>&lt;img src=&quot;http://bit.ly/1NglErw&quot; alt=&quot;Tangente&quot; style=&quot;&quot;&gt;Tangente&lt;p&gt;So NOMOS has this awesome looking Bauhaus style watch: &lt;a href=&quot;http://bit.ly/1NglEry&quot;&gt;Tangente&lt;/a&gt;. Apparently everyone wants one, but not everyone wants to break their bank ($2330 USD).&lt;/p&gt;  &lt;p&gt;Luckily, we have an alternative here: &lt;a href=&quot;http://bit.ly/1xjCy4A&quot;&gt;Rodina series watches&lt;/a&gt;.&lt;/p&gt;      &lt;h2 id=&quot;the-review&quot;&gt;The Review&lt;/h2&gt;  &lt;p&gt;Some people think it a copycat watch, while some others think it a homage. The truth is, with price only &lt;span&gt;$&lt;/span&gt;139.99, it is a really affordable price. During Valentine&#39;s, it is on sale with $99.99 shipped. The website frequently has sales. Without further delay, I bought it when it&#39;s one sale. It is shipped from Tianjin, China via EMS, and USPS after it arrives in US. After 10 days of waiting, I finally received it!&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1xjCy4B&quot; style=&quot;&quot;&gt;&lt;p&gt;It&#39;s funny that as others commented, the soft bag is supposed to be used to hold the watch, but after opening the case, the watch is not wrapped around it.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1xjCAJD&quot; style=&quot;&quot;&gt;&lt;p&gt;However, the watch itself is fine and intact. It is wrapped in plastic strips under good protection.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1NglHne&quot; style=&quot;&quot;&gt;&lt;p&gt;These are all the stuff in the box. I can understand that, as I don&#39;t think Rodina is not any famous big brand. Don&#39;t expect full service inside the box.&lt;/p&gt;  &lt;p&gt;This is really how it should come:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1NglEHX&quot; style=&quot;&quot;&gt;&lt;p&gt;It&#39;s transparent back, which is a perfect show-off for automatic watches. As you can see, it&#39;s 5ATM, which is slightly better than 3ATM that a lot of cheap watches have. It is said to have a Seagull ST1713 movement (with date function).&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1NglHng&quot; style=&quot;&quot;&gt;&lt;p&gt;The crown is really a bummer. If you go to look for its pictures online, the &#39;R&#39; will have a blue coating. However, the blue coating on mine is totally off. I wiped them clean instead. You can see there is still blue pieces in the cleaning cloth. Nevertheless, I like the letter &#39;R&#39; in the crown.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1NglEI1&quot; style=&quot;&quot;&gt;&lt;p&gt;The watch dial is unbeatable. Case is made with sapphire crystal, which is astonishing for this price. The hands are in blue dark blue, which looks really cool. The only problem as someone else pointed out is that the fonts does not match: the numbers are sans-serif, while the Rodina letters are serif fonts. Furthermore, &#39;CHINA MADE&#39; sounds weird, although I can understand they may feel proud to say this.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1xjCy4H&quot; style=&quot;&quot;&gt;&lt;p&gt;The strap. Leather is of cheap quality as expected. Feels like plastic. However, the making is not bad. The stitching, the holes, are definitely satisfactory. I picked the brown one as I think black is too dressy for everyday wear. I have a skinny wrist, so I almost used the last hole.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1NglEI4&quot; style=&quot;&quot;&gt;&lt;p&gt;This is how it looks like on my wrist. 39mm is a bit small for me. However, the winding piece is not stable enough. It creates noise and you can feel it moving when you move your arm and thus triggering the winding action. The ticking sound is pretty small though, compared to the notorious Timex Weekender.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1xjCykX&quot; style=&quot;&quot;&gt;&lt;img src=&quot;http://bit.ly/1xjCAJH&quot; style=&quot;&quot;&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;With lots of imperfection, this watch is still worth buying. I really like it&#39;s style. I wish I get one with roman literals and dates (the one with Roman literal does not have dates). I wish the leather is of better quality. But with this price point, one cannot expect too much, and the quality of the watch itself is really good. Here&#39;s the pros and cons:&lt;/p&gt;  &lt;p&gt;Pros:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;Affordable price&lt;/li&gt;  &lt;li&gt;Good style, similar to the famous NOMOS Bauhaus style&lt;/li&gt;  &lt;li&gt;Seagull ST1713 automatic movement&lt;/li&gt;  &lt;li&gt;5ATM (instead of 3ATM)&lt;/li&gt;  &lt;li&gt;Stainless steel case&lt;/li&gt;  &lt;li&gt;Sapphire crystal!&lt;/li&gt;  &lt;/ul&gt;&lt;p&gt;Cons:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;Noisy winding action&lt;/li&gt;  &lt;li&gt;Low quality leather (notice that the strap is good, only the leather is bad quality)&lt;/li&gt;  &lt;li&gt;Fonts in the dial do not match&lt;/li&gt;  &lt;li&gt;Blue coating in the crown not printed at the perfect location&lt;/li&gt;  &lt;li&gt;Whether it is a copycat or homage is debatable.&lt;/li&gt;  &lt;/ul&gt;&lt;p&gt;In general, my first impression for the watch is good. Might need some more time wearing it to see if , what do you think?&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1xjCxgW&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6486094118330815811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6486094118330815811?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6486094118330815811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6486094118330815811'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2015/03/watch-review-rodina-r005gb.html' title='Watch Review: Rodina R005GB'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-5065994319897245176</id><published>2014-09-29T11:12:00.001+08:00</published><updated>2014-09-29T11:12:42.864+08:00</updated><title type='text'>Notes on Maximum Likelihood, Maximum A Posteriori and Naive Bayes</title><content type='html'>&lt;p&gt;Let &lt;span class=&quot;math&quot;&gt;\(\data\)&lt;/span&gt; be a set of data generated from some distribution parameterized by &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt;. We want to &lt;em&gt;estimate&lt;/em&gt; the unknown parameter &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt;. What we can do?&lt;/p&gt;  &lt;p&gt;Essentially, we want to find a most likely value of &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt; given &lt;span class=&quot;math&quot;&gt;\(\data\)&lt;/span&gt;, that is &lt;span class=&quot;math&quot;&gt;\(\arg \max P(\theta | \data)\)&lt;/span&gt;. According to Bayes Rule, we have&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ P(\theta \given \data) = \frac{P(\data \given \theta)P(\theta)}{P(\data)} \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;and the terms have the following meanings:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(P(\theta \given \data)\)&lt;/span&gt;: Posterior&lt;/li&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(P(\data \given \theta)\)&lt;/span&gt;: Likelihood&lt;/li&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(P(\theta)\)&lt;/span&gt;: Prior&lt;/li&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(P(\data)\)&lt;/span&gt;: Evidence&lt;/li&gt;  &lt;/ul&gt;&lt;h2 id=&quot;maximum-likelihood-estimation-mle&quot;&gt;Maximum Likelihood Estimation (MLE)&lt;/h2&gt;  &lt;p&gt;An easy way out is to use the MLE method. We want to find a &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt; the &lt;em&gt;best explains&lt;/em&gt; the data. That is, we maximize &lt;span class=&quot;math&quot;&gt;\(P(\data \given \theta)\)&lt;/span&gt;. Denote such a value as &lt;span class=&quot;math&quot;&gt;\(\hat{\theta}_{ML}\)&lt;/span&gt;. We have&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ \hat{\theta}_{ML} = \argmax_\theta P(\data \given \theta) = \argmax_\theta P(\mathbf{x}_1, \ldots, \mathbf{x}_N \given \theta ) \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Note that the above &lt;span class=&quot;math&quot;&gt;\(P\)&lt;/span&gt; is a joint distribution over the data. We usually assume the observations are &lt;em&gt;independent&lt;/em&gt;. Thus, we have&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ P(\mathbf{x}_1, \ldots, \mathbf{x}_N \given \theta ) = \prod_{i=1}^{N} P(\mathbf{x}_i \given \theta ) \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;We usually use logarithm to simplify the computation, as logarithm is monotonically increasing. Thus, we write:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ \mathcal{L}(\data \given \theta) = \sum_{i=1}^N \log P(\mathbf{x}_i \given \theta ) \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Finally, we seek for the ML solution:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ \hat{\theta}_{ML} = \argmax_\theta \mathcal{L}(\data \given \theta) \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;If we know the distribution &lt;span class=&quot;math&quot;&gt;\(P\)&lt;/span&gt;, we can usually solve the above by setting derivative of &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt; to 0 and solve for &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt;, that is,&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ \frac{\partial L}{\partial \theta} = 0 \]&lt;/span&gt;&lt;/p&gt;  &lt;h2 id=&quot;maximum-a-posteriori-map&quot;&gt;Maximum A Posteriori (MAP)&lt;/h2&gt;  &lt;p&gt;In MAP, we maximize &lt;span class=&quot;math&quot;&gt;\(P(\theta \given \data)\)&lt;/span&gt; directly. Denote the MAP hypothesis as &lt;span class=&quot;math&quot;&gt;\(\hat{\theta}_{MAP}\)&lt;/span&gt;, we have:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[\begin{array}{rl} \hat{\theta}_{MAP} = &amp;amp; \argmax_\theta P(\theta \given \data) \\ = &amp;amp; \argmax_\theta \frac{P(\data \given \theta)P(\theta)}{P(\data)} \\ = &amp;amp; \argmax_\theta P(\data \given \theta)P(\theta) \end{array}\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Note that the last step is due to the evidence (data) &lt;span class=&quot;math&quot;&gt;\(\data\)&lt;/span&gt; is constant, and thus can be omitted in &lt;span class=&quot;math&quot;&gt;\(\argmax\)&lt;/span&gt;.&lt;/p&gt;  &lt;p&gt;At this step, we notice that the only difference between &lt;span class=&quot;math&quot;&gt;\(\hat{\theta}_{ML}\)&lt;/span&gt; and &lt;span class=&quot;math&quot;&gt;\(\hat{\theta}_{MAP}\)&lt;/span&gt; is the prior term &lt;span class=&quot;math&quot;&gt;\(P(\theta)\)&lt;/span&gt;. Another way to interpret is that we consider &lt;span class=&quot;math&quot;&gt;\(MAP\)&lt;/span&gt; is more general than &lt;span class=&quot;math&quot;&gt;\(MLE\)&lt;/span&gt;, as if we assume all the possible &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt; are equally probable a priori, e.g., they have the same prior probability, or &lt;em&gt;uniform prior&lt;/em&gt;, we can effectively remove &lt;span class=&quot;math&quot;&gt;\(P(\theta)\)&lt;/span&gt; from the MAP formula, and it looks like exactly the same as MLE.&lt;/p&gt;  &lt;p&gt;Finally, if the independent observation holds, again we can use logarithm and expand &lt;span class=&quot;math&quot;&gt;\(\hat{\theta}_{MAP}\)&lt;/span&gt; as:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[ \begin{array}{rl} \hat{\theta}_{MAP} = &amp;amp; \argmax_\theta L(\data \given \theta) \\ = &amp;amp; \argmax_\theta \sum_{i=1}^{N} \log P(\mathbf{x}_i \given \theta ) + \log P(\theta) \end{array} \]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The extra prior term has the effect that we are essentially &amp;lsquo;pulling&amp;rsquo; the &lt;span class=&quot;math&quot;&gt;\(\theta\)&lt;/span&gt; distribution towards prior value. This makes sense as we are putting our domain knowledge as &lt;em&gt;prior&lt;/em&gt; and intuitively the estimation is biased towards the &lt;em&gt;prior&lt;/em&gt; value.&lt;/p&gt;  &lt;h2 id=&quot;naive-bayes-classifier&quot;&gt;Naive Bayes Classifier&lt;/h2&gt;  &lt;p&gt;Assume that we are given a set of data &lt;span class=&quot;math&quot;&gt;\(\data\)&lt;/span&gt;, where each example &lt;span class=&quot;math&quot;&gt;\(\mathbf{x_j}=(a_1, a_2, \ldots, a_n)\)&lt;/span&gt;, which can be viewed as &lt;em&gt;conjunctions of attributes values&lt;/em&gt;. &lt;span class=&quot;math&quot;&gt;\(v_j \in V\)&lt;/span&gt; is the corresponding class value. Using MAP, we can classify an example &lt;span class=&quot;math&quot;&gt;\(\mathbf{x}\)&lt;/span&gt; as:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[v_{MAP}=\argmax_{v_j\in V} P(v_j \given a_1, \ldots, a_n)\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The problem is that it is hard to find a joint distribution for &lt;span class=&quot;math&quot;&gt;\(P(\mathbf{x} \given \theta)\)&lt;/span&gt;. If we use the data to estimate the distribution, we typically don&amp;rsquo;t have enough data for each attribute. In other words, the data we have is very sparse compared to the whole distribution space.&lt;/p&gt;  &lt;p&gt;Naive bayes makes the assumption that each attribute is &lt;em&gt;conditionally independent&lt;/em&gt; given the target class &lt;span class=&quot;math&quot;&gt;\(v_j\)&lt;/span&gt;, that is,&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[P(a_1, \ldots, a_n \given v_j) = \prod_{i=1}^n P(a_i \given v_j)\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;which can be easily estimated from the data. Thus, we have the following naive bayes classifier:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[v_{NB} = \argmax_{v_j \in V} P(v_j) \prod_{i=1}^n P(a_i \given v_j)\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Note that the learning of naive bayes simply involves in estimating &lt;span class=&quot;math&quot;&gt;\(P(a_i \given v_j)\)&lt;/span&gt; and &lt;span class=&quot;math&quot;&gt;\(P(v_j)\)&lt;/span&gt; based on the frequencies in the training data.&lt;/p&gt;  &lt;p&gt;Normally the conditional independence assumption does not hold, but naive bayes performs well even if so. More importantly, &lt;strong&gt;when conditional independence is satisfied, Naive Bayes corresponds to MAP classification.&lt;/strong&gt;&lt;/p&gt;  &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;MLE, MAP and Naive Bayes are all connected. While MLE and MAP are parameter estimation methods that returns a single value of the paramter being estimated, NB is a classifier that predicts the probability of the class that an example belongs to. We also have the following insightes:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;Given the data, MLE considers the paramter to be a constant and estimates a value that provide maximum support for the data.&lt;/li&gt;  &lt;li&gt;MLE does not allow us to &amp;lsquo;inject&amp;rsquo; our beliefs about the likely values for the parameter (prior) in the estimation process.&lt;/li&gt;  &lt;li&gt;MAP allows the fact that the paramter can take values from a prior (non-uniform) distribution that express our prior beliefs regarding the paramters.&lt;/li&gt;  &lt;li&gt;MAP returns paramter value where the probability is highest given data.&lt;/li&gt;  &lt;li&gt;Again, both MLE and MAP returns a single and specific value for the paramter. By contrast, &lt;em&gt;bayesian estimation&lt;/em&gt; computes the full posterior distribution &lt;span class=&quot;math&quot;&gt;\(P(\theta \given \data)\)&lt;/span&gt;.&lt;/li&gt;  &lt;/ul&gt;&lt;div class=&quot;references&quot;&gt;&lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/YCSk9Q&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/5065994319897245176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/5065994319897245176?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5065994319897245176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5065994319897245176'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/09/notes-on-maximum-likelihood-maximum.html' title='Notes on Maximum Likelihood, Maximum A Posteriori and Naive Bayes'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6289384702807221890</id><published>2014-05-28T16:27:00.003+08:00</published><updated>2014-05-28T16:27:07.349+08:00</updated><title type='text'>Fix Mid 2009 MBP RAM not recognized issue</title><content type='html'>&lt;img src=&quot;http://bit.ly/1nzEs9B&quot; alt=&quot;Possible cause of unrecoganized RAM&quot;&gt;Possible cause of unrecoganized RAM&lt;p&gt;A few days ago, I encountered an issue which seems to be common among mid-2009 MBPs: one of the RAM (in slot 1) is not recognized anymore. Or, sometimes it is recognized, but after sleep and wake up, the computer freezes and impossible to recover but force power off.&lt;/p&gt;      &lt;p&gt;It turns out this is a common issue in this model. See the discussion in this &lt;a href=&quot;http://bit.ly/1nTdWWS&quot;&gt;thread&lt;/a&gt; and this &lt;a href=&quot;http://bit.ly/1nzEs9F&quot;&gt;thread&lt;/a&gt;. In the following, I am going to present my temporary fix for this problem. For those of you that still want to stick to the old MBP, the fix shall last for a while. But I do recomend you backup all the files and prepare to migrate some day soon.&lt;/p&gt;  &lt;p&gt;As I suggested in &lt;a href=&quot;http://bit.ly/1nTdWWU&quot;&gt;my reply&lt;/a&gt;, this may due to a RAM slot degradation. My guess is, the RAM slot cannot align the RAM to a correct contact positions any more. Precisely, see the post image above. Notice that the two clips on the left and right are used to hold the rams in a horizontal position, otherwise they will bend upwards. I took a close look at those clips and found that the plastic wore out and cannot hold them as original. I don&#39;t have great ways to fix them, so I just cropped some papers and insert them between the RAMs and the back edges on the body, hoping they can help tucking the RAMs.&lt;/p&gt;  &lt;p&gt;As I am fixing it, I accidentally broke the left holder. So I have to customized a plastic holder and stuck it with the logic board to hold the inner ram (slot 1).&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1nzEqyo&quot;&gt;&lt;p&gt;To verify my theory, I then taped a padding at the corresponding RAM position in the back cover:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1nTdYhA&quot;&gt;&lt;p&gt;And they look like the following before I close:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1nzEqyq&quot;&gt;&lt;p&gt;Note that you have to screw it real tight to create the pressure such that the RAM is aligned. That said, there will be a &#39;bump&#39; at that position, and will easily cause scratch. So I use an apple sticker to cover my ass:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1nTdWWY&quot;&gt;&lt;p&gt;This method worked for me, well, at 99% of the time. Sometimes after sleep, the MBP still won&#39;t wake up. I notice that this usually due to running the MBP for a long time, and it&#39;s hot inside. Nevertheless, this is the best solution I can come up with by now. &lt;em&gt;If you have any other cheap solution that does not require replacing the logic board, please let me know in the comments.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Finally, Zach Clawson created a &lt;a href=&quot;http://bit.ly/1nzEqys&quot;&gt;dedicated page&lt;/a&gt; for this issue, which lists lots of reference and provides explanation to it. Make sure you check it out if you have encountered similar issue.&lt;/p&gt;  &lt;hr&gt;&lt;p&gt;There are other common issues for this model, and they can be easily fixed. See my following posts:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1nTdXKC&quot;&gt;Fix frayed Magsafe cable&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1nTdWpY&quot;&gt;Replace faulty SATA cable&lt;/a&gt;&lt;/li&gt;  &lt;/ul&gt;&lt;p&gt;&lt;em&gt;If you have similar experience, do not hesitate to let me know. If you find my instruction helpful, leave a comment and share it!&lt;/em&gt;&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1nzEqhO&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6289384702807221890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6289384702807221890?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6289384702807221890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6289384702807221890'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/fix-mid-2009-mbp-ram-not-recognized.html' title='Fix Mid 2009 MBP RAM not recognized issue'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-2588248434161742296</id><published>2014-05-28T16:27:00.001+08:00</published><updated>2014-05-28T16:27:03.410+08:00</updated><title type='text'>Replacing SATA cable in Mid 2009 MBP</title><content type='html'>&lt;img src=&quot;http://bit.ly/1nTdWpN&quot; alt=&quot;Replacing MBP cable&quot;&gt;Replacing MBP cable&lt;p&gt;Recently, my mid 2009 MBP (Model A1278) fails to recognize the hard drive. My first bet was another disk failure on me, but it was not the case. I took down the hard drive and put it to a mobile hard drive case and it can be read smoothly.&lt;/p&gt;      &lt;p&gt;It turns out that it is due to the SATA cable fault, which is a notorious problem for mid 2009 MBP model. See the threads and discussions &lt;a href=&quot;http://bit.ly/1nzErT4&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://bit.ly/1nTdXKw&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://bit.ly/1nzErT6&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://bit.ly/1nTdXKy&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Luckily, the solution is simple, just go ahead and purchase a &lt;a href=&quot;http://bit.ly/1nzEqhL&quot;&gt;replacement cable&lt;/a&gt; and replace it. iFixit has a very detailed &lt;a href=&quot;http://bit.ly/1nzErT8&quot;&gt;illustrated document&lt;/a&gt; on the procedures. However, Amazon has a &lt;a href=&quot;cable%20amazon&quot;&gt;cheaper option&lt;/a&gt;, and it works fine for me. I didn&#39;t test the infra-red though, since I never and not plan to use it.&lt;/p&gt;  &lt;p&gt;There are other common issues for this model, and they can be easily fixed. See my following posts:&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1nTdXKC&quot;&gt;Fix frayed Magsafe cable&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1nzEqhO&quot;&gt;Fix unrecognized RAM&lt;/a&gt;&lt;/li&gt;  &lt;/ul&gt;&lt;p&gt;&lt;em&gt;If you have similar experience, do not hesitate to let me know. If you find my instruction helpful, leave a comment and share it!&lt;/em&gt;&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1nTdWpY&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/2588248434161742296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/2588248434161742296?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2588248434161742296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2588248434161742296'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/replacing-sata-cable-in-mid-2009-mbp.html' title='Replacing SATA cable in Mid 2009 MBP'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-9028054436582042615</id><published>2014-05-23T11:39:00.001+08:00</published><updated>2014-05-23T11:39:53.894+08:00</updated><title type='text'>My Octopress Blogging Flow</title><content type='html'>&lt;img src=&quot;http://bit.ly/1om3hFu&quot; alt=&quot;Writing in Sublime Text and previewing in Marked&quot;&gt;Writing in Sublime Text and previewing in Marked&lt;p&gt;After blogging with &lt;a href=&quot;http://octopress.org&quot;&gt;Octopress&lt;/a&gt; for a while, I have already gained some insights on it, and my publishing flow has been smoother. I think it is right time to share my flow as a reference.&lt;/p&gt;      &lt;h2 id=&quot;the-flow&quot;&gt;The Flow&lt;/h2&gt;  &lt;p&gt;The following sections outlines the flow. The last section contains assorted tips and tricks. For the basic configuration of Octopress, please refer to the official &lt;a href=&quot;http://octopress.org&quot;&gt;website&lt;/a&gt;. I also recommend installing &lt;a href=&quot;http://bit.ly/1obJQBE&quot;&gt;Alfred.app&lt;/a&gt;.&lt;/p&gt;  &lt;h3 id=&quot;creating-a-post-alfred-workflow-blog-publish&quot;&gt;Creating a post: alfred workflow (blog publish)&lt;/h3&gt;  &lt;p&gt;&lt;a href=&quot;http://bit.ly/1om3fx7&quot;&gt;Artem Yakimenko&lt;/a&gt; created an awesome &lt;a href=&quot;http://bit.ly/1om3fx9&quot;&gt;alfred workflow&lt;/a&gt; for publishing and generating octopress websites. Use &lt;code&gt;blog publish [title]&lt;/code&gt; to create a new post:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1om3hFw&quot;&gt;&lt;p&gt;It then opens the post in your specified text editor with template.&lt;/p&gt;  &lt;h3 id=&quot;editing-sublime-text.app-marked.app-marked-app-menu-st-plugin&quot;&gt;Editing: Sublime Text.app + Marked.app + Marked App Menu (ST Plugin)&lt;/h3&gt;  &lt;p&gt;I use &lt;a href=&quot;http://bit.ly/1om3hVK&quot;&gt;Sublime Text (ST)&lt;/a&gt; as my text editor, because it provides VIM keybinding and there is a huge repository of plugins. While editing, I use [Marked] to instantly render the markdown file and view the result. In fact, the title image shows my editing and previewing in action.&lt;/p&gt;  &lt;p&gt;To make the process sweeter, there is a ST plugin called &lt;code&gt;Marked App Menu&lt;/code&gt; that allows you to open the current file in Marked. Just search in ST Package Control to install it.&lt;/p&gt;  &lt;h3 id=&quot;previewing-pow-rake-watch-pow-alfred-workflow&quot;&gt;Previewing: pow + rake watch + pow alfred workflow&lt;/h3&gt;  &lt;p&gt;To preview the generate website, simply install &lt;a href=&quot;http://pow.cx&quot;&gt;pow&lt;/a&gt; and execute &lt;code&gt;rake watch&lt;/code&gt; under octopress directory to monitor the change. Octopress official website provides &lt;a href=&quot;http://bit.ly/1obJQBJ&quot;&gt;some explanation&lt;/a&gt;. After installation, you can view your website locally at &lt;a href=&quot;http://octopress.dev&quot;&gt;http://octopress.dev&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You should also install the &lt;a href=&quot;http://bit.ly/1om3fxf&quot;&gt;pow alfred workflow&lt;/a&gt;, which can help you open pow website in a breeze.&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1obJSt6&quot;&gt;&lt;h3 id=&quot;math-rendering-mathjax&quot;&gt;Math Rendering: MathJax&lt;/h3&gt;  &lt;p&gt;Since I am an EECS student, I write a lot of &lt;a href=&quot;http://bit.ly/1om3fxg&quot;&gt;Optimization&lt;/a&gt;, &lt;a href=&quot;http://bit.ly/1obJQS2&quot;&gt;Machine Learning&lt;/a&gt; and &lt;a href=&quot;http://bit.ly/1om3fxl&quot;&gt;Computer Vision&lt;/a&gt; stuff, which relies heavily on mathematics. Thus, writing math formulas is a must for me. &lt;a href=&quot;http://mathjax.org&quot;&gt;MathJax&lt;/a&gt; is a javascript library for rendering math by writing LaTeX math. To do this, one needs to configure the site and link to the library. Put these two lines into &lt;code&gt;&amp;lt;octopress&amp;gt;/source/_includes/custom/head.html&lt;/code&gt;:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;  &lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://bit.ly/1om3hVT;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/javascripts/MathJaxLocal.js&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;The first script block loads MathJax, and the second loads a custom configuration in &lt;code&gt;source/javascripts/MathJaxLocal.js&lt;/code&gt;. It is a good place to write your own macro there. For instance:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;  &lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nx&quot;&gt;MathJax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Hub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;nx&quot;&gt;TeX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;nx&quot;&gt;equationNumbers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;autoNumber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;AMS&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;nx&quot;&gt;TagSide&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;left&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;nx&quot;&gt;Macros&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;          &lt;span class=&quot;nx&quot;&gt;reals&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;\\mathbb{R}&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;          &lt;span class=&quot;nx&quot;&gt;complex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;\\mathbb{C}&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;          &lt;span class=&quot;nx&quot;&gt;norm&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;\\left\\lVert#1\\right\\rVert&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;          &lt;span class=&quot;nx&quot;&gt;given&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;\\:#1\\vert\\:&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;          &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;\\mathcal{D}&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nx&quot;&gt;MathJax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;loadComplete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/javascripts/MathJaxLocal.js&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;Now you can write math!&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[e^{i \pi} + 1 = 0\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;There are a couple of good articles for reference:&lt;/p&gt;  &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1obJQS6&quot;&gt;Blogging With Math: Octopress, MathJax, and Pandoc&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1obJStc&quot;&gt;Writing Math Equations on Octopress&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1om3hVU&quot;&gt;LaTeX Math in Octopress&lt;/a&gt;&lt;/li&gt;  &lt;/ol&gt;&lt;h3 id=&quot;image-hosting-dropbox-public-folder&quot;&gt;Image hosting: Dropbox public folder&lt;/h3&gt;  &lt;p&gt;I host my images in Dropbox Public folder, since you can simply copy the public link and paste it to the post source, for example:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1om3fNE&quot;&gt;&lt;h3 id=&quot;image-editing-skitch-omnigraffle&quot;&gt;Image editing: Skitch + OmniGraffle&lt;/h3&gt;  &lt;p&gt;The previous image is done by a timed capture from &lt;a href=&quot;http://skitch.com&quot;&gt;skitch&lt;/a&gt;. For advanced vector graphics, I use &lt;a href=&quot;http://bit.ly/1obJStj&quot;&gt;OmniGraffle&lt;/a&gt;.&lt;/p&gt;  &lt;h3 id=&quot;markdown-converter-pandoc&quot;&gt;Markdown converter: pandoc&lt;/h3&gt;  &lt;p&gt;&lt;a href=&quot;http://bit.ly/1om3fNI&quot;&gt;Pandoc&lt;/a&gt; is a swiss-army knife like tool that convert documents in multiple formats to several dozens of output formats. I mainly use it as the markdown converter for Octopress. A &lt;a href=&quot;http://bit.ly/1obJStk&quot;&gt;plugin&lt;/a&gt; can help you with that.&lt;/p&gt;  &lt;p&gt;After installation, I update the &lt;code&gt;markdown&lt;/code&gt; section of &lt;code&gt;_config.yml&lt;/code&gt; with the following:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;  &lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;yaml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;markdown&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;pandoc&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;pandoc&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;l-Scalar-Plain&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;html5&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;l-Scalar-Plain&quot;&gt;extensions&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;smart&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;mathjax&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;bibliography&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;source/blog.bib&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;csl&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;_style/ieee.csl&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;which tells Octopress to use pandoc, and pass the option &lt;code&gt;smart&lt;/code&gt;, &lt;code&gt;mathjax&lt;/code&gt; and use the &lt;em&gt;style file&lt;/em&gt; &lt;code&gt;ieee.csl&lt;/code&gt; to format the &lt;em&gt;biliography&lt;/em&gt; &lt;code&gt;blog.bib&lt;/code&gt;. For example, &lt;code&gt;refer to [@xiao2013optimally]&lt;/code&gt; generates &lt;em&gt;refer to &lt;span class=&quot;citation&quot;&gt;[1]&lt;/span&gt;&lt;/em&gt; (scroll down to see the &lt;a href=&quot;#references&quot;&gt;References&lt;/a&gt; section).&lt;/p&gt;  &lt;h3 id=&quot;pandocs-markdown-reference-dash.app-and-dash-alfred-workflow&quot;&gt;Pandoc&#39;s Markdown Reference: Dash.app and Dash alfred workflow&lt;/h3&gt;  &lt;p&gt;&lt;a href=&quot;http://bit.ly/1obJSJy&quot;&gt;Dash.app&lt;/a&gt; is an API Documentation Browser and Code Snippet Manager. It provides an convinient alfred workflow that searches the documents:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1obJSJB&quot;&gt;&lt;p&gt;opens&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1obJSJD&quot;&gt;&lt;h3 id=&quot;tips-and-tricks&quot;&gt;Tips and tricks&lt;/h3&gt;  &lt;p&gt;Continuously growing…&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;There are lots of undocumented/less documented things in Octopress, which can help you write blog posts kinda &#39;programmatically&#39;. For example, &lt;code&gt;http://bit.ly/1om3icj&lt;/code&gt; returns the url of site, which is &lt;a href=&quot;http://bit.ly/1om3icj&quot;&gt;http://bit.ly/1om3icj&lt;/a&gt; in my case. In fact, anything in &lt;code&gt;_config.yml&lt;/code&gt; is a variable under &lt;code&gt;site&lt;/code&gt;.&lt;/li&gt;  &lt;/ul&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;In conclusion, Octopress is a revolutionary blogging framework. It provides a robust static site building framework (jekyll, bootstrap, scss, etc.) and allows complete control over the source, which is perfect for users that have basic coding and source control skills. In fact, it gives me a similar feeling of getting touch with a Mac. That is, compared to Windows, which is too close and does not provide built-in programming-friendly environment (Console, UNIX stuff, etc.), and compared to Linux, which is very open but too many variations and too many customizations needed, it combines their advantages by presenting a user- friendly interface and provides all sorts of underlying UNIX tools. I am very satisfied about this and my intention to write posts have revived. However, some sort of basic configuration is still needed. In particular, I would say Mathjax rendering and better image support definitely need to be integrated in the next release.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;What&#39;s your thought? Do you have any neat tricks publishing with &lt;a href=&quot;http://octopress.org&quot;&gt;Octopress&lt;/a&gt;? Please leave your comments.&lt;/em&gt;&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;  &lt;h2&gt;References&lt;/h2&gt;  &lt;p&gt;[1] Z. Xiao, Y. Du, H. Tian, and M. D. Wong, &quot;Optimally minimizing overlay violation in self-aligned double patterning decomposition for row-based standard cell layout in polynomial time,&quot; in &lt;em&gt;Computer-aided design (iCCAD), 2013 iEEE/aCM international conference on&lt;/em&gt;, 2013, pp. 32–39.&lt;/p&gt;  &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1obJScC&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/9028054436582042615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/9028054436582042615?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/9028054436582042615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/9028054436582042615'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/my-octopress-blogging-flow.html' title='My Octopress Blogging Flow'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-3699285942928590952</id><published>2014-05-22T11:24:00.001+08:00</published><updated>2014-05-22T11:24:50.821+08:00</updated><title type='text'>Sparse Gradient Image Reconstruction via L1-minimization</title><content type='html'>&lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF91KR&quot; alt=&quot;phantom_orig&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hFQU&quot; alt=&quot;phantom_backproj&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF91KT&quot; alt=&quot;phantom_tv&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Original&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Minimum Energy Reconstruction&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Sparse Reconstruction&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;  &lt;p&gt;This is a follow up of the L1-minimization series. The previous two posts are:&lt;/p&gt;  &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;&lt;a href=&quot;http://bit.ly/1jwjHpc&quot;&gt;A Comparison of Least Square, L2-regularization and L1-regularization&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;  &lt;a href=&quot;http://bit.ly/1jLeKZz&quot;&gt;Sparse Signal Reconstruction via L1-minimization&lt;/a&gt;   &lt;/li&gt;  &lt;/ol&gt;&lt;p&gt;We have explored using L1-minimization technique to &lt;a href=&quot;http://bit.ly/1jLeKZz&quot;&gt;recover a sparse signal&lt;/a&gt;. The example shows a 1D example. This post demonsrates on a 2D example, where the image is viewed as a signal. This makes sense as we can perform 2D Fourier Transform in the image, where the basis are a combination of &lt;em&gt;horizontal&lt;/em&gt; and &lt;em&gt;vertical&lt;/em&gt; waves. For a complete introduction to FFT on images, refer to &lt;a href=&quot;http://bit.ly/waLbgf&quot;&gt;this tutorial&lt;/a&gt;. Notice that similar to 1D signal, we do not measure the image directly in time domain, but we do it in the frequency domain. Concretely, say &lt;span class=&quot;math&quot;&gt;\(x\)&lt;/span&gt; is the 2D image collapsed to 1D, and &lt;span class=&quot;math&quot;&gt;\(A \in \reals^{k\times n}\)&lt;/span&gt; is the measurement matrix, &lt;span class=&quot;math&quot;&gt;\(b\)&lt;/span&gt; is the observation, we then have &lt;span class=&quot;math&quot;&gt;\(Ax=b\)&lt;/span&gt;. Usually we will require &lt;span class=&quot;math&quot;&gt;\(k = n\)&lt;/span&gt; to obtain an exact solution for &lt;span class=&quot;math&quot;&gt;\(x\)&lt;/span&gt; given &lt;span class=&quot;math&quot;&gt;\(A\)&lt;/span&gt; and &lt;span class=&quot;math&quot;&gt;\(b\)&lt;/span&gt;. Now, if we use FFT and obtain the frequency coefficients as &lt;span class=&quot;math&quot;&gt;\(\hat{x}\)&lt;/span&gt;, we can also perform similar measurements &lt;span class=&quot;math&quot;&gt;\(\hat{A} \hat{x} = \hat{b}\)&lt;/span&gt;, and the requirement &lt;span class=&quot;math&quot;&gt;\(k = n\)&lt;/span&gt; is the same. In other words, the required samples (the information) is &lt;em&gt;the same&lt;/em&gt;. By using the inverse fourier transform, we can convert &lt;span class=&quot;math&quot;&gt;\(\hat{x}\)&lt;/span&gt; back to &lt;span class=&quot;math&quot;&gt;\(x\)&lt;/span&gt;. The only difference is that the measurement &lt;span class=&quot;math&quot;&gt;\(\hat{A}\)&lt;/span&gt; is taken in frequency (Fourier) domain. As we can see later, we can utilize sparse information to reduce &lt;span class=&quot;math&quot;&gt;\(k\)&lt;/span&gt;.&lt;/p&gt;  &lt;h2 id=&quot;image-gradients-and-total-variation&quot;&gt;Image Gradients and Total Variation&lt;/h2&gt;  &lt;p&gt;We first introduct the concept of image gradients. For any 2D real image &lt;code&gt;I&lt;/code&gt;, if we think about each row as a signal, we can then view the &#39;difference&#39; between adjacent pixels as (horizontal) gradient &lt;code&gt;Gx(I)&lt;/code&gt;, this makes sense since a sharpe change denotes an edge. Similary, we can define the vertical gradient &lt;code&gt;Gy(I)&lt;/code&gt; for columns. Thus, we have&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[Gx(I) = \begin{cases}  I_{i+1, j} - I_{ij} &amp;amp; i &amp;lt; n \\ 0 &amp;amp; i = n  \end{cases}  \qquad  Gy(I) = \begin{cases}  I_{i, j+1} - I_{ij} &amp;amp; j &amp;lt; n \\ 0 &amp;amp; j = n  \end{cases}\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;where the image size is &lt;span class=&quot;math&quot;&gt;\(n\times n\)&lt;/span&gt;.&lt;/p&gt;  &lt;p&gt;Collectively, the image gradient &lt;code&gt;G(I)&lt;/code&gt; is defined as the magnitude (2-norm) of both components:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[G(I)_{ij} = \sqrt{(Gx(I)_{ij})^2 + (Gy(I)_{ij})^2}\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The following shows &lt;code&gt;Gx&lt;/code&gt;, &lt;code&gt;Gy&lt;/code&gt; and &lt;code&gt;G&lt;/code&gt; of the phantom image:&lt;/p&gt;  &lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF949A&quot; alt=&quot;phantom_gx&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hFR0&quot; alt=&quot;phantom_gy&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hIfE&quot; alt=&quot;phantom_gI&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;code&gt;gx(I)&lt;/code&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;code&gt;Gy(I)&lt;/code&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;code&gt;G(I)&lt;/code&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The &lt;em&gt;total variation&lt;/em&gt; &lt;code&gt;TV(I)&lt;/code&gt; of an image is just the sum of this discrete gradient at every point.&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[TV(I)= \norm{G(I)}_1 = \sum_{i,j} G(I)_{ij}\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;We notice that &lt;span class=&quot;math&quot;&gt;\(TV(I)\)&lt;/span&gt; is just the &lt;em&gt;L1-norm&lt;/em&gt; of &lt;span class=&quot;math&quot;&gt;\(G(I)\)&lt;/span&gt;, which leads us to the following: if we have an image that is sparse in its image gradients, we can exploit that and use our L1-minimization trick.&lt;/p&gt;  &lt;h2 id=&quot;sparse-gradient-image-reconstruction&quot;&gt;Sparse Gradient Image Reconstruction&lt;/h2&gt;  &lt;p&gt;The ratio of non-zero elements in &lt;code&gt;Gx&lt;/code&gt;, &lt;code&gt;Gy&lt;/code&gt; and &lt;code&gt;G&lt;/code&gt; of the phantom image is &lt;code&gt;0.0711&lt;/code&gt;, &lt;code&gt;0.0634&lt;/code&gt; and &lt;code&gt;0.0769&lt;/code&gt;, respectively. These ratios are really small - and we consider the gradient as &lt;em&gt;sparse&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;Let &lt;span class=&quot;math&quot;&gt;\(F: \reals^{n\times n} -to \complex^{n\times n}\)&lt;/span&gt; be the FFT operator, and &lt;span class=&quot;math&quot;&gt;\(F I\)&lt;/span&gt; be the Fourier transform taken on image I. Define a set &lt;span class=&quot;math&quot;&gt;\(\Omega\)&lt;/span&gt; as the &lt;span class=&quot;math&quot;&gt;\(k\)&lt;/span&gt; two-dimensional frequencies chosen according to some sampling pattern from the &lt;span class=&quot;math&quot;&gt;\(n \times n\)&lt;/span&gt;. We further define &lt;span class=&quot;math&quot;&gt;\(F_\Omega I: \reals^{n \times n} \to \complex^k\)&lt;/span&gt; as the &lt;span class=&quot;math&quot;&gt;\(k\)&lt;/span&gt; observation taken from the fourier transform of image I. We can then solve the following optimization problem to recover &lt;span class=&quot;math&quot;&gt;\(I\)&lt;/span&gt;:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[\min_I \norm{F_\Omega I - b}^2_2\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;where &lt;span class=&quot;math&quot;&gt;\(F_\Omega\)&lt;/span&gt; can be view as the measurement matrix, &lt;span class=&quot;math&quot;&gt;\(b\)&lt;/span&gt; is the observation, and we want to find &lt;span class=&quot;math&quot;&gt;\(I\)&lt;/span&gt; such that the &lt;em&gt;reconstruction cost&lt;/em&gt; (energy) is minimized.&lt;/p&gt;  &lt;p&gt;However, the above does not quite work. As we can see in the following images, the &lt;em&gt;L2-minimization&lt;/em&gt; does a poor job, either for a random measurement or a radial measurement &lt;span class=&quot;citation&quot;&gt;[4]&lt;/span&gt; in Fourier domain.&lt;/p&gt;  &lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF91KV&quot; alt=&quot;M rand&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hFR4&quot; alt=&quot;phantom rand bp&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF949E&quot; alt=&quot;phantom rand tv&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Random measurement&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;L2-minimization&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;L1-minimization&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hIfI&quot; alt=&quot;M radial&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hFQU&quot; alt=&quot;phantom_backproj&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF91KT&quot; alt=&quot;phantom_tv&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Radial measurement&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;L2-minimization&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;L1-minimization&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;To utilize the sparse information, we add a L1-regularization term to the above objective function, which yields the following:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[(TV_1) \quad \min_I \norm{F_\Omega I - b}^2_2 + \lambda TV(I)\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Without surprise, optimizing the above gives us a &lt;em&gt;perfect&lt;/em&gt; reconstruction of the original image. It is shown that if there exists a piecewise constant I with sufficiently few edges (i.e., &lt;span class=&quot;math&quot;&gt;\(G(I)_{ij}\)&lt;/span&gt; is nonzero for only a small number of indices i, j), then &lt;span class=&quot;math&quot;&gt;\((TV_1)\)&lt;/span&gt; will recover I exactly.&lt;/p&gt;  &lt;p&gt;A heavily commented code example is available in my &lt;a href=&quot;http://bit.ly/1jF91KX&quot;&gt;github repository&lt;/a&gt;. Leave a comment if you have any question.&lt;/p&gt;  &lt;h2 id=&quot;probing-further&quot;&gt;Probing Further&lt;/h2&gt;  &lt;p&gt;Now, take a look at another example &lt;code&gt;cameraman&lt;/code&gt;, which has the following gradients (intensity rescaled using matlab&#39;s &lt;code&gt;imagesc&lt;/code&gt;.&lt;/p&gt;  &lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hFRa&quot; alt=&quot;cameraman&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF91KZ&quot; alt=&quot;cameraman_grad&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Cameraman&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Gradient&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The following shows the reconstructions (left two are using random measurements, right two are using radial measurements).&lt;/p&gt;  &lt;table&gt;&lt;tbody&gt;  &lt;tr class=&quot;odd&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hG7q&quot; alt=&quot;cameraman_rand_bp&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hG7s&quot; alt=&quot;cameraman_rand_tv&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1jF921f&quot; alt=&quot;cameraman_bp&quot;&gt;&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://bit.ly/1m7hG7u&quot; alt=&quot;cameraman_tv&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr class=&quot;even&quot;&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Rand (L2)&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Rand (L1)&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Radial (L2)&lt;/td&gt;  &lt;td style=&quot;text-align: center;&quot;&gt;Radial (L1)&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;As we can see, the results are not as good. In fact, the non-zero ratio of its gradient is 0.9928, which is not sparse at all. However, if we plot the histogram of gradients, we will find that most of the gradient magnitudes are small:&lt;/p&gt;  &lt;img src=&quot;http://bit.ly/1jF921h&quot; alt=&quot;Gradient Histogram&quot;&gt;Gradient Histogram&lt;p&gt;In particular, most of them are smaller than 200, which means the number of &#39;changes&#39; that are larger than 200 is small. In fact, the ratio of gradient &amp;gt; 200 is only &lt;em&gt;0.0964&lt;/em&gt;! Thus, there are two possible ways to discard these information and get a &#39;compressed&#39; image that is sparse in gradients:&lt;/p&gt;  &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;Use mean-shift algorithm to segment the regions such that they have the same color intensities. K-means or quantization should achieve a similar result, though might not as good as mean-shift.&lt;/li&gt;  &lt;li&gt;Use image filtering to smooth the image, which can effectively average colors and discard high frequency information.&lt;/li&gt;  &lt;/ol&gt;&lt;p&gt;&lt;em&gt;I&#39;ll leave these conjectures for furture implementation. For those intereted, please try them yourself and let me know your results. If you have any thoughts, do not hesitate to leave a comment.&lt;/em&gt;&lt;/p&gt;  &lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;  &lt;p&gt;For interested readers, the following references will be helpful.&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;  &lt;p&gt;[1] E. Candes and J. Romberg, &quot;l1-magic: Recovery of sparse signals via convex programming,&quot; vol. 4, 2005.&lt;/p&gt;  &lt;p&gt;[2] J. S. Hesthaven, K. Chowdhary, E. Walsh, and others, &quot;Sparse gradient image reconstruction from incomplete fourier measurements and prior edge information,&quot; &lt;em&gt;IEEE TRANSACTIONS ON IMAGE PROCESSING&lt;/em&gt;, 2012.&lt;/p&gt;  &lt;p&gt;[3] J. K. Pant, W.-S. Lu, and A. Antoniou, &quot;A new algorithm for compressive sensing based on total-variation norm,&quot; in &lt;em&gt;Circuits and systems (iSCAS), 2013 iEEE international symposium on&lt;/em&gt;, 2013, pp. 1352–1355.&lt;/p&gt;  &lt;p&gt;[4] E. J. Cand&lt;span&gt;è&lt;/span&gt;s, J. Romberg, and T. Tao, &quot;Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information,&quot; &lt;em&gt;Information Theory, IEEE Transactions on&lt;/em&gt;, vol. 52, no. 2, pp. 489–509, 2006.&lt;/p&gt;  &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1sWJi0b&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/3699285942928590952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/3699285942928590952?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3699285942928590952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/3699285942928590952'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/sparse-gradient-image-reconstruction.html' title='Sparse Gradient Image Reconstruction via L1-minimization'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6157938961586854227</id><published>2014-05-19T13:03:00.001+08:00</published><updated>2014-05-19T13:03:48.974+08:00</updated><title type='text'>Sparse Signal Reconstruction via L1-minimization</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://bit.ly/1mLkdFr&quot;&gt;&lt;img src=&quot;http://bit.ly/1mLkdFr&quot; alt=&quot;Sparse Signal Reconstruction Results&quot;&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is a follow-up of the &lt;a href=&quot;http://bit.ly/1jwjHpc&quot;&gt;previous post&lt;/a&gt; on applications of L1 minimization.&lt;/p&gt;      &lt;p&gt;As we know, any signal can be decomposed into a linear combination of basis, and the most famous one is &lt;a href=&quot;http://bit.ly/1mLkbxr&quot;&gt;Fourier Transform&lt;/a&gt;. For simplicity, let&#39;s assume that we have a signal that is a superposition of some sinusoids. For example, the following:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;5&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(.&lt;/span&gt;1&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;7&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(.&lt;/span&gt;5&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;With &lt;em&gt;discrete consine transform&lt;/em&gt; (DCT), we can easily find the coefficients of corresponding sinusoid components. The above example&#39;s coefficients (in frequency domain) and signal in time domain are shown in the post figure.&lt;/p&gt;  &lt;p&gt;Now, let&#39;s assume we do not know the signal and want to reconstruct it by sampling. Theorectically, the number of samples required is at least two times the signal frequency, according to the famous &lt;a href=&quot;http://bit.ly/1jLeKJk&quot;&gt;Nyquist–Shannon sampling theorem&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;However, this assume zero-knowledge about the signal. If we know some structure of the signal, e.g., the DCT coefficients are sparse in our case, we can further reduce the number of samples required.&lt;a href=&quot;#fn1&quot; class=&quot;footnoteRef&quot; id=&quot;fnref1&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The following code snippet demonstrates how this works. We generate the original signal in time domain and then perform a DCT to obtain the coefficients.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;16&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;17&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;18&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% sparse signal recovery using L1&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 256&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;R&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 3&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;C&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% some superposition of sinoisoids, feel free to change and experiment&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;@(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;5&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(.&lt;/span&gt;1&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;7&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(.&lt;/span&gt;5&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;3&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;linspace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;10&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 10&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;coef&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;stem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;coef&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;0 &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Original signal in frequency domain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Original signal in time domain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;Let&#39;s assume that we have a device that can sample from the frequency domain. To do this, we create a &lt;em&gt;random measurement matrix&lt;/em&gt; to obtain the samples. We use 80 samples here. Note that we normalize the measurement matrix to have orthonormal basis, i.e., the norm of each row is 1, and the dot product of different row is 0.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% measurement matrix&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;K&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;80&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;randn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;K&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;orth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% observations&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;coef&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;We first try a least-square approach, which boils down to inverse the matrix and obtain &lt;span class=&quot;math&quot;&gt;\(\hat{x}=A^{-1} b\)&lt;/span&gt;. Note that as A is not square, we are using its &lt;em&gt;pseudo-inverse&lt;/em&gt; here. Furthermore, as A is othornormal, its transpose is the same as pseudo-inverse.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% min-energy observations&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;c0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&#39;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;% A&#39; = pinv(A) here since A is a full-rank orthonormal matrix&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;3&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;stem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;0 &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Minimum energy recovery - coef&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;4&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;b&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;0 &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Minimum energy recovery - signal&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;legend&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Recovered&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Original&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;As we can see, there are lots of non-zeros in the coefficients, and the recovered signal is very different from the original signal.&lt;/p&gt;  &lt;p&gt;Finally, we use L1-minimization for reconstruction. I used &lt;code&gt;lasso&lt;/code&gt; to perform a L1-regualarized minimization. Another package that performs various L1-minimization is &lt;a href=&quot;http://b.gatech.edu/1mLkdFv&quot;&gt;l1-magic&lt;/a&gt;.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% L1-minimization&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fitinfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lasso&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Lambda&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;01&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% If use L1-magic&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% addpath /path/to/l1magic/Optimization&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% [c1] = l1eq_pd(c0, A, [], b, 1e-4);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;5&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;stem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;0 &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;L1 recovery - coef&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;6&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;b&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;xlim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;0 &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;L1 recovery - signal&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;legend&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Recovered&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Original&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;The above shows that L1-minimization successfully recovered the original signal. A complete code snippet can be found &lt;a href=&quot;http://bit.ly/1jLeKJl&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;hr&gt;&lt;ol&gt;  &lt;li id=&quot;fn1&quot;&gt;&lt;p&gt;In order to recover f perfectly, we need at least &lt;span class=&quot;math&quot;&gt;\(B \log (N)\)&lt;/span&gt; samples &lt;a href=&quot;http://b.gatech.edu/1mLkdFy&quot;&gt;(source)&lt;/a&gt;.&lt;a href=&quot;#fnref1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;  &lt;/ol&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1jLeKZz&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6157938961586854227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6157938961586854227?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6157938961586854227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6157938961586854227'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/sparse-signal-reconstruction-via-l1.html' title='Sparse Signal Reconstruction via L1-minimization'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-1287466600237876370</id><published>2014-05-15T13:54:00.001+08:00</published><updated>2014-05-15T13:54:07.370+08:00</updated><title type='text'>A Comparison of Least Square, L2-regularization and L1-regularization</title><content type='html'>&lt;img src=&quot;http://bit.ly/T5fq7a&quot; alt=&quot;Recovered Coefficients by Different Methods&quot;&gt;Recovered Coefficients by Different Methods&lt;h1 id=&quot;problem-setting&quot;&gt;Problem Setting&lt;/h1&gt;  &lt;p&gt;Ordinary Least Square (OLS), L2-regularization and L1-regularization are all techniques of finding solutions in a linear system. However, they serve for different purposes. Recently, L1-regularization gains much attention due to its ability in finding sparse solutions. This post demonstrates this by comparing OLS, L2 and L1 regularization.&lt;/p&gt;      &lt;p&gt;Consider the following linear system:&lt;/p&gt;  &lt;p&gt;&lt;span class=&quot;math&quot;&gt;\[Ax = y\]&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;where &lt;span class=&quot;math&quot;&gt;\(A \in \reals^{m \times n}\)&lt;/span&gt;, &lt;span class=&quot;math&quot;&gt;\(m\)&lt;/span&gt; is the number of rows (observations) and &lt;span class=&quot;math&quot;&gt;\(n\)&lt;/span&gt; is the number of columns (variable dimension), &lt;span class=&quot;math&quot;&gt;\(x\)&lt;/span&gt; is the variable coefficients and &lt;span class=&quot;math&quot;&gt;\(y\)&lt;/span&gt; is the response. There are three cases to consider:&lt;/p&gt;  &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(m=n\)&lt;/span&gt;. This is the common-seen case. If &lt;span class=&quot;math&quot;&gt;\(A\)&lt;/span&gt; is not degenerate, the solution is unique.&lt;/li&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(m&amp;gt;n\)&lt;/span&gt;. This is called &lt;em&gt;over-determined linear system&lt;/em&gt;. There is usually &lt;em&gt;no&lt;/em&gt; solutions, but an &lt;em&gt;approximation&lt;/em&gt; can be easily found by minimizing the &lt;em&gt;residue cost&lt;/em&gt; &lt;span class=&quot;math&quot;&gt;\(\norm{Ax-y}^2_2\)&lt;/span&gt; using least square methods, and it has a nice closed-form solution &lt;span class=&quot;math&quot;&gt;\(x_{ls}=(A^T A)^{-1} A^T y\)&lt;/span&gt;. In L2-regularization, we add a penalize term to minimize the 2-norm of the coefficients. Thus, the objective becomes: &lt;span class=&quot;math&quot;&gt;\[\min_x \norm{Ax-y}^2_2 + \alpha \norm{x}_2\]&lt;/span&gt; where &lt;span class=&quot;math&quot;&gt;\(\alpha\)&lt;/span&gt; is a weight to decide the importance of the regularization.&lt;/li&gt;  &lt;li&gt;  &lt;span class=&quot;math&quot;&gt;\(m&amp;lt;n\)&lt;/span&gt;. This is called &lt;em&gt;under-determined linear system&lt;/em&gt;. There is usually no solution or infinite solutions. This is where it get interesting: when we have some prior knowledge in the solution structure, such as sparsity, we can have a &#39;metric&#39; to find a better solution among a whole bunch. The objective is thus: &lt;span class=&quot;math&quot;&gt;\[\min_x \norm{Ax-y}^2_2 + \alpha \norm{x}_1\]&lt;/span&gt; The optimization technique for the above problem is called &lt;a href=&quot;http://stanford.io/1jwjHp8&quot;&gt;lasso&lt;/a&gt;, and there is an advanced version called &lt;a href=&quot;http://bit.ly/1jwjHp9&quot;&gt;elastic net&lt;/a&gt;, which &lt;a href=&quot;http://bit.ly/T5fnII&quot;&gt;combines the L2 and L1 regularization together&lt;/a&gt;, hoping to get the advantages of both: L1 regularization finds sparse solution but introduces a large Mean Square Error (MSE) error, while L2 is better at minimizing MSE.&lt;/li&gt;  &lt;/ol&gt;&lt;h2 id=&quot;an-example&quot;&gt;An Example&lt;/h2&gt;  &lt;p&gt;In the following, we show their performances by solving a simple case.&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;regression_ex.m&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;16&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;17&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;18&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;19&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;20&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;21&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;22&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;23&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;24&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;25&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;26&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;27&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;28&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;29&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;30&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;31&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;32&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;33&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;34&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;35&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;36&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;37&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;38&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;39&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;40&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;41&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;42&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;43&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;44&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;45&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;46&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;47&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;48&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;49&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;50&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;51&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;52&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;53&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;54&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;55&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;56&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;57&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;58&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;59&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;60&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% Compare Ordinary Least square (no regularization), L2-reguarlized (Ridge),&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% L1-regualarized (Lasso) regression in finding the sparse coefficient&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% in a underdetermined linear system&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;rng&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;% for reproducibility&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 50&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;% num samples&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 200&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;% num variables, note that n &amp;gt; m&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;zeros&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;nz&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 10&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;% 10 non-zeros variables (sparse)&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;nz_idx&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;randperm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nz_idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nz&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; 3 &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nz&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;05 &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;% add some noise&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% plot original x&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;axis&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Original coefficients&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% OLS&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x_ols&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;\&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_ols&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;axis&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Ordinary Least Square&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y_ols&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_ols&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% L2 (Ridge) &lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ridge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;5&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;% last parameter = 00 to generate intercept term&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;b_l2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 3&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;axis&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;L2 Regularization&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y_l2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_l2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b_l2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% L1 (Lasso)&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_l1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fitinfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lasso&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Lambda&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;b_l1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fitinfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Intercept&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y_l1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_l1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b_l1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;subplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 4&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_l1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;axis&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;L1 Regularization&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% L1 (Elastic Net)&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_en&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fitinfo_en&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lasso&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Lambda&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Alpha&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;7&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;b_en&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fitinfo_en&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Intercept&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;y_en&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x_en&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b_en&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;MSE_y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_ols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_l2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_l1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y_en&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)];&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb&quot;&gt;disp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Mean square error: &#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;fprintf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;%g    &#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MSE_y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fprintf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;\n\n&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;c&quot;&gt;% Plot the recovered coefficients&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;figure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hold&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_l1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;b&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x_en&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;plot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;g--&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;legend&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;Lasso Coef&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Elastic Net coef&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;Original Coef&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;Output:&lt;/p&gt;  &lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;matlab&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;n&quot;&gt;Mean&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;square&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;1&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;81793&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;29    7&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;93494&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;15    0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;0975002    0&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;0641214  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;  &lt;p&gt;The above code snippets generates an under-determined matrix &lt;span class=&quot;math&quot;&gt;\(A\)&lt;/span&gt;, and a sparse coefficients which has 200 variables but only 10 of them are non-zeros. Noises are added to the responses. We then run the proposed three methods to try to recover the coefficients. It then generates two plots:&lt;/p&gt;  &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;The first plot is as shown in the top. As we can see, OLS does a very bad job, though the MSE is minimized to zero. L2-regularization do find some of the sparks, but there are also lots of non-zeros introduced. Finally, L1-regularization finds most of the non-zeros correctly and resembles the original coefficients most.&lt;/li&gt;  &lt;li&gt;The second plot shows how similar the recovered coefficients by lasso and elastic nets resemble the original coefficients. As we can see, both of them can recover most parts, while elastic nets contain some small &#39;noise&#39;. However, elastic net yields a slightly better MSE than lasso.&lt;/li&gt;  &lt;/ol&gt;&lt;img src=&quot;http://bit.ly/1jwjFxo&quot; alt=&quot;Plot of Coefficients&quot;&gt;Plot of Coefficients&lt;h2 id=&quot;probing-further&quot;&gt;Probing Further&lt;/h2&gt;  &lt;p&gt;Scikit has some excellent examples on regualarization (&lt;a href=&quot;http://bit.ly/T5fnIM&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://bit.ly/1jwjFxq&quot;&gt;2&lt;/a&gt;). Quora has an excellent &lt;a href=&quot;http://bit.ly/T5fnIN&quot;&gt;discussion&lt;/a&gt; on L2 vs L1 regualarization. I found the top three answers very useful in understanding deeper, especially from the &lt;em&gt;Bayesian regularization paradigm&lt;/em&gt; perspective by thinking the regularization as MAP (Maximum A Posteriori) that adds a Laplacian (L1) or Gaussian (L2) prior to the original objective.&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;    &lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1jwjHpc&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/1287466600237876370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/1287466600237876370?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1287466600237876370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/1287466600237876370'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/a-comparison-of-least-square-l2.html' title='A Comparison of Least Square, L2-regularization and L1-regularization'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-10261290717090509</id><published>2014-05-15T11:24:00.001+08:00</published><updated>2014-05-15T11:24:34.011+08:00</updated><title type='text'>A Comparison of Least Square</title><content type='html'>&lt;p&gt;Ordinary Least Square (OLS),&lt;/p&gt;  &lt;p&gt;Consider the following linear system:&lt;/p&gt;  &lt;div class=&quot;references&quot;&gt;&lt;/div&gt;  &lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bit.ly/1gpGEzP&quot; target=&quot;_blank&quot;&gt;via&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/10261290717090509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/10261290717090509?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/10261290717090509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/10261290717090509'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/a-comparison-of-least-square.html' title='A Comparison of Least Square'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-8930687574145703088</id><published>2014-05-05T04:53:00.001+08:00</published><updated>2014-05-05T04:53:11.211+08:00</updated><title type='text'>Debugging AppleScript: print to a file</title><content type='html'>&lt;p&gt;Debugging AppleScript is easy when you work with the script editor, simply use &lt;code&gt;log&lt;/code&gt; to print out anything in the console. However, after you compiled it to an app, this cannot work anymore.&lt;/p&gt;  &lt;p&gt;I find there are several ways to do it in this &lt;a href=&quot;http://bit.ly/1fJ547k&quot;&gt;thread&lt;/a&gt;. The &lt;a href=&quot;http://bit.ly/1kzK66u&quot;&gt;two approaches&lt;/a&gt; that work best for me are:&lt;/p&gt;      &lt;ol type=&quot;1&quot;&gt;  &lt;li&gt;Use &lt;code&gt;logger&lt;/code&gt; to log to the syslog. E.g.,&lt;/li&gt;  &lt;/ol&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;applescript&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb&quot;&gt;do shell script&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;logger -t &#39;AS DEBUG&#39; &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;myObj&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;    &lt;p&gt;However, I don&#39;t know why sometimes this is not logged. So I will use the following:&lt;/p&gt;  &lt;ol start=&quot;2&quot; type=&quot;1&quot;&gt;  &lt;li&gt;Echo to file&lt;/li&gt;  &lt;/ol&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;  &lt;span&gt;&lt;/span&gt;  &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;  &lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;  &lt;/pre&gt;&lt;/td&gt;  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;applescript&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb&quot;&gt;do shell script&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;echo &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;quoted form&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;myObj&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as &lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;¬&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;s2&quot;&gt;&quot; &amp;gt;&amp;gt; ~/Desktop/as_debug.txt&quot;&lt;/span&gt;  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;  &lt;/div&gt;      &lt;br&gt;&lt;br&gt;  via Zigang Xiao http://bit.ly/1nWnLGH&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/8930687574145703088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/8930687574145703088?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/8930687574145703088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/8930687574145703088'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/05/debugging-applescript-print-to-file.html' title='Debugging AppleScript: print to a file'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-7266338575628330575</id><published>2014-03-07T15:19:00.000+08:00</published><updated>2014-03-07T15:20:18.752+08:00</updated><title type='text'>It&#39;s birthday again :)</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;What I did in this birthday:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- Got up late &amp;amp; made myself a Latte.&lt;/div&gt;&lt;div&gt;- Brainstorm a bit and did an phone interview.&lt;/div&gt;&lt;div&gt;- Procrastinate: read some interesting articles on Frequentist vs Bayesian, brush up some Jazz chords, watch some anime.&lt;/div&gt;    &lt;div&gt;- Got that Federal Tax Return done!&lt;/div&gt;&lt;div&gt;- Had dinner &amp;amp; bday cake with friends.&lt;/div&gt;&lt;div&gt;- Practice ballroom dancing with Illini Dancesport.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It&amp;#39;s just another normal day. But I am quite happy with that :)&lt;/div&gt;        &lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/7266338575628330575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/7266338575628330575?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/7266338575628330575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/7266338575628330575'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2014/03/its-birthday-again.html' title='It&#39;s birthday again :)'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-5283681050625557884</id><published>2013-08-16T08:06:00.000+08:00</published><updated>2013-08-16T08:07:27.913+08:00</updated><title type='text'>资源调配不均匀</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;最近看《进击的巨人》，里面有个 dilemma 很引起我共鸣。背景：地球突然出现身高10+米的巨人，以人类为食，人类为了自保，修建城墙阻挡巨人。同时训练士兵，成绩好的士兵可以选择留在最安全的地方成为保护国王的宪兵，而其他则必须去进入调查兵团，即前线的士兵，随时牺牲生命。tl;dr：有能力的人明哲保身，能力弱的反而要肩负起最重要的保护人类生命的责任。  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;我突然觉得跟我在现实生活的一些想法很有共鸣。我身边一些我觉得很有聪明才智的人，没有选择在学术道路上，而是选择安逸的生活；而像我有兴趣在科学道路上有所建树，却总是为自己没有他们的智商而着急。从资源调配角度来说，真是离最优解恰好相反。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;这个问题其实跟在 quora 上的&lt;a href=&quot;http://www.quora.com/Working-at-Google-1/Whats-the-worst-part-about-working-at-Google&quot; target=&quot;_blank&quot;&gt;一个问题&lt;/a&gt;也有点类似。top answer 的大意是，Google 优越的条件吸引了世界上最聪明的一群人，然则大多数人在 google 其实 overqualified，因为 challenging 的东西总是已经被做完，或者说做决策的只能是高层更聪明的人。&lt;/div&gt;      &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;当然我本意不是埋怨别人不好好利用它们的聪明才智，每个人都有做出自己选择的权利。我仅仅，只是在着急搞研究进展缓慢，觊觎别人的能力而已...&lt;/div&gt;&lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/5283681050625557884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/5283681050625557884?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5283681050625557884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/5283681050625557884'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2013/08/blog-post.html' title='资源调配不均匀'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-6748498597095636976</id><published>2013-08-01T06:25:00.000+08:00</published><updated>2013-08-01T06:26:08.464+08:00</updated><title type='text'>关于 stty, erase, ^H, ^?</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;引用&lt;a href=&quot;http://v2ex.com/t/77397&quot;&gt;这位同学&lt;/a&gt;的问题，之前自己经常遇到但是没有好好总结。  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;表现就是，在 terminal 里面，backspace 经常会出现问题，偶尔会看到 ^? 或 ^H 这种东西的出现。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;由于历史原因 (追溯到打卡机时代)，要删除一个字符，必须先 ASCII BS (0x08, ^H) 回到前一个字母，然后再 ASCII DEL (0x7F, ^?) 删除它。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;现代电脑里，backspace 的作用基本上就相当于上述 BS+DEL的功能，而delete真正发送的是&amp;quot;^[[3&amp;quot;。而事实上 backspace 究竟定义为 ^H 还是 ^? 只是一个个人的选择，并且没有标准，所以不同的 terminal emulator 可能会采用不同的值。&lt;/div&gt;    &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;我们知道可以用不同的 terminal (emulator) login 到一个机器上。但是不同 terminal 有不同的 key mapping，具体来说，它们 backspace 发送的值可能 *不一样*. 比如 linux console 是模拟 vt220 的，backspace 发送的是 DEL，而 xterm 模拟 vt100，backspace 发送的是 BS。&lt;/div&gt;&lt;div&gt;    &lt;br&gt;&lt;/div&gt;&lt;div&gt;而 stty 是用来控制 terminal options 的。简单来说，是控制 terminal 怎么理解输入的字符串的。如果 backspace 发送的值与 stty 的设置定义不一样，那么就可能出现问题，最常见的，就是 stty 里 erase （向前删除一个字符） 设置为 ^? 而 backspace 发送的是 ^H. 这时解决方法是：&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;1. 设置 stty 理解 ^H 为 erase: stty erase ^H，或者&lt;/div&gt;    &lt;div&gt;2. 设置 terminal emulator， 使得 backspace 发送 ^? 而不是 ^H。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;历史与详细解决方法：&lt;a href=&quot;http://www.ibb.net/~anne/keyboard.html&quot;&gt;http://www.ibb.net/~anne/keyboard.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;历史与参考链接：&lt;a href=&quot;http://www.quetek.com/dictionary/linux-backspace-delete-config.html&quot;&gt;http://www.quetek.com/dictionary/linux-backspace-delete-config.html&lt;/a&gt;&lt;/div&gt;    &lt;div&gt;另外一些资料：&lt;a href=&quot;http://www.hypexr.org/linux_ruboff.php&quot;&gt;http://www.hypexr.org/linux_ruboff.php&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/6748498597095636976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/6748498597095636976?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6748498597095636976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/6748498597095636976'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2013/08/stty-erase-h.html' title='关于 stty, erase, ^H, ^?'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-2825453792489302413</id><published>2013-03-16T08:17:00.000+08:00</published><updated>2013-03-16T08:18:13.169+08:00</updated><title type='text'>man page memo</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;Hierarchy details:  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREMANMANUALPAGES&quot;&gt;http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREMANMANUALPAGES&lt;/a&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;Specifically, the local man pages is in&lt;/div&gt;    &lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;/usr/local/share/man/man[1-8]&lt;/div&gt;&lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;If there is man pages in other language than English, say de, then:&lt;/div&gt;&lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;/usr/local/share/man/de&lt;/div&gt;    &lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;Changing the LANG will search for man pages in different language. Example:&lt;/div&gt;&lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;(when LANG is not set, use default system locale)&lt;/div&gt;&lt;div style&gt;&lt;br&gt;&lt;/div&gt;    &lt;div style&gt;&lt;div&gt;$ man -w dvipdf&lt;/div&gt;&lt;div&gt;/usr/local/share/man/man1/dvipdf.1&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;(Change to de)&lt;/div&gt;&lt;div style&gt;&lt;br&gt;&lt;/div&gt;&lt;div style&gt;$ export LANG=de&lt;/div&gt;&lt;div style&gt;$ man -w dvipdf&lt;br&gt;&lt;/div&gt;&lt;div style&gt;    &lt;div&gt;/usr/local/share/man/de/man1/dvipdf.1&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/2825453792489302413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/2825453792489302413?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2825453792489302413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/2825453792489302413'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2013/03/man-page-memo.html' title='man page memo'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5171781364921802522.post-4735351162641975938</id><published>2013-03-07T01:58:00.001+08:00</published><updated>2013-03-07T01:58:24.244+08:00</updated><title type='text'>今天我生日</title><content type='html'>今年的生日，还算是蛮特别的。以往都没什么存在感的，今年我爸妈竟然记得住并且主动给我发微信祝贺，虽然爸妈的文采还是那么官样文章无甚出彩……不过『记得』这件事就已经足够了。另外我也收到了出生到现在收过的最大份最昂贵的『礼物』——不不不，应该说是无价的才对：某人要把自己包邮跨海空运过来呢 ~ 那我也只能受宠若惊地收下了 :)&lt;!--3--&gt;&lt;br /&gt;
&lt;br /&gt;
值得一提的是，我对我表妹『表白』了。跟表妹其实小时候很好，就像两小无猜，但是她初中开始去了外地读书后，就没怎么联系，到现在已经很生疏了。但其实大家都是独生子女，生日只差两个月，又从小一起长大，我真的是把她当做自己的亲妹妹来看待的。但是总是不知道如何开口，让她知道我对她的关心。今晚终于能说出口：&lt;br /&gt;
&lt;br /&gt;
『同埋你平時多d同我傾啦，我睇你平時好似唔係好開心咁〜我記得我地細個時好好噶，之後你出去讀書後就冇乜聯繫搞到咁生疏。我地都係獨生子女，應該要似親兄妹對待先至啱！』&lt;br /&gt;
&lt;br /&gt;
不过可惜的是，似乎关心自己的人都不在身边呢。我时常会想起这首歌，『如果我现在』。里面那种情怀，有谁共鸣？也许只有身在美国这种苦逼 PhD 才能体会到吧：&lt;br /&gt;
&lt;br /&gt;
『如果我現在死去　明天世界是否會在意』&lt;br /&gt;
&lt;br /&gt;
我手机可以整个月不响一次。我即使一周不去 lab，也没人会注意到什么。我总是在想，如果我在宿舍突然挂了，会不会等发臭了才有人发现呢？&lt;br /&gt;
&lt;br /&gt;
我期待的那种『几个密友聚在一起聊天喝酒，吟诗弹琴的日子』，始终没有来，也许它们将来也不会来。但是，相信吧，相信，无论如何，这世界上总有愿意对你好的朋友，只是可能有的人运气不好，缘分未到。&lt;br /&gt;
&lt;br /&gt;
最后要 special thanks to jide 同学。经历过颠沛流离，浮浮沉沉，还记得我的，只有你了吧。感谢你在我无力的日子给我的那些支持，我想我这辈子不会忘记。如果可以的话，我希望我们不要像其他人那样，因为拍拖、结婚、生子而渐渐疏远了。我希望能像以前一样，即使很久没见很久没说话，也能不陌生，也能很快心有灵犀重新补完缺乏联系的那段，很快熟络起来。&lt;div class=&quot;blogger-post-footer&quot;&gt;#end&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iveney.blogspot.com/feeds/4735351162641975938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5171781364921802522/4735351162641975938?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/4735351162641975938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5171781364921802522/posts/default/4735351162641975938'/><link rel='alternate' type='text/html' href='http://iveney.blogspot.com/2013/03/blog-post.html' title='今天我生日'/><author><name>Ivan Z. G. Xiao</name><uri>http://www.blogger.com/profile/12368930545391408672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqLyM06gIHlVWgEsAwEaLEUi3vLW2iVc-41IFyKTcpfHx5lLM9dvsxbU0htgNnjlY2nNJ5gSjly66fFneZKEhLZ5JrruBQ0oc_GavaEVh4OW6dh9WsvPR_zVGQmHmUeXI/s220/n543176538_1541170_4620.jpg'/></author><thr:total>2</thr:total></entry></feed>