Wednesday, July 7, 2010

Seek the problem, Not the Solution

It’s not uncommon to have problems in life, and so in the application/code that you write. I am not being too techie here.
It’s just I am relating my thoughts to something technical.
Being a software engineer, writing code is inevitable in my day-to-day life and so comes bugs :)
I spend a lot of time sitting on to solve bugs(of late it’s been eating away my head) and so do I see people around me, at my workplace, doing the same.

I always go in seek of the problem that caused the bug, rather than to find a solution for the bug.
Certain others go in seek of the solution for the bug, rather than the problem that caused the bug.
So am I not saying the same thing in two different ways….solving the bug!!!!
But they are not…at least for me :)

Seeking for the problem gives you the solution for the bug and also a better understanding of the code that you have written. You seek for the problem because you feel the mistake is at your part, maybe a implementation one or a logical one.
Seeking for the solution too solves the bug but does not give you a better understanding of that you have done. Mostly the solution might be a workaround to cover up some of your own mistakes, which went unnoticed, as you were too concerned of the solution for the bug and not the problem for the bug. This might really not solve the bug too, it might just be a temporary fix or a specific scenario fix.

This is just an example.
Same goes in the day to day life. Whenever you go in seek for solutions you are actually creating more problems for yourself.
Maybe a real life example(non technical :)) would do good.
Say you are a spendthrift and you keep spending away all what you get.
Need money urgently?? Solution is to borrow from your friend. Does it really solve the problem??
Nope !! The problem here is that you are spendthrift. So try to change that and not keep borrowing :).

Don’t be happy with the solution, hunt down the problem.
Happy hunting :)

Saturday, July 3, 2010

Hero or a Cheat????


Luis Suárez....that name would be said few more times, at least till Uruguay's fate is decided in FIFA WC 2010.
Early Saturday morning(IST),witnessed some dramatic moments of WC 2010.With the game about to be pushed into the shootout,which it did end up eventually,Ghana was to score a goal of substitute Dominic Adiyiah's header which was denied by Suárez with his 'hands'.The drama ended as Asamoah Gyan struck the crossbar for the penalty awarded and the match moved on to shootout,which saw Uruguay through to the best 4....shattering the African hopes.
Is he a Hero or a Cheat????
Wasn't it something anyone would have done?
Wasn't that a reaction rather than a response to a situation?
Ghana could have scored in the penalty awarded.But is just a penalty enough instead of a sure shot goal?

Would it be the next 'Hand Of God'??

Hero Or Cheat,fouls are committed knowingly and unknowingly in any game,as in football,as in this dramatic game.

So the play goes on says referee and so does Uruguay without him into the final 4

edit: Not too far says Netherlands,putting an end to the Uruguay's tale of WC 2010

Thursday, July 1, 2010

Synchronize SQL Server database objects


Updating an old database, with newly created/modified database objects(mostly stored procedures,views,functions and table value parameters), from a new database was a very common,tedious,error prone task that was performed at my workplace for the past few months.This came up with the client requesting to retain their existing data and just make updates to their old database from our development database(which of course is the new/latest one), whenever a deliverable was made.
When the very work I do is to automate peoples work,I felt perturbed seeing this being done manually.So decided on to automate it :)
Writing SQL scripts would be db expert way I guess.But I am no expert in that so decided to do it in my way.
The .Net way :)
Thanks to the whole concept of .Net and Microsoft for having exposed such complex functionalities in the most elegant way ..... SMO(SQL Server Management Objects).
You have to add a reference to Microsoft.SqlServer.Smo and a few other assemblies(Check the source code for more details).
Rest everything the API provides.

Code quality might not be that good.Just did it in an hour :)
A help is there within the app.

Thanks to .Net once more :)

Download the source code (rename to .rar)