<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>如是我聞</title>
 <link href="http://ztpala.com/atom.xml" rel="self"/>
 <link href="http://ztpala.com/"/>
 <updated>2016-11-03T22:04:17-04:00</updated>
 <id>http://ztpala.com</id>
 <author>
   <name></name>
   <email></email>
 </author>

 
 <entry>
   <title>在上海</title>
   <link href="http://ztpala.com/2015/07/03/shanghai"/>
   <updated>2015-07-03T00:00:00-04:00</updated>
   <id>http://ztpala.com/2015/07/03/shanghai</id>
   <content type="html">&lt;p&gt;回国三个月了，本以为呆两个月就会回去，没想到一转眼竟然快到生日了。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/18805753194&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/382/18805753194_10f485f3fb_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;平成屋，西康路，从淮海路乱走回来路过，有点深夜食堂的感觉。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19383389515&quot;&gt;&lt;img src=&quot;https://c4.staticflickr.com/4/3703/19383389515_dbe623fbb7_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;最近第二次来这里了，雨后这座楼更加的漂亮。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/18762365963&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/391/18762365963_394a2fe2b7_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;我还是喜欢夜上海的。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19196816419&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/305/19196816419_2a2cd6ea96_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;夜市结束后独自回家。这是唯一一条从我记事起到现在仍旧没怎么变化的街了。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19357165236&quot;&gt;&lt;img src=&quot;https://c5.staticflickr.com/1/474/19357165236_a04db19722_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;楼下就是传说中的黑暗料理一条街。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19383041745&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/435/19383041745_b836668389_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;浦图&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19195470668&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/497/19195470668_38e59ac34e_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;这种天气逛逛上海的小街小巷实在舒服。暴走了12公里。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/19197558289&quot;&gt;&lt;img src=&quot;https://c1.staticflickr.com/1/320/19197558289_f6c6843b8b_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;北京 恭王府。见到老朋友总是很开心。&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>大煙山國家公園</title>
   <link href="http://ztpala.com/2014/10/24/great-smoky-mountains-national-park"/>
   <updated>2014-10-24T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/10/24/great-smoky-mountains-national-park</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/15593674446&quot;&gt;&lt;img src=&quot;https://farm6.staticflickr.com/5612/15593674446_6801412940_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;三天半，開車2380公里，爬山27.5公里。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/15431245958&quot;&gt;&lt;img src=&quot;https://farm4.staticflickr.com/3949/15431245958_94f19bdf70_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;以後去每個國家公園都要買件 Life is good 做留念。標籤還沒撕。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/15431231818&quot;&gt;&lt;img src=&quot;https://farm6.staticflickr.com/5597/15431231818_175d1efc4d_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;在某些地方可以看到elk「加拿大馬鹿」，一直低頭悶吃。另外還有一些「Elk Xing」的牌子。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/15614680691&quot;&gt;&lt;img src=&quot;https://farm4.staticflickr.com/3955/15614680691_94bbd66767_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/sets/72157648531084007&quot;&gt;所有照片&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2014年秋</title>
   <link href="http://ztpala.com/2014/10/12/fall"/>
   <updated>2014-10-12T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/10/12/fall</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://dl.dropbox.com/s/gmegy8ajs2fjrrw/2014_Fall.jpg&quot;&gt;&lt;img src=&quot;https://dl.dropbox.com/s/gmegy8ajs2fjrrw/2014_Fall.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;斯泰特克里契最美的秋天又來了，又能喊出下面這句話了：&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;/2014/02/13/winterfell/&quot;&gt;Winter Is Coming!&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;今年年初時想今年要把冰與火之歌前四本看完，二月初順利看完第一本，結果時至今日第二本還未看完。👎&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>足球之夏</title>
   <link href="http://ztpala.com/2014/08/09/soccer-summer"/>
   <updated>2014-08-09T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/08/09/soccer-summer</id>
   <content type="html">&lt;p&gt;世界上有種球星(zhā)，每四年對足球狂熱一次，每四年踢一次球。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/ztpala/14846280526&quot;&gt;&lt;img src=&quot;https://farm6.staticflickr.com/5591/14846280526_2e3cb312b5_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Wander 2.0</title>
   <link href="http://ztpala.com/2014/06/12/wander-2.0"/>
   <updated>2014-06-12T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/06/12/wander-2.0</id>
   <content type="html">&lt;p&gt;Wander2.0版終於完工，和第一版比，做了很多減法，除去了一些冗余功能和設計。今天被放到了 Health &amp;amp; Fitness 的 Best New Apps里。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/WanderAppStore.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;新版本主要做兩件事：計步和提醒。&lt;/p&gt;

&lt;h2 id=&quot;section&quot;&gt;計步&lt;/h2&gt;
&lt;p&gt;Wander在內部記錄了每天每小時的步數，所以在歷史記錄里可以看到每天的步數以及禮拜幾的幾點鐘的平均步數。&lt;/p&gt;

&lt;h2 id=&quot;section-1&quot;&gt;提醒&lt;/h2&gt;
&lt;p&gt;2.0的主要功能。利用Background Fetch來查看你上一次步行或跑步是什麼時間，從而在合適時候發送提醒，防止久坐。&lt;/p&gt;

&lt;h2 id=&quot;section-2&quot;&gt;3.0&lt;/h2&gt;
&lt;p&gt;幾天前WWDC發佈了Swift和iOS 8，所以3.0將會用Swift重寫，邊學邊實踐。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/wander-pedometer-smart-reminder/id774474904?mt=8&quot;&gt;下載鏈接&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Mac下用「命令行＋系統通知」定時</title>
   <link href="http://ztpala.com/2014/03/25/mac-os-x-command-line-timer-notification"/>
   <updated>2014-03-25T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/03/25/mac-os-x-command-line-timer-notification</id>
   <content type="html">&lt;blockquote&gt;
  &lt;p&gt;為革命，保護視力&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;今天戴隱形眼鏡一直不舒服，然後去Quora上看看有什麼好的眼藥水推薦，結果看到一個眼科醫生推薦的&lt;a href=&quot;http://qr.ae/n63zB&quot;&gt;20-20-20法則&lt;/a&gt;，即&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;每20分鐘，遠望至少20ft（約6米）的距離，20秒以上。&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;然後用iPhone自帶的Timer定時，發現這貨到了時間就響鈴，哪怕你改了震動。接著想既然iTerm開機就運行，能不能在命令行實現一個簡單易用的計時工具，搜索了一下果然找到一個好的&lt;a href=&quot;http://apple.stackexchange.com/a/115373/51944&quot;&gt;解決方法&lt;/a&gt;：&lt;/p&gt;

&lt;p&gt;首先，我想在命令行能引發一個系統通知，方法如下：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;osascript -e &lt;span class=&quot;s1&quot;&gt;'display notification &quot;Lorem ipsum dolor sit amet&quot; with title &quot;Title&quot;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;後半部分其實是 &lt;code class=&quot;highlighter-rouge&quot;&gt;AppleScript&lt;/code&gt; ，&lt;code class=&quot;highlighter-rouge&quot;&gt;osascript&lt;/code&gt;則用於在命令行運行 &lt;code class=&quot;highlighter-rouge&quot;&gt;AppleScript&lt;/code&gt;。&lt;/p&gt;

&lt;p&gt;接著用 &lt;code class=&quot;highlighter-rouge&quot;&gt;sleep&lt;/code&gt; 命令設置多久後運行，所以最終的命令如下：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;sleep 1200; osascript -e &lt;span class=&quot;s1&quot;&gt;'display notification &quot;趕快走開&quot; with title &quot;休息時間&quot; sound name &quot;Sosumi&quot;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;1200的單位是秒，即20分鐘。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/timeline-timer.png&quot; width=&quot;350&quot; /&gt;&lt;/p&gt;

