List to dict

22/06/2009

Nifty one liner.

l = ['a', 10, 'b', 20, 'c', 30]
it = iter(L);
d = dict(zip(it, it))

No Comments

Facebook Purity

28/04/2009

So are you fed up with the new Facebook layout and the quiz spams. Install:

Facebook Purity.

Nirvana :)

No Comments

xmltramp and SQLAlchemy

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

No Comments

Quick way to check if all elements in a list are equal

18/03/2009
all(x == L[0] for x in L)
No Comments

Vimperator

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.

No Comments

Indian news on Reddit.com

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.

No Comments

Code to build up a dictionary of config file key/value

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']
No Comments

Das Keyboard

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.

6 Comments

Zenburn theme

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

No Comments

Law enforcement agencies now advertising in facebook….

19/09/2008

Are we moving towards a police state?

No Comments