Archive for August, 2006

Yesterday, I lost 3.5 hours of my life in one of the most horrible ways imaginable - by watching one of the most pathetic movies of my life. I left the cinema hall feeling thoroughly disgusted with the movie and it’s director. The saddest and most depressing part is, this movie is gonna make a lot of money, thus encouraging the director to churn out more rubbish like this.

To be fair, the theme of the plot was good. Well, not good good, but decent enough. The characters were good. They were believably real, to an extent. No superhuman heroes here - just plain, flawed human beings. Almost everything else about the movie was dismal. The only saving grace were the songs, which Radio Mirchi had drilled into my brain, and the Bs. Big B and Little B were the only ones worth watching, especially Little B. His character had a emotional depth that resonated well with me, and he actually managed to provide some respite in, what is otherwise, the most horrible movie I have ever seen.

I was slightly affronted by the almost-trivialized potrayal of the institution of marriage, though I must admit that the alternative climax would have been too cliched to bear.

This movie does carry a very VERY powerful message. In fact, two of them.

1. Karan Johar must not be allowed to direct anymore. His repeated “successes” with movies like this, will forever cripple the movie industry and prevent it from providing us with more gems along the lines of Swades (don’t get me started on Swades losing out to Veer-Zara at the awards)

2. Move over ‘King Khan’, Abhishek ‘Lallan’ Bachchan is here.

There was one more high point in the movie, or rather, before the movie. The trailer for D2. I had loved Dhoom and was looking forward to the sequel, and judging from the trailer, it’s gonna rock - John Woo style!!!!!!!

Humming loudly to vent some of the happiness bubbling up in me, I entered the elevator and jabbed ‘10′. Wordlessly, the doors slid shut and the metal cabin slowly started making its way up the steel corridor.

It stopped at floor 4. Someone entered and pressed ‘9′. I was too busy humming and celebrating to care. The doors closed and we continued our merry journey upwards.

Next thing I knew, the elevator had stopped at 9 and the doors slip open. My eyes just ran over the details of the office in front of me, when suddenly they dipped and noted that the floor of the elevator was not aligned with that of the office floor. ‘Was this reason for concern?‘, I thought. Before I could pursue that line of thought further, the doors slid shut, cutting us off from the rest of the world. ‘Well, so much for that..‘.

This time, there was no gentle stutter or jerk to indicate that the elevator had started its merry ascent again. I looked up at the LED display. It showed 9. Then all of a sudden, it started couting up and down at a rapid rate. Within a brief instance of time, I was on high alert. I looked around me. The others were yet to notice this. Even as the situation was dawning on them, all the button lights switched off.

Now, they were all looking at each other. I looked around the lift in panic. Was this, as far as my life would take me? Was I going to die in a painful and horrible manner? The lift gave a small shudder, as if the cable had given way a little, and my heart plummeted down 10 floors. We tried the buttons for various floors, tried to close or open the doors, but nothing worked. Immediately, I called my friend and informed him of our predicament. He ran off to get help. Meanwhile, we tried the “emergency” buttons. We pressed the ‘phone’ button. Nothing happened. We tried it again. Nope, it was dead. We then tried the next one, whatever it was meant for. That didn’t magically rescue us either. Then, almost frantically, I jabbed the ‘alarm’ button, and somewhere in the distance, I heard a siren go off.

Almost relieved, I kept jabbing at it, a bit worried that I was causing much commotion outside. ‘My life is worth more than other people’s discomfort!‘, I thought savagely. All the while running over in my mind, what I could do should the cable break. I looked up and saw that the ceiling had several glass panels. Would they be breakable? Could I break some and hang from them when we fell? So what if my hands came out of their socket? Maybe the rest of me might make it. All this while, the lift kept groaning and shuddering, playing its deadly game with us.

Then, as abruptly as this nightmare had started, it ended when the doors slip open. I almost literally jumped out in a single leap. The others exited less dramatically. In an almost hysteric tone, I asked a friend of mine, who happened to be there at the reception, which floor we were on. With a look of mixed amusement and astonishment, he replied that it was the 9th. Without further ado, I made my way back to my office on the 10th floor via the staircase.

