CloudFlare 推出 tag-based purge 功能

CloudFlare 推出這個功能很棒啊,不過這後面的資料結構必須設計的夠好才能這樣玩:「Introducing a Powerful Way to Purge Cache on CloudFlare: Purge by Cache-Tag」。

cache purge 一直都是 CDN 的痛處,用過的每一家 CDN 都在比慢的,大概都是 10 mins 起跳,但 CloudFlare 在這塊花了不少功夫:

可以想像到的方式是放入 user_gslin (在使用者停用時可以馬上更新) 或是 pic_id_1234567890 (可以針對各種縮圖一次刷新) 這樣的 tag 去歸類,然後就可以大規模刷...

GitHub 上程式語言的趨勢

GitHub 給了從 2008 年到 2015 年現在,放在 GitHub 上專案所使用程式語言的排名:「Language Trends on GitHub」。

這同時包括了公開與私人 repository:

The rank represents languages used in public & private repositories, excluding forks, as detected by Linguist.

可以看到 Java 專案的排名逐步上升,應該是愈來愈多 Java 專案放到 GitHub 上 (應該是跟 Android 有關)。而 Perl 是掉出去很久了,PHP 則是萬年不動... XD

回到 Android 世界熟悉...

最早的時候是用 Android 系統,HTC Desire 還在 2.1 的年代 (2010 年)。

後來切到蘋果的環境裡,第一隻 iPhone 4S 在 2011 年出的時候買 (英國機),後來台灣上了 iPhone 5S 就用到現在 (中華電信機)。

前陣子台哥大的 3G data 合約到期了,就順手升級到 4G 吃到飽再續了 iPhone 6 Plus,想起幾個月前老爹在問有沒有機會換 iPhone,想了想就把這隻超大螢幕的 iPhone 拿給老人家用。

於是他本來的 LG G2 就到我手上了:

拿到除了 reset 以外,把 4.2 一路先升級到 4.4.2。順便查了一下維基百科上的資料,了解一下這隻手機的背景。(雖然當初也是我幫老人家辦的,不過當時是 Ptt 上面找找資料看起來這隻不會是地雷就選下去了...)

之前幫 iPad 2 拿來上網辦了張台哥大的 SIM 卡 (幾乎不出門的),99 元綁一年的維繫方案,包含 500MB 的 data 就順手拿來用了,這幾天用了用覺得 Anrdoid 也很有趣啊,換過來有點不太順手還在習慣就是了...

這篇算是在嘗試 Android 過程的記錄,明顯是帶著 iPhone 使用習慣的人在寫的,所以沒打算討論什麼「不是這樣設計」了,因為就只是記錄而已。

先講大的感覺,在家走 WiFi 用 LG G2 的速度還蠻快的,大多數的應用程式也都很順,就 5.2" 1080p 的感覺也很好。而在外面用 HSPA/3G 的速度也不錯。

操作上最不習慣的幾個點,一個是「點上方的 status bar 回到最上面」的功能是 iOS 專有的功能 (應該是專利?),可以注意到常用的 App 在這塊都是設計成「再點一次 icon 回到最上面」 (包括 TwitterFacebookInstagram),而這個設計幾乎目前 App 慣例了,剛好保持平台之間的一致性,所以這點慢慢適應了...

另外是滑動時的捲動速度相較於 iPhone 快很多,翻了一下設定沒找到哪邊可以調,所以不是很確定能不能調整... 不過這點也慢慢適應了 :o

而到現在比較不習慣的是 LG 自己的注音輸入法,還是沒有搞懂是怎麼選字的,大寫的驚嘆號「!」還是打不出來,也許再多摸幾天會有感覺吧 XDDD

而有些 App 則是完全不同的設計。像是 Zite 的用法完全不同。

Android 上的 Zite 看不到文章的 tag,分享時也不會紀錄上一次使用的分享方式 (iPhone 會把上一次分享的方式放到前面,通常我是用 Twitter 發表分享)。而版面上,Android 的 Zite 沒有 Popular 的部份。這些在 Zite 被 Flipboard 買走後應該是沒機會改了...

另外老人家把電池保養的蠻好的,一整天帶出去才用掉 20% 的電 (我 iPhone 5S 的電池已經被我用的好慘啊),當初歐盟統一充電規範這件事情也方便不少,家裡本來就有一堆設備是吃 Micro USB 了 (參考之前寫的「歐盟強制使用 Micro USB 做為手機充電介面」這篇)。

以上是用了三天的感想,之後有新的未必會更新 XD

寄信到 Slack 裡的 Channel

Slack 的新功能,可以寄信到 Slack 的 Channel 裡:「Email, meet Slack. Slack, email.」。

這個新功能限制在付費使用者才能使用:

Today we’re launching a new feature: all teams on the Standard or Plus plans can have email directed into Slack channels.

包括圖片也是可以顯示出來的:

這樣接起來更方便了...

Usability 測試的 bookmarklet

