Friday, December 22, 2006

Reload modules in Python environment

You create a module and run it using the python interpreter. Now you modify this module and try to run it again, surprise surprise, the new changes are not reflected.

What really happens:
The python interpreter loads modules as and when they are used in a script. Once these modules are loaded they are cached in memory for reuse later. Now if you modify a pre-loaded module and try to run it, the interpreter does not bother loading it again as it already has a cached copy.

One technique that i have used effectively for (indirectly) reloading the modules is to delete the module object from the cache. This forces the interpreter to reload the module when it executes the script again and you can test your new changes easily.

How its done:
The interpreter caches the module objects in a PyDictionary (a map) called the sys.modules. This map stores the module objects in the following format:
key : the fully qualified class/module name
value : the actual module object

The basic trick here is to delete the required object from this map and your jobs done.


if "<the fully qualified class/module name>" in sys.modules.keys():
<the fully qualified class/module name>"]

line 1 : test if the module exists in the cache
line 2 : actually remove the module from the map based on its key

Say, you want remove the module "com.test.testfile" from the cache.

if "com.test.testfile" in sys.modules.keys():

Put these lines of code after the import statements or before you make a reference to your changed module, this ensures that the module is reloaded before execution.

There may be better ways of reloading modules but i found this most effective when working with a system which contains a lot of scripts.

Tuesday, December 05, 2006

bug tracking tool

right so the last 2 days i have been working on setting up a bug tracking tool for my boss. Some how i knew that one of these days the idea of acting smart was going to backfire. ;) ;) So here was my boss telling me how he was confident that i would help him out with setting up a bug tracking tool for his new project.

nways i got down to the task and did a bit of R&D on the different issue/bug tracking tools and here's what i found:

jira - if you have the cash, the best tool in the market

bugzilla - the king of open source and free tools, its heavily loaded but complex to setup, plus its written in perl

roundup - python based and quite good

But the ones i picked :

mantis - PHP based but simple to work with, its also called the unofficial 'light-weight' bugzilla

JTrac - Java based, not very impressive UI but ideal if your target audience is small. Best part is that its demo version is quite good. It has embedded jetty web-server and HSQLDB at the backend. You can be up and running in minutes, plus maintaining it is quite simple.

i'm sure you guessed what i used to impress my boss. Simple but working is still the flavour of the day. :)

Thursday, November 16, 2006

Wednesday, November 15, 2006

trekking spree over the weekend

My last weekend was quite an adventurous one.

On sat i went to bhimashankar. This was one place which was on my wish list for quite sometime coz i was under the impression that it was a nice place to go to. I mean so many people had spoken about it that i just wanted to check it out for my self. So on sat i did get there along with 2 of my office mates. It turns out that a lot of things said about bhimashankar is plain hype. The place is average considering its attractions viz. the shiva temple, the adjoining forest with its rich wildlife (although all i could see was hordes of butterflies and monkeys, thats it). Overall a nice place for a one day trip/picnic esp. during rainy seasons as the place would be covered with a thick blanket of green.

On sunday, i went trekking to kothaligad. This place is a long way from pune, infact its close to karjat and takes min 2/3 hrs to reach depending on the vehicle used. Since we took a (slow) bus, it took us, adding up all breaks and stops , approx 4 hrs to get there. But thats where the boring part ends. Getting on top of this fort comprises of one of the most amazing and strenous climbs. It takes on a avg 1-2 hrs to get on top of the fort. Excellent if you are trying to get that tummy in. At the end of the 2 hr climb my limbs were crying hoarse. There is not much to see in the for as such since it was just a storage house for food and water but the whole process of getting there is quite amazing. On the whole it was awesome fun and a welcome change from my routing lifestyle.

Looking forward to more trekking weekends from hence forth.

Thursday, September 07, 2006

How to interview?

    A good article on how to interview new candidates. Its much better that the numerous sites which give you a whole list of questions to ask right from whats 1+1 to what is cross-correlation. The basic idea is that you test a persons ability to solve problems,identify his approach, style of work, his eagerness to be discover new things, is he innovative, is he passionate about what he does, etc and not question him on hard facts which can be searched on the web in seconds.

    This article talks on similar lines. We want to recruit good enterprising personalities and not skill sets which will become obsolete in due time.  Its easy to find skill sets but a challenge to find talented people and a bigger challenge is to retain them.

    More on the retaining stuff in a future blog.

Tuesday, August 29, 2006



 Computer Game: Spacewar
 Registered Domain :

 ..... more later

Thursday, August 17, 2006

Metcalfe's Law

DEFINITION - Metcalfe's Law is expressed in two general ways:

1) The number of possible cross-connections in a network grow as the square of the number of computers in the network increases.

2) The community value of a network grows as the square of the number of its users increase.

The original statement from Robert M. Metcalfe, inventor of Ethernet, was apparently (according to one source):

