Archive for July 2010

Programming in Objective-C , sample code

postfix , 寄 yahoo 的信改由 hinet 的 smtp 發 , 用 telnet command 測試對方 smtp 通不通

cat main.cf
transport_maps = regexp:/etc/postfix/transport

cat transport
.*\.yahoo\..*   smtp:[msa.hinet.net]

telnet smtp.test.com.tw 25

HELO test.com.tw
mail from:test@test.com.tw
rcpt to:test@testdomain.com.tw
data
Subject:test
xxxxxxxxxxx

晨騎, 板橋 <==> 關渡宮 , 40K

報了 IRONMAN 70.3 Taiwan!

2010年10月30日(六) | 游泳1.9公里/自行車90公里/路跑 21公里  
http://www.ironmantaiwan.com/

[URL] iPhone programming bookmarks / reference

★ Your First iOS Application
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/Articles/00_Introduction.html

中文 :  http://icodeblog.com/category/iphone-programming-tutorials/

★★ iOS Reference Library : http://developer.apple.com/iphone/library/navigation/index.html

iPhone Dev Center : http://developer.apple.com/iphone/index.action

Using iPhone Simulator

iPhone Human Interface Guidelines :  http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html

objective-c 的基本認識 , 參考 URL :  http://www.otierney.net/objective-c.html.zh-tw.big5

有趣的 iPad iPhone development video 教學 : http://www.rorylewis.com/docs/02_iPad_iPhone/05_iPhoneTutorials.htm

給初接觸 objective-c 的介紹 : http://maciku.blogspot.com/2009/12/iphone-objective-c.html

包裝好給 iPhone 用的 http 元件/framework – ASIHTTPRequest
http://allseeing-i.com/ASIHTTPRequest/

—-

7/31 iPhone dev 課程 outline :

iPhone spec. / Objective-c intro.

intro. xcode / iPhone 開發限制 / 應用軟體架構 / 記憶體管理

first App. – HelloWorld

程式語法 – simple

Interface Builder基本操作

字串與資料結構 / UI Catalog

second App. – Location base App.

upload to real iPhone – use Apple

★ init , copy , retain 要記得 release memory

★ didReceiveMemoryWarning , viewDidUnload 暫時釋放 memmory

★ IBOutlet 引用到的 InterfaceBuilder 元件建議作 release , 但要注意到不要重覆 release

★ InterfaceBuilder : 事件與程式碼配合 – IBAction , 物件關聯 – IBOutlet , Delegate 指定.

RUNNER’S WORLD 首選全球知名的馬拉松 – The World’s Top 10 Marathon

New York City Marathon

http://www.nycmarathon.org/

波士頓馬拉松 BOSTON MARATHON – 4月

http://www.baa.org/

東京馬拉松 – Tokyo Marathon – 3月,要抽籤

http://www.tokyo42195.org/

JAL 檀香山馬拉松 – JAL Honolulu Marathon – 12月

http://www.honolulumarathon.jp/

河口湖日刊馬拉松 11月

http://nikkansports-marathon.com/

全球 Marathon Guide

http://www.marathonguide.com/

海外跑馬心得

http://www.taipeimarathon.org.tw/%E5%BF%83%E6%83%85%E6%95%85%E4%BA%8B/nymarathon.htm

 

runnersworld

URL: http://www.runnersworld.co.uk/event-editorial/the-worlds-top-10-marathons/563.html

1. London Marathon, April
2. Berlin Marathon, September
3= New York City Marathon, November
3= Chicago Marathon, October
5. Boston Marathon, April
6. Stockholm Marathon, June
7. Rotterdam Marathon, April
8. Paris Marathon, April
9. Honolulu Marathon, December
10. Amsterdam Marathon, October

World Marathon Majors : http://worldmarathonmajors.com/US/

Marathon Calendar 2011/2012 : http://www.adventure-marathon.com/marathons.aspx

 

照月份排:

April June September October November December
London

Boston

Rotterdam

Paris

Stockholm Berlin

2010,9/26

Chicago

2010.10.10

THE DATE TO MOTIVATE!!

Amsterdam

2010.10.17

New York

2010.11.7

Honolulu

2010.12.12


2011年

April June September October November December
London = 4/17

Boston = 4/18

Rotterdam = 4/10

Paris = 4/10

Athens =  4/28

Stockholm = 5/28 Berlin Chicago

Amsterdam

New York : 11/6 Honolulu

2011.7/3 澳洲 黃金海岸馬拉松

 


2012年

April June July September October November December
London : 4/22
開放抽籤1天, closed 

2012 Olympic 在 London
7,8月

 

 


[記錄] 2010.0718 石門水庫長泳

完成時間: 73分鐘, 今天水溫很高大約27度, 游起來不舒服.

