Adding webtrends framework crash the app
Water
|
04/11/2014
|

Try to add webtrends frameworks to one of my app. The framework request user to modify the app so that applicationDelegate should subclass webtrends' delegate. After the code is changed, the app crash right before the app launch:

    fwXXXXX[10818:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<fwXXXXXAppDelegate 0xc574d90> setValue:forUndefinedKey:]:

Continue Reading

Developing Amazon S3 locally using fakes3
Water
|
04/10/2014
|

We can use fake S3 to simulate Amazon S3 service locally.

Installation

Use gem to install fakes3

    gem install fakes3

Then you can start the fakes3 server

    fakes3 --root=/var/tmp/fakes3 --port=10453

that will open port at 10453 and store data at /var/tmp/fakes3

Editing /etc/hosts

To redirect traffic back to localhost, add the following line:

127.0.0.1 fakes3.local testme.waterworld.com.hk.f

Continue Reading

ADT failed to launch after updating Android SDK
Water
|
03/24/2014
|

Android SDK 22.6

Just trying to update Android Developer Tool(ADT) and Android SDK. After updated Android SDK to 22.6, ADT failed to launch:

Android SDK 22.6

Continue Reading

Block, weakSelf and strongSelf
Water
|
02/26/2014
|

Block is powerful in Objective-C. But there is a very stupid problem called cyclic retention pitfall, that a block locked an object so that the object will never be release.

For example, in the function:

NSBlockOperation *op = [[[NSBlockOperation alloc] init] autorelease];
[ op addExecutionBlock:^ {
    [self doSomething];
    [self doMoreThing];
} ];
[someOperationQueue addOperation:op];

When t

Continue Reading

10400 小米行動電源開箱報告
Water
|
02/21/2014
|

買這個 10400 小米行動電源 唯一原因只是價錢平。以前多數都是買lipo電,主要是因為比較輕身和安全,但 5000mAH 容量的也要幾百。近年大陸就大量用回 18650 電芯的尿袋,因為成本平很多,於是你會看到10000mAH的尿袋也只要百多元,

18650 其實即是鋰電的筆芯電版,原本經常用於要用充電的器材如遙控模型和電筒。兩種電比較:

18650電:

  • 易走電
  • 充電次數比較少

LiPo電:

  • 比18650發熱比較少,也比較安全(爆炸機會少一點)

所以,理論上 LiPo 電是完勝18650電的,但當加入價錢因數,18650的尿袋就變得很有競爭力。順帶一提雖然 18650 都是同一個大小,但是不同牌子和.型號容量會有很大差別。 而這粒小米電聲稱用了4粒 2600mAH 的 LG/三星 18650,老實講以HK$89價錢去淘寶買四粒電芯也不是太可能。

用後感:

  • 鋁殼感覺不

Continue Reading