Firewire 800 speed test!

[2010/9/3 下午6:05:46] _RTN Jason Chen: Firewire 800 外接盒效能還不錯,TimeMachine的差異備份很快。

[2010/9/3 下午6:22:44] _RTN Jason Chen:

1GB 檔案複製速度:
SATA -> SATA : 12sec
SATA -> FW800 : 21sec
SATA -> USB2.0 : 30sec

[2010/9/3 下午6:24:33] _RTN Jason Chen:

Xbench Disk Test:Sequential Uncached Read
500G SATA 7200轉:106MB/sec
USB 160G 5400轉:36MB/sec
FW800 250G 5400轉:80MB/sec

[MEMO/TIPS] iPhone class / method / instance naming convention

class  : 大寫開頭

method / instance : 小寫

Property List / SQLite 寫法 sample

類似 printf 的寫法

NSString *debugMsg = [NSString stringWithFormat:@"Process %d", 1];

取亂數

定義:
#define RANDOM_SEED() srandom(time(NULL))
#define RANDOM_INT(__MIN__, __MAX__) ((__MIN__) + random() % ((__MAX__+1) - (__MIN__)))

// --- 這樣用
    NSLog(@"%d" , RANDOM_INT(0,9) );

取 unixtime :

    NSDate *past = [NSDate date];
    NSTimeInterval oldTime = [past timeIntervalSinceDate:[NSDate dateWithNaturalLanguageString:@"01/01/1970"]];
    NSString *unixTime = [[NSString alloc] initWithFormat:@"%0.0f", oldTime];
    NSLog(@"%@" , unixTime);

印出 debug message / popup alert 的寫法:

// ---
-(void) printdebug:(id)msg {
	NSLog(@"%@", msg);
}

// ---
-(void) displayAlertMessage:(id)msg {
	// Display AlertView
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"___Alert___" message:msg
                        delegate:self cancelButtonTitle:@"Close" otherButtonTitles: nil];
	[alert show];
	[alert release];
}

Objective-C 奇怪的 null detect!

	if ( (NSNull *)[item objectForKey:@"nick"]==[NSNull null] ) {
		// FOR GUEST DATA
		cell.textLabel.text = @"Guest";
	} else {
		// FOR MEMBER DATA
		cell.textLabel.text = [item objectForKey:@"nick"];
	}

ASYNC network 寫法:

http://mobile.tutsplus.com/tutorials/iphone/iphone-json-twitter-api/

—-