&lt;p&gt;接下來可以把這個命令寫入&lt;a href=&quot;https://github.com/pala/dotfiles/blob/master/bin/zz&quot;&gt;dotfiles&lt;/a&gt;，方便的定制時間，顯示文字以及聲音。&lt;/p&gt;

&lt;h3 id=&quot;section&quot;&gt;通知的顯示&lt;/h3&gt;

&lt;p&gt;和其他程序的通知一樣，你也可以在系統設置里調整此通知的顯示方式：&lt;/p&gt;

&lt;p&gt;System Preferences - Notifications - AppleScript Editor&lt;/p&gt;

&lt;p&gt;比如選擇通知方式為&lt;strong&gt;Alerts&lt;/strong&gt;，這樣上面的通知框不會自動消失。&lt;/p&gt;

&lt;h2 id=&quot;section-1&quot;&gt;其他方式&lt;/h2&gt;

&lt;p&gt;如果你不想用系統通知的方式，則可以用一個簡單的 &lt;code class=&quot;highlighter-rouge&quot;&gt;say&lt;/code&gt; 命令讓電腦念一段文字：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;sleep 1200; say &lt;span class=&quot;s2&quot;&gt;&quot;nnnnnnnnnnn  nnnnnnnnnn  mmmmmmm m. gan, g ba, fa dong bu chi lai&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;只不過冷不丁的聽到機器人似的聲音挺嚇人的。&lt;/p&gt;

&lt;h2 id=&quot;google&quot;&gt;Google&lt;/h2&gt;

&lt;p&gt;如果你Google一下 set timer for x minutes，它會自動為你在網頁上設置一個timer。&lt;/p&gt;

&lt;h2 id=&quot;flux&quot;&gt;f.lux&lt;/h2&gt;

&lt;p&gt;底下有朋友留言提到了&lt;a href=&quot;http://justgetflux.com&quot;&gt;f.lux&lt;/a&gt;，它的作用是根據你的作息，在臨睡前幾小時會慢慢將你電腦屏幕中的藍光去掉變為暖色，有助入睡。&lt;/p&gt;

&lt;p&gt;剛開始用flux時可能對這種暖色屏幕不太適應，但稍微使用後再將屏幕調回正常模式感覺非常刺眼，有興趣的可以&lt;a href=&quot;http://justgetflux.com&quot;&gt;下載&lt;/a&gt;試用一下。支持Mac Windows Linux iOS（需破解）。免費👊&lt;/p&gt;

&lt;h2 id=&quot;ios&quot;&gt;iOS的睡眠模式&lt;/h2&gt;

&lt;p&gt;上面說到Timer到時總會響鈴，想只要震動的話一個解決方法就是自己做一個沒聲音的鈴聲&lt;/p&gt;

&lt;p&gt;另外後知後覺發現iOS內置了一個睡眠模式，在Timer計時結束後停止播放音樂視頻等，只要在選擇鈴聲時選擇 &lt;strong&gt;Stop Playing&lt;/strong&gt; 即可：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/iOSStopPlaying.png&quot; width=&quot;320&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>圖書館</title>
   <link href="http://ztpala.com/2014/03/14/library"/>
   <updated>2014-03-14T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/03/14/library</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3731/13157953014_7aee42a6e6_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7151/13157673995_2f48f37d33_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Mac OS X Hot Corners</title>
   <link href="http://ztpala.com/2014/03/12/mac-os-x-hot-corners"/>
   <updated>2014-03-12T00:00:00-04:00</updated>
   <id>http://ztpala.com/2014/03/12/mac-os-x-hot-corners</id>
   <content type="html">&lt;p&gt;You can use the following values to set Mac OS X’s hot corners in your &lt;a href=&quot;https://github.com/pala/dotfiles/blob/master/osx/set-defaults.sh&quot;&gt;dotfiles&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Hot corners&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Possible values:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  0: no-op&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  2: Mission Control&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  3: Show application windows&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  4: Desktop&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  5: Start screen saver&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  6: Disable screen saver&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  7: Dashboard&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 10: Put display to sleep&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 11: Launchpad&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 12: Notification Center&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# via http://git.io/1pS-2g&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# The following are my settings:&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Top Right Corner → Mission Control&lt;/span&gt;
defaults write com.apple.dock wvous-tr-corner -int 2
defaults write com.apple.dock wvous-tr-modifier -int 0

&lt;span class=&quot;c&quot;&gt;# Top left Corner → Application windows&lt;/span&gt;
defaults write com.apple.dock wvous-tl-corner -int 3
defaults write com.apple.dock wvous-tl-modifier -int 0

&lt;span class=&quot;c&quot;&gt;# Bottom Right Corner → Desktop&lt;/span&gt;
defaults write com.apple.dock wvous-br-corner -int 4
defaults write com.apple.dock wvous-br-modifier -int 0

&lt;span class=&quot;c&quot;&gt;# Bottom left Corner → Put display to sleep&lt;/span&gt;
defaults write com.apple.dock wvous-bl-corner -int 10
defaults write com.apple.dock wvous-bl-modifier -int 0&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>2014第一騎： Bellefonte繞圈</title>
   <link href="http://ztpala.com/2014/03/08/bellefonte"/>
   <updated>2014-03-08T00:00:00-05:00</updated>
   <id>http://ztpala.com/2014/03/08/bellefonte</id>
   <content type="html">&lt;p&gt;標題重用自 &lt;a href=&quot;/2011/06/12/2011bellefonte/&quot;&gt;2011第一騎：Bellefonte繞圈&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;看到六年半前&lt;a href=&quot;/2007/10/29/bellefonte/&quot;&gt;第一次去Bellefonte&lt;/a&gt;看到的那輛車牌為&lt;code class=&quot;highlighter-rouge&quot;&gt;GFW ****&lt;/code&gt;的車仍舊安穩的停在路邊，不覺感嘆時間過的好快。&lt;/p&gt;

&lt;p&gt;天氣轉暖，去年只騎了&lt;a href=&quot;/2013/07/13/biking-550/&quot;&gt;一次&lt;/a&gt;車，再不出去，車&lt;a href=&quot;/2011/06/17/garage/&quot;&gt;在那掛著&lt;/a&gt;都要發霉了。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/13023827185/&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3503/13023827185_b6281aea12_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/13024212034&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3114/13024212034_fc3751f34c_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/13023818675&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3348/13023818675_7e73504536_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;由於氣溫還是很低，中間走神很久，想起&lt;a href=&quot;/tag/#浙江&quot;&gt;在上海時&lt;/a&gt;騎車的日子，總是和一群朋友從一個城市騎向另外一個城市，現在基本都是繞圈了。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>UIBezierPath Animation</title>
   <link href="http://ztpala.com/2014/02/22/uibezierpath-animation"/>
   <updated>2014-02-22T00:00:00-05:00</updated>
   <id>http://ztpala.com/2014/02/22/uibezierpath-animation</id>
   <content type="html">&lt;p&gt;I use the following code to animate a &lt;code class=&quot;highlighter-rouge&quot;&gt;CAShapeLayer&lt;/code&gt;’s path property.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-objc&quot; data-lang=&quot;objc&quot;&gt;&lt;span class=&quot;n&quot;&gt;CGPathRef&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;oldPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shapeLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;CGPathRef&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newPath&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;n&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;myNewPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;CABasicAnimation&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&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;n&quot;&gt;CABasicAnimation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;animationWithKeyPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&quot;path&quot;&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setFromValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__bridge&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;oldPath&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setToValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__bridge&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;newPath&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setDuration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setBeginTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CACurrentMediaTime&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;n&quot;&gt;delay&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setFillMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kCAFillModeBackwards&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;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimingFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CAMediaTimingFunction&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;functionWithName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kCAMediaTimingFunctionEaseInEaseOut&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;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shapeLayer&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;addAnimation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;forKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shapeLayer&lt;/span&gt;&lt;span class=&quot;p&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;newPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;pitfalls&quot;&gt;Pitfalls&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;If the two paths have a different number of control points or segments the results are undefined. - &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CAShapeLayer_class/Reference/Reference.html#//apple_ref/doc/uid/TP40008314-CH1-SW20&quot;&gt;docs&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you delay the start of an animation, you might also want to set the fillMode property to &lt;code class=&quot;highlighter-rouge&quot;&gt;kCAFillModeBackwards&lt;/code&gt;. This fill mode causes the layer to display the animation’s start value, even if the layer object in the layer tree contains a different value. Without this fill mode, you would see a jump to the final value before the animation starts executing. - &lt;a href=&quot;https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/AdvancedAnimationTricks/AdvancedAnimationTricks.html#//apple_ref/doc/uid/TP40004514-CH8-SW2&quot;&gt;docs&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</content>
 </entry>
 
 <entry>
   <title>Winterfell</title>
   <link href="http://ztpala.com/2014/02/13/winterfell"/>
   <updated>2014-02-13T00:00:00-05:00</updated>
   <id>http://ztpala.com/2014/02/13/winterfell</id>
   <content type="html">&lt;p&gt;暴雪來襲。在快及膝的大雪裡走了一個鐘頭。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3799/12512423114_ac7028f7e4_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7309/12512072013_5218c1c5b4_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7388/12511945795_97dbdc931b_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3831/12512068293_fbc585beb9_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3747/12511938995_a436a58c9c_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3690/12511937745_862569a2ab_c.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://flic.kr/s/aHsjSsA3Pf&quot;&gt;更多照片&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;雪太大，工廠停工，學校停課，道場停訓，大家各自宅家裡喝酒吃肉。&lt;/p&gt;

