Being Bit(ten) and Byting Back

Saturday, April 30, 2005

Hitch hiking to see the "Hitch hiker's guide to the Galaxy" ... (and back again)

today is the day.

...

Saw the movie today. I think I like the book better. Salon.com had a nice review saying that it was gentle. Another review ( don't remember where) called it uneven. I think I'm going to call it disjointed. For those of you who have read the book, the story pretty much follows the story of the first book, starting with demolishing Dent's house and ending when the four protagonists plus marvin head to the restaurant at the end of the book.

Trillian's part wasn't so important in book, but the film bumps it up a little, with a little love triangle between Arthur, Zaphod and Trilian. Mos Def played the Ford's part really well. My personal favorite was the second and third book of the series, and I was disappointed when the movie ended where it did. I guess if the movie does well they might make a sequel. I think the opening sequence was a little too long. I understand the book had a little chapter in setting the tone of the book, but for the movie I thought it was a little too long. The movie should have begun with Arthur Dent waking up.

Plus the way Zaphod's other head was attached was kind of silly. In the book I always thought that he was a two headed person with a head surgically attached side by side with his original head. Trillian's role was played very well, but I think a better film could have been made if the filmmakers had avoided the whole party scene in Islington. That kind of broke the tempo of the movie as they were rescued from the Vogon constructor fleet.

I think the director tried to remain true to Douglas Adams' vision of Hitchhicker's universe, but the story was a little jerky, and left an unfinished taste in the average Hitchhickers' fan movie watching palate. It did'nt have that completeness other adaptations had, like Lord of the Rings or Spider-Main.

I think I'll stick with the book for now, Unlike the Lord of the Rings' where I thought I actually saw into the imagination of J. R. R. Tolkien.

ONDotnet.com: Introduction to Managed C++

ONDotnet.com: Introduction to Managed C++ Just found out from here that jagged arrays in Managed C++ are not supported.

Mac OS X 10.4 Tiger Review for all us Mac Heads out there ...

Thursday, April 28, 2005

Batman Begins

I don't know why they keep making sequels of this movie considering that the last three failed so badly. It just might work this time. Currently Listening too ... Devils & Dust from the album "Devils & Dust - Single" by Bruce Springsteen

So what's a POD in Managed C++??

While reviewing some documentation on Managed C++ I came across the word POD. I knew that it meant Plain Old Datatype and by definition, a POD is a datatype that can be copied by copying its bits and does not need a constructor. Digging it a little more I came across this Q & A article by Paul DiLascia. From what I understood , a POD in .Net is restricted in managed C++ classes because the framework then copy these datatypes without worrying about constructors, vtables, etc. Read more about it here I also came across about an interesting difference between C++ and C#. In C++, its generally regarded as bad practice to call virtual functions, in constructors and destructors. The reason is that, during the construction of a derived object, the constructor of the base class is run first, and hence would call the virtual function (if called) implemented in the base class instead of the one overridden in the derived class. On the other hand in C#, the virtual function in the derived class will be called as intended. The reason for this is that when the constructor in a C# object is called, the object is completely constructed. The reason for this behavior is because of the garbage collector. To optimize the performance of the garbage collector, the size of the objects should be known a-priori. And to know the size of the object a-priori, its necessary to construct the complete object (instantiate derived and any base classes). Read a more detailed explanation here.

Wednesday, April 27, 2005

Whats a whitepaper?

A white paper is a report outlining policy or authoritative report on a major issue. I need to write one of these ...

Currently Listening too ...

Twilight Creeps from the album "Dignity and Shame" by Crooked Fingers American Baby from the album "American Baby - Single" by Dave Matthews Band Speed of Sound from the album "Speed of Sound - Single" by Coldplay

Hacker deletes own hard drive

Hacker deletes own hard drive This has to be the silliest story I've read in sometime. Are there hackers out there who don't know that 127.0.0.1 is the self-referencing IP address for your own machine? Most probably, this was some kid who just got hold of some hacker tool off some website, and then tried to use it incorrectly. Alternatively, it could be a hoax where the person was messing with the moderator. Personally, I'm inclined to believe the latter explanation. Read more about it here which is a half-decent translation of the german chat transcript. Make whatever you want to make out of it.

Its good to be Bill Gates ...

Tuesday, April 26, 2005

Check this out ...

XBox 2 Promotion Ad on MTV... I guess I should really start planning to get the TV, I've been avoiding to buy, and play that XBox I won in a raffle :-). Brought to you via.

Monday, April 25, 2005

Only Five days Left for ....

this...

DMB on iTunes....

Wow! DMB decided to get on iTunes too. I read somewhere that the Dave Matthews Band didn't like selling their music online saying that they preferred to sell their music as albums since each album is a work of art in itself I agree with that point, but CD players are just sooooo inconvenient!! Apparently its their first work on iTunes, and by the sample I just heard seems to be pretty good too.

musings on c#, c++, java and the meaning of __liff__ today...

Found out something interesting in C# the hard way :-|

You inherit a value type from an interface, and then attempt to cast an object to an interface, you will implicitly box it, and get a reference to it. Any changes to that boxed reference, will only affect that boxed reference. So the moral of the story is if your value types implement interfaces, then access those operations, through the object and not the interface.

The cool thing about learning something the hard way is that you always remember it afterwards, even though you have wasted a couple of hours on something trivial. :-)

