My Portifilio

Actually, this website was my portfolio webpage before becoming a wordpress. It is moved to here: nicholasworkshop.com/portfolio. Using wordpress, I put the old webpage aside and always forgot to transfer the information from it to the front page. Anyway, I hope this can remind me of the projects and webpages I created.

Take a Screenshot on Samsung Galaxy S2 after the Upgrade to Ice Cream Sandwich

Thank you for checking out this tutorial. Reading the discussions in this post, seems like there is quite a number of people having troubles to take screenshots with Galaxy S2. To clear any confusions, I summarized some information and added as followings. Hope you could make it too. Fingers crossed. First, make sure your Galaxy…

Find the User Agent Strings of any Mobile Devices

It’s quite often for a developer to make use of the user agent to determine what browser does a user used, especially for those who develop web services and websites. Recently I found a website which has a huge database of mobile device information, including the user agent string and even the functions supported in…

Change author info for old commits in Git

While using hit, it is really usual to have regrets on the commits done, especially the name used. In order to change those information in your repository, open terminal (or cmd in windows), go to the folder of your git repositoy, and run the following commands. Remember, replace “old_name”, “new_name” and “new@email.address” with your own…

Animated sprites in Cocos2D

I have been working with Cocos2D for a while and I am still a newbie. The way to deal with animations in Cocos2D 1.0.0 – the stable version currently – is different from the way before using CCSpriteSheet. Now Cocos2D adapts animations as cache shared in the project using CCSpriteFrameCache. It also requires a plist file…

Convert character encoding in PHP

Usually while we extract information from other websites, character encoding might not correct. For example, j-jis.com is encoded with Shift-JIS. Therefore if your MySQL charset is UTF-8, it causes incorrect information. To handle the changing of character encoding, we can use iconv in PHP. [sourcecode language=”php”] $url = "http://j-jis.com/"; $html = file_get_contents($url); $html = preg_replace("/rn|n|t/",…

Handle unwanted character changes in Json for unicodes encoding in PHP

Json has been an efficient way to handle information and message exchanges in web programming. For example, I usually use PHP to connect MySQL and retrieve information, then display as Json. So a webpage can “AJAX” the displayed Json to create a dynamic view on itself. However, while the information involves unicode characters, PHP turn…

Database failed

In my chrome extension, the javascript injector, localStorage is used as the database to store the clients’ data. However, as localStorage support only data in string, information has to be stringified and parsed whenever saving and retrieving. The database seems unable to hold anymore data. It corrupted and became incorrect data. I need to rewrite…

Get temporary folder path in VBA

It is normal to create temporary files and folders to facilitate the process in programs. Apart from doing it in your working directory, why don’t we make use of the default temporary folder built in the Windows system? In the Windows working system, we know that the temporary folder can be opened by typing “%temp%” in “run” on the…