“We must take [India] as it is” – Jules Verne

I’ve gotten back to reading fiction ever since I got my netbook (review comin up!). Project Gutenberg has been very helpful. Jules Verne’s Adventures of a Special Correspondent was the first one I completed. It is a good book – but not phenomenal. It does have a few very good moments, and one of them hit extremely close to home.

Towards the end, when Claudius Bombarnac rumbles about how the Chinese do not make full use of the engine’s power – always keeping it running at 40 mph even though it could be pushed to do way more.

“I agree with you, but where you have a railway you might as well get

all the advantage out of it that you can.”

“Bah!” said Pan-Chao carelessly.

“Speed,” said I, “is a gain of time–and to gain time–“

“Time does not exist in China, Monsieur Bombarnac, and it cannot exist

for a population of four hundred millions. There would not be enough

for everybody. And so we do not count by days and hours, but always by

moons and watches.”

“Which is more poetical than practical,” I remark.

“Practical, Mr. Reporter? You Westerners are never without that word in

your mouth. To be practical is to be the slave of time, work, money,

business, the world, everybody else, and one’s self included. I confess

that during my stay in Europe–you can ask Doctor Tio-King–I have not

been very practical, and now I return to Asia I shall be less so. I

shall let myself live, that is all, as the cloud floats in the breeze,

the straw on the stream, as the thought is borne away by the imagination.”

“I see,” said I, “we must take China as it is.”

India too, as I see it from where I am, is pretty similar. Practacality can go shoot itself in the head.

What do I gain by copying stuff from the board to the notebook? Nothing, but do it anyway because that is how it has always been done.

Why should I go back 10 years by not using a mobile phone? Because we aren’t good enough to hold your attention long enough, so we are going to force you to not do anything else even if you are going to be bored to death (even if literally).

Why should I use Turbo C, even though it is extremely antique and doesn’t really conform to any standards? Because that is what the people setting the syllabus learnt! (Nothing personal, TC.exe – just that I hope people stop believing Windows was written in Java/VB because you can do GUIs only in those!)

Doesn’t matter if there is a better way, if it is not the way it is done. Conservatism. Bah

I’m talking only from my point of view, from where I have been (apparently) hurt. I am sure this is not the only place – this happens everywhere. Anti-Change Conservatism. Which I am told, is not even the true meaning of the word conservatism. I hope someone sometimes explains to me what the word was supposed to mean, and how it came to represent parents who won’t let their kids out to have fun with their friends.

Good news is, trains in China are no longer run at a max of 40 mph. Change does occur, but it takes time, and hurts those who live during it. We are those people. I hope.

First Binary Dream

I had my first ever dream in binary today.

The cycle moved like this:

Borg -> nanoprobes -> a scene in Minority Report when nanobots go around looking for John Anderton (Tom Cruise), who was hiding in a bathtub full of water -> Will Smith and his Dog cuddling in a bathtub in I am Legend -> the climax of I am Legend when Will Smith blows himself up to save the others -> A column of binary numbers came up, showing state of Will Smith as ‘SAD’ AND MSB FLIPPED TO ZERO, and then he has this epiphany (Realization of God Moment) and becomes ‘HAPPY’ and the MSB FLIPS TO ONE.

WTF? Shouldn’t he be sad when the MSB is at one (Negative) and happy when it is at zero (Positive)?

Note for Non-CS folks: MSB -> Most Significant Bit, the left-most bit in a binary sequence. Usually, setting it to zero means the number is positive, and setting it to 1 means it is negative.

Measure of Learning: Epiphanies per Session

The measure of code quality is WTFs/minute.

I just realized, after a rather intriguing facebook conversation with Shiva, that the only true measure of learning is Epiphanies per Session.

My latest Epiphany was a couple of days back. And the one before that was a month or so back, when I was ‘pairing’ with Sid. I think the one before that was quite some time back – when I understood the true meaning of closures. And a few “Yes, it is not just me” moments when talking with SriramK.

College is yet to give me a technical one. It has given me a lot of emotional ones though. Maybe someone could chuck the totally pointless part of what we call college (the supposedly technical part (where they give you xeroxes of shittily written programs that often don’t compile and give you a banana if you are able to copy it perfectly on to the screen (a task at which, many CS students fail))) and keep just the useful parts.