One thing I like about C# is that you can pass parameters in different ways like C++. So value types are passed into methods by value,

ref parameters are used to pass value types into a method by reference and out parameters are used to only to return information from a method. Compared w/ Java, this is definitely an improvement. Actually you can achieve the same sort of effect with some indexer magic using the [ ] operator, but its kinda clunky. They could have avoided all of this by just making it like Like some functional language and returned everything as a tuple. After all, is'nt Python like Java or C#, utilizing a runtime to run its bytecode, like Java byte code, or MS IL?

Question to someone out there, what exactly is the difficulty in returning tuples from a method call in a OO language, a'la Python, Lisp, or Haskell?

In a way I think, all languages are gradually getting there. C# already has features like foreach and params, which is akin to Python's argument passing scheme, (when declaring a method like def foo(**args), and that passes a dictionary of arguments). C++ already can do this sort of thing using generic programming. So can you pass in different parameter lists of objects using the params and object keywords in C#, something like

void foo(params object[]bars){ .... } ?

And the answer to the above is that you can !!

One of the stuff I need to do for some work related stuff is to experiment with some Managed Extensions for C++. At work, I'm working with a lot of legacy code, that needs to be somehow integrated as we migrate to newer technologies.

Not Much on the Meaning of __Liff__ today.. May be tomorrow. Too bad this font is going to be appear only on computers, that have it installed, I don't see it on my Windows XP box. It looks really nice on my Mac.

Sunday, April 24, 2005

Political Compass

My Political Compass is (-3.75, -3.90), i.e. My rating on the Economic Left/Right on scale is -3.75, and on the Social Liberatarian/Authoritarian scale is -3.90. Brought to this blog from here.

Monday, April 18, 2005

Musings for the day...

I'm confronted with a design problem at work that has been driving me nuts. Framework design has been on my mind quite a lot lately. One of the most vexing questions I have to deal with is how to refactor C++ code written somewhere in the last century with distinct C flavor into a viable modular OO design. I bought Martin Fowler's book on refactoring last night to help me get some ideas. I guess that will be my bed time reading for today.

On another note I started reading up on DirectX and how to render 2D images in it. One of the big problems that we face in the company I work for is how to render images quickly enough. A lot of image processing is done by the IPL from Intel (actually we're using an older version, we need to move to IPP), but that's only one part of the solution. We need a faster way of rendering the 2D images on the screen. I've been looking at DirectDraw for that. There is only one person in the team who knows anything about DirectX, and even he worked on DirectShow which is something for rendering movies. Since this will be probably be happening in my own time. I guess I won't be moving to Linux like I had to planned to.

I've been debating if I should get the new Max OS X release, when Apple releases Tiger. Its about $129.00. That's pretty steep(!) for poor ol' me. Or should I wait until I can afford to buy a new PowerMac. I heard that Apple is planning to come out with some new hardware. I wonder why Apple did'nt release a Java 1.5 for Macs when Sun released it. I'm pretty sure they are going to release it with Tiger.

Sunday, April 17, 2005

Python Bindings for the MPEG Library, finally finished...

Finally managed to test and get a running program running with the Python bindings I wrote. Python, SWIG and C++ source is FINALLY on the way. Need to write some documentation though. :-(

Sunday, April 10, 2005

Bloglines

N. invited me to Bloglines. This tool uses the RSS feeds on various blogs to generate a one-stop for all the blogs and websites a person may want to read. I was using A9.com's toolbar to consolidate my favorite links, but I think Bloglines is much more useful, especially for blogs.

Sunday, April 03, 2005

Another weekend gone...

And tax day is only ten days away :-)

Testing the Python Bindings for the MPEG Library...

Just started testing the Python bindings for the MPEG Library. Found my first bug of the day :-), there was a problem of how I was transferring the data from C++ world to Python World. Should have used the SWIG provided function to convert the std::vector object to create a new Python Object and then add it to the tuple.

There is one think I haven't managed to work out, is the number of warnings the VC7's compiler emits when compiling the C++ code that it emits. i thought of using #pragma's but I want to investigate a better way of suppressing those warnings.

Plus there is also the issue of SWIG's warnings. I have a bunch of classes that are derived from an abstract class that uses templates. The template arguments come from a library that I don't want to expose to Python. Now because SWIG emits Python bindings by parsing the C++ header files, SWIG complains that it can't find any information about those classes in the interface file. hmmm, I could use the protected inheritance. That way SWIG won't attempt to locate class information in the template class.

Fixed the bug in the C++ code, but a new problem in the Python client code... Turns out, that the proxy objects don't interoperate C++ to Python seamlessly. I will need to write some sort of translation code.

Friday, April 01, 2005

Movie Review: "Paycheck"

Saw Netflix: Paycheck in the theater, and then saw it again today. It was a dissappointment then and its still a dissappointment now.