Monday, April 18, 2011

Size of objects in Python

struct.calcsize(fmt) - only gives size of fixed data types given by fmt
sys.getsizeof(obj) - (added in Python 2.7) gives the size in bytes of builtin types, but not the actual used memory
pympler.asizeof(obj) - gives the actual memory the object uses

Monday, April 11, 2011

Multiple logins to the same site

Multifox is a great firefox add-on that allows you to switch between multiple accounts on the same site (Say you have two facebook accounts and you need to switch between them and are tired of logging out and then back in again). It's user interface is simple and effective.

Diff files in eclipse

From here:
  • Add the two (or more) files you want to diff to your workspace.
  • Select all the files you want to diff.
  • Right click on one of the selected files and chose "Compare with -> each other"

Tuesday, April 5, 2011


Whenever I submit a job to the computing cluster I have to smile and wonder if the folks at Platform Computing planned their command naming very carefully so that one of their commands would endup as "bjobs".

Thunderbird bug

If new mail comes in and goes through a filter and into a folder, if you are viewing that folder, the new mail does not appear until you view a new folder and then go back to the old folder.

Sunday, April 3, 2011

Writing to NTFS partitions from Mac OS X 10.5

Use NTFS-3G. It did something odd to my Finder, but after I restarted the computer as recommended things went back to normal, though there was a longer than usual start-up time.

Install multiprocessing module for Python 2.5

The great multiprocessing module was included in the Python 2.6 distribution. If you need to use it on a box with Python 2.5 with no root access then do this:

From here download the package. And then install in user space by doing

python install --home=~