2010 – The Beginning, the bicycle ride and external dependencies

I was writing a post on how 2009 ended. Here is the tl;dr version: It was my ‘growing-up’ year in Tech, and ‘roller-coaster’ year in personal stuff. There! I’m certainly significantly wiser at the end of 2009, and that is due more to my state at the beginning of 2009 than at the end :) Good enough

So how did I celebrate? By joining the KPP competition at Kurukshetra. That’s what I did at around 12 on New Year’s. Not intentionally, mind you. Just happened.

Then, on 2nd Jan, I did something interesting. On a whim, I took my bicycle, and rode an hour in traffic. Alone. To Marina Beach.

And then I spent the next hour sitting near the waves. Looking around. Just enjoying myself. And then rode back home, and for the first time in over 4 years, slept before 12.

I did it again the next day. With a friend this time. My knees were already killing me since I practically had no physical activity before this. But I still did it again. My knees would literally kill me now if they had a way to.

I’m happy. Teen Angst has taken a break :)

Let this year be the one when I remove external dependencies on my happiness :)

The Python Workshop

We had a python workshop at college a week back.

One hellova workshop it was! Kausik conducted it, and about 14 people turned up (We picked 15, one girl had to miss it ‘coz of fever). Every single one of them was there because they wanted to be there. This happened during semester holidays, so they came to college just for this. And from the feedback (and the actions that followed it) I got, it was worth their while.

Teaching Python

Kausik did all the hard work, with me just going around helping people get unstuck. Watching people when they suddenly get it is a really amazing feeling.

The hardest part for many people was not the significant whitespace (most intuitively got it, we didn’t even have to repeat it once). It was the concept of explicit self. And the biggest (though not exhaustive) selling points were, in no particular order: Lack of the semicolon, no boilerplate code (type declarations, etc) and support for arbritarily large numbers. pointers are conspicous by their absence.

So, what did you guys cover?

Day 1

  • "Hello World!"
  • Conditionals, Looping constructs
  • Functions
  • Lists, Dictionaries and Tuples
  • Basics of OOP (Classes, Objects, and explicit self)

Day 2

  • Using Google to find docs
  • The datetime module
  • Using easy_install to install external libraries
  • Exploring docs of python-dateutil module

Pretty much zero time was spent lecturing, and most time was spent actually doing things. Just as how things should have been :)

Following up

The best thing about this workshop was it did not end at closing time Day 2. It went on. We are now planning on a weekly programming competition at college, with cash prizes (sponsored by the college and Mr. Dorai Thodla). And several people have taken up solving problems on Project Euler, and we have a working game done by one of the students. That isn’t the end – one team is hoping to replace the antiquated VB6-ish management system in our library with one built in django, while another is trying to automate attendence systems using SMS.

Inspiration

So, how did it all get started? The inspiration? Hackfest. Huge thanks to vimzard, kstar and the rest of the Hackfest team who were our inspiration. I hope there is a Hackfest next year too, and that some (a lot!) of our students are more than good enough to attend and make meaningful contributions. It changed me this year, and it should continue to shape and change more people throughout the years :)

And ofcourse, no small thanks to Dorai Thodla, who helped get this entire iCell thing off the ground, and Ms. Sumathi Poobal & Mr. Ramanayagam from our college, without whose participation the iCell would’ve died a silent death. (What’s this iCell thingy anyway? A post for some other time :) )

I didn’t happen to forget someone whose name began with a K, did I?

What I lack

Commitment.

I keep jumping around. My GitHub profile is proof for that. So are the large number of projects I’ve taken up only to leave in the middle. Unless and until I fix my commitment issues, I’ll be just-another-guy-who-learnt-to-code-in-his-teens, not the-guy-who-changed-the-world. Just reading a lot of stuff isn’t going to do me any good unless I actually get off my ass and do something.

Hopefully, putting this up in public will make it more real. Maybe I’ll be shamed into being more committed to whatever I choose to commit to.

It is good to jump ship when it is sinking, as long as you know where you want to go.

