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

Using iOS 7 text to speech
Water
|
02/05/2014
|

iOS 7 provides powerful text to speech (TTS) support. Here is a simple example:

NSString *language = @"zh-HK";    // set language, zh-HK will speak cantonese
NSString *string = @"你好嗎";
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:string];
utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
uttera

Continue Reading

XCode4TemplateForXCode5
Water
|
01/28/2014
|

In Xcode 5, the default project template will create a new project using storyboard and use new API for iOS 7 only.

This repo ported older project under Xcode 4 to Xcode 5, so that you can easily create project that supports both iOS 6 and iOS 7. It is useful if you want to:

  1. Using xib instead of storyboard.
  2. Support both iOS 6 and iOS 7.

Installation

Copy "XC4 Installation" folder in this repo t

Continue Reading