&lt;p&gt;所有照片均為iPhone 5s拍攝，用&lt;a href=&quot;http://vsco.co/vscoca&quot;&gt;VSCO Cam&lt;/a&gt;編輯。&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;郭冬臨這個名字突然高大上起來 &lt;a href=&quot;https://twitter.com/search?q=%23%E6%9D%83%E5%8A%9B%E7%9A%84%E6%B8%B8%E6%88%8F&amp;amp;src=hash&quot;&gt;#權力的遊戲&lt;/a&gt;&lt;/p&gt;&amp;mdash; Tao (@ztpala) &lt;a href=&quot;https://twitter.com/ztpala/statuses/431283349517500416&quot;&gt;February 6, 2014&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

</content>
 </entry>
 
 <entry>
   <title>學畫畫</title>
   <link href="http://ztpala.com/2014/01/22/learn-to-draw"/>
   <updated>2014-01-22T00:00:00-05:00</updated>
   <id>http://ztpala.com/2014/01/22/learn-to-draw</id>
   <content type="html">&lt;p&gt;Quora上有人問「&lt;a href=&quot;http://qr.ae/hKYCZ&quot;&gt;沒有去過設計類學校怎麼能變成職業設計師？&lt;/a&gt;」。&lt;/p&gt;

&lt;p&gt;第一個答案得了1.5k的頂，其中第一步就是學習畫畫。其實就算不是職業設計師，很多程序員也需要有一定的設計能力。碼農們，開始學畫畫吧。&lt;/p&gt;

&lt;p&gt;上面推薦了一本書：&lt;strong&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0738212415/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0738212415&amp;amp;linkCode=as2&amp;amp;tag=palaapp-20&quot;&gt;You can draw in 30 days&lt;/a&gt;&lt;/strong&gt;，看著不錯，便開始跟著畫畫試試看。好像以前在某網站上看到過某大神從0基礎開始學畫畫，然後堅持N年貼自己的學習成果，進步是驚人的。所以，以後也不定期在這裡貼一下學習進度吧：&lt;/p&gt;

&lt;h2 id=&quot;section&quot;&gt;2014-1-22 第七天&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;/images/2014-01-22-draw.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;n&quot;&gt;2014-3-12 第N天&lt;/h2&gt;

&lt;p&gt;拖延症 越到最後難畫的越拖延，停了半個多月，今天開始畫眼睛。炯炯🈚️神 👀&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2014-03-12-draw-eye.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Wander for iPhone 5s</title>
   <link href="http://ztpala.com/2013/12/18/wander-for-iphone-5s"/>
   <updated>2013-12-18T00:00:00-05:00</updated>
   <id>http://ztpala.com/2013/12/18/wander-for-iphone-5s</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/wander-for-iphone-5s/id774474904?mt=8&amp;amp;uo=4&quot;&gt;Wander&lt;/a&gt;是一個目前只能在&lt;strong&gt;iPhone 5s&lt;/strong&gt;上運行，用來分析&lt;strong&gt;&lt;a href=&quot;http://www.apple.com/cn/iphone-5s/features/&quot;&gt;M7 協處理器&lt;/a&gt;&lt;/strong&gt;數據的程序。&lt;/p&gt;

&lt;p&gt;它可以統計你每一天每一小時的運動情況。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/jxvwiyze0rbv1fr/Screenshot%202013-12-19%2017.35.41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;每次打開Wander，它會告訴你現在距離上次運動（走路，跑步）過去了多久，同時App的主題顏色也會根據你的運動情況變化，比如你在電腦前坐了一個小時，此時Wander會顯示為紅色，從而提醒你該去走動一下了。當你開始拿著你的iPhone 5s走動的時候，Wander會慢慢變為原本的藍色。&lt;/p&gt;

&lt;p&gt;除了簡單的統計步數之外，Wander還有一個特色功能叫做&lt;strong&gt;打孔卡&lt;/strong&gt;，簡單來說打孔卡的功能是用來分析你的活動規律，它上面用了7*24個點來表示你一禮拜七天每天24小時的平均步數，比如你禮拜一上午八點平均的步數是多少。&lt;/p&gt;

&lt;p&gt;打孔卡是非常好的總結自己運動情況的工具。如果你發現大的點都集中在夜晚的區域，那麼說明你是個夜貓子：）&lt;/p&gt;

&lt;p&gt;除了記錄與分析數據外，Wander還利用Game Center內置了一些有趣的待達成的成就，比如你如果某一天的多數活動都發生在凌晨12點到5點，那麼將會得到&lt;strong&gt;守夜人&lt;/strong&gt;稱號。&lt;/p&gt;

