Tuesday, April 11, 2006

Happened to attend a seminar on Agile Development : For Fun and Profit last weekend
came back a little disappointed . Though the topics were good and the presentation excellent , addressing certain aspects like drawbacks of SOA,Agile development could"ve been highlighted .Also the stuff like how a particular technology(SOA, Agile ) helps business could have been more emphasised. IMHO for whatever its worth, I feel WebServices, SOA is just another hyped stuff .The EJB experience is still fresh in mind . Advice caution before embracing any technology if all you hear is fancy names and a few extra frills .

Friday, December 02, 2005

Yaawn ! 10 mins past midnight and I start to have guilt pangs about my blog updates . I would say there's always a reason not an excuse , but after spending close to 10-12 hours everyday and add a couple of hours to commute , plus an hour on the technical pursuits (the trail has turned cold by now) there's nothing much a guy can think about other stuff.
Technically I have found myself wanting on XQuery ,so going through the XQuery Spec 1.0 was a pretty daunting task and in between fixing targets of ant scripts,the regression test cycles and the report generation task ,and the CRs there's this task of developing the cache Management which is pretty interesting .

Wednesday, October 26, 2005

Downpour Stories

6:00 pm Tuesday ..
Wiping the visor of my helmet I took off from the office premises .. was unusually dark for 6:00 pm . The first km from office was a breeze and was surprised by seeing so many less vehicles on the road .. As I took the first right turn ahead ... it started drizzling , did slow down seeing the huge puddle of water .. A Qualis went by splashing water on either side of the road was fortunate not to get drenched there , since the road was pretty wet with the rains pouring from the morning I decided to go slow and stick to the main roads no more shortcuts today, the brakes were 50% efficient , so decided not to risk it .As I approached the traffic signal , I saw the dial of my watch showing 6:05 pm pretty good progress for the first 5 minutes At this rate, I thought home was just 30 minutes away
Heavy incoming traffic from the opposite direction forced us to wait for a few extra minutes at the signal .Its starting to pour now .. In my eagerness to cross the signal .. I overtook a few vehicles from the left and had to cut sharply to right where i saw a huge sea of traffic waiting at a signal. There was no traffic police in sight .. My jacket was getting drenched and was feeling a little cold .My trousers were wet as well .. Water was dripping from my helmet visor. I saw a couple of motorists around people were drenched to the bone Maybe I should call home , I thought but then I realized there was no shelter till I crossed the signal across the road .
The rain looked unrelenting and so was the traffic from the opposite side , A driver in front of me zigzagged and helped his bike across the pavement and went on it for about 500 meters . I was tempted to do that at the same time the light turned green and i sped away .. It really started to pour now and the visibility was getting less when I reached a junction , I saw a young NCC cadet around 12-13 years braving the rain trying to guide the traffic .. then the traffic jam happened .. I had to take a shortcut to avoid the traffic went across the bylanes and reached Richmond Circle , I was stuck here badly ... with rain water gushing heavily though the traffic would'nt ease until another 10 mins I had to keep my engine running .. could'nt risk stopping it since was not sure if it would start .. that's the last thing I want..

6:45 pm Still stuck at the same traffic jam .. waited for another 10 mins while considering the alternatives .. was not very sure about the bylanes since most of them were narrow and chances of water logging there was very high
The endless jam seemed to continue and I was forced to take the pavement to overtake a couple of buses on the main road .. The rain was reduced to a drizzle by now .. but not the traffic and add to it the road rage ...

7:15 pm very less progress made in the last half an hour ... It looks its going to take another hour before I reached home.The traffic around Majestic was very less and very few people were out .. I sped across the Majestic signal and reached home at around 8:00 soaked in water .good thing I did'nt get my laptop from office today

Monday, October 10, 2005

