Tuesday, May 11, 2010

This semester was... LEGEN-wait for it-DARY


It's been a week since the summer holidays, and that means another semester is behind me. Reflecting on the past two years of engineering, I would say that this semester has been the best 6 months of my life ever. I have changed (read: improved) in a hell of a lot of ways. I also dumped some of my inclination to always plan out the day and introduced some spontaniety. Just before the sem there was December, which meant FOSS.in and the rural internship. Both thrust me into the public all alone, resulting in an eye-opening experience. FOSS.in was a collection of geeks where for the first time I could talk to other people all day about technology and computers and meet lots of coders from around the country. From a wi-fi enabled, air-conditioned environment to a laid-back village in the middle of nowhere in 3 days. That was the beginning of my rural internship. Those 4 days in the village were quite boring, yet it also opened my eyes to what India was. It doesn't mean I am going to go and use ICT in a socially responsible manner -- It isn't as much fun as programming.

Next up was Synapse. For the first time any piece of my code was being interacted with by hundreds of people, as my backend powered the registration and site navigation for the fest. I knew my code was very good ( definitely better than some code I had to look at for some events with specific websites ), and it felt good when the amount of junk IDs were a very small percentage of the total number of registrations.

Then just a day before Synapse was to begin, we had a 'Bazinga!' moment. The server room air conditioner caught fire, rendering the entire DA-IICT network infrastructure down for about a week. No Synapse website, no updates to do in the dead of the night, which meant I had 3 days off to enjoy :-). This also meant I finally had time to give my laptop for repairs.

Enjoy I did. This Synapse was and will remain a very memorable one. We had a blast decorating the SAC for D-lounge. This involved hanging flags on the awnings by climbing a shaky ladder up to the first floor, then leaving both hands to unravel and hook up the flag. Next up was putting up a installation in the middle of the lotus pond. This required calling in a special-ops team as the pond was full of water. Which reminds me, someone has photos of the entire drama. That same rickety ladder was placed flat and one person sat on the end to keep it from toppling into the water. Then about five of us walked across to the first stage of the pond. Then the ladder was pulled across to the next level. Then me and tanmay passed over. After that the ladder was pulled back, and the artwork was passed over. Time for the final jump. The ladder was brought up all the way to the centre, and we literally pushed the canvas across it, hoping it wouldn't end up tearing or going in the water. Then we repeated the entire sequence to get back out. Fortunately, no one fell in, although two poor souls had to stand barefoot in the dirty water all this while.


(effort)

Finally at 3am the task was done, or so we thought.

Synapse Day 1 - 10:30pm I had just finished the last lecture of the day, and wanted to go to Ahmedabad and get my laptop back. But a gust of wind had caused the installation to collapse. Which meant going back in again, this time much more easily and confidently, and sticking it into the ground using bamboos and nails.


Of course this isn't a post about Synapse, so I am going to jump ahead to day 2, which was all about Indian Ocean.
There is a secret to getting the best view at the Pro Nites in Synapse. Get into security, and know a lot of people. The concert was just a treat, well worth all the effort put into Synapse. It was mindblowing and perhaps only the video can capture most of it. They played some never before played songs which are to be released in movies soon. Yet Ma Rewa and Kandisa stole the show as usual. But the most important part is at the end. Once the concert was done we formed a cordon to let the guys get to their room. Now we weren't allowed in, but in an act of spontaneity I took of my Synapse T-shirt (right there!) and threw it in to the coordinator so he could get it signed. And then I *ran*, to the nearest bathroom which was still some 100 metres away :o Well it definitely paid of. In my closet is now a T-shirt signed by Amit Kilam from Indian Ocean. Finally there was the D-Lounge treasure hunt and the late night pool-playing. Ah... those were the days.

Ok, enough about Synapse. The other thing I do in DA-IICT is play football. This year has been a record in terms of the number of tournaments we've played. In the 3rd semester we went to Patan and had our very own Concours. Then we won the IPTG Petro Cup. And in March we went to BITS Pilani, Goa. I've been in top form ( if I should say so myself ) and improved tremendously in ball control and dribbling this semester. Although we lost in the first round, I was happy to hold my ground and not make any mistakes.

And finally there was of course the Google Summer of Code result. I hadn't got in last year. But this time I had put in a *lot* of effort and would have been really disappointed if I didn't make it. But fortunately I did