&lt;p&gt;最後你可能比較關心的是耗電問題。因為Wander是直接從M7里讀取數據，所以你無需擔心它會消耗你過多電量，甚至，你幾天打開Wander一次，它仍能毫不遺漏的分析你的歷史數據。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/wander-for-iphone-5s/id774474904?mt=8&amp;amp;uo=4&quot; target=&quot;itunes_store&quot; style=&quot;display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/en_us//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media only screen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/en_us//images/web/linkmaker/badge_appstore-lrg.svg);}&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Happy Valley vs. eastern China</title>
   <link href="http://ztpala.com/2013/12/08/happy-valley-vs-eastern-china"/>
   <updated>2013-12-08T00:00:00-05:00</updated>
   <id>http://ztpala.com/2013/12/08/happy-valley-vs-eastern-china</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11272725986&quot; title=&quot;昨天在網上發了左邊那張雪後晴天的照片 結果有朋友回復了右邊這張昨天天朝某地的照片 by Tao, on Flickr&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7291/11272725986_8f185196d8_z.jpg&quot; width=&quot;640&quot; height=&quot;640&quot; alt=&quot;昨天在網上發了左邊那張雪後晴天的照片 結果有朋友回復了右邊這張昨天天朝某地的照片&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;昨天在網上發了左邊那張&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11257003346&quot;&gt;雪後晴天&lt;/a&gt;的照片 結果有朋友回復了右邊這張昨天天朝某地的照片。希望身在霧霾中的朋友們安好。&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>2013冬的第一場雪</title>
   <link href="http://ztpala.com/2013/11/26/2013-winter-first-snow"/>
   <updated>2013-11-26T00:00:00-05:00</updated>
   <id>http://ztpala.com/2013/11/26/2013-winter-first-snow</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11069927793&quot;&gt;&lt;img src=&quot;//farm4.staticflickr.com/3667/11069927793_cae0bfc69c_c.jpg&quot; width=&quot;800&quot; height=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11069891554&quot;&gt;&lt;img src=&quot;//farm8.staticflickr.com/7393/11069891554_84f516ffb2_c.jpg&quot; width=&quot;800&quot; height=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11069796275&quot;&gt;&lt;img src=&quot;//farm6.staticflickr.com/5528/11069796275_625c8c6c90_c.jpg&quot; width=&quot;800&quot; height=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/11074971475&quot;&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5540/11074971475_59439baca3_c.jpg&quot; width=&quot;800&quot; height=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;距離上次空手道訓練已經過去了&lt;strong&gt;55&lt;/strong&gt;天，從秋天到了冬天。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/10891009635&quot; title=&quot;牆 by Tao, on Flickr&quot;&gt;&lt;img src=&quot;//farm3.staticflickr.com/2848/10891009635_3d2887a42f_c.jpg&quot; width=&quot;800&quot; height=&quot;450&quot; alt=&quot;牆&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/10891009496&quot; title=&quot;落紅滿地 by Tao, on Flickr&quot;&gt;&lt;img src=&quot;//farm6.staticflickr.com/5505/10891009496_fdfa5d0f23_c.jpg&quot; width=&quot;800&quot; height=&quot;600&quot; alt=&quot;落紅滿地&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/10880765155&quot; title=&quot;Halloween leftover by Tao, on Flickr&quot;&gt;&lt;img src=&quot;//farm3.staticflickr.com/2827/10880765155_5a8ebdd906.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;Halloween leftover&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ztpala/10300174236&quot;&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5499/10300174236_2f9bab80c8.jpg&quot; width=&quot;468&quot; height=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>早上好，冬天</title>
   <link href="http://ztpala.com/2013/11/03/good-morning-winter"/>
   <updated>2013-11-03T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/11/03/good-morning-winter</id>
   <content type="html">&lt;p&gt;夏令結束，冬天開始&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3666/10648108224_13a6c070cf_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5544/10648328873_0998d545c6_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Daylight Saving Time and NSDate</title>
   <link href="http://ztpala.com/2013/11/03/daylight-saving-time-and-nsdate"/>
   <updated>2013-11-03T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/11/03/daylight-saving-time-and-nsdate</id>
   <content type="html">&lt;p&gt;刚刚在写关于&lt;code class=&quot;highlighter-rouge&quot;&gt;NSDate&lt;/code&gt;的一段程序，大概就是从今天凌晨零点开始，每次加一小时，然后往一个数组里加一个数，直到当前时间结束。结果发现数组长度总是多1。用&lt;code class=&quot;highlighter-rouge&quot;&gt;@&quot;EEEE, MMMM d, HH:mm:ss&quot;&lt;/code&gt;格式打印那个&lt;code class=&quot;highlighter-rouge&quot;&gt;NSDate&lt;/code&gt;变量，发现凌晨1点打印了两遍，才醒悟是夏令至的问题。&lt;/p&gt;

&lt;p&gt;之前还一直在程序里放了一个&lt;strong&gt;Magic Number&lt;/strong&gt;：&lt;code class=&quot;highlighter-rouge&quot;&gt;HoursPerDay = 24&lt;/code&gt; -,-!&lt;/p&gt;

&lt;p&gt;计算两个日期之前相差多少小时可以用以下方法：&lt;/p&gt;

&lt;div class=&quot;language-objc highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;NSDate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;date1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;someDate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;NSDate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;date2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;someOtherDate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;NSTimeInterval&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;distanceBetweenDates&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;n&quot;&gt;date1&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;timeIntervalSinceDate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;double&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;secondsInAnHour&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;NSInteger&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hoursBetweenDates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;distanceBetweenDates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;secondsInAnHour&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/a/4084356&quot;&gt;via StackOverFlow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;特殊的时间运行特殊的程序发现了特殊的bug。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How to get the bounds of a word inside UITextView</title>
   <link href="http://ztpala.com/2013/10/19/how-to-get-the-bounds-of-a-word-inside-uitextview"/>
   <updated>2013-10-19T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/10/19/how-to-get-the-bounds-of-a-word-inside-uitextview</id>
   <content type="html">&lt;p&gt;In &lt;a href=&quot;https://itunes.apple.com/app/the-missing-word/id716259978?mt=8&quot;&gt;Missing Word&lt;/a&gt;, I need to get the exact bounds of the missing word and put a same-sized UITextField onto it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/fl8kntyzu4mhvjd/Screenshot%202013-10-19%2001.20.37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Thanks to the power of &lt;strong&gt;TextKit&lt;/strong&gt; which was introduced in iOS 7, this task can be accomplished pretty easily.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-objc&quot; data-lang=&quot;objc&quot;&gt;&lt;span class=&quot;n&quot;&gt;NSTextStorage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aStorage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;textView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;textStorage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;NSTextContainer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aContainer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;textView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;textContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;CGRect&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;wordRect&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;n&quot;&gt;aManager&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;boundingRectForGlyphRange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wordRange&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inTextContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Don'f forget the inset
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UIEdgeInsets&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;textView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;textContainerInset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;wordRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;origin&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; &lt;span class=&quot;n&quot;&gt;inset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;wordRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;origin&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;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;CGRect&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;textFieldRect&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;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;convertRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wordRect&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;fromView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;textView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Why do I need the missing word’s exact bounds instead of the position?&lt;/p&gt;

&lt;p&gt;If you use hint, you’ll notice the hint letters are not popping out from nowhere, they are appearing like part of the textField’s text.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/3h6tcwu551nphk7/Screenshot%202013-10-19%2001.55.00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Check out the letters &lt;strong&gt;inv&lt;/strong&gt; in the above image. Actually, &lt;strong&gt;in&lt;/strong&gt; is in the textView and &lt;strong&gt;v&lt;/strong&gt; is in the textField.&lt;/p&gt;

&lt;h2 id=&quot;one-flaw-misaligned-images&quot;&gt;One flaw, Misaligned Images&lt;/h2&gt;

&lt;p&gt;Turn on the &lt;code class=&quot;highlighter-rouge&quot;&gt;Color Misaligned Images&lt;/code&gt; of the simulator, you’ll notice this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/z7ppllzup8j1bhx/Screenshot%202013-10-19%2002.02.14.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The reason is that the “exact bounds” of the missing word look like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-objc&quot; data-lang=&quot;objc&quot;&gt;&lt;span class=&quot;n&quot;&gt;origin&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;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&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;&lt;span class=&quot;mi&quot;&gt;333&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;108&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&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;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;378002&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;46&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;444&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;These fractional parts will create a bit of blurriness of your text:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/82npmxo66gb5kyz/Screenshot%202013-10-19%2002.09.55.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you want the text to look sharp, you’ll need to use set the textFiled’s position pixel-aligned. But under that situation, the letter &lt;strong&gt;v&lt;/strong&gt; looks one pixel lower:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/emijm5wjsssr8h9/Screenshot%202013-10-19%2002.17.26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Any ideas?&lt;/p&gt;

