Thursday, October 22, 2009

Chinese Intervention?

Just on a light note, have a look at this screenshot of Firefox in an "embarrassing" situation. I wonder if it was because of the ever present Chinese... :)

Thursday, August 27, 2009

Automatic Django Template Directory adjustment

Django is that hot new MVC framework on the block that's kept me sleeping at night, quite unlike PHP. Yup, its that good! :) It's got wonderful features that make me feel - Yeah! Development for the web is still worth the grind! By the way, if you're not into Web Development and don't care two hoots about the difference between a framework and a library, this post is not for you - Mosey along now! Nothing to see here. ;)

Anyway, one of my few n00b questions to which I've never actually got a satisfactory answer is - How do you specify the template directory so that you can send your code to others and have it execute by runserver without any changes? The primary problem is the hardcoding of directories that is done in the file at the root of the project. After a bit of searching, I've come to a satisfactory solution and lest I forget it, I've decided to post it to my blog. Here's the code snippet.

# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
# os.path.realpath(os.path.curdir).replace("\\", "/") + "/templates",
os.path.abspath(os.path.dirname(__file__)).replace("\\", "/") + "/templates"

This seems to work most of the time, just let me know how it works out for you!

Geeky Stuff - The Linux Kernel Implementation of Pipes, FIFOs and other Filesystems

