My Experiments with Django… with interesting results!

So I was all ready to try out this beautiful framework called “Django”. (Funny, always reminds me of the great guitarist Django Reinhardt). And so I go to the homepage of Django and get version 0.95. I decided to test it all out on my Windows box before trying it out on good ol’ unpredictable Linux (okay,okay GNU/Linux). So far so good.

Installation went off without a hitch. The prerequisites had already been loaded (Believe me, the prerequisites list is almost as big as that for GNU/Linux software packages and almost as obscure… my eternal gratitude to the maintainers of the “Cheeseshop” who make my life easier!) and I was ready to take the plunge. I decided to start with the “Django book”. In case you haven’t already got lost in the pool of URLs already (though it couldn’t possibly ever equal that of Slashdot’s), you can get this gem of a book here. Excellent book. Take my word for it!

So I start off with the initial pages and I already like these guys! The Awesome Threesome as I would like to call them – Adrian Holovaty (loved his duel with David Heinemeier Hansson in this excellent video), Simon Willison (the soft-spoken Brit) and Jacob Kaplan-Moss (the dude who presented a Django demonstration in Google). Their sense of humor (I suspect mostly Adrian’s) is wonderfully to my liking. A bit on the sarcastic-and-yet-almost-self-flagellating-and-still-almost-playing-dumb-and-yet-profoundly-enlightening-humor-which-hits-you-after-you-have-finished-laughing type. You know what I mean? Anyway, to get back to the flesh of the discussion, there I was happily following the instructions in the Django Book and configuring here, tweaking there and everything seemed to work fine. And then I try this simple example to generate a dynamic HTML page which would purportedly return the current date and time to the user and wham!!!! The whole thing throws up an ugly page full of error messages and stack messages and what not (I thought for a moment I could even see Richard Stallman’s rotund assets there). I am distraught. I am devastated. I am ruined. Naah… I am just messing around with you. In true hacker fashion, I set about dissecting the error messages, painstakingly tracing the chain of errors back to the source. Ha ha ha… who am I kidding? In even truer hacker fashion, I went straight to the source code and tinkered around a bit. I could find the source of error to be the wrong usage of the “rindex()” method on a non-string (specifically an HttpResponse object). Nothing much I could do about that so straight to the Django users’ group where I am directed very politely to an FAQ which described my problem perfectly. So the problem was with the incompatibilities between the Django Book and the Django version!

So I shake it off, download Django 0.96 and get to work all over again. And this time the damn thing won’t even install! Bwah-ha-ha-ha-ha-ha! I wipe off my tears of
half-anguish and half-amusement and set about hacking into the code again. I find that the problem lies in the setup file. The damn thing is supposed to read the directory structure in an OS independent way and yet it does not. So I take the code and change it to hardcoded directory for my specific OS (Windows XP!!!). And voila! magic! the built-in application server for Django works starts humming and gets to work and there is this beautiful HTML generated dynamically and gosh, this really is the beginning of something beautiful! Needless to say, I have raised a “ticket” with the Django folks and thanks also to robin_percy on the Django Users’ group for saving me innumerable man seconds of time on trying to hack the Django 0.95 code. For now, everything is running chummily and hopefully I’ll have only positive stuff to post about my tryst with Django hereonin!

By the by, know why I love Python? Check this out –

set(word for word in open(“words.txt”).read().lower().split())

The single line of code above will open the file “words.txt”, read all the lines in it, change them to lower case, split them into individual words and return a set of all the unique words in the whole file! Is that cool or what?!? 🙂

Advertisements
My Experiments with Django… with interesting results!

Andrew Tomkins’ Yahoo seminar

I had the privilege of attending Andrew Tomkins’ seminar on emerging search technologies on April 5th. The talk was held in the ballroom of the Taj Westend hotel on Racecourse Road – pretty close to my office. Andrew Tomkins is the Director of Search in Yahoo. He has had over eight years experience in IBM prior to joining Yahoo.

He seemed to be more the academic type than the presentation type. You know, speaking mostly in jargon and not shying away from having slides full of mathematical equations which of course, he would not explain! The talk was good but I felt that it could have been a bit more concrete. To his credit, Andrew presented a highly unbiased presentation. I could feel the true spirit of sharing of knowledge in his talk. He presented many complimentary examples from rival search engines especially Google. Despite the topic there were not many revelations as far as search technology was concerned. Not much beyond what could be scoured off the web anyhow. I would have preferred a bit more in-depth discussion on the next level of web search technologies.

