Friday, July 20, 2012

Post#3 Making Incremental Progress

I could finally achieve closure on Accounts Set Up use case last week. It was grueling. For a long time jqueryui combobox did not work on ie 8. I tried various ways moving things around but it would not. Finally I gave up.

There was a lot of development that happened on that page. I split it up into common code vs use case specific. After moving them into their respective files, I tested again, to double check everything was okay, and lo! it worked in ie8. Don't ask me how but it did.

I've since moved on to the next use case. Upload Transactions. This was the most fun when I implemented it the first time. There is a free utility called uploadify. An awesome piece of work. They help you with uploading files. In the past my biggest challenge has been identifying the size of the file being uploaded beforehand. HTML does not allow for it. Hence you end up uploading a 1 mb document, and then the server reports that the size is too big.That's dumb and it also a wasteful use of server resources. Uploadify uses flash to read the size of the file and warns you if the file is bigger than allowed limit.


I did struggle a bit with configuring Uploadify but the documentation is good. The product is still evolving. I had 2.4 version from last December which I upgraded to the current 3.1 version and it solved my problem. 5 stars to Uploadify. They have made a real contribution to the user experience. I'd like to donate money to them. If I ever go live with this, I'll pay up.


Late nights have been hurting my exercise routine. For the last 2 days, I've been sleeping late and getting up all groggy in the morning. Yesterday night, Tomcat crashed. Its the second time. Fortunately, this time before reinstalling it, I took back up of web.xml, server.xml and context.xml. Saved me the effort of re-configuring the data source. 


Weekend looks busy. I have a late night birthday party to attend. Tomorrow, I have to take my daughter and her friends to their weekly class. On Sunday, I'll try running 18 kms. That will screw up the rest of the day for sure. So going slow. But making progress....

Sunday, July 08, 2012

iPhone Disaster

When I run I sweat.... A lot!. I have an arm band to hold my iPhone and I wear it during my weekly long runs. Today however, was a bad day. Somehow the sweat leaked in and my iphone conked off.  Whatever I did it would not come up. I felt horrible. I had damaged the phone. I had bought it last year in may, and since have absolutely loved it. This was a disaster. I was not prepared. This was not happening to me.

I frantically searched for a solution. I read up on the net. There were some really useful tips. Based on a few of these, I wrapped up the phone in paper napkin and put it inside the rice jar. The article said it sucks out the moisture. And it did. After 4 hours when I pressed the power button, it sprang back to life. I was relieved ecstatic only to find out that the home button did not work. Ouch!

Some more frantic searching. After a while I found the solution. I went to settings->general->accessibility->assistive touch and turned on the feature. Its amazing how it saved the day for me. The home button is gone for good, but the phone still works. Its a little inconvenient to get to home, but its bearable. Hope I can keep it safe for another year before I upgrade. Hope iPhone 5 will be out by then. I have the perfect excuse to upgrade. I just need to keep this going till then.

Running Adjustments

Since last Jan's debacle when I missed the 2hr mark by 30 seconds, I've been working on things.
The Gear
- I bought a pair of new shoes one size bigger than my natural size.
- On my visit to Amsterdam, I came across an ACSICS store and bought myself a Hydration Backpack.
I had seen someone running with similar product back in my Thane Marathon. When you are trying to shave 30 secs off the clock, you tend to go overboard. I'm thinking, if I did not stop to hydrate myself during the run, I might have saved about 4 minutes. But then to carry 1 liter water along may slow me down. I do not know how it will finally pan out but then I'm making all efforts :).
- Yesterday I bought 3 pack Dri-Fit socks from the Nike showroom. My run was ruined by blisters on both my feet. I could not walk properly for 2 days after the event. I read up on the net. Cotton socks are the worst offenders when it comes to long runs. They absorb the sweat and become soggy. At the same time your feet swell up after running for an hour or so. Add the two and you have a perfect concoction for blisters.
I typically start feeling the friction after 8-9 kms of running. Thats about 45 mins into the run. Today, I ran wearing the new pair of dri-fit socks and honestly I did not feel any discomfort for the whole 16 kms. When I removed the socks, I saw that the blisters were there but then at least they did not hurt.


