Saturday, August 22, 2009

Fallback

Rahul (mether) Sundaram proposed this idea of a web-application to make Fedora remixes/spins.

I had decided to implement it using Ruby on Rails (surprising?).

I had already parsed the comps into a MySQL database schema. I then filed a ticket to the Fedora Design Team for a mock-up UI. I am still waiting for a response on this.

The name of the application is yet to be decided.

The next hurdle is to parse/build kickstart files. There are two ways of doing that:

  1. Writing my own kickstart parser in Ruby.
  2. Using the already existing and extensively used pykickstart - a Python library for manipulating kickstart files.
While the fate of the project was already decided at this point, I decided to give it another shot by asking around in the kickstart-list.

Well now its final. The web application would be developed using Django.

Hence I would not only be able to use pykickstart and thus avoid writing a parser from scratch, but I would also be able to integrate the application with FAS.

P.S. - This is the second time a missing or poorly written Ruby parser has let me down. While I am all for the far-more-superior framework of Ruby on Rails when building web-apps, I can't help but admire the advantage Django has when it comes to integration with existing and awesome Python libraries that do cool stuff.

Friday, August 21, 2009

Tab Auto-Completion in Python Shell

Strangely enough, I discovered that I do not get bash-like auto-completion in my python interactive shell.

Looking up helped.

Just need to have a file called .pythonrc in your home directory containing the following:


#!/usr/bin/python
import os
import sys

try:
import readline
except ImportError:
print "Module readline not available."
else:
import rlcompleter
readline.parse_and_bind("tab: complete")


Apparently, that was not enough. I also needed to add the following line to my .bashrc file (in my home directory again).

export PYTHONSTARTUP=~/.pythonrc


That's all. Open a new shell and start the python shell.

And enjoy auto-completion!

Saturday, August 15, 2009

Dear Juniors,

Its the start of a new academic year and I know you feel very fresh after a long stretch of summer vacations. Hope you enjoyed them to the fullest.

But now that you are back to college, the usual worry crops up:

"Will I get a decent job?"

You tell me "Placements are poor!". I say it was inevitable. With the software companies having more on their plates than they can eat and the recent economic chew-up, this scenario was more than expected. Lets say its sad luck, so now what?

For those in final year, my advise is don't let the last few fun days of your lives go to waste looking for a job. Its not time yet. This can be your most productive year in college. There is another whole year of you life you can learn.

Yes, learn. And don't just learn something because you can learn. Learn because you need to. So how does that work?

Think of something you like. Something new you want to develop. A brilliant idea. Its natural you may not have the requisite knowledge to get it done. List down the ways it can be done. Google up. Ask for help on IRC, drop mails to mailing lists. Communicate. Get people to appreciate your idea and contribute to its enrichment. Use other's experience. Chalk up a plan.

Once you have a plan in place draw up a time-line. Make it flexible. A time-line is very important as it keeps the idea afloat. List down the minimum things you need to learn in order to make something which minimally resembles your idea. Learn.

This way of learning is fun as you have a motivation for learning stuff. Its as if you are building a stair in order to reach up. Always keep the goal in mind when learning. Relate how each and every detail fits in with your goal.

Once you think you can start with building your stuff, start on it. Put the rest of your learning as and when you require it. There'll be obstacles, many of them. Don't be afraid to ask questions. Before asking questions, look up and try gathering information yourself. And ask valid, strong and complete questions. The stronger and more complete a question is, the more easier it will be for the other person to help you out. Never look of spoon-fed solutions. Read up, understand the context. You will feel as if you solved the problem without help. Its a different level of excitement altogether.

As a developer one can never stop learning. There is just too many stuff to learn. Its a whole world out there to explore.

Well then coming back to the problem at hand. Once you have something minimal ready, release it. Do not wait for the correct moment. "Release early, Release broken" as they say. Its natural to have snags and edges. You will get enough feedback to help you sustain your motivation.

Where you go from here onward is entirely upto you.

Join a community you want to be a part of. Communicate with people. Build reputation. Discuss matters. Ideas are just waiting to be born and implemented.

Enjoy the journey, do not worry about where the path leads to. Wherever you reach by the time you finish college, I'm sure you'll have found your place.

Thursday, May 28, 2009

This is why we love python!

Well, this is what Kushal said, and I agree completely.

I wanted to sort a dictionary by value. I asked Kushal.
He said, "I don't know. You can sort it by key. Maybe you have to do manually!"

I went ahead and googled...

And this is how we do it:

