Monthly Archive for July, 2009

Mockery Of A Great Tale : Happy Potter And The Half Blood Prince Movie

Despite all the poor reviews, I decided to go to a movie theater and watch the movie myself. The author of the book on which the movie is based wrote a very clearly understandable book, and I used to wonder how can a script-writer for the movie get anything wrong.

But at the end of painful 3 hours, I was left shocked, amazed and dismayed. Did the script-writer ever care to read the original book himself, or did he just make a movie listening to an oral summary of the story from his kids? The focus of the movie and the book were two different extremes. And in the end, it made mockery of the abilities of a great man.

The book and the movie I am talking about is Harry Potter and the Half Blood Prince. If you haven’t yet watched the movie, better don’t go. Read the book again and you’ll utilize your 3 hours better.

If you cannot comprehend my anguish, I’ll try to put in words a few scenes from the movie.

Its a quite night, and Harry is back in the Burrows for the winter vacations. He is idly looking out of his window. Ginny climbs up the stairs in her night dress and walks up to Harry. They look into each other’s eye and she says ‘your shoe laces’. She sits down next and ties Harry shoe laces. She stands up and they kiss ! What a dumb thing. And at this time, she was supposed to be dating Dean.

And yeah, immediately after this scene there was an appearance of two death eaters, who after fooling around with the boy and his to-be girl friend burn down the Burrow. Now, I am not sure this happened in the book. I need to check this.

Funnily, totally out of context, at one point in the story, Dumbledore summons Harry and asks him if there is anything between him and Hermoine ! Now I am damn sure this was never written down by Rowling.

The whole movie was a romantic comedy. The book had lots of excursions of Harry and Dumbledore together. Dumbledore imparts a great deal of information to Harry so as to help him in his future quest. They plunge down the memories of the great warlock and see Riddle’s mother. They try and understand what Voldemorte values the most, which then later enabled them to take a blind shot as to what might be the horcruxes. But nothing of this sort ever happens in the movie.

There are only ever two pensive visits. The first was that of Dumbledore meeting the young Riddle in the orphanage. The second was the conversation between Horace and Riddle. That’s it! Could the script writer not have omitted a few smooches and inserted a few travels. The director should realize that its not a cheap crowd that watches Harry Potter movies. These lowly tricks are not required to lure people into the theaters. By her narrative Rowling has already ensured that almost everybody will watch all the movies however poorly it has been depicted on screen.

And yet I was ready to forgive the director, until the last scene atop the Astronomy tower. They literally made mockery of the Dumbledore.

Now this is what happens in the book :

A death mark is hovering above the Astronomy tower. Horrified by the presence of the mark, Dumbledore, though tired and drained, flies to the tower. Harry accompanies him in his invisibility cloak hidden. Malfoy comes up the stairs. At this point two spells are cast – one by Malfoy disarming Dumbledore, and another by Dumbledore petrifying Harry. And this was crucial.

Now this is what is shown in the movie:

Dumbledore requests Harry to go and hide behind. The coward Harry does so. Then Draco walks up to Dumbledore and disarms him. The warlock, who just an year ago was able to duel Voldemorte, and not only that, who after wards was ready to fight the aurors too, get disarmed by a young school going boy who hardly knows ten spells. Bullshit. After a few moments, Snape walks up to the place where Harry is hiding and gestures him to remain silent. Snape next clilmbs up to where Dumbledore was and kills him. All this time the apparently courageous Harry is hiding below. Harry can move, but he doesn’t. And afetr killing Dumbledore, all the Death Eaters raze through the castle and escape unchallenged.

Why ? Why ? Why ?

Why could they have not just copied Rowlings ending. There is a reason why Rowling has more money then the script-writer of the movie. People want to read what Rowling has written, and so why can’t the director just make what people want. Why does he have to use his brains? Damn it, if he cannot figure out what is important and what is not, could he not just simply ask Rowling to mark the passages that should be made into a movie? Who the hell did advise him to infest the movie with kisses and romance leaving out all the important stuffs.

It was so stupid watching the movie of a story I so dearly loved. It angers me. It pains me. And now I hear people who haven”t read the story talk about how crappy Rowling’s concept has been.

