Sunday, December 6, 2009

First-time Vista users...like me

Want a quick shortcut by right-clicking on folder to get to your cmd.exe in Vista?

Hold Shift & right-click on the folder and you will see a "Open Command Window Here".

Waahaha..I'm starting to like Vista - I don't need to install PowerToy or edit my folder settings already... :P

Sunday, September 13, 2009

SVN export with Tortoise

After using Tortoise for some time, it's only now that I found out that it is possible to export files the easy way. I right-clicked all the folders containing svn files and dragged to my working folder and a pop up menu will appear for options to export all items.

It REALLY pays to be lazy....... =p

Tuesday, July 28, 2009

maven newbie...

Being a newbie to maven, I jumped headfirst into the application without reading much documentation, and I was perplexed by my application not compiling until I read the Maven Standard Layout

*note to self - don't forget the main folder!

Monday, July 20, 2009

Metering for exposure

I have done it again.........forgetting to switch my TTL metering on my SLR while taking photos, and I ended up with spot metering for each photo, making them overexposed in some. Thanks to Mr. Ho, I have learnt that uneven lighting creates overexposure in spot metering.

By the way, I've just got myself a polarising filter, so I'm definitely looking forward for more pretty skies and no more hazy skylines!

Tuesday, July 14, 2009

One file for all, and all loading from one?

Lesson in making trees:

Never use a single xml file to store your stuff if you are not even thinking of chopping it into several parts to cater for lazy-loading for your tree.

My fingers wouldn't listen to me!

I have a bad habit when I play the piano that I inherited from my organ-learning days. Since the organ doesn't have touch-response I could tap with any level of finger force I'd like and now it seems that it is going to harm my piano lessons....

Teacher says, "Tap with strength from the fingers, not the wrist."

But I kept tinkering with my wrist going up, down, up, down.... argh so frustrating. I had my friend and the teacher hold both of my wrists while I was playing from the book at class. Feels weird having to concentrate on the fingers and the piano keys at the same time!

Lessons from the validators

In my previous Java project, I had to code validators for a bunch of classes that have no concrete requirements specified and I was a bit clueless as to how big is the implementation scope and how should I validate the text fields that may accept different kinds of patterns of different data types. First of all, they needed a field that could accept only * and 0-9, and naturally Regex came to mind........ and that being a former PHP scripter, I inadvertently used regex in all of my validations, which, in the end, was not as elegant as I thought! (Although some seasoned OOP developers may feel regex is unnecessary, in my opinion it is quite handy.)

As I struggled in getting the correct method to use and at the same time getting help from the seniors, I realised that I could have separated my validation methods into regex parsing and the regular numeric data type parsing. And then, I have decided that the middle road is the way to go in my future projects.

This is my conclusion :
1) If the field consists of special characters and/or alphanumeric -> use Java regex
2) If the field is only tied to one data type, for instance only numeric -> use the Java number class to do the parsing e.g. Double.parseDouble

Mix and match is good eh?

Pick out the null and throw in an Empty

The Dangling Composite pattern

I have learnt not to assign a null to a reference in a list object's constructor, because when the equals() method is applied, I will get a NullPointerException. It says creating an Empty class will fix that - I guess it's because it's still a class (although it does look weird in the UML diagram...)