想到一個不錯的點子: 明年早點到石門水庫停車場, 先繞下池跑兩圈約 9k , 再下水涼快!

Continue reading ‘[記錄] 2010.0718 石門水庫長泳’ »

A simple Objective-C Method Declaration and Definition

定義

- (void) sayHello: (NSString*) name;

implementation :

- (void) sayHello: (NSString*) name {
  NSMutableString *message = [[NSMutableString alloc] initWithString:@"Hello there "];
  [message appendString:name];
  NSLog(message);
  [message release];
}
//

simple.m 宣告 sayHello method:

#import "Simple.h"
@implementation Simple
- (void) sayHello: (NSString *) name {
  NSMutableString *message = [[NSMutableString alloc] initWithString:@"Hello there "];
  [message appendString:name];
  NSLog(message);
  [message release];
}
@end
//

simple.h

#import 
@interface Simple : NSObject {
}
-(void) sayHello: (NSString *) name;
@end
//

main 呼叫 sayHello method:

#import 
#import "Simple.h"
int main(int argc, char *argv[]) {
  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  Simple * mySimple = [[Simple alloc] init];
  [mySimple sayHello:@"James"];
  [mySimple release];
  int retVal = UIApplicationMain(argc, argv, nil, nil);
  [pool release];
  return retVal;
}
//

objective-c-intreface

Protected: oracle 的一些 SOP command

This post is password protected. To view it please enter your password below:


iphone / hello world 2 / single rows in the table view

// --
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    [cell.textLabel setText:@"Hello World!"];
    return cell;
}
// --
// --

[導覽] 有趣的 iPad iPhone development video 教學

From : Rory Lewis, PhD, JD

URL : http://www.rorylewis.com/docs/02_iPad_iPhone/05_iPhoneTutorials.htm

另外給初接觸 objective-c 的介紹:

URL : http://maciku.blogspot.com/2009/12/iphone-objective-c.html

中文開發網站 : http://www.cocoachina.com/iphonedev/

// ——————

obj->method(argv);

[obj method: argv];

// ——————

@implementation HelloController
- (IBAction)sayHello:(id)sender {
  [destinationTextField setStringValue:[sourceTextField stringValue]];
}
@end
(id)sender 是一個可以選擇性的用法,
若您有需要取得發出 IBAction的元件時,可以用這個 sender變數來取得.
但記得可能需要 cast一下.
UIButton *senderButton=(UIbutton*) sender;
[senderButton setHidden: YES];
這樣就會把該button隱藏起來.

(id)sender 是一個可以選擇性的用法,若您有需要取得發出 IBAction的元件時,可以用這個 sender變數來取得.但記得可能需要 cast一下.

UIButton *senderButton=(UIbutton*) sender;[senderButton setHidden: YES];

這樣就會把該button隱藏起來.

// ——————

[2010/7/9 下午 04:48:25] Rimmon 2.0: jason 有 mac os 的 sftp GUI 的 tools 嗎?

[2010/7/9 下午 04:48:40] Rimmon 2.0: 想要用 tools 傳 code 比較方便

[2010/7/9 下午 04:51:05] _RTN Jason Chen: http://www.versiontracker.com/dyn/moreinfo/macosx/15693

[2010/7/9 下午 04:51:08] _RTN Jason Chen: Fugu

[2010/7/9 下午 04:51:35] _RTN Jason Chen: www.versiontracker.com 有非常多的 OSX 軟體可下載

[2010/7/9 下午 04:53:59] _RTN Jason Chen: 還有 Microsoft Remote Desktop Connection 可遠端遙控 Windows

[2010/7/9 下午 04:55:13] _RTN Jason Chen: smb://172.30.0.29/Install   這樣 OSX 才看得懂網路分享目錄

[2010/7/9 下午 05:00:10] _RTN Jason Chen: Finder, 用 apple鍵 + K 再輸入 cifs://172.30.0.19/Install 即可連 server shared

河濱路跑距離

7/8 , 華翠橋下到中正橋下 = 約略 10K , 1HR

擷取-河濱路跑

華翠橋加碼到福和橋, 約略 14K

擷取-河濱路跑-加碼

[記錄] 2010 外木山長泳

完成時間: 1HR16MIN , 因為後面繞得比較大圈一點, 時間比去年慢了8分鐘. 今天水母比去年多, 水溫也較高27度吧, 一早氣溫就33度了.

a3a5a6
P004P005P002P009

a7a9

網家 8044 百元俱樂部 滿月!

linux mount windows share directory / cifs / samba

在 /etc/fstab 加一行:

//192.168.100.1/ruten /rutenlog cifs user,rw,suid,username=XXX,password=YYY 0 0