Block cursor vs Post Cursor (gVim vs Emacs)

Here is an approximate timeline of the editors I’ve used so far:

  • Turbo C++ (4th grade to 8th grade)
  • Visual Basic 6 (8th grade to 10th grade)
  • Visual Studio 2005 (10th grade to 11th grade)
  • Visual Studio 2008 (11th grade to 1st year of college)
  • gVim (1st year of college)
  • GNU Emacs (after gVim)

Now, the one thing, maybe even the only thing I miss is the fact that gVim gives me the I-Bar cursor, while Emacs by default gave me the block cursor. I like the I-Bar better than the block, and so far, couldn’t figure out how to change that. It’s not helping that I don’t have access to the internet.

So what does a sane man do?

He stops using the GTK version of Emacs, and switches to the console version :D

Perfect Day #1

So, I wake up at noon.

And my phone doesn’t work.

Then I find out my Internet doesn’t work.

Then I find my TV’s crapped.

Then I find that I’ve to go to college tomorrow.

The last thing is good. The others aren’t. Oh well.

Anatomy of an impromptu hackathon (Git vs SVN)

One of the (good) things that came out of the IIT Hackfest was me hanging out on the #hackers-india IRC channel. It is wild, swingy and usually fun. Usually.

So yesterday night, ideamonk casually mentioned that he was working on something called pymos. It was a python script that made mosiacs. Now that was something I was totally interested in – I tried making a similar ‘script’ a long time back (in C#), and totally utterly failed, simply because I was so caught up with the part that downloaded pictures from flickr that I didn’t do the part that generated the actual Mosaic. Since ideamonk’s code already generated the mosaics (and since it was in Python), I forked it, and began to work on the to do items.

Note that ideamonk and I don’t know each other (we were apparently sitting next to each other at PyCon India ’09, but that doesn’t count!). We were on the channel, he’s commented on my blog once, and that’s about it. But still, we worked together all night fixing code. I could bore you with details of the work that was done within the next five or so hours (1 AM – 6 AM), but I will just point you to to this commit graph generated by GitHub. There was a flurry of commits, and there should be a tagged version up for download (and on PyPI) soon.

If not for github…

Let us, for a moment, assume that this code was on, say, Google Code instead of GitHub. How could I have contributed?

  1. Checkout the code via SVN
  2. Fix one thing
  3. Send ideamonk a patch file (I can’t commit anything anywhere!)
  4. Wait for him to:
4a. Open up his mail client
              
4ai. Get lost in [proggit][7] (or [FaceBook][8])
              
4b. Grab the patch file
              
4c. Apply patch
              
4d. Test things to make sure I didn’t break things
              
4e. Wonder if the code is good enough to be merged in
              
4f. Commit code with my patch in it
              
4g. Notify me that my patch is in, so i can do an svn up
  1. Go to 2

No code gets committed, simply because step 4 is a huge involvement for ideamonk. Knowing that step 4 is a huge involvement for ideamonk is a huge block for me too. Obviously, he’d rather be coding than dealing with patches. Who wouldn’t? Being a developer > Being a maintainer. One of the reasons I respect maintainers of projects a lot.

Now, how does it work with github?

  1. I fork it (1 click)
  2. Fix one thing
  3. Commit, Push to my repo
  4. If there is something significant in, notify ideamonk to pull from me. Else go to 2.

Much simpler, and note that all four are things I could do myself. Nothing depends on ideamonk. Maintainence works is almost zero. Nobody has keys to the cathedral, since this is not one.

Please put your code on GitHub

It has the least amount of friction for developers looking to contribute, and the least amount of work for you as maintainer. Thanks!

Why I got rid of my fork of Waffle

For those of you who didn’t know, Waffle is a schemaless storage layer that sits on top of SQLAlchemy. Something that I was initially very interested in.

Not anymore.

Why?

Because I found MongoDB.

And fell in love.

Yes, I do know they both are different, but MongoDB has the things that attracted me to Waffle (very flexible schema, great querying, indexes) and is just as easy to set up (maybe not as easy as Waffle over SQLite, but only slightly less easier).

I <3 MongoDB. Let’s see how long this lasts!