Google Maps App 支援離線作業

Google Maps 宣佈支援離線操作:「Navigate and search the real world … online or off」。

Now you can download an area of the world to your phone, and the next time you find there’s no connectivity—whether it’s a country road or an underground parking garage—Google Maps will continue to work seamlessly.

這功能在國外旅遊 (漫遊的時候) 還蠻好用的,可以先在飯店把地圖抓下來,再往外面跑...

Facebook 更新 iOS 應用程式,修正吃電問題

在「在 iOS 上不使用 Facebook App 時要完全砍掉 process」這邊提到了 Facebook 在 iOS 版的應用程式會在背景播放無聲音樂,導致吃電特別兇的問題,Facebook 的 Ari Grant 出來澄清是 bug 造成的,而非故意行為。

修正了兩個 bug,第一個是 network code 的部分:

The first issue we found was a “CPU spin” in our network code. A CPU spin is like a child in a car asking, “Are we there yet? Are we there yet? Are we there yet?”with the question not resulting in any progress to reaching the destination. This repeated processing causes our app to use more battery than intended. The version released today has some improvements that should start making this better.

第二個則是之前提到無聲 audio 的問題:

The second issue is with how we manage audio sessions. If you leave the Facebook app after watching a video, the audio session sometimes stays open as if the app was playing audio silently. This is similar to when you close a music app and want to keep listening to the music while you do other things, except in this case it was unintentional and nothing kept playing. The app isn't actually doing anything while awake in the background, but it does use more battery simply by being awake. Our fixes will solve this audio issue and remove background audio completely.

同時澄清並沒有要在背景更新取得地理位置資訊:

The issues we have found are not caused by the optional Location History feature in the Facebook app or anything related to location. If you haven't opted into this feature by setting Location Access to Always and enabling Location History inside the app, then we aren't accessing your device's location in the background. The issues described above don't change this at all.

理論上新版應該會省一點電了?

在 iOS 上不使用 Facebook App 時要完全砍掉 process

在「The Background Data and Battery Usage of Facebook’s iOS App」這邊提到 Facebook AppiOS 上使用了非常吃電的技巧來強制背景更新。

作者猜測,如果你把 Facebook App 設定成不允許背景更新,那麼 Facebook App 會利用 iOS 在「播放音樂」可以在背景執行來進行更新:(所以只是打開播放的 channel,但是沒有聲音)

My guess is that Facebook is hijacking audio sessions on iOS by keeping silent audio in the background whenever a video plays in the app. And because, by default, videos on Facebook auto-play on both Wi-Fi and Cellular and few people ever bother to turn it off, that means there's a high chance the Facebook app will always find a way to play a video, keep audio in the background, and consume energy to perform background tasks.

而且有些人也發現了類似的現象:

I'm not alone in noticing the mysterious "Facebook audio" background consumption, and video auto-play seems to me the most likely explanation at this point. I don't know if turning off auto-play may fix the problem, but I'd recommend doing that anyway to save data.

印象中我們家的 zonble 也有提過類似的事情,當時他好像還有抱怨不知道 Facebook App 在搞什麼鬼... Anyway,這就可以理解作者提到為什麼這麼吃電:

On my girlfriend's iPhone, for instance, iOS 9 reports 5 hours of on-screen usage for the last 7 days, and another 11 hours of background audio usage with Background App Refresh turned off.

我的想法是,如果不用的時候就按兩下 home 鍵把 Facebook App 整個踢出去,或者就如同作者建議用 Safari 開行動版本:

I wonder if Apple should consider additional battery controls to take action against shady practices like invisible background audio. What Facebook is doing shows a deep lack of respect for iOS users. I continue to recommend using Safari instead.

Google Chrome 會 bypass Adblock 的問題

新版的 Google Chrome 使得 YouTube 可以繞過 Adblock 類軟體的阻擋限制 (像是 uBlock Origin),導致這些使用者會需要「看完完整的廣告影片 (無法 skip)」才能看本篇:「Google Chrome reportedly bypassing Adblock, forces users to watch full-length video ads」。

目前確認這是在修正 CVE-2015-1297 時產生的 bug:

