Tag Archives: code

PDB style function backtrace in python using Inspect module.

A while back I had a conversation with a friend of mine, which went something like this(with some paraphrasing). Friend : Hey, is there a way in python to display the function calls which end up calling a certain function, … Continue reading

Posted in code, hack | Tagged , , , , , , , , | Leave a comment

notify.sh: Get notified when shell scripts go wrong.

TLDR: Project Summary: Can be used to automatically suspend execution of a shell script if runtime error occurs, followed by notifying the user who started the script. The suspended script can be easily resumed later by the user. This is … Continue reading

Posted in code, hack | Tagged , , , , , , | Leave a comment

Workaround for google app engine’s – File not accessible error using virtualenv

Google App Engine comes really handy for devs who want to host their application idea/hack on google’s infrastructure without having to spend any $$ for it (and the resource limits are pretty descent for free account). No wonder it is … Continue reading

Posted in code, troubleshooting | Tagged , , , , , , | Leave a comment

Find Kth minimum element in a unsorted array

Some days ago while interviewing a candidate, I asked the candidate a very easy by the book interview question. Design an efficient algorithm to find the 2nd smallest integer in a unsorted integer array of length N, which should run … Continue reading

Posted in Algorithm | Tagged , , , , , , | 4 Comments