2009年9月14日 星期一

generate 32 or 64 bit binary by gcc

-m32
-m64

compile C program that calls Java

ex:
gcc -o test.o -I/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers -framework JavaVM test.c -m64

show file is 64 bit or 32 bits

ex:
file test.o

2009年9月9日 星期三

Quartz introduction

drawRect:
drawRect method of UIVew is called when a view needs to redraw itself
we usually add drawing code in this function

2009年9月6日 星期日

run terminal from applescript

use & to combine string

ex:
tell application "Terminal"
activate
repeat with i from 1 to 5
do script with command "cd test\\ " & i & ":ls"
set custom title of window 1 to "test" & i
end repeat
end tell

panic reporter

in Console's log files --> /Library/Logs --> PanicReporter

2009年8月26日 星期三

use ReleaseSCSITask to release SCSITaskIdentifier

because GetSCSITask will increase fNumCommandsOutstanding,
we must use this function to decrease fNumCommandsOutstanding