Wednesday, September 13, 2006

Nearly Get Killed

A typical situation in Malaysia's major highway is that you are able to see so many trucks on the move, carrying containers, goods, woods, and any kind of transportable items you can imagine.

Another typical situation is the presence of unwanted objects on the road, obstacles I would call them that might hinder the smoothness of your driving experience. These are usually paper boxes, stones, relatively small objects.

Today, I learnt another lesson of why you shouldn't drive behind a large truck. Besides the risk of stones dropping on your windscreen from these vehicles, they also prohibit you from seeing what's up in front on the road.

Driving at the speed of 90-100 kilometers per hour, behind a truck (as you might guessed), I caught by surprise by a metal rod rolling towards my car, which I only saw after that bloody truck driver avoid it at last minute. Roughly 1.5 meter long, 30 cm diameter with some funny sting on it. On the left lane is another truck, while on the right lane is a Toyota Altis moved at the speed of 110kmph. I got no choice but to roll over that "thing". The car movement direction skewed nearly 70 degrees. What a stunt you might think, my life is indeed on the stake.

No life casualty due the impact, however my passenger's left wheel is rendered useless and the alloy rim slightly bended.

The morale of the story is that do not drives near any trucks in whatsoever direction; they are killing machine, although they failed to kill today. And beware of funny looking metal rod.

Sunday, September 10, 2006

Mistake Mistake

The multithreaded Java application I wrote in April 06 for extracting data from 90k files to IBM DB2 v8.2 system suffering from performance bottleneck when dealing with too many worker threads. This is a common issue for multithreading programming and that's why we got something called Thread Pool. While waiting for the extraction to be finished (God, it has been running for 30 hours and still executing at this moment), I took some initiatives to perform a code review, trying to identify possible programming faults. And oh yeah, found a potential program problem. See figures below




What you think is wrong with the above code snippets? Well, I try to recall the rationale of doing the stuff like that when I was developing this program and I think I did that to avoid the intricacy of thread synchronization due to very constrained assigned time frame.

I wouldn't tell you what's wrong with it and I hope you can spend some time exploring it out. However I can tell you that one of the way to get out from this scalability issue is to using java.lang.ThreadLocal to manage the connection instead.

Tons of POS Transaction File

For the purpose of POC for a retail company's data mining initiative (again), I being trashed with 90k number of small files containing 1 year POS transactional data, nearly double the amount of files/data for previous POC effort. Almost 70% of these files are compressed in Z format. Made a quick study on java.util.zip package provided in Java SDK 1.4.2 (The package is available from SDK 1.1), no luck, the standard facility only supports ZIP and GZIP formats. Ok, fine. I made a search in sourceforge, looking for any open source java implementation. None of the search results are directly useful to my decompression need. Then, I tried Winzip, WinRAR, PowerZip and etc. Emmmm, most of the Windows GUI version of these programs are able to decompress Z archive, however none of them provide batch processing. Darn, I not going to decompress 90k files one by one, am I look like that dumb? Ok, thinking of command line version of Winzip and Winrar. Ooops, unfortunately enough, they don't supports Z format in their command line version.

Decided to do some research on Z archive and found this useful article

Uncompress gz and Z format

It seems to me that Z format and many other compression formats are natively supported by UNIX systems. So sad for Windows users.

Also, read this
Wikipedia: List of archive formats

Uppercase .Z is a different format compared to lowercase .z file. Generally .Z is produced using UNIX's compress command, whereby .z is by UNIX's pack command. Algorithms used for the compression are different too.

Since I only got limited time for this decompression task, I finally settled with GUNZIP program, that's freely available (http://www.gzip.org/) and performed a batch decompression. Proceed to the ETL phase then.

And here is a forum post that I found stating similar decompression requirement. Most probably I will use Runtime.exec to call out external utility such as GUNZIP, rather than trying to find a Java implementation for integration. Anyway, it's depends on the amount of time I have.

Similar Issue

Friday, September 08, 2006

Stay Alive 2006



Cool movie. I really like the idea of reading prayers before starting a game. That would be a nice start for any horror genre game. The movie begins with few gamers died in the same way as they did in the game they played, named Stay Alive. The scene where the guy with a pighead mask on the bed really amused me. Hahaha, I wonder what kind of simulation they're playing. Story continues with a group of friends then play the same game and one die after another. The only way to get out from the curse is to find a way to kill Elizabeth Bathory, the devilish character in the movie.

Check Elizabeth out

I don't give credit to the ending. As a matter of fact, the ending can definitely better than such typical kind.

And of course if such a game has been developed, I definitely will sign up as beta tester. Count me in.

CA Clarity Boot Camp '06 in Malaysia

After 3 weeks of intense boot camp training, finally the D day. Completed all exams with consistent scoring and time of completion, wonderful. *thumbs up*

A photoshooting session in the last day, and here is the Yahoo! photo album that contain pictures from one of my classmate's camera (Sony Cybershot W5).

Yahoo! photo album

And a souvenir from CA Malaysia as a token of appreciation for the completion of the course and certification. See below.

Name Card Holder



What most matter now is the prepareness into real world projects. Certification is one thing, implementation would be a totally different dimension. Good luck to every certified technical guys in my class.