Training
Last year this time I was off the track. I was nursing a knee injury. The doctor said I should stop running. Instead
- I gave myself a 4 month break and started training only around September. That helped.
- I did not run on the road except a couple of runs in December.
- I did not attempt to run fast. I realized I get the pain if I tried to run @12 kmph.
- I also trained on elliptical for stamina.
This year has been a little better so far. No knee injury yet. Though I must say I did feel the discomfort  today when I ran 16 km for the first time this season.
In terms of running @12kmph(5 min /km) the best I did was 5 kms in 25 min back in 2010. Last year was a washout due to knee injury. This season I've been trying to ramp up. Earlier this week, I went up to 6 kms in 30 min. Now that's the benchmark I set for myself. I had a similar run way back in April. But right after, I had one of the worst flu infections. Since then, I've been trying to get there but could not. Last week, I tried eating a couple of bananas before the run and that did the trick. Bananas are a great source of instant energy. I believe I'm going to carry one on my run this time.


I've started clocking 20 kms a week for the last 2 weeks. I think I'll keep that on till October and then increase to 25km or so till end of Dec. Jan will be more about building up the reserves. Hence low on mileage. 

Tuesday, July 03, 2012

Post#2 Working Through Basics

And I thought that I could just walk over to business use case and crack it. Typical developer mindset. Every developer novice or retired thinks that he can develop the functionality in super fast time. Some really great developers do deliver faster than eye can blink, but a vase majority of them just set themselves up for failure. 


I know this lesson as a manager. I learnt it several years ago. Well its time to revisit that. The developer in me stands chastened by the manager in me. Developer me Hates the Manager and the Manager feels exasperated by simplistic life view of the developer.


Step 1 of getting to Accounts Set Up is to fetch the Master Data. That's about 2% of the use case. Of that getting bank data is 20%. Ha! But just implementing that 20% of 2% is such an education. 


Traversing that path took me through so much learning. I learned about getting multiple rows through Spring NamedParameterJdbcTemplate and RowMapper. The RowMapper gets just 1 row. But used in conjunction with List NamedParameterJdbcTemplate.query(dbCon,Map,RowMapper) it can fetch multiple rows.


While developing the code I researched the net several times. The top 3 sites I've constantly found useful are
StackOverFlow.com trouble shooting and quick ref
CodeRanch.com for trouble shooting and quick ref
mkyong.com For good hands on learning
viralpatel.net Spring MVC concepts  Desis contribute to the world too :)
krams915.blogspot.com Great Learning Experience on spring MVC security
roseindia.net 101 for beginners


In the ancient web development world of servlet and jsps (back when I last coded). This would be a 2 step process. 
Step 1 - You have a controller servlet which works as the traffic cop (authentication and authorization) and then sends it over to the jsp.
Step -2 The jsp would invoke all the pojo's needed and you'd use jsp tags to render the page. All reusable jsp was stitched together using jsp:include. You had to take care of closing the db connections (you could write util classes that addressed the connection leakage issues). And you'd be done.

In this new world everything is encapsulated. The frameworks are Robust but the learning curve is steep.
So 
- I created a controller using @Controller. Added @RequestMapping
- I set up Spring MVC Security and created authorization levels (Took a lot of time)
- I configured the web.xml and server.xml for db connection.
- Updated  dispatcher-servlet with pojo wirings
- Wrote the jsp

Midway I changed some packages and used application refactoring to update references. Well its not foolproof because somehow it forgot to update spring-security.xml and the server refused to start up. Some head banging got it resolved.

So now finally I can see the masterlist of banks! Hurrah! 



Sunday, July 01, 2012

Post#1 Sunday Blues

I have been working on Spring and learning Spring MVC to build the site on. I've created the Master Page Template. Choosing the colors is fun and also time consuming. Its like my daughter choosing colors for her coloring app on her ipod Touch. Anything goes. You keep choosing colors and changing them trying to make things better.

