Archives

gravatar

Dedicate swap partition for Leopard

Prior to 10.5, it needs to modify /etc/rc.local to mount the disk partition because that dynamic pager is run before mounting volumes.
In Mac OS X 10.5 Leopard, /etc/rc.local does not no longer exist. Instead, lanuchd is used to run some daemons after system start. In /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist, it controls the dynamic swap size and location. In my case, I have a separated partition name ".swap" and will be mounted under /Volumes/.swap. Just run Terminal.app and sudo vi com.apple.dynamic_pager.plist to edit it. Here is a portion of an example,

<key>Label</key> <string>com.apple.dynamic_pager</string> <key>ProgramArguments</key> <array> <string>/sbin/dynamic_pager</string> <string>-S</string> <string>1073741824</string> <string>-H</string> <string>4096</string> <string>-L</string> <string>1073750016</string> <string>-F</string> <string>/Volumes/.swap/swapfile</string> </array> <key>OnDemand</key>
After reboot, the swapfile will be relocated to /Volumes/.swap and size is fixed to 1GiB. note: remember to delete /var/vm/swapfile* to release unused swap spaces.

gravatar

SafariPowerToy 0.2 for 10.5 Leopard

Only available and tested for PowerPC 32-bit Mac OS X environment.
Objective-C 2.0 and the WebKit build of 10.5 Leopard are incompatible with previous build of SafariPowerToy on 10.4. A new version for Leopard is released.
The InputManagers installation is not like that on 10.4 Tiger. Please refer to the manual for the detail.
For developer compatible topics: 1. Objective-C 2.0 does not support

IMP func = [class methodFor:@selector(method)]
to get the method address. It will result coredump in Leopard Objective-C 2.0. Using class_getClassMethod() and method_getImplementation() instead. For example,
Method method = class_getClassMethod(NSClassFromString(@"NSString"), @selector(initWithString));
IMP func = method_getImplementation(method);
2. Method.method_imp is not supported in Objective-C 2.0. MethodSwizzle will not correctly work. Instead, using
method_exchangeImplementations( method1, method2 );
is simple and easy.

gravatar

SafariPowerToy 0.2

SafariPowerToy is now open source in Google code. SafariPowerToy 0.2 supports Safari 3 for traditional/simplified Chinese glyph conversion on-the-fly. However, it contains only Power PC binary bundle. Without the environment of Intel Mac, it is not able to write and test the assembly code.

gravatar

雅虎輕鬆付-ATM還要多付10元

薪資戶頭的跨行提款轉帳都不用手續費, 用露天付款快手還有多種銀行可以選擇. Yahoo輕鬆付就是包給中國信託, 信用卡也還沒上線. 結果選用web ATM付款, 還要多繳10元給yahoo或中信. 下次不用輕鬆付了, 寧願額外開瀏覽器用別家可以抽獎的 Web ATM, 雖然多打了些字, 但是至少省 10 元呀.

gravatar

SafariPowerToy is not compatible with Safari 3

Recently people reports that SafariPowerToy did not work in Safari 3. It is a known issue already. Safari 2.x uses a branch of WebKit of apple build. SafariPowerToy is based on this old WebKit framework. Safari 3 uses new WebKit and includes some new architectures which are not compatible with SafariPowerToy. I know this and some technical issues have to be solved for original functionalities of SafariPowerToy.

gravatar

新聞談話節目還是少看

今天陰森新聞台在講些台灣經濟和科學園區, 不過還是那堆媒體人在胡扯?? 科學園區明明就電子工業, 還說是資訊工程?? 國科會我聽過, 到沒聽說過有關國建會; CMOS 叫做雙氧半導體?? VLSA 叫做超大型積體電路?? 韓國半導體技術落後台灣10年?? 導播應該也請個有知識的人來校稿. 或許有些歷史來龍去脈沒錯, 但是感覺一堆小地方亂扯. 所以還是少看這種談話節目比較實在.

gravatar

Shrink the Disk Image

Trying Carbon Copy Cloner to copy the whole DVD to disk image. Unselect language packages, printer drivers, and Xcode tools; Using block level copy to new sparse image. After the copy completion, you mount the disk image and you can find the used size is < 4.7G but the disk size is ~= original DVD size. Because the underlay partition and file system is still the same as them in DVD. However, just run this 'hdiutil resize -size min xxx.sparseimage'. It will shrink the partition and file system size to possible minimum.
Note: If you delete some file and resize it, the disk size is still not changed because some files might be still occupied in the tail of the file system.