Tuesday, May 26, 2009

busybox 怎麼寫出來的

busybox將大部分的command全部link到一個主程式內

當執行某個command時, 由該主程式檢查第1個參數名稱, 再執行相對應的動作

test.c
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
int i;

for (i=0;i<argc;++i) {
printf("%s ", argv[i]);
}
printf("\n");

if ( strstr(argv[0], "iamlink") ) {
printf("hello, link\n");
}
}

>gcc -o test test.c
>ln -sf test iamlink
>./iamlink
hello, link

Wednesday, May 20, 2009

在mac上開發xcode的經驗

在此記錄 xcode & Objective-C 的經驗

1)
在 mac 上編譯
gcc -o prog file.m -lobjc -framework cocoa
在 ubuntu 上編譯
gcc -o prog file.m -lobjc -lgnustep-base

筆記,
1) Every method has an implicit local variable called self, which is a pointer
to the object that is executing the method.
2) Because you will frequently need objects that you are not retaining, many classes have class methods that return autoreleased objects.
3) outlet感覺有點像class AppController, 透過outlet, 存取 UI 的 controller. 或者 class AppController 如何存取 UI 的 controller, 則是透過 outlet 指向這個 controller.

Tuesday, May 19, 2009

我的第一台公路車

為了慶祝我剛出社會找到工作, 所買的人生第一台公路車

版本2,
為了慶祝我剛滿20歲, 所買的人生第一台公路車

KHS R3000

P5180250

P5180251

P5180253

P5180254

P5180255

P5180256