"The power of the network increases exponentially by the number of computers connected to it. Therefore, every computer added to the network both uses it as a resource while adding resources in a spiral of increasing value and choice."

Metcalfe's Law is often cited as an explanation for the rapid growth of the Internet (or perhaps more especially for the World Wide Web on the Internet). Together, with Moore's Law about the rate at which computer power is accelerating, Metcalfe's Law can be used to explain the rising wave of information technology that we are riding into the 21st century.

India IT performance for the yr 05-06

Indian software and backoffice industry generated $23.6 bln in fiscal 2005-2006 by ZDNet's ZDNet Research -- India's software and backoffice services industry recorded 33% growth in export revenue to $23.6 bln in the year to March 2006. This included $6.3 bln from services like call centres, payroll processing, claims management and high-end financial analytics. Including the domestic market, the sector expanded 31% on year to $29.6 bln. Overall software and services [...]

Monday, August 14, 2006

Life vs. Blogs....v2

Well if you remember my earlier blog on life vs blogs, i had said that blogs don't let to edit things once blogged. Although this was true for first generation blogs, now days all blogger sites allow editing. I guess they realised that we being humans are so error prone that we always need that second chance. So much for comparison between life and blogs. :-(

Monday, July 24, 2006

Future of Networking: Human Area Network (HAN)

   The biggest challenges with wireless n/wing is that in multi-user scenarios its performance is quite abysmal, in fact the performance is inversely proportional to the no. of users i.e. as the no. of users increases the performance goes down. So how does one counter this limitation? Do we move back to wired commnunication? Didn't we just patronize wireless because wired n/ws are cumbursome to setup and manage plus the sight of zillions of cables is quite overwhelming. Also wired n/wing doesn't sound too well when we talk of 'Ubiquitous computing'.

   Okay here's a hint, imagine if we could simulate wired communication with the only difference that the medium (i.e. the cables) is dynamic in its type of material (i.e. wood, water, pads, etc.) or is the user of the n/w itself (i.e. our body). Research is going on towards developing devices which could be connected simply by touching them or keeping them on a table or on a mat. This is the principle behind HAN or Human Area Network. Infact they are all set to launch prototypes. For a through understanding go thought the following site:  redtacton

Sunday, July 23, 2006

few wi-fi related keywords

Wi-Fi - Wireless Fidelity (fidelity - accuracy of signal reproduction)

IEEE - Institute of Electrical and Electronics Engineers

IEEE 802.11 - IEEE standard for Wi-Fi or Wireless LAN (802 - founded in feb, 1980; 11 - 11th working group)

CSMA - Carrier Sense Multiple Access (senses the if the carrier is free for transmission and only then transmits data, reduces effective data rates to ~50% of max. capacity of standard)


1. WEP - Wired Equivalent Privacy, first attempt at secure wireless n/wing, good against casual snooping

2. WPA - Wi-Fi Protected Access, 2nd generation system to overcome the flaws of WEP

My rendezvous with Wireless technologies

    I have always been intrigued with wireless networking and luckily my interests have always been well fed by unintentional events. e.g. i recently bought a compaq laptop (my first ever) which had wifi and bluetooth by default. Being a traditional desktop user these technologies were quite foreign to me and like a true rigid being i avoided adopting these technologies. But for how long??? Fortunately peer pressure forced me to take the plunge and this is what i was able to conjure:

   Not very surprisingly the first technology i embraced was 'Bluetooth'. Actually I am not sure why this was my first choice, may be coz blue is my favourate colour or maybe coz its the latest buzzword in mobile phones. I think later was more motivating. Well i got a friend's mobile phone which was bluetooth enabled and setup a quick n/w and transferred data between my laptop and his mobile phone. Its that simple! With this done i took a step forward and checked out all info on the net. Bluetooth is a promising technology but i was quite disappointed by its distance limitation, althought the idea of a cableless desktop is quite cool i.e. using bluetooth or infrared devices to replace the data and control buses in computers. Nways i moved on the Wi-fi.

   Now Wi-Fi was the real thriller. It did not have any distance limitations (offcourse using repeaters) and was more user-friendly or shall i say more networking friendly. What i mean here is, u could actually buy wi-fi components and setup a wireless network at home.
   My first experience with Wi-Fi was when i used my laptop for surfing in a wi-fi zone. The idea of comfortably sitting on a couch, drinking coffee and surfing was a real treat.
   My second experience was more meaningful and satisfying. Basically i wanted to backup a lot of data from my desktop to my laptop. After evaluating a lot of options i was particularly attracted towards the idea of setting up my own wireless n/w at home. So i went out shopping and bought a wireless usb adapter by linksys for my desktop. After struggling with it for 2 days i was finally able to setup an adhoc n/w and voila!!! Although this might have been the most expensive option but it was truly the most awesome one, worth every penny i spent.

LESSON LEARNT: 90% of the times we refuse to embrace a new technology because of our  Laziness and not because of its demerits, so get up and get going!!