&lt;p&gt;Missing Word is available on the app store. &lt;a href=&quot;https://itunes.apple.com/app/the-missing-word/id716259978?mt=8&quot;&gt;iTunes link&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Stop</title>
   <link href="http://ztpala.com/2013/10/12/stop-selling-apps-for-99-cents"/>
   <updated>2013-10-12T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/10/12/stop-selling-apps-for-99-cents</id>
   <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Stop selling apps for 99¢. You can’t even buy gum for 99¢ anymore, and it lasts for, what, five minutes? If you’re lucky. Stop it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.davidchartier.com/post/62908696202/almost-the-entire-app-store-pricing&quot;&gt;via&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Missing Word</title>
   <link href="http://ztpala.com/2013/10/09/missing-word"/>
   <updated>2013-10-09T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/10/09/missing-word</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/the-missing-word/id716259978?mt=8&amp;amp;uo=4&quot; target=&quot;itunes_store&quot; style=&quot;display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/en_us//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media only screen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/en_us//images/web/linkmaker/badge_appstore-lrg.svg);}&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is the best way to learn from the masters?&lt;/p&gt;

&lt;p&gt;Look to the master, follow the master, walk with the master, see &lt;em&gt;__&lt;/em&gt; the master, become the master. - Eric Steven Raymond&lt;/p&gt;

&lt;p&gt;Missing Word contains more than 200 (and counting) hand-picked quotes. Every quote has a missing word. You need to think in the way as the master did, and figure out the missing word to complete the quote. Every time you finish a quote, not only have you read the quote, but also deeply understand it.&lt;/p&gt;

&lt;p&gt;Learn from the masters, one quote at a time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/the-missing-word/id716259978?ls=1&amp;amp;mt=8&quot;&gt;Missing Word&lt;/a&gt; has 6 colorful built-in themes, you can also randomly shuffle themes when you play.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/the-missing-word/id716259978?mt=8&amp;amp;uo=4&quot; target=&quot;itunes_store&quot;&gt;&lt;img src=&quot;https://dl.dropbox.com/s/hs3xd9agftattj4/iOS%20Simulator%20Screen%20shot%20Oct%207%2C%202013%206.49.36%20PM.png&quot; width=&quot;320&quot; height=&quot;568&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/the-missing-word/id716259978?mt=8&amp;amp;uo=4&quot; target=&quot;itunes_store&quot;&gt;&lt;img src=&quot;https://dl.dropbox.com/s/4xjl9ztilwakzmb/iOS%20Simulator%20Screen%20shot%20Oct%207%2C%202013%206.40.23%20PM.png&quot; width=&quot;320&quot; height=&quot;568&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/the-missing-word/id716259978?mt=8&amp;amp;uo=4&quot; target=&quot;itunes_store&quot;&gt;&lt;img src=&quot;https://dl.dropbox.com/s/tt8ezqaambnkk9y/iOS%20Simulator%20Screen%20shot%20Oct%208%2C%202013%204.51.48%20PM.png&quot; width=&quot;320&quot; height=&quot;568&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>兩個debug教訓</title>
   <link href="http://ztpala.com/2013/10/06/nsattributedstring-height-uitableviewcell"/>
   <updated>2013-10-06T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/10/06/nsattributedstring-height-uitableviewcell</id>
   <content type="html">&lt;p&gt;記錄一下今天犯的兩個特二的錯誤，都和&lt;strong&gt;tableView&lt;/strong&gt;裏的&lt;strong&gt;seperator&lt;/strong&gt;有關。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; 如果&lt;code class=&quot;highlighter-rouge&quot;&gt;tableView&lt;/code&gt;有&lt;code class=&quot;highlighter-rouge&quot;&gt;seperator&lt;/code&gt;，則cell的&lt;code class=&quot;highlighter-rouge&quot;&gt;contentView&lt;/code&gt;的高度比cell本身小1。&lt;/p&gt;

&lt;p&gt;##錯誤一，高度計算&lt;/p&gt;

&lt;p&gt;iOS 6後計算 &lt;code class=&quot;highlighter-rouge&quot;&gt;NSAttributedString&lt;/code&gt; 的固定寬度下的高度應該使用以下方法&lt;/p&gt;

&lt;div class=&quot;language-objc highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CGRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;boundingRectWithSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CGSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NSStringDrawingOptions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NSStringDrawingContext&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;nv&quot;&gt;context&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;如果是多行字符串，需要在 &lt;code class=&quot;highlighter-rouge&quot;&gt;options&lt;/code&gt; 裏傳入 &lt;code class=&quot;highlighter-rouge&quot;&gt;NSStringDrawingUsesLineFragmentOrigin&lt;/code&gt;。另外在根據這個高度設定如 &lt;code class=&quot;highlighter-rouge&quot;&gt;UILabel&lt;/code&gt; 的大小時，需要將計算的高度取 &lt;code class=&quot;highlighter-rouge&quot;&gt;ceilf&lt;/code&gt; 值。&lt;/p&gt;

&lt;p&gt;今天在IB裏直接畫一個 &lt;code class=&quot;highlighter-rouge&quot;&gt;Prototype Cell&lt;/code&gt;，然後在上面加了一個 &lt;code class=&quot;highlighter-rouge&quot;&gt;UILabel&lt;/code&gt;，設定好位置後，回到 &lt;code class=&quot;highlighter-rouge&quot;&gt;UITableViewController&lt;/code&gt; 計算Cell高度時老是出錯，導致字符串顯示不完全。接著先入為主以為是上面的高度計算有問題，因為之前看到說上面那個函數並不一定會嚴格遵循你設置的固定寬度。結果搜了半天發現了最終特sb的原因：&lt;/p&gt;

&lt;p&gt;總所周知在IB裏按住 &lt;code class=&quot;highlighter-rouge&quot;&gt;option&lt;/code&gt; 鍵，可以看到一個view相對於superview的位置，上下左右各有多少距離。在上面的 &lt;code class=&quot;highlighter-rouge&quot;&gt;Prototype Cell&lt;/code&gt; 裏，這個位置時是相對於 &lt;code class=&quot;highlighter-rouge&quot;&gt;contentView&lt;/code&gt; 的，而 &lt;code class=&quot;highlighter-rouge&quot;&gt;contentView&lt;/code&gt; 的高度是比cell本身要小1，所以在返回 &lt;code class=&quot;highlighter-rouge&quot;&gt;heightForRowAtIndexPath&lt;/code&gt; 時也就沒有返回正確的值。由於我偷懶直接在IB預設值好那個label是 &lt;code class=&quot;highlighter-rouge&quot;&gt;UIViewAutoresizingFlexibleHeight&lt;/code&gt;，所以也就無法完全顯示字符串了。&lt;/p&gt;

&lt;p&gt;##錯誤二，separatorInset&lt;/p&gt;

&lt;p&gt;在 iOS 7裏可以設置 &lt;code class=&quot;highlighter-rouge&quot;&gt;tableView&lt;/code&gt; 或者 &lt;code class=&quot;highlighter-rouge&quot;&gt;tableViewCell&lt;/code&gt; 的 &lt;code class=&quot;highlighter-rouge&quot;&gt;separatorInset&lt;/code&gt;，這樣seperator則可以有左右的縮進。&lt;strong&gt;注&lt;/strong&gt;：左右縮進的部分的顔色 == &lt;code class=&quot;highlighter-rouge&quot;&gt;cell.backgroundColor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;我的cell是暗色背景，seperator的顔色是白色。在設置cell的背景色時用了&lt;/p&gt;

&lt;div class=&quot;language-objc highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contentView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;backgroundColor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;someColor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;而忘記了應該直接設置cell的backgroundColor，默認為白色。同時我把seperator的顔色也設置成了白色。&lt;/p&gt;

