月份:八月 2010

timeGetTime v.s. GetTickCount()

Posted on

referenced from http://www.gamedev.net/community/forums/topic.asp?topic_id=126327
first, timeGetTime is a win32 function, not a c one.

second, timeGetTime is much more accurate than GetTickCount (1 ms vs 50 ms resolution).

third, GetTickCount takes less time to execute.

fourth, nice use of the $. (stolen from Stoffel)

use GetTickCount if 50 ms resolution is acceptable because it has less overhead, and timeGetTime if you need more precise timing. remember to call timeBeginPeriod and timeEndPeriod to obtain 1 ms resolution on nt.

mac/iphone/obj-c programming note

Posted on

Every method or function whose name includes “new”, “alloc”, “Create” or “copy” requires a balancing release/free

how to restore SMS data in iPhone

Posted on

referenced from : http://www.ihackintosh.com/2009/08/restore-sms-history-from-iphone-3g-to-iphone-3gs/

Windows User : C >> Users >> User Name >> AppData >> Roaming >> Apple >> Computer >> MobileSync >> Backup >>
Mac OS X User : ~/Libary » Applications Support » MobileSync » Backup.
In the backup folder there will be X number of folders according to number of phones you synced to your iTunes. For example i have two iPhone 2G and 3G so i have two folders named with 40 random hex characters. But i need to copy SMS from iPhone 3G so how do i identify?
To identify your particular iPhone backup sync both phones with 5 minutes of interval and note the time in your computer clock while syncing.
Now Sort the view by date–this will let you easily tell which subfolder belongs to which phone.
Now you knows the folder where your previous iPhone 3G backup is saved, so explore to that particular folder (iPhone 3G) and copy these two files to iPhone 3GS folder. Make sure you must synced new iPhone 3GS at least once so back up folder will be created.
3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata
3d0d7e5fb2ce288813306e4d4636395e047a3d28.mdinfo
Connect your new iPhone 3GS to the computer and launch the iTunes.
When your iPhone appears under Devices in your iTunes sidebar, Control-click it and select the ‘Restore from Backup…’ option.
Select the backup related to your device i mean iPhone 3GS.

downgrade iphone from 4.0 to 3.1.3

Posted on Updated on

ref: http://www.blogsdna.com/9175/how-to-downgrade-iphone-3g-4-0-os-to-3-1-3-firmware-on-windows-mac.htm

1. download the firmware from ref.
2. use iTunes press option and Restore to restore the firmware which you downloaded in step1.
3. 1015 error appear, dont’ care click ok.
4. open console on mac:
cd Desktop
. / iRecovery -s
setenv auto-boot true
saveenv
fsboot
exit
5. Now unplug your iPhone and turn it off by pressing the home+power button
6. Once it is off, turn it on by pressing the power button. Plug-in your iPhone and load iTunes to continue with the activation.