I had to create a presentation on the implementation of Pipes and FIFOs on GNU/Linux for my Network Programming class (we're doing some background on IPC). Since I couldn't find any decent documentation online, I decided to dive deep into the Linux kernel code and see what devils were lurking beneath the pipe() and the mkfifo() system calls. The end result? A rather organized documentation of how pipes and FIFOs are implemented on linux (including some stuff about the pipefs filesystem). You can use this documentation in a variety of ways (including creating your own, new filesystem, for linux), but beware, I've made this complete documentation by reading the code. It elides a lot of informative stuff and might be incorrect in places. I would love to hear about anything wrong or misleading in this documentation. I undertake no responsibility if something happens to you, your computer or someone else's computer if you use/misuse the information provided. Please feel free to use the information as you see fit, but keep your eyes open and your mind working. I release this presentation into the public domain. However, I would love to hear if you liked it and used it somewhere.

The presentation is located here.

Life Updates after the internship

Hello Web Surfer,
Firstly - Apologies! Its been a really long time since my last (reasonable) post and I've been neglecting my blog a lot. Mostly, this can be attributed to my internship at Microsoft which sapped me for over 2 months and then the brilliant work I've been doing at Zigndog. Forgive me for all the neglect and thank you for your brilliant patience. Given the long absence of updates, it is only fair that I give you a peek into the inner workings of my life (If you're not really interested, just skip on to the next post, you just might like spicy letters to the Dean :D ).
I've been tweeting a lot about DesignChef and Zigndog. If you don't already know of it, Zigndog is Puneet Jaggi's brainchild startup that working in the Web Development and Print Design space. Its working out well - Zigndog got 2 special mentions at the first DesignChef Logo Challenge and Second Place at the DesignChef UX Challenge. That's bagged us a cool Rs. 10,000 as a cash prize, not to mention a lot of positive publicity. (Hey! DirectI got so impressed by our work, we got contacted by them to do some work on rush basis). Of course, needless to mention that I was involved in the creation of the UX. But, collars up comments apart, serious kudos should go the entire team - Sampath, Rishabh, Sanat, Vikesh, Puneet and Priyanka Mdm. This was the outcome of our team effort and nothing significant could have been achieved without each one playing his part. Besides this, we've been working hard at ensuring that all our clients get satisfied. Something that's rather tough to achieve. (Trust me... Specially if you're planning to go for a startup someday)
Ok, here's the deal - I need to post some meaningful stuff that will document my internship and not leave you bored to death... First, some tech stuff: - That's my internship presentation on Coalescing. Don't even bother reading about it if you're not interested (I don't have a transcript of my speech, so the slides are rather empty). It suffices to say that people liked it and I met my personal goal of getting across 60% of my work. Most people failed in their early twenties... :)
On the non tech front, here are a few images that document the really fun time I had in Hyderabad while sampling restaurants and enjoying the weekends. Thanks a lot everyone! It was great fun. Oh, and as a parting note - Happy Birthday Umesh!
This photo was taken at the Ramoji Film City. Its located about 2 hours away from Hyderabad but its a "must visit" for any tourist.
Taken at Tirupati. The golden cupola at the center is the sanctum sanctorum of Lord Balaji at the Tirupati temple. Many many thanks to P. Abhyuday and his family for making our trip such a memorable experience.

Thursday, August 20, 2009

[Cinema Club] Appeal

Dear Sir,
   I would like to inform you about a number of irregularities that have taken place in the selection and subsequent notification of the secretary of the Cinema Club. The professors in charge have refused to consider my case and hence I am resorting to this final recourse of appeal to you.

To give you a little background, I would like to state my version of events. You may wish to verify this with any you deem suitable:-
1. A notice was issued wherein applications were requested for application to the post of Secretary, Cinema club on Monday/Tuesday - 17th/18th August.
2. The notice clearly stated that applications must be deposited in the office of the undersigned Prof. R. Prasad (of Electrical Department) by 20th August 2009. I complied with the same, having slipped in my application to his room at about 4:45 PM on 20th August 2009 (today). He was not present in his room and the timetable in his office showed that he was in a Lab. I visited some Labs in the department but was unable to locate him.
3. Just before 6 PM, I am informed, in casual conversation, by one of my batchmates that interviews for the post of Secretary Cinema Club have already taken place at 5 PM in the office of Professor R. C. Mittal (of Mathematics Department) and that he has already notified the selected candidate by issuing a letter to Mr. Somya Mohan.
4. I immediately rush to the office of Prof. R. Prasad where I meet him and ask him whether he has received my application for the post. I am informed by him that he has received the application but that it is too late as he has already conducted the interviews, the result of which has already been  declared.
5. I appeal to him by stating that I have complied with all directions of the notices and all  the information that was available with me. He refuses to consider my case. 
7. At 6:30 PM at his behest, I have a telephonic conversation with Prof. R C Mittal wherein he states that he was made aware of my application by Prof. Prasad but was not willing to consider it.
8. On further conversation with Prof. Prasad, I come to know that information about the interviews was passed on to the applicants through a single person - Mr. Somya Mohan via the phone during the afternoon.

I would like to make the following representation:
1. I was not given a chance to represent myself at the interview for the post.
2. My application, though within time and present at the requested place was not accepted by the concerned Professor.
3. The interviews were scheduled before the deadline for applications had elapsed.
4. Only oral notification of the interviews was made and that too via a single student, who was also an applicant for the post and thus had significant self interest in the matter.
5. The results were declared before the deadline for applications had elapsed.
6. I was given no valid reason for the rejection of my application and my request for revoking/modifying/holding the earlier order in abeyance were summarily dismissed.

I feel that I have been unfairly discriminated against in this process.
Due process was not followed for the notification of interviews which were conducted without considering all applicants and before the expiry of the application deadline. Further, I wish to state that the interview procedure followed was arbitrary, unfair and opaque.

I request you to hear me out and take corrective measures as necessary so that my grievances are redressed. I shall be depositing a hardcopy of this application in your office tomorrow.

Thanking you,

Yours sincerely,
Divye Kapoor
4th Year
B.Tech (IDD) CSI
IIT Roorkee

At bottom, every man knows perfectly well that he is a unique being, only once on this earth; and by no extraordinary chance will such a marvelously picturesque piece of diversity in unity as he is, ever be put together a second time. -Friedrich Nietzsche, philosopher (1844-1900)

Monday, April 27, 2009

The Complete Story - The NSS Valedictory Fiasco

Not everything went according to plan at the NSS Valedictory Function on the 25th of April. This is a chronicle of all the events that took place. This is the mail that I sent to the NSS group to explain the effect of their individual choices on the collective whole.

Hello everyone,
For those of you who don't know what has taken place, let me give you a quick summary. For those of you who do, you might have missed some of the following points. Please go through this carefully. 
1. The Chief Guest for the Val function was Dr. Harsh Sinhval, Dean (Alumini Affairs)
2. The Guest of Honour was Dr. Gaurav Raheja - Institute Architect
Both of them had agreed to be present at the Val function at the last moment. They had been invited at around 5 pm the previous day.
The fiascos that took place:
1. Almost no one was present at the venue at the allotted time of 3:15 pm
2. Dr. Sinhval arrived punctually at 3:28 as the time given to him was 3:30 pm
3. 3:28 pm onwards - we push the panic button and start calling up everyone to be present at the Val function
4. 3:43 pm - Dr. Sinhval expresses his anger at the state of events and threatens to leave the function if the event doesn't proceed by 3:45
5. 3:44 pm - We start the event. Dr. Sinhval requests that all the doors to the auditorium be closed to prevent the entry of latecomers
6. We disregard his request. We keep on calling up people. We even request the Dramatics section to fill up the auditorium. They refuse. I call upon personal friends to help me out at this point of time. The NSS activity list is being read out by Shruti.
7. Close to 4:00 pm: Dr. Sinhval is asked to say a few words to the audience. He is furious. Total audience strength: close to 40 people.
A quote from his speech: "Normally, it isn't considered good manners to criticize your hosts but I am compelled to do this today. All the activities that you have read out to me hold no value. Anyone can write anything on a piece of paper and say that we've done this and done that. From an organization of 345 students, is this what is expected? Had I been the head of NSS, I would have clearly stated - those who don't attend this function will have their grades held back."
Just then, someone enters. Dr. Sinhval responds - "Aayiye, Aayiye. Mushaiyare mein tashreef rakhiye. Aakhir yeh mushaira hi hai na, koi function nahin." The entire executive team is looking shamefaced.
At the time of inviting him, Dr. Sinhval had expressed happiness at the work we were doing to teach students. He had asked us about the problems we were facing and had even offered to get a room for Prerna students to be taught at the ABN School on Saturdays. This is what he said then:
"Naga had told me about the problems you were facing in teaching students on weekends. I had thought of helping you in this regard but after what I have seen here today, I shall most certainly not be doing that. This is all that I had to say." He proceeds to his seat.
Can you imagine the plight of all those present there? Katiyar sir on the dias, sitting right next to him. Me and Naga sir down below - looking at the dismal empty chairs of the Civil Audi, desperately hoping that something can still be done, our hearts sinking with a feeling of deep loss. What should we do next? 
8. Dr Raheja states a short story on the work that NSS has done. He maintains a calm disposition, but it is clearly seen that he's disappointed with the state of events. Meanwhile, Katiyar sir is desperately trying to calm Dr. Sinhval. Water arrives for the guests. There was no bouquet for any of them as the flower shops in Roorkee were closed. 
9. Dr. Sinhval realizes our plight and requests the mic to say another story, this time a humourous one to diffuse the tension, but it is obvious that he is still simmering under the surface.
10. Naga sir was asked to announce the new team - Katiyar sir interrupts him and asks him not to do so.
11. The prize distribution for all the active volunteers takes place. Dr. Sinhval's comment: "I hope atleast they are present here". First two names called out are not present. Just to save face, we start sending other people up in case those that were being awarded were not present. Katiyar sir is given a memento for being the NSS Program Coordinator. There are no mementos for the Chief Guest and the Guest of Honour.
12. Prize Distribution over. I come up on stage and try salvaging the situation. I highlight the fact that the NSS Volunteer Awardees have worked close to 100 hours over the course of 2 semesters for a 2 credit course and that the people sitting in the audience aren't the "masses" working for grades, but those that realize the importance of their work and the service they are rendering to the nation, not out of pity, charity or kindness, but out of a feeling that every person in the country deserves as much as his country can give him.
14. I escort the guests down from the stage towards the refreshments. Dr. Sinhval refuses to leave the stage before me (as is his right, being the Chief Guest of the Event). This is an indirect slap to my face.
15. Katiyar Sir and the other Guests chitchat over refreshments but Dr. Sinhval refuses to give an assurance that he will continue to help us in the future.
16. The guests leave.
Let me make a few points here:
1. Why do I make such a big fuss about punctuality?
     a) I realize the value of time. So do others.
     b) This is what happens when you're not punctual. I know this. That's why I care.
2. Who is responsible for this mess?
     a) I am - for leaving the management of critical aspects of such an important event to my juniors.
     b) Naga Sir - for doing the same.
     c) The new executive team - for not taking their responsibilities seriously.
