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

Programming - A Gateway Drug to Math

I decided to try my hand at the Stanford’s AI Class. The pre-requisites mentioned Probability and Linear Algebra. So I started watching Probability videos on KhanAcademy. Sal Khan was teaching how to find the probability of 2 heads when you toss a coin 5 times. A classic nCk problem: The probability of getting 2 heads while tossing a coin 5 times is: But I wanted to find out the probability of getting at least 2 heads when I toss 5 coins....

October 4, 2011 · 1 min

Rant about C++ dependency hell

When was the last time I vented about C++? The answer for that is always: “TOO LONG AGO”. The initial friction to setup a substantial project using C++ is unfucking bearable. When we started code revamp at work recently, I decided to be a good citizen and decided to incorporate cpptest, a unit testing framework in our project. It made me realize how unreasonably complicated Makefiles can be. After 3 hours of peeling away at the complexity I managed to add cpptest to the build dependency of the project....

October 4, 2011 · 2 min