All in all, a good presentation that was undone by the insensible schedule.

Andrew Tomkins’ Yahoo seminar

Some videos from BarCamp Bangalore 3

Okie-dokie, here are some videos which I had recorded during BarCamp Bangalore 3 and which I had mentioned in my previous post I would be posting soon. Enjoy…

The new Three Stooges @ IIM-B

Lawrence Liang’s excellent presentation – part one

ThinFone demo

Lawrence Liang’s excellent presentation – Bush spoof

Lawrence Liang’s excellent presentation – Van Halen spoof by IIT-M geeks

Lawrence Liang’s excellent presentation – Bush spoof part deux

Lawrence Liang’s excellent presentation – Backstreet Boys spoof

An inside view of the IIM-B campus

Some videos from BarCamp Bangalore 3

BarCamp Bangalore 3 finale

So today, April 1 2007, was the last day of the third edition of BarCamp Bangalore. Since I had missed some events yesterday, I decided to make an early move to the venue. So my friend Bharath and I arranged to meet up in our old college, UVCE and move to the venue, IIM Bangalore. Around 20 odd kilometers of low grade roads. Thankfully it was a sunday and I anticipated very less traffic. Unfortunately, I had to also reckon in the half-an-hour of delay due to my friend’s immaculate lack of punctuality! And I was absolutely right again – he arrived at half past eight sharp. Well, to make it a short story, we managed to reach the venue by nine and I was surprised to see a much smaller crowd than yesterday and none of the events even seeming to be anywhere close to commencing. I could see the first event was scheduled for half past ten and it was by a person named Lawrence Liang on “IP rights and the social factors affecting its perception”. Of course those weren’t the exact words – a bit of syntactic sugar on my part.

I actually wanted to skip this event and wait for the “juicier” events instead. However, Ravi and Bharath persuaded me to attend it and so after the brief introduction which I may add was held in a true “Unconference” style in the front of the auditorium (which was locked, hence the impromptu session outside) and each presenter had an opportunity to give the gist of his or her event for the day. So far so good.

The first event started and it started off quite calmly and honestly, I think not many people had any expectations from the presentation. Then Lawrence started to weave his magic and the superb combination of humor, slides, audio and visual effects and the strong pace of the talk itself made the lawyer an instant favorite with the crowd and despite stretching his scheduled time by almost half-an-hour, the audience just couldn’t have enough of him! It was the best presentation of the two days. I couldn’t resist from shooting a few videos of his presentation and I will be posting them on youTube soon. I will publish the URLs here once I am done.

The few other events that I attended were nothing special… got the feeling most of them were merely seeking free publicity of their startups/ventures(mymuv.com which was an absolutely ludicrous idea for a startup) or ego boosting (Kiruba Shankar’s podcasting session) or greater exposure of one’s job profile for possible employment opportunities (?) (the ‘Usability’ event held by someone whose name I cannot recall or just wasn’t interested enough in to register in my mind the first time). So a pretty tame end for a BarCamp. oh yeah, there was a cheap publicity stunt by a couple of bummers from a startup called Yulop. They probably reckoned that not enough folks would be interested in a presentation called “Citycast” ( or was it “Citicast”? Whatever it was, it was extremely forgettable) so they rewrote the name of the presentation as “How to build the next Google – cracking the Google algorithm”. Needless to say, the people were already in high spirits and high on expectations after Lawrence’s presentation. So there was a sizable portion of the crowd in the room waiting with great anticipation and what happens then? One of the bummers cheekily informs everyone that it was a mere “April fool’s” joke! Quite a prank eh? Most folks weren’t amused and began streaming out of the room almost immediately. Who’s the sucker now, paisan?

Personally speaking, it was quite an irony that the most memorable event of the BarCamp meant for geeks was a presentation by a lawyer with an awesome sense of humor. And that said, despite the low quality of the technological presentations, I did gain a lot of insight into the Indian mindset, the state of the art in Indian startups, the mood of the entrepreneurial market, my own immense shortcomings (thankfully also the means to alleviate them) and with a huge gain in confidence that I am indeed the best. Or rather will be, but that is in the very near future!

