Productive Meter

A few weeks ago I decided that I should suck it up and start learning how to develop for the web. After asking around, my faithful community brethren, I decided to learn Django from its docs. ::Django documentation is awesome:: Around this time I came across this post about Waking up at 5am to code. I tried it a few times and it worked wonders. I’ve been working on a small project that can keep track of my productivity on the computer....

February 9, 2012 · 1 min

Picking 'k' items from a list of 'n' - Recursion

Let me preface this post by saying I suck at recursion. But it never stopped me from trying to master it. Here is my latest (successful) attempt at an algorithm that required recursion. Background: You can safely skip this section if you’re not interested in the back story behind why I decided to code this up. I was listening to KhanAcademy videos on probability. I was particularly intrigued by the combinatorics video....

October 17, 2011 · 2 min

Python Profiling

I did a presentation at our local Python User Group meeting tonight. It was well received, but shorter than I had expected. I should’ve added a lot more code examples. We talked about usage of cProfile, pstats, runsnakerun and timeit. Here are the slides from the presentations: Download profiling.pdf The slides were done using latex-beamer, but I wrote the slides in reStructuredText and used rst2beamer to create the tex file which was then converted to pdf using pdflatex....

October 13, 2011 · 1 min

Rapid Prototyping in Python

I was recently assigned to a new project at work. Like any good software engineer I started writing the pseudocode for the modules. We use C++ at work to write our programs. I quickly realized it’s not easy to translate programming ideas to English statements without a syntactic structure. When I was whining about it to Vijay, he told me to try prototyping it in Python instead of writing pseudocode. Intrigued by this, I decided to write a prototype in Python to test how various modules will come together....

September 25, 2011 · 3 min

Scripting Tmux Layouts

Tmux is an awesome replacement for Screen. I have a couple of standard terminal layouts for programming. One of them is show below. Vim editor on the left. Top right pane has the bpython interpreter. Bottom right pane has the bash prompt. I have a small tmux script in my ~/.tmux/pdev file that has the following lines selectp -t 0 # Select pane 0 splitw -h -p 50 'bpython' # Split pane 0 vertically by 50% selectp -t 1 # Select pane 1 splitw -v -p 25 # Split pane 1 horizontally by 25% selectp -t 0 # Select pane 0 In my tmux....

August 3, 2011 · 1 min