Sunday, November 28, 2010

Cheer Chen Qizhen - A Piece Of Summer II ( 陈绮贞 - 夏季练习曲 )

Some selected photos from Cheer Chen's memorable concert on 13 Nov 2010 at the Max Pavilion, taken using Panasonic TZ-10.



























Sunday, November 7, 2010

Deleting Windows system folders on an old hard drive

I had to install Windows 7 on a new hard drive after my computer died. The installation went well and I wanted to reclaim some hard disk space from the hard disk where I had installed Vista. However, I couldn't delete some of the system folders. If you're having the same problem, you can try what I did.

  • Right-click the folder.

  • From the context menu, click on "Properties".

  • Click on the "Security" tab.

  • Click on the "Advanced" button.

  • Click on the "Owner" tab.

  • Click on the "Edit" button.

  • Change the owner to the current logged in user. If user is not found, try to find it by clicking on the "Other users or groups" button.

  • Check the box for "Replace owner on subcontainers and objects".

  • Click on the "Apply" button.

  • An alert box will appear with the message "If you have just taken ownership of this object, you will need to close and reopen this object's properties before you can view or change permissions.". Click on the "OK" button.

  • Click on the "OK" button.

  • Click on the "OK" button.

  • When you are back in the "Security" tab, select the "CREATOR OWNER" option from the "Group or user names" combo box.

  • Click on the "Edit" button.

  • If the box for "Full control", "Allow" is not checked, check it. Click on the "Apply" button.

  • Click on the "OK" button.

  • Click on the "Ok" button.


Now you should be able to delete the folder.

Sunday, October 31, 2010

Replica Island project setup

I was trying to run the Replica Island in the Android emulator, but I needed to setup the project correctly before I could proceed. Well, here's what I did.