BarCamp Bangalore 4 (BCB4) is scheduled to be held in June this year so you can definitely see me there. And I promise, it will be a very different Timmy, a much better Timmy (I can almost say a radically improved Timmy) there.

Ciao!

BarCamp Bangalore 3 finale

BarCamp Bangalore Day 1

Yesterday was the first day of the third BarCamp held in Bangalore. It was also my first BarCamp and frankly, it was a mixed experience. To start with, it was held in the IIM Bangalore (Indian Institute of Management) campus, which by the way was superb (and also superbly far from the city). The campus kind of reminded me of my school days in St. Joseph’s (Bangalore) with its thick stone architecture and with the unreasonably high ceilings which actually acted like a sort of natural air conditioner. And thank god for that because it was a blazingly hot day outside.

I missed the first few presentations (in fact it was inevitable to miss quite a few events throughout the two days of the program because there were up to four events being presented simultaneously) because of some commitments in the morning. By the time I reached the venue, it was around half past eleven. I attended a seminar presented by a couple of guys from Washington State University (Dinesh and his colleague) on ‘JavsScript as a tool to teach the principles of programming’. Needless to say, that topic brought about a lot of arguments as to the usefulness of JavaScript as a tool for teaching the principles of programming. Some even argued as to whether any programming language ought to be used for such a ‘didactic’ purpose. Interestingly enough, the presenter even had a slide about the SICP (Structure and Interpretation of Computer Programs) course by Abelson and Sussman which used to be and may still be taught to undergraduate classes in MIT and other universities in the US. The language used there is, of course, Scheme which is a powerful subset of the grand old sire, Lisp. In fact the Lisp which Paul Graham advocates is arguably Scheme and not pure Lisp. It was kind of disappointing because the seminar didn’t really cover enough to make any useful augmentation to my knowledge.

The next seminar was more interesting. Yahoo was the presenter and two guys presented a description of an Open Source project called Hadoop which basically is a project for performing extensive search over huge clusters of data nodes distributed over vast geographical distances. They said it had scaled to around 1000 machines to data per name node (which is the main singly redundant controller node for the data nodes) and that they hoped to scale to 10,000 machines soon. Contributors welcome!

The third event which I attended was on a blogging portal which the presenter had developed as part of his eighth semester engineering project and which was now his startup. The poor dude’s idea was nowhere novel and he had a pretty screwing session as the audience persisted in torturing him in trying to find out “what” it was that would convince people to use his site and not the other blogging portals out there such as blogspot, livejournal and wordpress. The interface seemed quite slick but there was no actual demo. You can check it out by Googling for “B for Blogs”. I don;t think I will be doing that myself very soon!

Then there was a seminar on the “Wiki book” which was an effort by the Indian Wiki groups to publish a book on “Unconference”. It sounded like a pure gimmick to me. Especially since they were going to sell it for a price.

The last seminar which I could attend for the day was by a lady named Savita on “Are services companies transitioning to product development”? To be honest, this was the most informative (and entertaining) event of the day. It gave me a lot of insight into the mindset of the Indian technology industry. It was an especially raw nerve point for most of the audience since there were representative from both sides of the argument – services as well as product development. Of course, there is no real product development that happens in India. Just imagine the closest thing that you can picture in your mind! More than the content of the arguments or even the context, I learnt a lot of lessons about the most difficult aspect of doing or even starting a business (read ‘startup’) in India – the social interaction of Indians sucks! Big time! We as a nation are highly interested in bickering and going to nihilistic extremes in sticking to a single point and trying to bring the opponent down. And like one of the participants in the highly heated discussions said, Indians love to talk and talk and by the time we reach the planning stage, the Chinese (or any other competitor) have already got a product out of the idea, deployed it and grabbed the market! This is true. The only thing an Indian cannot stand more than his failure is the success of his fellow Indian. This is the shit reality of the Indian business ethos. Like I said, it sucks big time. The only way I see to succeed in this environment is to play it smart and what do I mean by that? I think that would be better demonstrated than written about!

Some highlights of the day – free food (much better than the ofice food believe me!) and of course, the free BarCamp T-Shirt. I don’t particularly like the “Yahoo IDC” logo on the back though! More on BarCamp day two in the next blog….

BarCamp Bangalore Day 1