&lt;p&gt;結果在設置 &lt;code class=&quot;highlighter-rouge&quot;&gt;separatorInset&lt;/code&gt; 時無效，總是顯示和tableView等寬的seperator。後來就是想為什麼 &lt;code class=&quot;highlighter-rouge&quot;&gt;separatorInset&lt;/code&gt; 無效，因為 &lt;code class=&quot;highlighter-rouge&quot;&gt;tableView&lt;/code&gt; 和 &lt;code class=&quot;highlighter-rouge&quot;&gt;tableViewCell&lt;/code&gt; 均可以設置此值，並且後者會覆蓋前者。後來把seperator的顔色改為其他顔色才發現，原來是cell本身的背景色為白色。&lt;code class=&quot;highlighter-rouge&quot;&gt;separatorInset&lt;/code&gt; 的效果完全正常。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/pciih2thjhrsmyy/Screen%20Shot%202013-10-07%20at%2012.33.12%20AM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;##教訓&lt;/p&gt;

&lt;p&gt;debug時總是先入為主複雜化，以為錯誤出現在使用的新東西上面，懷疑是否錯誤理解了什麼，而忘記了最基本的東西的特性，比如 &lt;code class=&quot;highlighter-rouge&quot;&gt;contentView&lt;/code&gt;。這個1的高度差好像在多年前那個斯坦福iOS開發課程裏就講過，現在完全不記得。&lt;/p&gt;

&lt;p&gt;一個新app基本完工，預計這兩天傳上去。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/layq8eoklbwwfxf/AppIcon76x76%402x.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>iPad Split Keyboard Notifications</title>
   <link href="http://ztpala.com/2013/09/23/ipad-keyboard-notifications"/>
   <updated>2013-09-23T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/09/23/ipad-keyboard-notifications</id>
   <content type="html">&lt;p&gt;最近發現iPad下一個關於&lt;strong&gt;Split Keyboard Notifications&lt;/strong&gt;的詭異問題，在這裏記錄一下。&lt;/p&gt;

&lt;p&gt;一般情況下，只要鍵盤處於&lt;strong&gt;split&lt;/strong&gt;狀態，不應該收到任何相關通知，但以下是個例外。&lt;/p&gt;

&lt;p&gt;當鍵盤處於&lt;strong&gt;docked&lt;/strong&gt;狀態，此時如果&lt;strong&gt;手動split&lt;/strong&gt;鍵盤，鍵盤會仍處在docked的位置。此時切換輸入法（高度變化）不會收到任何通知。但如果將鍵盤隱藏，再重新顯示，或者一種更普遍情況，顯示鍵盤的時候，狀態是 &lt;strong&gt;split + docked&lt;/strong&gt;，那麼切換輸入法時會收到 &lt;code class=&quot;highlighter-rouge&quot;&gt;UIKeyboardWillShowNotification&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;UIKeyboardDidShowNotification&lt;/code&gt;，但再隱藏時不會收到 &lt;code class=&quot;highlighter-rouge&quot;&gt;UIKeyboardWillHideNotification&lt;/code&gt;。最神奇的是，如果按住隱藏鍵盤按鈕將鍵盤向上推離dock區域，仍然會收到 &lt;code class=&quot;highlighter-rouge&quot;&gt;UIKeyboardWillHideNotification&lt;/code&gt;。&lt;/p&gt;

&lt;p&gt;在蘋果官方文檔 &lt;a href=&quot;https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html&quot;&gt;Text Programming Guide for iOS&lt;/a&gt; 中，給出了如下處理鍵盤通知的代碼：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-objc&quot; data-lang=&quot;objc&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Call this method somewhere in your view controller setup code.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;registerForKeyboardNotifications&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;NSNotificationCenter&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;defaultCenter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;addObserver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keyboardWasShown&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;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UIKeyboardDidShowNotification&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nil&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;NSNotificationCenter&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;defaultCenter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;addObserver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;
             &lt;span class=&quot;nf&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keyboardWillBeHidden&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;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UIKeyboardWillHideNotification&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nil&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;c1&quot;&gt;// Called when the UIKeyboardDidShowNotification is sent.
&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;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keyboardWasShown&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;n&quot;&gt;NSNotification&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;n&quot;&gt;aNotification&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;NSDictionary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;info&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;n&quot;&gt;aNotification&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;userInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;CGSize&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kbSize&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;n&quot;&gt;info&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;objectForKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UIKeyboardFrameBeginUserInfoKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;CGRectValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;n&quot;&gt;UIEdgeInsets&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UIEdgeInsetsMake&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kbSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contentInset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scrollIndicatorInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 
    &lt;span class=&quot;c1&quot;&gt;// If active text field is hidden by keyboard, scroll it so it's visible
&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;// Your app might not need or want this behavior.
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;CGRect&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;aRect&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;frame&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;aRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kbSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&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;n&quot;&gt;CGRectContainsPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;activeField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;frame&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;origin&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;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;scrollRectToVisible&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activeField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;frame&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;animated&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;YES&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;p&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;c1&quot;&gt;// Called when the UIKeyboardWillHideNotification is sent
&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;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keyboardWillBeHidden&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;n&quot;&gt;NSNotification&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;n&quot;&gt;aNotification&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UIEdgeInsets&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UIEdgeInsetsZero&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contentInset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scrollIndicatorInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;上面的代碼在上述特殊情況下，&lt;code class=&quot;highlighter-rouge&quot;&gt;scrollView.contentInset&lt;/code&gt; 怎麼也不會被重新reset，下面的代碼怎麼也不會執行&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-objc&quot; data-lang=&quot;objc&quot;&gt;&lt;span class=&quot;n&quot;&gt;UIEdgeInsets&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UIEdgeInsetsZero&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contentInset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;scrollView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scrollIndicatorInsets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contentInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;如果有人能幫忙測試一下，不勝感激。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2013塔西山雞翅節</title>
   <link href="http://ztpala.com/2013/08/15/tussey-mountain-wingfest-2013"/>
   <updated>2013-08-15T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/08/15/tussey-mountain-wingfest-2013</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.tusseymountain.com/&quot;&gt;Tussey Mountain&lt;/a&gt;滑雪場在夏天的時候會舉辦一個為期六個禮拜的雞翅節 - &lt;a href=&quot;http://www.tusseymountain.com/wingfest.php&quot;&gt;Tussey Mountain WingFest&lt;/a&gt;。具體內容就是這六個禮拜的每禮拜四下午5:30-10:00，聚集村裡的四家不同的烤雞翅商家，再加上一些生啤攤，熱狗攤，一起搞一個類似嘉年華的活動。每次有兩個不同的樂隊來表演助興。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5349/9518539517_b8a97983b0.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;門票是$5/人，然後進去可以隨意買小票，$1/張，一張可以換兩個雞翅，四張換一杯生啤。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2810/9521325690_0642123b94.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;啤酒味道一般，但雞翅很贊。每次來的四個雞翅攤最後要經過遊客投票選出最佳雞翅。結果可以在上面的網站上看。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2894/9518539243_41a5fa8540.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;走時正好看到特漂亮的日落。從停車場的擁擠程度可以看出這活動還是挺有人氣的。若干年過去，發現SC村雖然小，但一年到頭活動還是挺多：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;http://ztpala.com/2008/02/23/thon-2008&quot;&gt;THON&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;http://ztpala.com/2011/07/15/central-pennsylvania-festival-of-the-arts/&quot;&gt;中部賓州藝術節&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;http://ztpala.com/2011/10/15/alpha-fire-company-open-house/&quot;&gt;Alpha Fire Company Open House&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;http://ztpala.com/2013/07/04/4th-july/&quot;&gt;獨立日煙花&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;http://ztpala.com/2012/01/01/happy-new-year-2012/&quot;&gt;新年冰雕展&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Tile Tale的故事</title>
   <link href="http://ztpala.com/2013/08/11/tile-tale-story"/>
   <updated>2013-08-11T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/08/11/tile-tale-story</id>
   <content type="html">&lt;h2 id=&quot;tldr&quot;&gt;tl;dr&lt;/h2&gt;