alist = sorted(alist.iteritems(), key=lambda (k,v): (v,k))

Thursday, May 21, 2009

Nightro

This is perhaps the most interesting way I have blogged!

I am sitting outside my flat door because I forgot to take the keys to office yesterday. Actually I couldn't find it. So I went without it. Why did I do it?

I returned back to my GusetHouse/Flat at 1 a.m. and knocked incessently. No one answered. I called the caretaker again and again (over the phone, which is switched-off now because its out of charge; and before it got out of charge it got out of balance [I won't say how]). He didn't receive my call. So I went down and asked the guard. He said "Kharak singh does not live here, woh lamba rehta hai (he lives tall??)". Anyway he called another guy from the security cabin, and he tried calling some another guy with my phone. No one was picking up.

So I told him I would go up and try knocking again. And if no one answers, I would go back to my office. I came up and knocked, no answer.

Ten minutes later the guard and the other guy(Kamal I guess, or not maybe) came up and saw me squatting on the floor outside my flat door, with my laptop on my lap trying to connect to the Wireless Broadband Modem inside. They laughed and asked me to come along. They would try and get me a room for the night.

So together we went around the buildings of the Sophronia Society Complex, waking this guy up and that (mostly caretakers of different GuestHouseFlats in the Society, looking for a place where I could spend the night.

Finally when the group has increased to a Five, they got me a room at some S1-302, air-conditioned.

And I slept.

I woke up at 7:30 today hoping someone would be up in my guesthouse by now....


KNOCK!! KNOCK!!!!!
OPEN UP FOR GOD'S SAKE!


Ah, I hear footsteps! :)

Sunday, May 17, 2009

Into the Wild

Yesterday while walking my way back from Koregaon Park to Kalyani Nagar, I lost my way. I walked some three kilometres extra. Total of five kilometres. Alone. At the dead of night. After midnight.

Things I saw on the road were strange. My thoughts, however, were different.

The last four years have been so happy. Stuck in a small place called Durgapur, with nothing more important to do than organising some fests, with your friends all around you. Bunking classes. Studying a day before the examination. Visting home once_in_a_while. That was so unrealistic. So not RealWorld.

This was so inevitable that you did not want to realise it before. But now when reality comes and hits you hard on the face, you can all but ignore it.

High time when you realised the importance of hard work. How there is no second chance in this real life. How values you had assumed to be something have totally different values than what you can possibly imagine. Plans you had made for the future were actually fantacies and differ a lot from what is actually in store for you.

Friends you had taken for granted, made for free, that you have left behind. Now now that you start afresh with a clean board you realise the effort that goes into earning the trust of someone.

Now that you have enjoyed your dream, wake up. Brush your teeth, wash your face, wear your specks. And when you look out of your balcony, you'll notice that the world below is much more stranger than you had always wanted it to be.

Wednesday, May 13, 2009

Punics

Puja Vacations of 2007 was the time I had for the first time taken a train journey across the country from Kolkata to Pune with a guy called Souvik Ray for publicity purpose of a failed thing called Mukti '08. Puja Vacations of 2007 was the time when I fell in love with this place called Pune and decided that if I ever got a choice of where I would work, I would choose Pune.

Summer of 2009, here I am at this place called Kalyani Nagar in Pune working at a company called Red Hat.

Its been roughly 75 hours since I landed up at the Pune Airport. Seems like a week already. Not that I have done a lot of things since I landed here. But I certainly can do with some more company (no not another employer).

I am liking the work here. Time passes quickly if I'm working. The clock slows down when I'm idle. Speaking of clocks I can just see the time but actually have no sense of how its running(thanks to the time meridian difference from Kolkata [India should seriously think about having two TimeZones]) and certain other reasons I'm not sure of).

First night at the guest house was a ghastly experience (I would blame it on a properly timed BlackOut and the thought of a DeadBody floating in the bathtub planted in my head). I'm living alone in the 3 BHK(new term, means 3 bedrooms + 1 hall + 1 kitchen) guesthouse-cum-flat.

Kalyani Nagar is a costly place, more so to a working man (ye, I'm a MAN now) like me who has not got his first salary yet. More so when there is a MacD + BigBazaar + CCD + SubWay + KFC + MORE + ShoppersStop and a whole lotta other brands just near my office+GuestHouse. But wandering around the place without a companion is really sad. :( (I sound desperate when I really am)

Third day at office is about to end. I really and sincerely hope I make some friends here and fast. Without that I guess I won't last here long (figure of speech).

Wish me luck! :)