Had I been the author, I would have most certainly sued the director.

My suggestion – If you are a great fan of Harry Potter books, do not watch the movie. Its a crappy romantic piece of shit. If you haven’t read the book yet, better invest your 3 hours in reading the book than watching this sorry excuse for a movie. Once again the Harry Potter movie disappoints me.

Popularity: 2% [?]

Varargs

Just like you have variadic functions in C, Java has the Varagrs :) . Its usage is as simple as this :

public List<string> getModifiers(String... arg) {
  // arg is String[]
}

And the wonderful thing is that the arg is a String[].

Popularity: 4% [?]

Hard Disk Manipulation

Hmm … for some reason, I would like to have a tool which allows me to configure my hard disk in a way such that :

  • A portion of my HDD is reserved for some purpose, say movies
  • Only an external web admin can add files to this reserved portion
  • The user can only delete files, copy from/to the reserved portion not allowed

Basically, the idea is to create a reerved spacxe where the web admin can push certain confidential files knowing that the user can only go through them, or delete them if they are not of his use. The user should not be allowed to modify the files or redistribute them.

Well, one solution would be to actually have an online managed space with the permissions appropriately set. But in the event of file size going beyond GB’s, it’ll be more convenient to have a local unmodifiable/non-distributable copy of the file itself, instead of having to stream the whole thing every time.

But I suppose such a thing might not exist. Obviously, its illogical to assert that a computer administrator has limited modification permission to a piece of his own hard disk.

I’ll google around to see if any tool comes near to my requirements – non-redistributable local copy of files on the web server.

Popularity: 2% [?]

Trying To Get AST Working … I

Well, as a part of a dummy project Rahul and I are working currently, we need to create an Abstract Syntax Tree for the source code provided. Once that is done, we will be able to create wrapper classes around it and get our project running.

The AST that is provided by the core Java APIs give only a read-only handle, which is not of much use as we would like to be able to modify the AST later on. So we decided to go with the AST provided by Eclipse. Basically, eclipse has this thing integrated in its IDE to provide the refactoring features.

Importing a lot of eclipse jars, we set out to test if it works. The result is partial. We have been able to pass a source code as a string and get its AST, but when we tried passing the whole workspace, eclipse gave a run time error. It says IllegalStateException as the workspace is closed.

Googling around a bit, we realised that IWorkspace can be used only as an eclipse plugin. Now we certainly do not want to add the extra complexity of making an eclipse plugin, as we would like our code to run even in the absence of eclipse. So now, we need to figure out how to provide the whole workspace to the application as an input so that its AST can be generated.

Popularity: 2% [?]

Why Ani .. why ?

Star wars is one of my favourite series of movies. I have watched the whole series a number of times. Yesterday, I was once again watching the 3rd movie, and the duel between Anakin and Obi Wan always gets my emotions running high. I love both the guys, and its painful to see them locked in an intense light saber duel.

I still remember my feelings when I watched the movie first time. After the 2nd movie, I fell in love with Anakin. I could see myself in him. His arrogance and the confidence, his hatred towards all the beings who have wronged him, his desire to be the best, to rise above any other and his focus towards his goal. These are the qualities I admired in him, and I wanted to be that guy. I could see my role model in Anakin Skywalker.

And then to watch the same man being tempted by power to do wrong deeds just broke my heart. And it did more than just that. It made me question myself – I wanted to be the same guy, would I have reacted in the same way? Could I have transformed from a charming Anakin to the most dreaded Vader? And after introspection, the realisation baffled me.

I realised that all the heroes I idolised are like him. I rate Tom Marvolo Riddle highly, and look at what became of him. In Dumbledore’s words – Tom was a charming head boy, and when he returned a few years later as Lord Voldemorte no one could recognise him as the same guy.

Part of my life has been a constant struggle to prevent myself from turning into one of these. I still aspire to be a Anakin Skywalker, or a Tom Marvolo Riddle, but I shall never transform into their latter selves.

And this is why everytime I watch the movie I feel the same pain again and again. I cannot get over it. Why Anakin … why did it have to be only Anakin to turn bad? Why could it not have been anyone else?