Now I just got my results, and I got an 8 out of 10 SPI, my lowest yet :-( All thanks to CT and EL, although it was my fault... Well you can't have everything.

Tuesday, April 27, 2010

Success! Google Summer Of Code

Well after all the micro-blogging at night and the IRC chat, and writing an exam, here is a really good post!

The proposal is Amarok and KDE UPnP Integration. I'll be working with mentor Bart Cerneels. This news was awesome! Last year I didn't get in for kwin-tiling, but I participated in Season of KDE and did a few other contributions all year and it paid off. This year I started of quite early and worked hard on the proposal. When the ideas list went up, Amarok UPnP integration seemed the most interesting to me. Since then I was in talks with Bart and started a discussion on the Amarok mailing list, that much to my surprise, was very responsive :-)

Now with the result out of the way, its time to start working as soon as my final exams get over this week. This will involve choosing a UPnP library and daemon for device discovery. The next step is to implement a KIO slave which can browse UPnP media servers like any other folder. The final thing will be to write an Amarok Collection which can index music on UPnP servers on the network. This involves filtering and sorting and also making the server play music when in the playlist :-), can't forget that. So its going to be a very eventful 3 months, with lots of commits, a T-shirt and lets not forget the money. Right now I'm waiting for the invitation to the private mailing list.

It was great to hear some stats. KDE got 50 slots, 11 Indians got into KDE, and 3 from DA-IICT got into KDE. Which is awesome! Sai Dinesh will be working on getting mobile phones working nicely with KDE. Aditya Bhatt will be working on Digikam face recognition. Others I know are Varrun Ramani, working on Amarok too, implementing Distributed Collections. Vishesh Handa will be working on Nepomuk, and finally the one and only :) Shantanu Tushar on Gluon. Happy hacking everyone...

Monday, April 26, 2010

KWin tiling is merged

I'm glad to announce that yesterday the kwin-tiling branch was merged into kwin trunk by commit 1118677!. It will be available in KDE SC 4.5. Please keep in mind that it is an experimental feature with rough edges. Bug fixes are already on the way, but some things, like session saving and so on are absent. Please do add feature requests and bugs to the KDE bug tracker.

This screencast should show off a few things. Apparently xvidcap produced really bad video, so I will have to do it again, watch out for updates here.

Thanks to Martin Graesslin for being my mentor during Season of KDE, and all the others who bugged me with emails about when tiling would be integrated into KWin :)

GSoC results now 13 hours away...

( Mamma, I'm not stressed out :-) )

Thursday, April 22, 2010

Quick and dirty Instant Messaging with Redis

(Aside: Yes this is a post after a zillion years, but I have a few more lined up, and waiting for some important stuff in about a week)

Redis is a wicked cool NoSQL database, in that storing stuff is not the only thing that it does. Mathias Meyer already has a collection of Redis use cases, but this great idea is mine. Like all good ideas it emerged in the shower :) ( I was not aware of Pieter Noordhuis' MUC when I did this, in either case mine deals with one-to-one IM )

Using the new publish-subscribe commands and a bit of node.js code, here is a tiny instant messaging server. An explanation follows, refer to the code while reading it, Blogger sucks for publishing code.

Here is how it works. For every client, the server maintains two connections to redis. This is because a subscriber is not allowed to invoke other commands. So we have a subscriber connection and publisher connection. Consider two clients are now connected, Alice and Bob.

When Alice connects ( NICK Alice ), we insert her nickname into 'mclarens:inside', a Redis set. This allows us to have a WHO command to list online members. Bob to does the same. To start chatting with Alice, Bob initiates a conversation ( TALKTO Alice ). The node server does none of its own client management. Instead each client just maintains subscriptions to two channels/classes. Each client is always subscribe to '[nick]:info', where it is notified of talk initiations and exits etc. When Bob wants to talk to Alice, he sends a 'start Bob' to Alice's info channel, 'Alice:info'. Then both Alice and Bob subscribe to the class 'Alice:Bob', using alphabetical order to decide the name. When either of them wants to talk to the other, they do MSG [nick] [message]. The connection uses the publish redis connection to send a message to the channel, resulting in both sides being notified of the incoming message.

To terminate the chat, one side just has to send a 'STOP [nick]'. That unsubscribes the user from the class so that he no longer receives messages. It also sends a 'stop [nick]' to the other side, so that he/she can also unsubscribe.

On QUIT, we simply remove ourselves from the mclarens:inside set, unsubscription is handled automatically by Redis!

That's it, simple Instant Messaging! Now this lacks any kind of security and ignore lists and status but proves the point. In fact I'm thinking of using this as the backend for the IM part of the XMPP server I'm hacking on. At this point it is in no shape to have this feature just yet, but it should some day.

(Thanks to roidrage and tnm on #redis for pointing out that I had to use two Redis connections for PubSub.)

Wednesday, December 23, 2009

#emo

A few years down the line, we will have little devices stuck on your cheeks monitoring facial expressions. And then they will tweet "nikhil is #laughing", "nikhil is #sad" and perhaps even "nikhil got #slapped" - The cult of microblogging...