Wednesday, July 12, 2006

Italians won!!

I know this is a bit late but THE ITALIANS WON THE WORLD CUP!!!!!!!!!!  HURRAHHHHHH.......... and the Germans came 3rd HHUUUUURRRAAAAAAHHHHHHH !!!!

Friday, July 07, 2006


ok i know its been a long time since my last blog but u can't blame me for it. Blame the WC. Its been one of the best tournaments so far and if you saw the Germany Vs Italy game, phew..... can't imagine i have to wait another 4 yrs for this event to take place again. Nways there is still the final to be played and i got my eyes and heart set on the Azzuries. Go Italy go......

Sunday, May 14, 2006

what the #$%# is wrong with the formatting??

one thing that i would want to change now is the formatting of my previous post but i just can't....... ;)

Life vs. Blogs

It’s unfair. What you blog cannot be unblogged. Although technically this is a miniscule task to solve I wonder why all blogger sites insist on not providing the delete or modify feature. I guess this is got something to do with the human attitude of wanting to go back and change things once they are done.

To think of it, blogging is almost like life, once done it cannot be changed!! There are so many things in life that you want to go back and change, may be for good or worse but you just can’t. Probably blogs try to emulate the same. They insist that what’s been posted once cannot be modified. This actually can be a good tool for introspection. People do a lot of things on the spur of the moment, right or wrong but at that moment they do things rashly, without thought and it’s only later when the moments long gone and the situation is way beyond control that they try to re-evaluate the implications of their actions.

So let’s try to use this tool to improve ourselves, let’s always try to understand the repercussions of all our actions and let’s work towards getting things right the first time around. Life doesn’t give you a second chance so easily, neither do blogs.

Sunday, May 07, 2006

its 'marriage' and not 'marraige' or 'marrige'

NOTE to Self:

1. Never write ur blogs when ur frustrated

2. Type slowly

3. Improve your spellings

4. Stop using copy-paste; they just propagate the error u made the first time

 .... and lastly.....

5. Use spell check, that’s what it is designed for..... ;)


    Today I had to attend a usual cliched marrige. When i got there i was, not so surprisingly, suffering the usual predicament: unknown people, mom introducing me to infinte amount of old people who could barely recognise me but were hyperexcited nonetheless, etc. One strange thing about the entire setup was the mass quantity of Nehru topi clad men, a little snooping around and it was revieled to me that the girl's dad was local politician. Hmmmm.... that explains!!! No wonder immediately after the garlands were exchanged these guys made a run to the food section and picked prime seats in the pangat . Losers!!!

    Nways, even though i hate politicians more than marraiges this is not the time or place to discuss them. Ok to continue my story, so i went on to the stage met the couple, cracked my usual jokes about newly married couples, et al. Down from there, i made a run for the food section ;) (hey thats the only interesting thing to do in such occasions). The plan was to have a quick lunch and get out of the place but plans are meant to be thwarted and thats what my mom did. She met a few other ladies she knew and they decided to chat till eternity.

    Finally after hours of prompting and making funny noises and faces my mom took the hint. Thankfuly after that we had a quick lunch, congratulated the parents, the couples and other hordes of people how directly or indirectly influenced the marraige and made a run.......

    A not so interesting expedition finally came to an end after 3 hrs...
    Long live the tradition of marraiges.....

Wednesday, May 03, 2006

testing performancing plugin for firefox

Although i have been using a different plugin all this while for updating blogs even this plugin seems to be good enough. Actually the UI is much better.

Need to finalize on either one of these.

Monday, May 01, 2006

Mobile data card

Today i got my Reliance Mobile Data card, another beauty of the wireless world. Frankly i used to get terribly frust when the lights used to go out in the afternoon on weekends. I mean whats the use of a laptop if you cannot browse the internet just because you don't have electricity to power your modem!!

Well now i can actually have some undisturbed browsing time, lights or nolights!!! Thenga to the MSEB!!

Thursday, April 27, 2006

quick relook

testing my resolve!! again!!

i am back!!

ok so i am back!!!! Almost after a year!!! Yiiiiippppppppppyyyyyyyyy!!!!!!!!!!

I always knew that i was bad at writing down things, infact i am outright lazy, just can't motivate myself to sit and write stuff and my first attemp at writing blogs just proves that. Nways now i am back with renewed vigor and pledge to update my blog everyday (atleast i hope ;)).

So what brings me back to blog writing and makes me so confident that i will be able to update my blogs regularly. Well the difference is firefox and its amazing blogger plugin. I am totaly in love with firefox - the flexibility and customizability it provides through its numerous plugins is just fabulous. The latest addition to the my collection of plugins is the blogger extension "Deepest Sender". Although it has a wierd name but its quite awesome, the fact that i don't need to go to the website just makes my task easier. The integrated blogger tool is made just for lazy bums like me.

N'ways lets keep our fingers crossed and HAPPY BLOGGIN!!!