The rest of the day was spent in pretend-elevatorphobia. I am not the superstitious kind (ok, maybe a little) but it was fun pretending that the elevators were cursed and that as long as I am alive, I would never use another elevator. However, at the end of the day, when I had to return home, the prospect of climbing down 10 flights of stairs, made me enter the elevator quite meekly, thus ending an adventure that lasted barely 10 minutes, but had cut, probably, 10 years from my life. My life had, for 10 minutes, dangled by a thread (well, so it was a steel cable - the point is still valid).

Mashups seem like an awesome idea (I know I am a little late on the scene). Thinking of dipping my legs into the Mash(up) Sea.

Link

So what exactly is the difference between a class and a struct in C++? After wondering and debating internally for quite a long time, I looked around the net and found the (simple) explanation that:

"The only difference between a struct and a class is in the default access."

That is, a sruct is public by default and a class is private by default. Extending (inheriting) them is also like-wise - public inheritance for struct and private for class.

I believe struct was made public by default to be compliant with C . Thus a C struct can be used similarly in C++. i.e.

C++:
  1. struct Foo
  2. {
  3. int bar;
  4. char* baz;
  5. };
  6.  
  7. Foo makeFoo()
  8. {
  9. Foo temp;
  10. temp.bar = 1;
  11. temp.baz = "test";
  12. return temp;
  13. }

The only reason the above code will work in C++ is because of the default access of struct being public.

How easy would it be to build include graphs in ruby?

Here's my first attempt:

RUBY:
  1. $list_of_files = Hash.new
  2. $list_of_files.each {|node|
  3. node = Array.new
  4. }
  5. def store_includes(pathname)
  6. lines = IO.readlines(pathname)
  7. lines.each {|line|
  8. if line.include? "#include"
  9. include_file = line[line.index("#include")+"#include".size,line.size]
  10. fidx = 0
  11. sidx = 0
  12.  
  13. if include_file.include?("\"")
  14. fidx = include_file.index("\"") + 1
  15. sidx = include_file.index("\"",fidx+1) - 1
  16. end
  17.  
  18. if include_file.include?('<')
  19. fidx = include_file.index('<') + 1
  20. sidx = include_file.index('>') - 1
  21. end
  22.  
  23. include_file = include_file[fidx..sidx]
  24. $list_of_files[pathname].add(include_file)
  25. end
  26. }
  27. end
  28.  
  29. def iterate_files(pathname)
  30. list = [] #alternate way of initializing an array
  31. if pathname=="." or pathname==nil
  32. list = Dir["*"]
  33. else
  34. list = Dir[pathname + File::SEPERATOR + "*"]
  35. end
  36. list.each { |path|
  37. if File.filetype(path) == "directory"
  38. iterate_files(pathname)
  39. end
  40. if File.filetype(path) == "file"
  41. store_includes(path)
  42. end
  43. }
  44. end

Any comments?

Is there a more efficient way to extract the file extensions in ruby? I currently do the following.

RUBY:
  1. ext = File.basename(filepath).reverse.split('.')[0].reverse

I am having hell managing 5 different mail accounts. Since I hop from PC to PC, I can't afford a desktop client (fyi, i prefer Thunderbird). So it really irritates me having to log into 5 different pages to check all my mail. Yup, this means a lot of mails goes unread.

I looked around for a webmail client that lets me manage multiple accounts.

Here are the ones I found:

1) IMP - Part of the Horde project

That was it. Just ONE. WTH! And that too, for this one, I had to install the whole Horde framework (which I am not at all prepared to do). Meanwhile, for squirrelmail, managing multiple accounts is still down there somewhere, in the wishlist.

Was wondering whether I should take the pain of writing something like this? Or a plugin for squirrelmail? I dont know.

Welcome to Tech-no-Spark! This is primarily a tech blog. I will be putting my random thoughts as well as discourses and discussions regarding information technology.