Popularity: 2% [?]

The So Called Coders

This could be a sensitive topic for a lot of people. Pardon my arrogance, and be advised before you read any further. What is written below is my opinion, and in a few matters, I never deviate from them. You might try to prove me wrong, you might produce great examples to contradict me, while I do not even try to defend myself, but nothing can make me change these opinions of mine.

So here I am. A fresh graduate student out of the hyped IIT’s starting a career at FICO. I look around myself, I look at the people I’ll be working with and I am disturbed. The realization of truth that I am surrounded by non-CS people, people who probably started coding only after graduating out of their universities, makes me miss my alma mater. But why ?

Well, IIT’s are definitely over hyped when it comes to imparting knowledge to students. However, the aspect of my campus life that I relished the most was the belonging to a geeky society of skilled coders. These are the people who wouldn’t care for the so called good programming practises, but none the less, would implement almost all of them, knowingly or un-knowingly. They would do so because of logical reasons, and not because someone instructed them to. They would hunt the internet to find interesting informations regarding the scripting languages. And these are the kind of things I do not expect from people not of coding background.

Coming back to the disturbing world of reality, I was shocked to know that people don’t even understand the significance of 80 characters per line thingy. They just do not understand the difference between tabs and spaces. Give them an Eclipse pre-configured and they’ll be happy coding their entire life using it, without ever caring how the code would look like if  a guy on a linux machine using vi and having 800×600 resolution chanced to look at the code.

My friend Naresh told me about the Shebang notation and the story thrilled me. It was an awesome idea not to add extension suffix when using scripting languages. The Shebang line contained  the information for any coder interested in reading the code. And now, when I tell my friends, the ones not involved in coding before getting into a job which requires coding, and all I get back is a bored stare suggesting dude-which-part-of-it-was-interesting !

I do not expect these people to feel the same excitement as I. For them, coding shall always be a way to earn money. For me, it is the satisfaction of producing a beautifully written code which gets me up every morning. For these people, writing a code is merely following fixed guidelines and structuring the code around them. I hate it if someone comes to me and says use addall() function instead of the add() because addall() is faster. No ! I do not want statistics. Come to me and tell me why addall() should be quicker. Lets discuss the internal implementation of addall() which causes it to become faster than the other. And by internal implementation, I mean I am prepared to get as deep as compiler or OS level implementations.

In IIT Kharagpur, the place I come from, we have this competition called the Bitwise. It amazed me to learn in my third year that if you use a general purpose function like strcmp() your code will almost certainly fail the time test. Upon discussions, I found out why. And now I do advise people to make custom pointer based copy and compare functions instead of using the all purpose ones. But will these people understand it ? Will they appreciate the complexity at such a simple level.

I never expect them to. To me, they shall always remain aliens in the wonderful world of coding. I shall try my best to make them interested in the non-programming aspects of coding, but will I succeed ? I doubt that.

I conclude with another example of a friend who was using Eclipse for the first time. She copied a piece of code from some site. Then she found out the refactoring bliss of eclipse and got her code reformatted. But instead of being happy, she was disappointed at the result. What was bothering her was that a function had been broken into 3 lines, that the complete for() statement was written across 2 lines and that the comments were also put in multiple lines, despite the fact that 1/4th of her screen on the extreme right was empty. She sat down and brought everything to single lines. The ugly code spanning screens pleased her. She was happy in scrolling righ to left and then back again, but would not consent to the 80 characters guideline.

These people will never understand why the confirmation to programming practises is required. They will never appreciate the simplicity of the logic behind each of the rules that they are told to follow when writing a program.

My friends refuse to use putty or an equivalent ssh shell. They would rather go through the pains of installing cygwin and some IDE within it. vi disgusts them !

My friends, if you are one of the others, you can never be one of us. You can never become a coder. The love for code comes from within a person. It cannot be produced, not at all by making someone code for 10 hours a day.

So tomorrow if you walk upto me and insist that everyone involved in software product development is a coder, then please, you could not be more wrong. The distinguishing quality is that a coder cares not for how a particular thing is done, but why is it done the way it is.

I miss IIT Kharagpur.

Popularity: 2% [?]