Hack Day India
I was at Yahoo! Open Hack Day at Bangalore on Friday and Saturday. 24 hours of hacking, meeting lots of old friends, and sarcasm unlimited. It doesn’t get better than this.
- 2007-10-05 Fri 02:30 PM
- Arrived at Taj.
- Registered myself, got the schwag
- Met Raghu and discussed the presentation he’ll be making on Flex
- Social networking, the offline kind
- 2007-10-05 Fri 03:30 PM
- The presentations start.
- Joe starts the ceremonies.
- Chris starts the first talk on what Yahoo can do for you. Yahoo APIs, that is.
- 2007-10-05 Fri 05:30 PM
Why students and open source?
Two days before the BMS College Information Science Department Fest called “Genesis 2007″, I received an email from a couple of students asking me to talk about “introduction to open source”. Apparently, they were frantically looking for a speaker. Since I’m not the right person for this, I agreed to come only if they didn’t find someone else… and I ended up going there on Friday.
The talk was supposed to be an introduction for a day-long session on Open Source Hacking which was organized by few enthu students trying to get other students interested.
I started making the presentation on the midnight before Friday, so I didn’t have a very polished presentation, but I had something reasonable. The title of the talk was “How to make money from coding (or Why Open Source)”. That should get their attention.
15 minutes before the talk, there were 2 students in the hall. I wanted to start the talk on time and decided to start without much crowd anyway. My sore throat was troubling me and I was coughing every two minutes. Anyway, I started off with a funny anecdote. It flopped. Oh boy.
Then, I decided they’re not warmed up yet, and recovered quickly. 15 minutes later, the 225 seater hall was full. Phew.
An hour later, they were still all there, they were asking lots of questions and they seemed genuinely interested. I hope the students do take FOSS software seriously, if not for the freedom and open source aspects, at least for their own career aspects which I detailed out in the talk. (And I’m sure once they’re hooked, they will later “get” the freedom and open source aspects.)
Why do I say that? Well, it comes down to the first question in the Q&A session - “How to get into Yahoo!?”, and I replied “Well, do you want to know how I got into Yahoo!?”. A unanimous yes. I told them the MySQL story, the Python story and few other tidbits. Now, they’re really listening. I pointed out that I didn’t have any special skills, just the knowledge of these two open source software got me the job at Y!, and it saved me from a service industry job (no offense meant, just a personal preference).
Next question: “Any regrets in college life?”. It caused a flashback in my mind on Atul’s words : “There are two times you innovate in your life - one is when you are a student, the other is when you retire.” Back then, I didn’t believe him. Now, I do. So, I told them “I haven’t yet regretted not scoring well in college. This is the only ‘free time’ you have, so use it well.” I got lot of smirks and “oh, please, we have so much to study” looks. I said “Two years later, I’ll see how many of you come back and tell me I’m wrong.”
Then, after the session ended, a few electrical students said they wanted to get into the software industry and don’t know where to start. I told them that some of the best programmers I’ve known are from a mechanical background, so that’s okay. You should prove your skills, that’s all, your background shouldn’t matter, although it may be difficult to get your first job because you’re not a computer science student. Then, a telecom student. I was happy about this guy because he said he wanted to remain in the telecom domain but learn coding really well, I said that’s a very good decision he’s taken and told him to see open source projects such as Asterisk and OpenMoko. He said “I’m in my final year, just 8 months to go, am I too late?” I said “8 months is a really long time, you’re not late, you just have to start now.” (8 months is a long time when you think about it, but it seems to fly away so soon).
After that, students headed towards the computer lab where I gave a crash course in using subversion. I had to get back to work, so I didn’t stay for the rest of the day, but I heard there was a “good response” from the students.
In the end, I don’t know if anyone was inspired about FOSS or not, but I did see that few students absorbed the fact that knowledge and projects are going to get them good jobs, not just marks (of course, you do have to have a decent score), and working on FOSS projects is one way to achieve that.
P.S. If you’ve read this far, and you’re interested in learning how to contribute to open source software, then you’re in luck, because the foss.in community event is coming up soon. You can start right now by reading Atul’s latest post on foss.in.
Update : A related must-read article is “How to Get a Job Like Mine” by Aaron Swartz.
Lookup
Most of my writing inside the browser is done with the combination of the It’s All Text extension and Vim. During this writing, I use words whose meaning I know vaguely but don’t know the exact usage, and in such cases, I usually open a new browser window and look up the meaning of the word in an online dictionary. This process of looking up the dictionary meaning was getting rather tedious, so I wrote a small Vim plugin today to do this job with a simple command.
To use the plugin, first install
BeautifulSoup. Then, get my
lookup.vim script and
copy it to . See the new version’s installation instructions, it now uses John Goerzen’s dict client implementation in Python.~/.vim/plugin/.
Next time you use Vim, just place your cursor over any word and run :Lookup,
and you’ll see something like this:
Since, this is the only command starting with L on my Vim installation, I just
end up running :L. Of course, you can always create your own keyboard
shortcuts to make it easier.
Update: Based on the comments, I’ve updated the script to now use the DICT protocol and talks to some servers. This avoids screen-scraping, is much faster to use, allows me to now use both a dictionary and a thesaurus which is very very handy because I can see what other words I can use, and of course, doesn’t violate any TOS (which screen-scraping could amount to).
Big Brother
Long ago, I had seen Nat Friedman show off a small Mono app that displayed the amount of time you spent on each application, and updated the chart in real time - so that you could clearly make out how much time you’re spending in the browser and how much time you’re actually spending on work.
I couldn’t locate that app, so I had been wanting to write my own version for a long time and finally got around to doing it today.
It turned out to be easier than I thought. First, I had to figure out how to
find out what application has the current focus at any point in time, and I was
trying to see if I can do it from Python (using the Win32 extensions, and yes,
this hack is Windows-only). After a lot of searching, I finally found out that
it boils down to just one line:
win32gui.GetWindowText(win32gui.GetForegroundWindow()) and this
would fetch the title of the application that the user is using at that moment.
After this, all I had to was record the window title every 5 seconds and increment the time spent for each window, and voila, the data is ready. I was quite satisfied with just a command line output, but Raghu egged me on to create a Flex chart frontend for it as well, and when Harish joined in, the fun really got started. The first problem was how to push the data from Python to Flex, and we use the oldest trick in the book - write it to a file. Next, Flex can read the same file as long as the file is in the same directory as the SWF (i.e. the Flash file) location. Then we parse the text to get back the original data, create a pie chart and point it to this data, and voila we have a beautiful chart:
Now I can finally track what I actually end up doing the whole day, heh. You can download the files if you want to use it as well:
- The Python script called “BigBrother.py”
- The MXML file called “BigBrotherGUI.mxml”
- The compiled SWF file for those who don’t want to go through the hassle of compiling the MXML to SWF.
- Just run/open both
BigBrother.pyandBigBrotherGUI.swfat the same time and watch the statistics.
And who said meetings aren’t productive
Update:
Chris J Andrews made a JavaScript GUI frontend.
Theyagarajan modified the Python script to make it work on Linux.
Brazilian Portuguese Bytes of Python
Samuel Dias Neto has translated “A Byte of Python” to Brazilian Portuguese.
Hats off to Sam!
Mukthi
Today, I talked at Mukthi 6.03 at M S Ramaiah Institute of Technology.
First of all, M S Ramaiah is a huge campus. So huge that the students actually tell the teachers that they were late for class because they couldn’t find the class, and that’s a fact. I made sure that Srichand, the student who took me inside to the auditorium led me back to the front gate as well, so that I wouldn’t get lost.
The auditorium where the talk was scheduled was in the new building, so it was plush, comfy, and it wasn’t a big auditorium which was perfect. The talk (introduction to Python) went well, the students were alert and interactive (even though the talk was between 5-6 pm) and I was especially happy with the range of questions that came at the end of the talk.
After the talk was over, one of the students announced that Mukthi was originally planned as a 1-day event, but later they made it a 2-day event because I had informed them that I would be available only on 17th to present a talk and not on the 18th. Whoa!
Why won’t I be here on 18th? That’s where my next post comes in.
German Bytes of Python
Yesterday, I got this mail from Christoph Zwerschke:
Thanks a lot for “A Byte of Python”. Since I thought it would be great if Python gets more popular in German, I participated in the German translation project at BerliOS started by Lutz Horn. Unfortunately, the translation progress stalled last year shortly before the work was finished since all of us were very busy. However, this weekend I found some time to finish the translation and cut a German release, which is now available at http://abop-german.berlios.de.
Greetings from Germany,
Christoph Zwerschke
Hats off to Christoph, Lutz Horn and others who made the German version happen! Thank you guys
Byte of Python is now a wiki
In a recent discussion on the byte-of-python list, an enthusiastic bunch of people were interested in seeing A Byte of Python available as a wiki so that readers can contribute directly as well.
So, I followed up and made this announcement on the list recently :
Hello all,
As we have discussed, suggestions that Byte of Python should be converted to a wiki garnered enthusiastic responses. I’ve finished converting the book to the wiki and is available at http://swaroopch.info/text/Byte_of_Python:Main_Page .
There are some Todos I’ve sprinkled across the book which I will be working on in the coming weeks. Few readers have taken the trouble in pointing out how to export a book from the wiki as well. Once I can work on the todos, I’ll work on a downloadable version.
A good advantage of the wiki is that my turn-around time to suggestions from readers have improved. For example, a user pointed out that ESR is not the one who coined the term ‘open source’ and I corrected it on the wikibook within 2 minutes.
If you want to add/remove/improve any text in the book, please feel free to register as a user on the wiki and start editing. However, if you only want to read the book, there is no need to register.
Help about how to use the MediaWiki is available at http://meta.wikimedia.org/wiki/Help:Contents .
MCC FOSS Day
Yesterday, I talked about Python at the FOSS Day at Mount Carmel College For Women.
I was not able to attend the earlier sessions in the day because my team (at work) is making a release soon and as expected, that means crunch time. I managed to make time for presenting my own talk and attending Shreyas’ talk (who spoke after me).
Before I started my talk, Surjo warned me to make my talk as non-technical as possible. I was informed that some of the earlier talks had not been well received by the audience since it was “too technical”. That reminded me of Guy Kawasaki’s notes from a Stevenote where he says it helps that Steve has a beautiful operating system to show off, and for me, it helps that I have a beautiful language to show off, heh.
Earlier in the day, I had reminded myself of Simon’s notes on public speaking where he makes two good suggestions:
- Show, don’t tell
- Never, ever put up a whole slide full of code
Following this advice, I had stripped down the content of my presentation (the same presentation that I have used earlier for beginner Python talks) to the bare minimum.
The mistake in my last talk at foss.in was that I had made the slides too detailed and I suffered by trying to “stick to the slides”. Since I had avoided that this time, I had a free hand in what I spoke and actually used the slides for what they were meant - a reminder of what topics to talk about and not a replacement for the speaker. As a result, my talk was better than I anticipated.
Since I was asked to try to make the talk non-technical and I had also perceived the audience to have a short attention span, I decided to make the talk more about interaction rather than about Python. Most of them knew about C, so I followed the principle of “always start from the known to the unknown” and kept comparing C to Python and that helped to keep them interested. I knew the talk was going well when I compared their 6-line version of Hello World in C to 1 line in Python, and when I demoed some simple statements and asked them “I just ran a program, but where’s the semicolon?” - that surprised them and they started clapping. From there on, it was all about keeping them enthused.
I asked them if they liked cricketers or film stars, and they gave an overwhelming response that cricketers were preferred. So, I wrote a Python list and added names of cricketers they liked (Irfan Pathan is popular indeed) and asked them how they would get the second and third cricketers names in a C array and compared that with slicing in Python and that received cheers as well.
One of the few mistakes I did was waste a lot of time in the last part of my talk trying to download FeedParser to demonstrate how to use it.
After the talk was over, I received some good feedback as well as questions, which is always a good sign. It’s good to know that I’m improving my speaking skills. I’ve come a long way from a kid who thought thrice before standing up in class.
Interestingly, this has been my 10th talk on stage.
ShowMeDo
Ian Ozsvald and Kyran Dale have created ShowMeDo.com which is a hub for video tutorials. Very interesting idea! Currently, it has a special emphasis on Python. This should be helpful for beginners and perhaps teach experts a trick or two as well.
I found the Debugging with WinPDB video very useful.
Ian will be uploading some wxPython introductions shortly, and they’ve got matplotlib, PythonWin, PyDev and more planned.
Also, users can contribute their own videos as well.
Update : The wxPython videos have been already uploaded.
Disclaimer : I was asked for feedback before the website’s release, but I have no other involvement with the website.
Jump
Gopal, I’ve added the jump feature, but sorry, no UI for it