Before everything else, make sure you've installed the Android SDK, Eclipse ADT, installed the relevant Android packages (install all if you're unsure), created the AVD and installed a subversion client (I'm using Subclipse).

Check out code
From trunk from http://replicaisland.googlecode.com/svn
Minimally, you will need to check out the "res" and "src" folders seperately.

Fix the xml in the "res" project.
Turns out there's some problem with apostrophes here.
This may be fixed in the future versions of the code, if so, just skip this step.
First, find "mustn't" in strings.xml in the values folder. Replace with "mustn\'t".
Second, find "I'll" in wanda.xml. Replace with "I\'ll".

Create a new Android project.
For project name, you can put anything. (I used "ReplicaIsland")
Check the "Create new project in workspace" radio button.
Check the "Use default location" checkbox. Else, specify your project location.
Select the Build Target. I checked Android 1.6.
Specify the application name as "Replica Island".
Specify the package name as "com.replica.replicaisland".
Click the "Finish" button.

Move the files to correct folders
Delete folders in the "res" in the "ReplicaIsland" project.
Copy all the folders inthe "res" folder checked out from SVN into the "res" folder in the "ReplicaIsland" project.
Copy all the Java files in the "src" folder checked out from SVN into the "com.replica.replicaisland" package in the "ReplicaIsland" project.

Replace the contents of AndroidManifest.xml
From http://replicaisland.googlecode.com/svn/trunk/AndroidManifest.xml

Finally run the project as an Android application.

And there you have it! The emulator should start up and Replica Island will start to run.

Sunday, October 17, 2010

Links dump 11-Oct-2010 to 17-Oct-2010

The Seven Wastes of Software Development

This talks about reducing the costs of developing software from a process-driven perspective. The seven wastes highlighted are:

  1. Partially Done Work

  2. Extra Features

  3. Relearning

  4. Handoffs

  5. Delays

  6. Task Switching

  7. Defects


As a programming grunt, I can readily identify with the problems highlighted. Basically the series talks about delivering value to customers and eliminating overheads while delivering software to the customer. These overheads are what constantly pisses off programmers. Unchecked-in, untested codes. Lost of domain knowledge. Unexplainable design decisions. Customer requests not correctly captured. Multi-tasking. Long-standing bugs that are just uncovered. The list goes on.

This is a must read for all involved in the business of building software.

Replica Island

Replica Island is a free, open-source game for Android.  I'm interested in designing some simple games but I've no experience doing such things. This website is great as source codes are provided for people to use some reference. The developer notes are also enlightening, tracing the design decisions and problems faced by Google developer, Chris Pruett. One of the most important sources of knowledge on Android game development.

chmod -x chmod

A puzzler for system administrators, what can you do if you remove the execute permission for the program that changes file permissions, aka chmod? Assume a data center environment and no Internet connection. Very interesting solutions provided.
Partially Done Work

Extra Features

Relearning

Handoffs

Delays

Task Switching

DefectsPartially Done Work

Extra Features

Relearning

Handoffs

Delays

Task Switching

Defec

Saturday, August 28, 2010

Important task completed – lessons learnt II

Recently I've been involved in a change request that modified some data that is returned to a web service client.

There was a bug that occurred whenever the stub made a remote service call, there was a conflict in the security algorithms being used. Even after googling, I still couldn't figure out what the problem was.

After some futile investigation, my colleague advised me to print out the security providers as additional providers may have been loaded during the remote service call.

So I did something like

Provider[] providers = Security.getProviders();
for (Provider p: providers)
{
System.out.println(p);
}


before and after the call, and true enough, there are security providers being dynamically added! So I called Security.remove(providerName) for those additional ones and lo and behold, it works! This is something totally new to me as I've not done much work on this aspect of Java programming before.

While debugging the problem, I realized it's sometimes more convenient to check the existence of environment variables rather than playing around with the program arguments.


#To get the environment variable in Unix
echo $PATH

#To get the environment variable in DOS/Windows
echo $PATH

#To set the environment variable in Unix
export VARIABLE=value # for Bourne, bash, and related shells
setenv VARIABLE value # for csh and related shells

#To set the environment variable in DOS/Windows
set VARIABLE=value

More info can be found at this Wiki.

Sunday, August 1, 2010

Missed 4 trains last Friday during morning rush hour

SMRT CEO Saw Phai Hwa says that even though trains are crowded during peak hours, people can still board the trains if they choose to. Well, there was certainly not much choice last Friday. I had to stand by the side and watch 4 trains whizz past me. All of them pulled into Bedok MRT station nearly filled to the brim. And the platform was nearly half-full with passengers going toward the city. Only some of them manged to squeeze in. Considering that there only a handful of stations east of Bedok, you can guess how bad it is for the rest of the passengers further down the eastern part of the East-West line.

Random checks with my friends seems to suggest that the congestion already started before 8.30am.

Friday, July 16, 2010

Challenger setting up shop at Bedok Point

Taken from their company announcement on SGX. A piece of good news to me, I'm usually too lazy to go down to Sim Lim

So around my area, there's quite a few branches. Excluding the upcoming one, there's one in Tampines 1, one in Eastpoint Mall, one in Parkway Parade
http://info.sgx.com/webcorannc.nsf/AnnouncementLast3Months/92D6AC4B193A94274825774400246E2A?opendocument#

Friday, June 11, 2010

World Cup 2010 on free-to-air channels

With the World Cup around the corner, I dug out my trusty A-B converter again to tune in to the Indonesian channels. The reception is a bit grainy but still acceptable. And it's way cheaper than the $94.16 you have to shell out for Starhub and Singtel's World Cup package.

A-B Converter

The good news is that I'm getting pretty good quality on Malaysia's TV1  and TV2, so I can watch that as well.  As I said before, if our neighbours can provide us with free World Cup coverage, why can’t the local channels do the same?

Saturday, May 1, 2010

Spamming the word "professional" makes you look quite the opposite

Just spotted this comment, which I will mark as spam.

Couple of days back I have started my local recruiting agency and now i am looking for some good highly professional place that is dedicated in placement of professionals, that can help me to expand my business of recruiting. I am also having many professional candidates looking for professional jobs and I also look for professional companies that require professional candidates from different areas right from restaurant jobs to highly trained engineers job and also management jobs. Does anyone know about anything nice place?


That's 6 "professional"s in 2 sentences. Wow. Besides showing a lack of vocabulary, the author also trips up on his/her grammar.

Saturday, April 24, 2010

Edsger W. Dijkstra's manuscripts

Edsger W. Dijkstra should be a familiar name to any computer science student, since one of the most important algorithms, Dijkstra's algorithm, is taught in graph theory.

Besides being a brilliant computer scientist, he's also written some articles regarding the computer science discipline and the computer industry. Click here for the link.

As such, most of what he covers are quite esoteric to those without any programming experience. Case in point, when I first started programming, I had to get used to the fact that in many languages, numbering starts at zero. Ie, the the first item in a list is indexed as 0, the second item is indexed as 1, and so on. An interesting view I discovered is that according to him, many mathematicians view computer science in poor light, and these are usually the poorer mathematicians.

My favourite piece is The Humble Programmer.

Some quotes:
On poor mathematicians:

I gave the puzzle as a sobering exercise to one of the staff members of the Department of Mathematics at my University, because he expressed the opinion that programming was easy. He violated the above rule and, being, apart from a pure, perhaps also a poor mathematician, he started to look for interesting, non-obvious properties

On poor mathematicians again:

Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.

On learning:

We are all shaped by the tools we use, in particular: the formalisms we use shape our thinking habits, for better or for worse, and that means that we have to be very careful in the choice of what we learn and teach, for unlearning is not really possible.

On the Internet's impact on computer science:

No, I'm afraid that computer science has suffered from the popularity of the Internet. It has attracted an increasing —not to say: overwhelming!— number of students with very little scientific inclination and in research it has only strengthened the prevailing (and somewhat vulgar) obsession with speed and capacity.

On the power of machines:

Machine capacities now give us room galore for making a mess of it. Opportunities unlimited for fouling things up! Developing the austere intellectual discipline of keeping things sufficiently simple is in this environment a formidable challenge, both technically and educationally.

On society's expectations:

.....machines have become several orders of magnitude more powerful! To put it quite bluntly: as long as there were no machines, programming was no problem at all; when we had a few weak computers, programming became a mild problem, and now we have gigantic computers, programming had become an equally gigantic problem. In this sense the electronic industry has not solved a single problem, it has only created them, it has created the problem of using its products. To put it in another way: as the power of available machines grew by a factor of more than a thousand, society's ambition to apply these machines grew in proportion, and it was the poor programmer who found his job in this exploded field of tension between ends and means. The increased power of the hardware, together with the perhaps even more dramatic increase in its reliability, made solutions feasible that the programmer had not dared to dream about a few years before. And now, a few years later, he had to dream about them and, even worse, he had to transform such dreams into reality!

Saturday, April 17, 2010

Serving static resources in Glassfish 3

I was playing around with the Google Maps API, when I found that I can't access my Javascript files in Glassfish. The JSPs were working fine, so I guess it's some URL handling thing in web.xml. As it turns out, there's a default servlet in Glassfish that should be used to serve static resources (like CSS, Javascript, PDF, image files, etc). Digging into ${GLASSFISH_HOME}/glassfish/domains/domain1/config, I found the default-web.xml. Under the section called "Built In Servlet Definitions", there's this XML snippet:


default
org.apache.catalina.servlets.DefaultServlet

debug
0


listings
false

1


I copied this verbatim into my web.xml.

Now, I want the default servlet to handle all the accesses to the static resources. I tried to map URLs with certain prefixes to this servlet like so:


default
/js/*
/css/*
/img/*


Not sure what the problem is, but it doesn't work. I'm forced to try extension matching instead:


default
*.gif
*.jpg
*.png
*.js
*.css
*.txt
*.pdf


Well, now that works, but it's not an elegant solution. Imagine, if I want to serve a new kind of file, say an Excel file, I have to remember to include the extension in web.xml, besides just throwing the file into the correct folder. I will have to relook into this again, but for now, I'm just happy it works :)

Saturday, April 10, 2010

Four Hands Guitar

It's quite common to see 2 people playing one one piano. It's indeed rare to see 2 guys play the same guitar. Check out this clip for the duet (and look our for Tommy's expression :))

Wednesday, April 7, 2010

92.2% of grads found employment within 6 months


SINGAPORE: 92.2 per cent of students who graduated from the three local universities last year found jobs within six months of graduation, according to figures posted on the Education Ministry's website on Monday.

The employment rate of graduates from the Singapore Management University (SMU) is the highest among the three local varsities.

96.8 per cent of its graduates found jobs within six months of graduation.

In comparison, about 91 per cent of graduates from the National University of Singapore (NUS), and about 89 per cent of graduates from the Nanyang Technological University (NTU) found jobs within six months of graduation.

In terms of salary, graduates from SMU's Information Systems Management course earned the highest mean monthly salary of about S$3,450.

Graduates from the Business Administration with Honours course at NUS came close with a mean monthly salary of about S$3,400.

At the other end of the scale are graduates from NUS's Applied Science course. Their mean monthly salary is about S$2,400.

That's slightly lower than graduates from NTU's Art, Design and Media course, who have a mean monthly salary of about S$2,430. - CNA/vm

Source


In terms of salary, graduates from SMU's Information Systems Management course earned the highest mean monthly salary of about S$3,450.

Creating a PostGIS database

Inside the pgAdmin tool, run
CREATE DATABASE my_spatial_db TEMPLATE=template_postgis

More details here

Tuesday, March 16, 2010

Unable to run Star Tales benchmark.....and even worse

I was downloading Nvidia drivers and I saw this benchmark for Star Tales. Basically it's rendering 5 girls dancing to Wonder Girl's monster hit, Nobody. It's supposed to demonstrate the power of the PhysX in enhancing games. Here's a video of the benchmark


I downloaded the benchmark and installed it. When I tried to run it, the program complained of missing files. That's pretty bad, but worse was to come.

Today, I saw this

That's evil, dude!
That's evil, dude!

Monday, January 25, 2010

It's offficial: Spring 3.0 is not compatible with Hibernate 3.5 beta3

After fiddling around with the persistence.xml for a while, I found the bug report here.

Get the 3.0.1 snapshot!