在「Usability: Don't Make Me Think and a Bookmarklet」這篇文章裡作者在讀了「Don’t Make Me Think, Revisited」之後有所啟發,寫了一小段 javascript code,可以將網頁上所有文字都變成同樣長度的亂碼,藉以測試許多 usability 特性。

我把程式碼丟進 yui-compressor 後變成這樣,比較容易貼到 bookmarklet 上使用:

javascript:(function(){var a=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";$("*:not(iframe)").contents().filter(function(){return this.nodeType==Node.TEXT_NODE&&this.nodeValue.trim()!=""}).each(function(){var c="";for(var b=0;b<this.nodeValue.trim().length;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}this.nodeValue=c})})();

不過這段程式碼假定頁面上有 $ 這個 object (i.e. jQuery),所以我把程式碼改成吃 jQuery 這個 object,這樣確保 jQuery.noConflict() 後的網站還是可以動:

javascript:(function(){var a=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";jQuery("*:not(iframe)").contents().filter(function(){return this.nodeType==Node.TEXT_NODE&&this.nodeValue.trim()!=""}).each(function(){var c="";for(var b=0;b<this.nodeValue.trim().length;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}this.nodeValue=c})})();

效果如下,還蠻有趣的:

關於 KeyCDN 的 HLS streaming 最佳化...

KeyCDN 發表了對 HLS streaming 的最佳化:「New feature: Optimized HLS streaming」。

其中這段看起來就很奇怪:

The index file (.m3u8) will not be cached at all. The .ts files will only be cached for 5 minutes. If the origin server sends other Cache Control headers, it will be ignored by the CDN.

也就是這個畫面:

如果你把對 .m3u8 的壓力全部打到後端,那麼就註定不 scale 啊?之前在 EC2 c3.8xlarge 上面用 Wowza 測試,就發現單台最多只能承受 4000 reqs/sec。

比較好的作法應該是 cache 很短的時間 (也許三到五秒),讓 CDN 幫你擋下來,而不是前面打多少 reqs/sec 後面就吃多少...

AWS Lambda 的本地端測試工具

Twitter 上看到的工具:「Run AWS Lambda Functions on your local computers, for testing purposes」。可以在本地端測試 AWS Lambda 的程式碼:

Cisco 開發新的 Video Codec:Thor

Cisco 開發新的 Video Codec 與 HEVC (H.265) 競爭,專案名稱叫做 Thor:「World, Meet Thor – a Project to Hammer Out a Royalty Free Video Codec」。

沒什麼意外,專利問題是主要的原因:

Unfortunately, the patent licensing situation for H.265 has recently taken a turn for the worse. Two distinct patent licensing pools have formed so far, and many license holders are not represented in either. There is just one license pool for H.264. The total costs to license H.265 from these two pools is up to sixteen times more expensive than H.264, per unit. H.264 had an upper bound on yearly licensing costs, whereas H.265 has no such upper limit.

不過一開頭寫到 VP9 是 proprietary 的描述讓人很不解:

There are two of note – Google’s proprietary VP9 codec, and the industry standard H.265 (HEVC) codec, which is the successor to H.264 (AVC).

往下拉 comment 看果然就有人提出來:

How exactly is VP9 more "proprietary" than Thor? Both are open sourced under BSD license, both are royalty free, both are intended to be unencumbered by patents. Are you defining "proprietary" as "not controlled by Cisco"?

不知道在搞什麼鬼...

聯想的 BIOS 會自動安裝軟體,即使你整台重灌...

這家公司與這類事情,好像不怎麼意外:「Lenovo used a hidden Windows feature to ensure its software could not be deleted」。

每次開機時 BIOS 會檢查是不是 Windows 7 或 Windows 8,如果是,而 C:\Windows\system32\autochk.exe 不是 Lenovo 所簽名的版本,那麼就會蓋掉變成自己版本:

If Windows 7 or 8 is installed, the BIOS of the laptop checks ‘C:\Windows\system32\autochk.exe’ to see if it’s a Microsoft file or a Lenovo-signed one, then overwrites the file with its own.

接著這個 autochk.exe 在開機被執行時就會建立 LenovoUpdate.exe 以及 LenovoCheck.exe,然後透過網路下載程式回來跑:

Then, when the modified autochk file is executed on boot, another two files LenovoUpdate.exe and LenovoCheck.exe are created, which set up a service and download files when connected to the internet.

影響的範圍包括了:

A wide range of Lenovo laptops are affected by the issue: Flex 2 Pro-15/Edge 15 (Broadwell/Haswell models), Flex 3-1470/1570/1120, G40-80/G50-80/G50-80 Touch/V3000, S21e, S41-70/U40-70, S435/M40-35, Yoga 3 14, Yoga 3 11, Y40-80, Z41-70/Z51-70 and Z70-80 / G70-80.

如果已經買了這批電腦,請依照官方提供的新 BIOS 更新:「Lenovo Service Engine (LSE) BIOS for Notebook」。

如果還沒買的話,以後也請不要買,像是「My dream machine: Lenovo may build a new “classic” ThinkPad」這種消息看看就好...