發表文章

目前顯示的是 7月, 2013的文章

Nexus7升級到Android4.3

圖片
Nexus7, Android 4.3 Jelly Bean 隨者Nexus 7(2013 edition)的出現,也伴隨者Android的新版本。此次升級版本為Android 4.3, Jelly Bean。 買Google的Nexus系列的好處之一,就是比較容易獲得更新。在七月的最後一天,我的Nexus 7出現可以更新的訊息,於是就更新了… Nexus7通知可以更新到Android4.3 Jelly Bean

築於塑膠罐中的蜂巢

圖片
蜂巢的材料,看起來彷彿衛生紙 在家裡的陽台中看過不少昆蟲、動物來築巢。看過的有麻雀窩(當時裡面還有小麻雀)、蜂窩(種類還不少)。之前遇過比較扯的是,在 電腦硬碟外接盒中的螞蟻窩 。(最近又再度遇到一次) 家裡有蜂窩對住在靠山的住戶來講,應該也不算有什麼奇特之處,從小大到已經摘除過幾個小蜂巢了。不過,這次有個奇特之處就是…這個蜂窩居然築於塑膠瓶罐內… 蜂巢這蜜蜂選錯了築巢地點,居然選在塑膠罐內…

php如何用正規表達式(Regular Expression)處理unicode

最近使用正規表達式(Regular Expression)處理夾雜中英文、及符號的字串。因為字串是UTF8的編碼,於是翻了一下正規表達式的經典書籍- 精通正規表達式(第三版) (這本書寫的真不錯,看了前兩章就可以感受到作者的用心與功力),看看PHP該如何處理。 書中提到PHP的表示方式為\xnum、\x{num},這和常見的\unum方式不同。照書中所述的處理方式去做,結果和預期不同。 最後看了以下兩篇PHP官網上的說明,才瞭解正確的用法 Pattern Modifiersu ,提到PCRE UTF-8 mode… This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern strings are treated as UTF-8. This modifier is available from PHP 4.1.0 or greater on Unix and from PHP 4.2.3 on win32. UTF-8 validity of the pattern is checked since PHP 4.3.5. Escape sequences ,這篇說明了 \xYY 和 \x{YYYY}的差異… After "\x", up to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, "\x{...}" is allowed, where the contents of the braces is a string of hexadecimal digits. It is interpreted as a UTF-8 character whose code number is the given hexadecimal number. The original hexadecimal escape sequence, \xhh, matches a two-byte UTF-8 character if the value is greater t