Friday, January 20, 2012

A free JavaScript IDE? Aptana to the rescue

Just thought I share one cent: for those of us doing web development and looking for a good, free IDE, Aptana fits the bill well!

http://aptana.com/

Sunday, January 8, 2012

Visual Studio Code Formatting (tab spaces)

In our project at work, we have a visual studio code base that contains server codes of various languages, including C#, JS, HTML, XML, SQL, and CSS. The issue we have is that the format of the code is very much inconsistent: some code are tabbed at two spaces while others at four spaces. The reason for this mixture is because the code has been passed on by a few teams, who have been following different coding standards. This problem can be common among project code, especially legacy code.

To solve this problem, there are recommendations to use the VS macro to run the "Format Code" command on the solution. And I found such a recommendation: Format all document in visual studio. However, for some undiscovered reasons, it was not able to re-format our project code. Then I was quite lucky enough to find an existing tool called CodeMaid that does this job wonderfully. I could simply run the cleanup all files function, then all code will be automatically re-formatted with the same tab spacing. Afterwards, the inconsistent itches in our code are gone!

P.S. if you're looking for some coding style suggestions, StyleCop as an add-on may fit the bill. It prints out possible coding style problems as warnings for your consideration.

Saturday, October 29, 2011

Got my HTC tattoo updated to Android 2.3 with CyanogenMod

Recently a friend told me that he's got his HTC tattoo to use Android 2.3. He proceeded to showing me the upgraded phone with cool-looking UI and new features. On top of this, his phone now has a much better performance (UI response) along with a longer battery life.

So five days later, on a free Friday night when the clock struck 12 midnight, I googled on the way to update my Tattoo from Android 1.6 to 2.3. What follow are the results and steps to doing so.

The main instruction page on how to flash can be found here:

http://wiki.cyanogenmod.com/wiki/HTC_Tattoo:_Full_Update_Guide

I then followed the instruction prescribed here but found I was having trouble rooting my device using the adb command line. The error that I always encounter was unable to "exit" debug shell correctly. Many messages were printed such as "reboot...". So when I tried to perform a "su", I got permission denied. It turns out there's a much easier way to root my device, as it can be found here using Universal Androot:

http://www.addictivetips.com/mobile/how-to-root-android-devices-with-universal-androot-app/

After this first hurdle is overcome, the rest seems like much doable and effortless (well, relatively). The next thing on the agenda is installing the ClockworkMod Recovery. While using the instructions from the update guide, I had a problem with flash_image: it simply won't work. Either it's not found or illegal instruction. The solution was found there:

http://forum.cyanogenmod.com/topic/24333-flash-image-not-found/

Basically, I downloaded the flash_image version as detailed here (file hosted on rapidshare). Voila, the flash_image executable now works and recovery was installed. To boot into ClockworkMod Recovery, the instruction is: adb reboot recovery

http://www.addictivetips.com/mobile/what-is-clockworkmod-recovery-and-how-to-use-it-on-android-complete-guide/

Then after flashing CyanogenMod via Recovery, I was a happy man with his Tattoo upgraded :-)

P.S. If you find that the newly upgraded phone does not work with Wifi, you may need to replace a new file: wlan_loader, as detailed here:

http://code.google.com/p/cyanogenmod/issues/detail?id=4370

Happy hacking, flashing or bricking!!!

Tuesday, September 6, 2011

ASP.NET for rookie

Looking for a quick start into ASP.NET? Here is an introduction video that I find to be educational and entertaining at the same time.

Friday, September 2, 2011

Relax NG

It seems like the RELAX NG syntax is much like the DTD (Data Type Definition) for XML. In another word, it's a grammar for XML - to see if a given XML matches a RELAX NG pattern. Personally, I think it's much easier to read the RELAX NG format than DTD!

Sunday, August 21, 2011

Disable shutdown event tracker in Windows Server 2003

1. Open the local group policy editor by typing gpedit.msc in the run prompt. (applicable to non-domain computer)

2. Expand the left menu tree. Computer Configuration => Administrative Templates => System (if the System container if not there, right click on Administrative Templates and add the container)

3. Double click on the "Display Shutdown Event Tracker" item

4. Select Disabled















5. Click OK and close the dialogs.

6. To ensure the change is in effect immediately, type "gpupdate /force" in a command prompt.

Saturday, August 20, 2011

My first game on iPad 2: Tiny Tower

I've just recently bought an iPad 2. I thought about playing a game or two on this platform. And with the help from app store feature marketing, I downloaded this game called Tiny Tower. It turns out to be quite a nice and addictive game. The concept of the game is simple in that the object is to build more floors to the "tiny" tower you own. Each floor allows a different usage from residential use to retail. To be exact, there are six types in all: residential, food, recreation, service, retail and creative.

Each residential floor or apartment can house up to 5 people. You get to collect a rent $100 per person per day. These people like real life for the most part, need to get a job. They can be hired from a floor that caters food, e.g. sky burger, with each floor hiring a maximum of 3 people. Ideally, they should be placed in their dream jobs if possible, so to make them most happy and productive. The lift or elevator is the key to the game. Every now and then, a guy or gal comes to the lobby and indicates a floor to go to. By using the arrow up/down buttons, you can ship them to the desired floor and get 2*floor-level money. On the occasion, they may tip you a tower bux, which can be turned into more money or used for speeding up construction or restocking the business floor with items. VIP may also come and visit your tower occasionally. Depending on the type of VIP, they can help reduce the construction time, buy out an entire product from a floor, boost customer number to a floor, reduce restocking time, or bring in a floor of new bitizens (residents).

After playing the game for a while, you will start to get a feeling of how to best optimize the income or sales per minute so to help build the tiny tower to an ever taller tower! For me, the result is a 17-floor tower after playing the game for 3 days. Have fun and enjoy the mspaint-like graphics! :)

[9/4/2011: Just realized it's one of the best games as recommended by gamepro.]

My 17-floor tower

With the lobby view

VIP is coming to tower

Sky burger (favorite store)

More stores

Fun stores

18th floor? Maybe next time.