6/10/2009
Nifty transaction decorator to be used with SQLAlchemy methods. Taken from: IBM developer site.
Code sample:
def transactional(fn):
"""add transactional semantics to a method."""
def transact(self, *args):
session = Session()
try:
fn(self, session, *args)
session.commit()
except:
session.rollback()
raise
transact.__name__ = fn.__name__
return transact
28/04/2009
So are you fed up with the new Facebook layout and the quiz spams. Install:
Facebook Purity.
Nirvana 
17/04/2009
So lately for bunch of jobs, I have been required to parse and work with bunch of XML which contains lot of SQLAlchemy serialized values.
After fighting with all the XML based parsers for quite sometime, I finally found xmltramp. A great tutorial is available here.
It simple, concise and does couple of things but in a great way. Really love its XML to Python object translation.
On top of xmltramp, I wrote a simple SQLAlchemy ORM serializer/deserializer. Almost looks like a hack now but it works so I am happy.
http://bitbucket.org/beamtous/sandbox/src/f0301bb4425d/xmltramp/test.py
18/03/2009
all(x == L[0] for x in L)
12/02/2009
If you love using VIM and want a similar experience in your browser:
Vimperator. They even have muttarator though that only works with Thunderbird 3.0 and above. Will need to play around with that too.
24/11/2008
Good to see that some Indian news is making headlines in Reddit.com.
Some good asskicking.
Hopefully, this will generate enough interest in Indian people to show the duplicity and hypocrisy of Indian media.
31/10/2008
The following code generates a dictionary of all key/value in a configuration file.
import ConfigParser
config = {}
cp = ConfigParser.ConfigParser()
cp.read('test.cnf')
for section in cp.sections():
config[section] = dict(cp.items(section))
print config['section1']['key1']
30/09/2008
In an attempt to have the best programming environment setup, I ordered the Das Keyboard ultimate.

I simply love the mechanical sound it makes.
BTW, VIM+Python rocks 
Soon a post of what I have done to improve my Python coding with VIM.
20/09/2008
If you are somebody who spends 12+ hours everyday with VIM and Konsole, you have to use this theme for both.
Vim
Konsole