Category Archives: Programming

Quickly open the source of a Python module from the command-line

Add this to your .bashrc: pysource() { $EDITOR $(python -c "import ${1}; import inspect; print inspect.getsourcefile(${1})") } Your favorite editor should pop up and you can browse the module source. If you want to open a module from an existing … Continue reading

Posted in Programming | Tagged , | View Comments

Trac Math Plugins Galore!

I’ve decided to put my Trac plugin hackery knowledge to use. This past week I became the official maintainer of the TracMathPlugin. This is a plugin we use on our Trac installation at work which lets people enter in Math … Continue reading

Posted in Programming, Python | Tagged , , | View Comments

Speeding up SQLAlchemy collections with innerjoin

Recently I’ve been working on a project wherein we rewrote a body of code whose architecture was… well, less than ideal. We took a mess of an object model and built something more elegant and structured. The new code design … Continue reading

Posted in Python | Tagged | View Comments

Eclipse, Python, and file extensions

So I’ve recently been giving Eclipse (and PyDev) a try for developing Python. Despite my initial hesitation of switching away from Vim, I’ve found it to be quite productive. My text editing speed is not nearly as good as in … Continue reading

Posted in Programming, Python | Tagged | View Comments

Easy context managers with contextlib

Do you ever use some functions in Python that you wish had a context manager, but do not? Are you too lazy to write one? Then use the contextlib module! I often need to work with gzipped files, but unfortunately … Continue reading

Posted in Programming, Python | Tagged | View Comments

enzyme.vim – A Terminal.app friendly color scheme

I finally got fed up of not being able to read code in Terminal.app when it was being highlighted in Vim. It seems no matter what color scheme I used, there was always some text that I couldn’t see properly. … Continue reading

Posted in Programming | Tagged , | View Comments

Method over technology

Derek Sivers of cdbaby.com has posted an interesting editorial piece on the O’Reilly Ruby site regarding his switch from Ruby on Rails back to PHP. It’s caused quite a storm of discussion on slashdot. While some people think it really … Continue reading

Posted in Programming | View Comments

WebCT (in)sanity!

Anyone who’s had to use WebCT for any of their courses knows that it’s a complete abomination of all that is holy with regards to web applications. Sometimes it seems like the developers go out of their way to make … Continue reading

Posted in Personal, Programming | Tagged | View Comments

Presenting: latexmath2png

So as my internship is winding down and I have finished my projects, I’m left with not much to do around the office. Today I decided to ssh in to my workstation at home and do some cleanup of my … Continue reading

Posted in Programming, Python | Tagged | View Comments

Python and the joy of programming

Recently since things have got pretty slow at work as my term here is winding down I’ve got back in to Python programming. It happened purely by coincidence, or rather several factors coming together. I’ve been reading Paul Graham’s articles … Continue reading

Posted in Programming, Python | View Comments