3. Who is not responsible for this mess?
     a) The first yearites - You have done exactly what I had expected you to do. You will prioritize 1 hour of sleeping or lazing around in the name of studying over coming for the val function. 
Don't you think that your seniors might have spent many more hours getting the permission for the Civil audi, tallying the attendance, getting the certificates printed, writing the names of the people, getting the mementos, arranging for refreshments etc? Aren't their examinations on the same days as all of you?
   All you guys had to do was to get up and come over for one hour - one single hour away from your studies too finally see and understand what you have achieved as part of NSS, what other cells had done and why you should be proud of your work and give a farewell to the current team. Of course, most of you weren't interested.
4. Who should bear the brunt of the consequences?
    The NSS Team. They are now entrusted with the task of jumping through administrative hoops and loads of red tape to get permission for the simplest of things. By serving your self interests, you have inadvertently denied NSS a golden opportunity to have better relationships with the administration.
In any case, there is no use crying over spilt milk. You have done what you had to and we did what we could to save face. That's all there is to it. Thanks everyone for a very "memorable" farewell. It affected me to the depths of my heart... really. Thanks a lot...
Divye Kapoor
Ex-Joint Secretary

Thursday, April 23, 2009

BUGS in DK's soul

Recently received via
DK's soul has bugs too!!!! Thats why its in Beta...

Thanks for the obvious creativity guys, you really cracked me up. :-)
The other mails were also fun, but some were unpublishable.

Keep mailing... Love to see your quote of the day in my inbox.

Wednesday, March 11, 2009

Google moving towards the "Google OS"

Google Code Blog: Announcing the Native Client Security Contest

Google is moving slowly but surely towards its much hyped (but never confirmed) "Google OS". Google has just announced the Google Native Client Security Contest which challenges students and professionals from around the globe to have a look at the Google Native Client (or NaCl as it is better known in the docs) to find bugs and vulnerabilities. The person who identifies the maximum number of bugs can receive (in typical Google fashion) upto $ 2^13 . Great chance for all you hackers out there to earn some real m00lah.

However, its not the money that has caught my eye in this contest. The most eye popping thing about this piece of software are the screenshots that show how a full fledged 3D game - Quake, is running right inside of a browser. Its no wonder that Google claims that it will revolutionize the degree of interactivity available inside of a browser. Have a look at the screenshot below:

Another thing that you should consider doing is reading the research paper of the people who built this sandbox. The've gone to great lengths to ensure security of their sandbox by using static code analysis, code flow control and syscall interception. Its really worth your time.