Monthly Archives: May 2011

python Fibonacci list

The Fibonacci sequence in python looks something like this def fib(n): if n == 0: return 0 elif n == 1: return 1 else: return fib(n-1) + fib(n-2) But expect stack overflows for even small values of n, e.g., fib(60) … Continue reading

Posted in python | Leave a comment

scraping and parsing html

I would like to read J. Krishnamurti books on my Kindle. Unfortunately, no ebooks were available although I did find that jkrishnamurti.org has an extensive collection of books on their website. At present there is no full download, only a … Continue reading

Posted in html, python | Leave a comment

smiley shell prompt, or frown

I've been using the following command prompt for years server ~/dir :) whoami victor server ~/dir :) badcommand -bash: badcommand: command not found server ~/dir :( echo sorry sorry server ~/dir :) It's a smiley emoticon, but only when the … Continue reading

Posted in bash, shell tips | Leave a comment

recursive grep

I am trying to search through all files in a directory tree, perhaps to find a specific function declaration. Ideally I want the exact files and line numbers of every search match. A modern GNU grep contains a "-r" recursive … Continue reading

Posted in shell tips | Comments Off on recursive grep