Some fancy hacks and a remote car key

  1. Emergency numberThe Emergency Number worldwide for Mobile is 112. If you find yourself out of coverage area of your mobile network and there is an emergency, dial 112 and the mobile will search any existing network to establish the emergency number for you, and interestingly ...this number 112 can be dialed even while the keypad is locked. Try it out.
  2. Locked the keys in the car? Your car has remote keys?This may come in handy someday. Good reason to own a cell phone: If you lock your keys in the car and the spare keys are home, call someone on your cell phone. Hold your cell phone about a foot from your car door and have the other person at your home press the unlock button, holding it near the phone on their end. Your car will unlock. Saves someone from having to drive your keys to you. Distance is no object. You could be hundreds of miles away, and if you can reach someone who has the other "remote" for your car, you can unlock the doors (or the trunk).
    ( sure this wont work at least now .. Why ? First of all the remote car key does work on some radio signals and mobiles need to emit those radio signals which is not the case now ..so for this to work your mobile should transmit those weak radio signals from miles away ... yawn ..anyway somebody gets this working do let me know )
  3. Hidden Battery powerImagine your cell battery is very low, u r expecting an important call and you don't have a charger. Nokia instrument comes with a reserve battery. To activate, press the keys *3370# Your cell will restart with this reserve and the instrument will show a 50% increase in battery. This reserve will get charged when u charge your cell next time.
    (did'nt work on my mobile ... though some of the other mobiles showed a significant increase in battery level upto 30% )

Wednesday, October 05, 2005

A week that was..

Its been a roller coaster ride so far from lazing to guitar classes, to getting the code done, to the endless lectures ,to trying to make some sense of those differential equations (which was very easy back in college)and applying them to some real time problems , to the changes in the workplace ,its all happening .It was frustrating , confusing, and as well as exciting time . Wonder what's in store next ? Technology wise just picking up some stuff in SOA and Web Services need to put them use in the next project .
I"m getting ready for the hols next week ,get the much deserved break and hopefully catch with some more guitar practice .. well I"m getting there ..


Oops Did i talk about Digital Fortress , picked the book in Sunday afterrnoon ,this one too lives up to its expectations Dan Brown strikes again .. the book as one of the readers said is unputdownable .. for all those fiction buffs make sure you are not going to miss this one ..
Enuf said ... getting late ...

Friday, September 23, 2005

Darn It ,

Spent the last hour fiddling with wierd issues when starting the server.. life was good till afternoon ,it was at this point I decided to speed up things and changed the implementation , alas forgot to change the property file ... the server started to spew venom .. took me about 40 mins to get the new config back and its humming softly now ... what a rookie ?

People have already started leaving ... makes me think of the maniac traffic outside .. one of the most favorite topic Bangaloreans have ,the name driving needs to be rechristened as "avoiding"

Time's up ... Need to complete a couple of more tasks before going home

Wednesday, September 21, 2005

SNAFU

Thanks AK, for the term , was actually lost for words , when trying to describe my guitar classes Situation Normal but All Fouled Up .. could'nt properly get the finger shift ,if that works the rhythm is lost ..45-60 mins of practice not working at all in my fav..planning to squeeze in some practice before the weekend comes , In the days of fast foods and instant coffee.. just learnt that music is not on the instant list .. So that's the update from my guitar .

Work's been pretty fun these days ... reading code has been quite an interesting task so has been learning the framework.. My first impression from a user point of view of this framework (API) it's pretty simple and effective ,need to dig a lil deeper .
To quote Mopheus " I do need to find how deep is the rabbit's burrow"

To be continued ....

Wednesday, August 10, 2005

I had a guilty conscience while dusting my guitar , though now it looks pretty new and well tuned its been ages since I practised it .
Just like any of the starters started looking for the scales , continue to search for the elusive pattern yesterday and after two hours at around midnight I discovered the scale with some painful fingers .. it was worth it
Only hours of practice and toil lie between me and the music ..more updates coming soon on my journey to play a Floyd number

Wednesday, July 06, 2005

A thought about Equals and hashCode

The equals () and hashCode() relationship has great importance while storing objects in the hashtable/hashMap/ hashSet , for one if you dont implement hashCode at all you might end up having a duplicate values in a Set or even having objects getting overwritten in case of Hashtable or hashMap.

It is necessary to exercise caution while writing this method. We learnt this when one of the object (we are storing in a hashMap) had the same value of int for all objects in the hashCode(). This eventually was a bottle neck as we realized since we no longer got the performance we desired from Map since all the elements were in the same bucket it made retrieval expensive..

Monday, May 16, 2005

Some thoughts about AJAX

Ajax architecture has been pretty impressive at the first sight , and after having a look at Google Maps ,Google Suggest and the Java RSS the potential of this architecture is amazing .To have the web application behave like a rich client side app will no doubt be good and also is one of the takeaway AJAX gives us (we do owe it Microsoft for XHTMLRequest ) .

A couple of examples tried out with Validation using AJAX showed plenty of promise For a website to be more responsive and to avoid multiple requests to the servers AJAX can be used effectively by caching information which is typically done during validation of input fields.Also since you do not have to refresh the entire page this would also improve usability. It does not end here alongside validation , we can have features like auto completion (Google Suggest ) uses this and then there is autocompletion , autorefresh etc..

Monday, April 04, 2005

From a programmer's diary..

The following is the minimum essentials one needs to be successful
  1. One Programming Language (JAVA)
  2. One scripting language (Javascript)
  3. RDBMS concepts
  4. Know-how of DataStructures
  5. One framework (Struts)
  6. other utilities like ( Ant, Junit, UML)

The key point here is these things will atleast see us through our everyday tech challenges though tech challenges these days are becoming harder to find .. one would consider himself lucky if he does'nt have to do the mundane maintenance or fix a CR which involves changing the gif image on the jsp and producing 3 documents in the process

Sunday, January 23, 2005

I"ve been churning out documents by a dozen the whole of last 2 weeks ... Interestingly found out this is an entirely different ball game as compared to technical work for one i found it this was not as easy as it appeared and also as far as the formatting was concerned its pretty time consuming.The worst part was not having anything to do technical..
as they say "Necessity is the mother of invention" I"m studying about the Head First Design Patterns . This is an amazing book in terms of clarity and the depth the author packs it in .It seems to be a long time ... and i dont like to be in the sideline for long enough ..waiting to get back in action.





Tuesday, October 12, 2004

Weblogic and the curse of the Session Id
While implementing a simple session time out scenario , i encountered problems which seemed bizarre .. i discovered that multiple sessions being created .Strangely i saw that these sessions were being created even though an existing session was in place .and clicking any link on the site created a new session almost everytime . Deciding to do something different i entered the url on the browser and voila !! no sessions were being created ... Further investigation led me to the weblogic.xml which had an encode sessionidinquery params value set to true . What this triggered was the weblogic now only understood if there was jsessionId present in the browser .and the web site did'nt use any of the response.encodeUrl() so clicking on any link on the website resulted in creating a new session.

Changing the parameter encodeSessionIdinQueryParams to false restored some sanity and able to carryout the timeout implementation.


Monday, October 11, 2004

The Phantom data trail

For those who have come in late ..
We were happy to use the connection pool for database access . just get the connection from the pool use it and release it back... life's cool until one day when we decided to execute a transaction . we followed the following steps ...
  1. get a connection from the free pool
  2. set the connection's auto commit property to false (needed for a transaction
  3. put the db execute/update statements within a try catch block
  4. In the catch block log the exception and,close the statement release the connection and throw the exception back
  5. end of the method con.commit()
  6. release the connection back to the pool

This worked pretty much fine for all the happy flows ... whenever an error happened we used to have some data appearing in the database long time after the operation was over .The mystery further deepened when we found out this data which was appearing was due to failed transaction.

Reality dawned a li'l later when I found out that in the catch block one crucial step was missing conn.rollback() w/o which we used to release it to the pool and when someone else gets this same connection and performs certain other operations along with those operations whatever statements were successful in the previous operations were being updated

Moral of the story

pool or no pool ... to keep life a li'l simpler and easier follow the best practices


Thursday, September 16, 2004

KISS

bigg problems simple solutions ..It took me 2 days and 6 hours later to learn this lesson.The issue was with the deployment , things were going smoothly while coding and problems started when we tried to deploy the application. Initially found some abandoned jars in the lib folder , it took us a while to ensure that this was not needed as we removed them we found out certain entries made in xml files were redundant , the classes corressponding no longer there .. from here it was road to hell .. missing files, wrong config issues and we had almost made it when we encountered the dreaded 404 error ...everything seemed fine the path the jsps were all in place .. and in the end we tracked it to the webserver which was not configured for jsps ... does sound crazy ... we fixed that and found a similar symptom for the css, htm, java script files ... it was about this time that we got the app deployed

a lesson learnt Keep It Simple Stupid !!

Tuesday, August 24, 2004

What say folks ?

Imagine a software application written without proper error handling mechanism. guess how wud the maintenance be ..ask me ?? i had a pretty torrid time setting up the application last week and struggled for more than a couple of hours with a classic classpath problem. I just cant stress the importance of having the correct set of classes in the source control..What more ,In case if some thing goes wrong show the user a blank page to test how vivid his imagination can be ...had a pretty frustrating time with the setup it took more effort than my coding ...finally was able to get it up and running after some hours of SOP and commenting of the code found that the logger part was not working ...so the application is not working ...yup u would read it right ...the logger is not working and so the application is not working ....what can any one say ? i am muted ... what say folks ?

Wednesday, August 04, 2004

So i am back after hibernation, I was too busy doing nothing ... trying out my hand at developing utilities like FTP in java , SMTP , writing use cases ..writing schedulers to read and generate some stupid reports ..coping with the everyday travel of 3 hours right through main arteries of the city .. just noticed that my ejb skills are becoming a rusty ...an ejb(ean) a day keeps rustiness away !.

Wednesday, June 23, 2004

To except(ion) or not to accept
The usage of checked exceptions in Java has been one of the debatable concepts recently and IMHO it makes sense . seeing the misuse of the exception handling , i can understand the issue about it.

For those who came in late, the big debate is the misuse of the checked exceptions in that the programmers can circumvent the exceptions by either swallowing it or still worse throw an RuntimeException or a subclass of it.
Both the approaches violate the principle of checked exceptions that the user needs to know that there is a risk of something going wrong in the program and hence declare it "throws". The errors (RuntimeException ) on the other hand signify that these are not to be handled and are a result of abnormal conditions and for errors it is not required that the user declare "throws" clause

Also the checked exceptions should be caught and re-thrown at different levels to avoid the coupling of the tiers . Assuming that the EJBTier throws an exception indicating that one of the subsystem failure, this exception has to be caught in the Web tier and an different exception needs to thrown wrapping in it the other exception .The J2SE 1.4 provides an way to wrap the reason in it by providing an constructor which takes in a Throwable object and also an method initcause which takes Throwable as an argument. Using either of the above , one can wrap an exception and throw it doing so will require minimal changes only to the web tier in case the ejb tier changes and no changes to the classes which call the web tier.

On the flip side the code for exception handling becomes more bulkier in that u have a nested of catch blocks trying to catch the exception.

One more way to do this might be to have some constants within the checked exception describing about the errorcodes majorCode and minorCode, major code indicating the severity of the exception as business error or system error ,the minor code would indicate the nature of the exception say "Login failure " or "Dup primary key exists" this approach is for u if u dont mind writing catch block and doing a li'l bit of parsing ... By using this approach the users of this program mainly have to just check the code and act accordingly and a single exception could suffice

see Bruce Eckel's suggestions here

Tuesday, June 08, 2004

Some Java trivia
Here are some of the questions posed to me
Unfortunately i"m not including answers for them

Happy solving ....

1. Static method overriding concepts
2. Pass-by-value concepts read my blog
3. Collections Usage of HashMap ,ArrayList
4.static methods and variables
5.Thread concepts
6.Internationalization and Locales
7. J2EE container Diff components
8.equals() and ==
9. Case scenario coding
10. JMS RemoteQueue PUB/SUB message properties, PTP,
11. JDBC diff types of drivers
12 Diff between AWT and Swing
13. What are the various stages in JVM while loading of the classes
14. Exception handling How do you write your own custom exception class
15.diff kinds of operations provided by HTTP protocol
16. a get request is sent to the servlet which has only doPOSt() defined what will happen
17. How do we load the same connection object twice
18. Difference between POST and Get
19.MessageDrivenBeans concepts and case scenario
20.HOw does MDB differ from session Bean
21.RMI HttpTunneling concepts, stub and skeleton
22. Clustering concepts
23.Diff between String and StringBuffer
24.Diff between ArrayList and Vector
25 Concepts of requestDispatcher.fwd and response.sendRedirect
26.Design Patterns COmmand, Singleton, Mediator, Factory
27.Session replication and Session caching
28. SAX DOM parser JAXP and JAXB
29. Thread program
30. How do we send multiple responses to the client indicating the server is processing the request
THe request is a single request and the user needs to know how the progress o
31.What are the properties of the MessageBody in JMS
32. Diff types of Paradigms in Messaging
33.App server security concepts
34.In what location do u put the classes in a web application
35.In 2 interfaces you declare a variable with the same name what happens when in a class if u extend these
2 interfaces
36. What would happen if u have the same method declaration in both of these interfaces
37.What is Aggregation, Composition, Association and Inheritance
38. What is meant by synchronization



Monday, May 24, 2004

Driving Sense
The traffic scenario in bangalore is divided among 4 players
1. The Monsters Brutual Urban Service a.k.a Bus
2. Weird autorickshaws with crazy messages on top
3. The Misguided Two wheelers and lastly the
4.Cars, trucks and others spewing up smoke

BUS
The don of all the other players, likes to drive in full throttle (brakes are either non existent or not used ) Legend has it that these drivers were once novice cyclists.They still have this characters in them that they turn these buses within a radius of 4.5 mts ...
Main characters include honking incessantly at signals even though a red light is glowing Will stop at non existent bus stops sometimes in the middle of the roads . The private ones are very awful ,keeps u wondering how a bus can accomodate so many ppl and yet move.They think that roads are their own private property.These guys rule the road and
my advice dont go near it ..

Autos
These mavericks have a foul language and are close cousins of the bus drivers,they take u for a ride literally Every artery is choke- a- block with these three wheelers,Their motto in life care a damn to other motorists... drive like barbarians on a rampage...and rely on
uncanny knack of squeezing through any gap.If two autos coming from opposite directions meet they wave hands and stop in the middle of the roads shake hands and discuss about life's problems and as about you well ....make your own road that's what they say. Higly unpredictable and can turn any way they like If u are following them most
likely u will since no one will allow you to overtake them my advice would try and predict which way they will go ...really a tough one .. watch out for these guys


Trucks Cars and others
Late entrants to the traffic scenario but no less crazier than the others..These guys comprise of call center pick and drop vehicles... are known to beat the sound barrier and no lane is small enough for them Try driving in the night you can see these predators prowling in their Qualis , Sumo and other SUV's.etc , travelling at break neck speeds nothing seems to stop them not even humps , craters (pot holes) these guys would give serious competition to the Moto cross champions


Two wheelers : a.k.a misguided missiles known to check the speed limit and other motorist's endurance ... main potent weapon is the horn which they use it more than accelerator or brake... General characterstics include swerving , trial of speed, not caring
a damn about the yellow lines, cant wait till the red signal turns to green...all the other symptoms of road rage can be found in this species.....