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.