Blogs

Pull down to refresh table view

An easy way to add twitter like pull down to refresh function to any table view. No dependency to other libraries, only include the 4 source files and 1 resource file to use it.

How does it work?

Disable Java Auto Updater

If you've installed java in your Windows, the java will automatically run an auto update periodically. If you are using Vista or Windows 7, the annoying UAC will prompt you every time when the system try to run the auto updater. To disable this, edit the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy]
"EnableAutoUpdateCheck"=dword:00000000

Ref: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6294083

DIY iPhone stand

Easily turn your useless credit card to an iPhone stand

IMG_1031[1].JPG

UIGraphicsBeginImageContext and retina display

To support retina display, you need to set the scale of UIImage correctly. If you use UIGraphicsBeginImageContext to create offline image, you should use UIGraphicsBeginImageContextWithOptions instead to set the correct scale of the image. Below is the help function that will call with correct scale according to the scale of current device and will use the old function if the OS version of the device is below 4.0 that UIGraphicsBeginImageContextWithOptions is not available.

To use the code, simply replace all UIGraphicsBeginImageContext with RetinaAwareUIGraphicsBeginImageContext

See emoji keyboard in notes but not other apps

If you can see emoji keyboard in notes app. Congratulations, you have enabled the emoji keyboard. But some users set they can't use it on other apps. You can try the following fixes:

1. Reboot the iPhone, iPod Touch. Long press the power button, slide the slider to turn off the phone completely. Then press the button again after the screen is off to turn it on again.

iPhone 4 相片集

iPhone 4 開盒,盒子又比上一代細了,可能是要方便水貨商。
iphone4_1.jpg

Huawei 華為 E583C Pocket Wifi

早前出席了華為 Huawei 的blogger 聚會,當聽到是關於 3G Pocket Wifi 的產品便一口答應了,主要是想幫自己的那部 Wifi 版 iPad 找一個 3G 上網方案。利益申報,聚會上每一個 blogger 也得到一部 pre-production 版 E583C (這我事前是不知道的 XD)

華為 E583C

dd-wrt PPTP VPN Setup

To setup PPTP VPN on dd-wrt

In Services-> VPN-> PPTP Server:

PPTP Server: Enable
Broadcast support: Enable
Force MPPE Encryption: Enable
Server IP: 0.0.0.0
Client IP(s): 192.168.2.51-55
CHAP-Secrets: user1 * pass1 *
user2 * pass2 *

where client ip stores what IPs will be assigned to the client. In the above case, the server will assign 192.168.2.51 to 192.168.2.55. The subnet can be different to the NAT in the server (192.168.1.X)

CHAP-Secrets stores the username and password for the logins, multiple accounts are supported.

Clear location service object in resign active

Since iOS 4.0, I am aware freeing unnecessary object when the application is in inactive state so that the app can free up as much memory as possible. So in one of me location based app, I try to free the location service object when it is inactive:


- (void)applicationWillResignActive:(UIApplication *)application {
self.locationService = nil;
....
/*

Charge your iPad using USB port on your PC

If you are PC user, you will feel frustrating that you cannot charge your iPad through the PC's USB. I've thought that it is the hardware limitation of PC, but I was wrong. After install this ASUS ai charger:

aicharger.PNG

http://event.asus.com/mb/2010/ai_charger/

You can now charge your iPad using the USB port of your PC. The software even claim it will charge iPhone and Ipod Touch faster that I didn't test. The software is not limited to ASUS motherboard, I successfully installed and used on my Foxconn motherboard without any problem.

Syndicate content