&lt;p&gt;前幾天&lt;a href=&quot;http://zuimeia.com/&quot;&gt;最美應用&lt;/a&gt;的編輯說想推薦一下&lt;a href=&quot;https://itunes.apple.com/us/app/tile-tale/id577675173?ls=1&amp;amp;mt=8&quot;&gt;Tile Tale&lt;/a&gt;，讓我大概寫一下開發中的故事，比如idea的產生，中間遇到的趣事和&lt;del&gt;苦難&lt;/del&gt;困難等。&lt;/p&gt;

&lt;p&gt;昨天，最美應用已經發表了推薦文章：&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;一款非常親民的 puzzle 類遊戲。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Tile Tale 讓小美一上手就欲罷不能，連續幾天，公交車、蹲廁所、走路都在玩，終於通關。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;http://zuimeia.com/app/219/&quot;&gt;最美應用評測&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/us/app/tile-tale/id577675173?ls=1&amp;amp;mt=8&quot;&gt;App Store下載鏈接&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.douban.com/subject/20512589/&quot;&gt;豆瓣頁面&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;idea&quot;&gt;Idea的產生&lt;/h2&gt;

&lt;p&gt;2012年上半年，Draw Something正火，自己和周圍的朋友都很喜歡玩這個遊戲，當時Game Center已經支持了Turn Based Game，於是自己也想寫一個此類小遊戲玩玩。正好當時自己也在玩一種Puzzle類小遊戲 - &lt;a href=&quot;http://en.wikipedia.org/wiki/Nonogram&quot;&gt;Nonogram&lt;/a&gt;。所以初步想法就是寫一個可以兩個人玩的Nonogram。&lt;/p&gt;

&lt;p&gt;這個Nonogram遊戲開發到可以玩的階段後發現自己隨意設計出來的Puzzle解決起來並不是很有樂趣，要不特別難，要不無解，所以開發進展緩慢。接著App Store上出現了一個很流行的遊戲叫做&lt;a href=&quot;https://itunes.apple.com/us/app/flow-free/id526641427?mt=8&quot;&gt;Flow&lt;/a&gt;。玩了幾次發現這個遊戲的玩法太適合目前的項目了。然後我將這個未完成的遊戲按Flow的玩法修改了一下，變成了後來的Tile Tale。玩法和Flow是一樣的，只是賣點在界面不同和主力推薦Turn Based的玩法，也就是玩家可以設計自己的Puzzle。&lt;/p&gt;

&lt;h2 id=&quot;section&quot;&gt;開發中的故事&lt;/h2&gt;

&lt;p&gt;因為整個界面的風格是有些像素化的，所以自己很想用一種獨有的風格展現所有的Puzzle。考慮到遊戲本身的特點，比如每關都是正方形，於是為了統一風格，決定每一個難度的Puzzle數量都是一個平方數，展現出來如下：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/s/ox2mqnvqials22b/Photo%20Aug%2008%2C%201%2024%2052%20PM.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;但總覺得用數字寫第幾關很無趣。後來想既然都是正方形，為何不在Puzzle展示的時候直接顯示縮略圖呢，所有Puzzle放在一起一定很壯觀。接著就有了現在的選關風格。n²難度的Puzzle有n²關，完成後會顯示結果縮略圖，這樣解決所有10x10的Puzzle後會看到一個有10000個小單元格的彩色正方形。&lt;/p&gt;

&lt;p&gt;此種展示方式的困難在於怎麼樣快速的畫出這幾百個小的彩色單元格，並且要計算好每個單元格的寬度都是整數，防止出現類似78.6px寬這種情況，會讓單元格的顯示有些模糊。還有要選擇一些比較搭的顏色放在一起，讓玩家看著比較舒服。這裡要感謝一下&lt;a href=&quot;https://kuler.adobe.com/&quot;&gt;Adobe Kuler&lt;/a&gt;這個工具。&lt;/p&gt;

&lt;p&gt;另外一個最大的困難是怎麼用不怎麼好用的Game Center讓玩家很容易的給朋友設計和開心的玩別人發過來的Puzzle，並且還可以用iCloud保存和同步自己設計過的Puzzle，方便發給多個朋友。這一塊的工作量佔據了此遊戲開發的多數時間。目前版本(2.1)的多人遊戲還有不少bug，將要發佈的下一版本應該能改進很多。&lt;/p&gt;

&lt;p&gt;因為考慮到要內置5²+6²+…+10²=355個Puzzle。所以Tile Tale最先寫好的是Turn Based遊戲中設計Puzzle的部分，這樣可以一邊測試Puzzle設計界面及雙人遊戲，一邊將自己設計的Puzzle直接保存成後來內置的單人遊戲。在2.0版本的更新中又多加了100個10x10的Puzzle，其中絕大多數都是後來玩多人遊戲時保存的。&lt;/p&gt;

&lt;p&gt;在設計這些單人遊戲的時候，有時既要考慮到遊戲難度，又要使每一關完成後的圖案盡量好看一些。我的特約Puzzle設計師&lt;a href=&quot;https://twitter.com/azaleasays&quot;&gt;@azaleasays&lt;/a&gt;同學很多時候還堅持在如此有限的單元格里畫出點有意義的東西，而不是完全隨機的顏色線條。比如下面這個例子：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropboxusercontent.com/s/sc8xh0bygsec97t/Screenshot%202013-08-08%2015.22.57.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;完成之後就變成了&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://dl.dropboxusercontent.com/s/9luqxp7u7r4a4t0/Screenshot%202013-08-08%2015.24.12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;當然還有其他好多我自己怎麼也看不出來畫的什麼的抽象圖案。&lt;/p&gt;

&lt;h2 id=&quot;section-1&quot;&gt;其他&lt;/h2&gt;

&lt;p&gt;有人問過我這個遊戲是不是參考了很多&lt;a href=&quot;https://itunes.apple.com/us/app/letterpress-word-game/id526619424?mt=8&quot;&gt;Letterpress&lt;/a&gt;的設計，比如Puzzle的展示風格和Letterpress的主界面很像。其實Tile Tale在界面設計基本完成之後Letterpress還沒有發佈，兩者的相似真的完全是一個巧合。要說參考和模仿，那就是玩法本身從&lt;a href=&quot;https://itunes.apple.com/us/app/flow-free/id526641427?mt=8&quot;&gt;Flow&lt;/a&gt;而來。&lt;/p&gt;

&lt;p&gt;雖然此遊戲最初的出發點是想做一個好玩的Turn Based Game，但由於是建立在Game Center的基礎上，似乎多數人還是不怎麼用它來玩遊戲，所以絕大多數人都只玩單人遊戲。我個人認為，自己設計Puzzle和玩別人發給我的Puzzle樂趣更多。&lt;/p&gt;

&lt;p&gt;由於此遊戲是我一個人在做，所以還有很多不足，比如沒有聲音，Game Center有一堆bug，字體太不易讀等等。這些不足都會在接下來的更新中慢慢改進。很感謝所有玩家的反饋。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>螢火蟲</title>
   <link href="http://ztpala.com/2013/07/18/firefly"/>
   <updated>2013-07-18T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/18/firefly</id>
   <content type="html">&lt;p&gt;前幾天看到這篇新聞：&lt;a href=&quot;http://gx.people.com.cn/n/2013/0717/c179430-19090134.html&quot;&gt;青島花巨資從廣西引進萬只螢火蟲 待3天一半死去&lt;/a&gt;。養殖戶賣3-4塊錢一隻，青島一公園一次就買了一萬只。&lt;/p&gt;

&lt;p&gt;我們後面的樹林里有大片大片的螢火蟲，那能賣多少錢啊。今天天黑後扛著相機去試著拍了幾張：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7282/9319134588_26cc9212c8_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7314/9319134526_1e501c1fdd_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7429/9319133856_41da74a57a_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3759/9316345561_7638850388_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2836/9319132756_9d87b288b6_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;水平有限，完全不能展示用肉眼看到的美麗景象。附近的朋友可以晚上天黑後去看看，就在Sunset Park後面那條Bike Path上。注意防蚊子。&lt;/p&gt;

