
Latest posts
WhatsApp Top Posters
A few years ago I joined a CTO WhatsApp group. I think I was the 14th person there or so. These days this group has more than 270 members. It is an amazing group, with a lot of valuable content. People have repeatedly asked for an easily searchable index of the group’s history, and at…
My method of learning a new (natural) language in 5 points
1. A habit is better than a burst I am a strong believer in building good habits. My approach to language learning (and also fitness) is that it’s better to do a little every day, than a lot just once. A corollary is that it’s easier when you add your language learning to your day-to-day…
Read more > My method of learning a new (natural) language in 5 points
Teaching my son to h̵a̵c̵k̵ win at Mastermind
Recently my 4.5 year old son started playing “Mastermind”. This is a game where one player picks a 4 color code, and the other player has to guess it. After each guess, the first player lets the guesser know for how many colors both the color and position were correct, and how many only the…
Favourites
Rhyme and Reason with Python
After reading xkcd’s blog, I went to LimerickDB.com. It looks and works just like bash.org, but for limericks. Quite amused with some of the limericks available, I wanted to try and compose my own. The first one came out fine, but I got stuck without a rhyme for the second one: a man named guido…
Manually fuzzing my own compiler
As I mentioned before, I had to write a compiler for simplified CPL. An obvious requirement was that the compiler generate correct code. A less obvious requirement, but important none-the-less, was that after a syntax error, the compiler will keep parsing the source program. Now, the default behavior of a parser generated by Bison for…
Fractals in 10 minutes no. 3 – The Dragon
When first I looked through the pages of the book “Hacker’s Delight”, I found myself looking at the chapter about bases. There I learned a very curious fact – with the digits of 0,1 and the base of -2, you can represent any integer. Right afterwards I learned something even more interesting – with the…
Fractals in 10 minutes No. 2 – Recursive Spring
Imagine a straight wire. Bend this wire until its ends meet. You get a ring. Next stage. Take another straight wire, bend it as before, but this time, don’t let the ends meet, instead continue bending the wire more and more, until you get a spring. Now, Think of this spring as the first wire,…
Python module usage statistics – Cont.
Well, very embarrassingly for me, turns out I had a bug in my original post and code. As per Doug’s suggestion, I tried running the script I wrote on the standard library, and got results I didn’t quite believe. So I checked them, opened socket.py, and there was an “import _socket”. However module “_socket” was…
Python module usage statistics
IMPORTANT UPDATE: The code I used to create these statistics had some bugs. The fixed statistics are available here. After reading Doug Hellman’s post about python stdlib modules he needs the documentation to, I commented there that I need the documentation for logging because I don’t use it too frequently. Later, I thought a little…