Tag Archives: python

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

Python Global Interpreter Lock (GIL) explained – Pycon Tech Talk

Today I saw a amazing tech talk on the much debated topic of python Global Interpreter Lock a.k.a GIL. Python’s Global Interpreter Lock or GIL is probably one of the least properly understood parts of python, but is extremely important … Continue reading

Posted in Tech talks, Video | 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

Generating all possible permutations of a sequence.

P.S. – This Post is intended for people who want to know a simple,efficient approach to generate all possible permutations for a sequence.For real world software I would recommend using standard library functions. All of us at some moment while … Continue reading

Posted in Algorihtms | Tagged , , , , , , | 2 Comments