&lt;p&gt;看大圖請去&lt;a href=&quot;http://www.flickr.com/photos/ztpala/sets/72157634701970434/&quot;&gt;flickr&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>用Dropbox選擇性同步Jekyll</title>
   <link href="http://ztpala.com/2013/07/17/dropbox-selective-sync-jekyll"/>
   <updated>2013-07-17T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/17/dropbox-selective-sync-jekyll</id>
   <content type="html">&lt;p&gt;如果你用&lt;a href=&quot;http://db.tt/H7ei7k2&quot;&gt;Dropbox&lt;/a&gt;存放和同步Jekyll的代碼和文章，那麼最好進行一些設置防止運行Jekyll時Dropbox大量更新而&lt;del&gt;燒毀&lt;/del&gt;燒熱你的電腦。&lt;/p&gt;

&lt;p&gt;Dropbox的 &lt;strong&gt;Selective Sync&lt;/strong&gt; 可以讓你選擇性的同步某些文件夾：&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Preferences&lt;/code&gt; - &lt;code class=&quot;highlighter-rouge&quot;&gt;Advanced&lt;/code&gt; - &lt;code class=&quot;highlighter-rouge&quot;&gt;Selective Sync&lt;/code&gt; - &lt;code class=&quot;highlighter-rouge&quot;&gt;Change Settings&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Jekyll用 &lt;code class=&quot;highlighter-rouge&quot;&gt;_site&lt;/code&gt; 這個文件夾來存放生成好的靜態文件，這也是為什麼 &lt;code class=&quot;highlighter-rouge&quot;&gt;.gitignore&lt;/code&gt; 里會默認加入它。&lt;/p&gt;

&lt;p&gt;所以最好也在上述的Dropbox選擇性同步里將這個文件夾排除，以防止每次build網站時都同步大量的新文件，這天已經夠熱的了:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;RealFeel 40°，我去 &lt;a href=&quot;https://twitter.com/search?q=%23%E5%A4%A9%E6%B0%94&amp;amp;src=hash&quot;&gt;#天氣&lt;/a&gt; &lt;small&gt;&lt;a href=&quot;https://twitter.com/ztpala/statuses/357578857265643520&quot;&gt;@ztpala&lt;/a&gt; 3:13 PM - 17 Jul 2013&lt;/small&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>550繞圈</title>
   <link href="http://ztpala.com/2013/07/13/biking-550"/>
   <updated>2013-07-13T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/13/biking-550</id>
   <content type="html">&lt;p&gt;最近一直陰雨，所以趁今天天氣晴好還算涼快，去550繞了一圈。&lt;/p&gt;

&lt;p&gt;2013第一騎。把車從&lt;a href=&quot;/2011/06/17/garage&quot;&gt;車庫&lt;/a&gt;搬出來後發現到處纏的都是蜘蛛網。罪過罪過。&lt;/p&gt;

&lt;p&gt;之前在修路的一部分現在已經完工，路況非常好。中間 &lt;a href=&quot;https://twitter.com/azaleasays&quot;&gt;@azaleasays&lt;/a&gt; 的剎車有問題，自己提著後輪走了兩步，結果被一開車路過的大哥看到，掉頭回來問我們有沒有要幫忙的，還是好人多。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2854/9278713969_8ab4d836cd_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;↑ 大片的麥田和玉米&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3825/9278713531_62cb4c34e7.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7399/9278717891_df9666ea3b_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5453/9281495544_622e090527_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5535/9278711183_5b56d468d6_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5542/9281502976_dd79a99660_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;↑ 沒有碼表，完全不知道速度。路程≈31km。&lt;a href=&quot;http://flic.kr/s/aHsjzaVhu1&quot;&gt;Flickr&lt;/a&gt;&lt;/p&gt;

&lt;iframe src=&quot;//instagram.com/p/buUYQUIBnp/embed/&quot; width=&quot;612&quot; height=&quot;710&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowtransparency=&quot;true&quot;&gt;&lt;/iframe&gt;
</content>
 </entry>
 
 <entry>
   <title>雀巢</title>
   <link href="http://ztpala.com/2013/07/10/birds"/>
   <updated>2013-07-10T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/10/birds</id>
   <content type="html">&lt;p&gt;前兩天發現有位新住客在家門口的燈上安家了：&lt;/p&gt;

&lt;iframe src=&quot;//instagram.com/p/bE0iYQoBia/embed/&quot; width=&quot;612&quot; height=&quot;710&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowtransparency=&quot;true&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;幾天後：&lt;/p&gt;

&lt;iframe src=&quot;//instagram.com/p/bmBQjDIBi3/embed/&quot; width=&quot;612&quot; height=&quot;710&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowtransparency=&quot;true&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;今天instagram推出了在網頁中嵌入照片/影片的功能，順便在這裏測試一下。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>dotfiles</title>
   <link href="http://ztpala.com/2013/07/09/dotfiles"/>
   <updated>2013-07-09T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/09/dotfiles</id>
   <content type="html">&lt;blockquote&gt;
  &lt;p&gt;A man’s home is his castle. Never leave your dotfiles behind.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;上面這句是我最近看到的最好的技術方面的文案，來源於 &lt;a href=&quot;https://github.com/technicalpickles/homesick&quot;&gt;homesick&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;對於*nix-based系統的用戶來說，dotfiles定制著各種軟件的外觀與使用方式，但很多人習慣把各種定制全寫在一個文件里：&lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;。&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Face it: you’re proud of that 204-line .bashrc, and you should be! You’ve fine-tuned your prompt, carefully planned your aliases, and written some pretty time-saving functions over the years. Why not show off your work and, in the spirit of the open source community, share your efforts. You may even learn a few tricks. &amp;lt;footer&amp;gt;http://dotfiles.org&amp;lt;/footer&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;每次用一台新電腦，如果沒有time machine備份的話總是很頭疼。今天終於後知後覺，決定也把所有的dotfiles整理一下，然後放到GitHub。以後用新電腦，只要clone下來馬上就有順手的使用環境。另外也不怕自己胡亂改而犯錯。&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;git clone git@github.com:pala/dotfiles.git ~/.dotfiles
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/.dotfiles
script/bootstrap&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>2013 獨立日</title>
   <link href="http://ztpala.com/2013/07/04/4th-july"/>
   <updated>2013-07-04T00:00:00-04:00</updated>
   <id>http://ztpala.com/2013/07/04/4th-july</id>
   <content type="html">&lt;p&gt;在Downtown跑了大半天，發現除了酒吧多數的飯館都關門了，一直從大碗跑到了金鼎，最後發現金鼎開門，但老闆已經換人，變成了一個川菜館。三個人要了四個菜竟然沒吃完。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5455/9211286531_2ccdbcfb2b_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;吃完慢慢往BJC晃。發現最近多了好多非常小的兔子&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5344/9211170567_3c619ce726_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;本來說可能有雨的，結果天氣很好，Old Main被灑上了一層很漂亮的金色&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2818/9213951200_a446cebc08.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;一路過去看到很多人開始往那趕，才發現忘了帶折疊椅過去。BJC旁邊這裡是非VIP看煙花最好的地方了，位置高，離得近。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7386/9214066814_a1a314fa48_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;不會拍煙花，看來要搞個遙控器，否則拍出來抖的跟方便面似的。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3811/9213951124_e1e5220990_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;本來是心形，結果給我拍的跟鬼臉似的。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7447/9211169327_baa3643758_z.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;State College的煙花表演據說是全美規模最大的幾個之一，會吸引約6-8萬人觀看。&lt;/p&gt;
</content>
 </entry>
 

</feed>