Update: We have been contacted by Rob Wu, a developer on the Chromium project - the open-source foundation for the Chrome browser - who has informed us that this change was not intentional but, rather, an unintended result of fixing a previous security issue (CVE-2015-1297). He confirmed that the issue will only be seen if the YouTube app is installed and that, at the moment, apart from disabling AdBlock or whitelisting YouTube, the only solution, as described above, is to uninstall the app. The problem is expected to be patched in the upcoming weeks or, at least, when Chrome 46 is released.

目前的暫時解法是移除掉 YouTube 這隻 app,或是將 YouTube 放到白名單網站。

Instagram 的 Hyperlapse

Instagram 上星期推出了 Hyperlapse:「The Technology behind Hyperlapse from Instagram」。

如果講得很簡略,就是「防手振的錄影 app」,可以直接看 Instagram 提供的範例影片:

文章裡面還解釋了很多原理,有興趣的人可以看看 :p

Firefox 的 WebIDE

在「WebIDE Lands in Nightly」這邊看到 Firefox 將 WebIDE 整合進 Nightly 版本,代表之後的幾個版本後就會變成正式版...

從開頭這段:

Editor’s note: if you want to help test it on a recent nightly you can toggle the devtools.webide.enabled preference in about:config. The WebIDE is available today under Tools>Web Developer>App Manager and will be renamed in tomorrow’s Nightly into WebIDE.

以及一些截圖資訊:

都可以看出來是跟 html5 app 的開發有關。

找資料的時候發現國內有人報導過了:「Firefox變身HTML5全功能IDE 光用瀏覽器就能開發各平臺App」,這邊就不再介紹太多。

比較想要知道的還是決策的部份是怎麼想的:綁到 Firefox 預設環境裡面,而非用 extension 方式安裝...?

Heroku 創辦人 Adam Wiggins 寫的 The Twelve-Factor App

先前在看一些 open source 的 PaaS 文件時看到 Adam Wiggins (Heroku 的創辦人) 寫的「The Twelve-Factor App」。

裡面其實就是 Heroku 對上面跑的 app 的要求,以及 Heroku 在設計產品時的想法,所以跟 Heroku 業務沒有關係的部份也大多都沒寫到 :p

拿來參考與理解想法是 okay 的,但如果要完全照著上面的方法做就未必了。

有人把 Twitter 官方 App 的 OAuth API Key 解出來了...

在「Twitter OAuth API Keys Leaked」看到有人把 Twitter 官方應用程式的 API key 給解出來了,包括所有平台 XD

這件事情在技術上沒辦法避免,就跟 DRM 技術一樣... 不過也不用擔心,這些 key 與 secret 沒有安全問題,在 OAuth 設計上只是拿來識別 client 用,而用這些 key 的好處是 Twitter 不會限制這些 client 的 API 呼叫次數... XD

這完全怒了啊 XDDD

Perl 中 local::lib 與 App::cpanminus 的搭配...

用過後才知道這兩個東西搭起來超方便 XD

首先是 App::cpanminus (一般會稱呼他可執行檔的檔名「cpanm」),可以很方便的將軟體裝在自己的目錄下,而不用動到 root 權限。預設的目錄是裝到 ~/perl5/ 下。

再來是 local::lib,預設的 use local::lib; 就會讓系統使用自己目錄 ~/perl5/ 的 module... (感謝 clkao 的推薦)

相當好用啊...

Perl on Google App Engine

Python 是第一個可以在 Google App Engine (GAE) 上執行的程式語言,而下一個很有可能是 Perl

Brad Fitzpatrick 在他的 Blog 上說,他被 GAE team 允許對外公佈「我可以使用 20% 的時間開發 Perl on GAE」:Perl on App Engine

這是 GAE 支援其他程式語言的消息中,第一個被正式公開的。在 Brad Fitzpatrick 的文章裡面有一些藍圖,關於他大概會怎麼做的想法。我們應該可以期待他認真起來的戰鬥力 :p

PS:Brad Fitzpatrick 是 LiveJournal 的創辦人、memcached 的作者、OpenID 的制定人。