I finally settled on Green. Chatak Green :) Ha Ha! White, Green and Gray. With a little sprinkling of Yellow, Red and Orange. No Blue! eh!

The next challenge was to reuse the template across pages. Only the central content will change. How do you achieve this? I wondered off on the web. The age old technique is to use jsp: include. It works. I used it a lot about 10 years ago. But its outdated now. One of the programs I run in office uses Wicket(I just sign team leaves and look at weekly reports) and so I tried reading up a bit. I then meandered to Velocity, Tapestry and finally settled on Apache Tiles. For the simple work I'm doing Tiles is just fine. Its a little old. Wicket is popular and good but then I want to use Spring MVC. So Tiles it is. 

Started on Tiles and set it up on Friday. Worked on it yesterday. Finally I'm done. Its working to my satisfaction. Hurrah! Learnt a new thing and used it.

Then came the crash. Today morning when I left for the gym, I had left the laptop on. The cleaning lady came and switched off the power. After I returned from gym, I had my bath and then breakfast. It was time now to get cracking on Login Use Case. I settled down at my desk only to find out the battery had drained and the Laptop had switched off. I cursed the maid silently and fired up the laptop only to find an error. Spring was unable to load from the application. Aaagh! I tried refreshing the project, copied spring-mvc in the lib again but nothing. Out of frustration, I uninstalled Tomcat and reinstalled it. That worked. My app came back up.

I worked a bit on the login page and when I tried testing it, the datasource will not be found. When uninstalling Tomcat, the server config files were deleted. Of course I had no backup. Aaagh Again!

I had forgotten how to set up datasource, as I did it way back in december. Anyhow, I spent a good 3 excruciating hours setting up the datasource. Whatever  I did the error won't go. After tearing out a few hair, I finally figured out the in the new datasource name I had one alphabet in Caps while JNDI name I was using in my util class it was not!

A throwback to my developer days. Anyhow its solved now. The login usecase main flow is half done. I'll close it before I move on to business use case Accounts Set up.

Daily Diary

I've been struggling to put together my site for some time now. I made great progress last year in December. I got the conceptual part done. But for the last 6 months, I've struggled and my efforts have sputtered poorly.

The challenge for me is that I'm outdated. I even admit it in my profile :). I've been out of touch with technology for a very long time. The last I worked hands on on Web Technologies for about 6 years ago, that too was a brief stint of about 2 months. It was perhaps 10 years ago I last did anything substantial. And you know what, the world has changed a lot since then.

The last 6 months have been a challenge. I did put together something using, basic jsp just so that I could get the concept tested but that was that. I could cover a lot of business use cases in just 10 days (Xmas Holidays). But since then its been an uphill task. But then its been a great learning journey.

Lets look at the stuff  I'll have to learn to deliver my dream.
- IDE Eclipse.
- css 3
- jQuery
- Ajax
- Spring
- Annotations
- Spring MVC
- My SQL Database
- Apache Tiles (I thought of using Wicket but Tiles is enough for my app)
- json

This weekend I again got some traction. But I'm afraid I'll lose the momentum soon. How do I keep myself motivated? Its easy to lose the way in the daily humdrum. The work sucks! It also sucks life out of me. Long hours and constant pressure leave little time to spare. And yet I've been able to keep up with the gym schedule for 2.5 years now.

It became possible because I refused to take calls in the morning hours. I refused to take my phone to the gym. While one hour of gym is just dandy, working on a project of this scale is different.

Its not like anyone is helping me with either learning or development. I've got to learn and build everything on my own. Ah! Its a pipe dream. But I'll get a working model out by the end of the year. At least thats the plan.


So back to the question, how do I keep myself going? By keeping a daily diary to keep track of this voyage.
I'll write as often as I work on the project. I'll rant about by frustrations, learning, disasters and recoveries progress or the lack of it.

Lets see how it goes... It all begins today 1-July-2012...