Redefine (and hence the blog) is back and so am I. Got back from Chicago this afternoon - it was supposed to be this morning, but that part of the story comes later.
I was in Chicago over Christmas primarily to attend my friend Shital's wedding. Left on Friday afternoon, got there friday evening. Off to my friend Bina's parents' place (where we were going to stay the night and hang out the next day). Got force-fed super wonderful Indian food and then to top it off got a huge number of (very unexpected) gifts from Bina's parents. They rock. We visited Malay's parents later on saturday for some more force feeding, followed by a huge dinner at Bina's place where (I'm pretty sure you can't guess what's coming) I got force fed again. Talk about diets and watching my weight and all that. Phooey.
Landed up my friend Mark and Laura's on Saturday evening. I was supposed to be there at 10 (told Mark that) and got there at 11.30. Wonderful Indian Stretchable Time.
Next morning got together with Kevin, Christella and JP and drove down to Peoria (where Shital was getting married). The wedding was awesome - the generalized chaos of an Indian wedding followed by a less chaotic but very enjoyable reception. And good food, lest I forget. Lots of dancing as well and a very good time in general.
Next day back to Chicago, saw Return of the King, extended edition at Mark's. Mark's parents gave him a ton of loot - this was part of it and we were taking due advantage. Poker party at night with Mark's good friend Constantine and Stavros. Awesome discussion on the poker table about socialized medicine and the fall of the US dollar, the US economy and bashing on Mark for being a republican. Stavros has a doctorate in economics so he knew what he was talking about; for the most part I didn't.
Got up ridiculously early (after 3 hours of sleep) - thanks Mark! (since I woke him up too) and got a ride to the airport. 1 hour security wait followed by nearly losing my flight because of overbooking and I got on the plane. To my pleasant surprise, I got upgraded to Business Class. Business Class is sweet (this was my first time flying Business). Large, wide seats that nearly flatten out. Coffee served in real cups. Real silver for cutlery (except the knife, which is plastic). I liked it.
I fell asleep right away and woke up in ... Portland!. Portland? I had a direct flight to Seattle, how did we end up in Portland? Turns out that Seattle had so much fog that they had to divert our flight to Portland. After we refueled and let some people off and on, we were back in the air for a 26 minute flight to Seattle.
Awesome weekend ended on a poor note (unfortunately). Seattle airport handlers took over an hour to deliver our luggage and hence my fantastic plan to be in at work at 11 failed utterly - it was 2.30 by the time I started my day. Oh well. I had more than enough fun to compensate for that slight amount of frustration.
Awesome...
Warning to uninitiated: Serious geekiness ahead.
I have a love hate relationship with C++. On one hand, I am amazed at the awesomeness that is the STL. The STL would not be, naturally, had C++ not allowed things like templates (and generics in general). This is the love part.
C++ has features that will drive you up the wall and if you are unaware, will occassionally kill you, or at least, maim you for life. C++ is not a newbie tool - you don't let beginning woodworking students anywhere near the hyper-fast power blades; you don't let a beginner pilot into an F-22 (or JSF). I think you get my point without furthur illustrative examples.
I've been mulling about blogging about C++ for a while, without really knowing what I'd write about. I love it one day - so I could write about its super cool features (which have very little to do with objects and inheritance) and I absolutely hate it - so I could write about what makes it such a terror to use.
Today is one of the hate days. More like "I barely evaded a huge bullet, so let me write about it" days.
Consider you have a class that is a better pointer. (For a discussion about why you'd need a better pointer, have a look at the Boost Libraries.
class better_ptr { ... }
One of the things you'd like to do is check if the pointer is null. If you've ever grappled with the "NULL" or "null" or #defined your own null, you know that the best thing to do with a naked pointer is just
if (ptr) { ... }
which skirts around the whole NULL, null comparison issue.
In order to do the same thing with better_ptr, we shall define an operator bool like this:
operator bool () { ... }
Lovely. So now we go around using our better pointers and things are all good. We have a class Foo which takes in as a constructor argument a better_ptr with a default value of null.
class Foo {
Foo( better_ptr
};
All good so far. Now we had to write a bunch of code that needed another argument to the foo constructor
class Foo {
Foo( int value, better_ptr
};
All good right? All your foo objects that were declared like
Foo foo( some_better_pointer );
have to be changed and the compiler will complain if you don't change them.
Bzzztt!! Wrong answer! The compiler will not complain. Why? Extended entry if you'd like the answer
Remember that operator bool we defined?
But you say that Foo takes in an int but not a bool. Well, the standard lets you have only one implicit user defined conversion but as many implicit intrisic conversions as it likes. Which means that it can logically change the bool to an int. So it took the better_ptr, converted it to a bool, and then converted the bool to an int. And passed in a null for the new better pointer.
That really should scare people. Using
operator type
is just evil. Don't do it.
I went out with the guys to see the opening night show of Blade Trinity.
First of all, the theatre was medium-full at 10.30 on a wednesday night. All guys (with three exceptions). That should tell you something.
Second (in case the former didn't give you a hint of what was coming), here's what the critics had to say: ... "preposterous weapons, ludicrous bloodsucker logic, a judiciously offbeat supporting cast, and gory Snipes swordplay galore."
My opinion: a person going with full knowledge of what Blade and Blade II were like, and assuming, that you liked both of the previous two (maybe one more than the other), will not be disappointed. Sure, the movie has no plot, but then neither did Blade II and Blade's plot was razor thin, at best. I don't think they make the Blade series to try and win an Oscar for .. anything. But for gore, hack and slash and sheer mayhem, it was worth the money.
I still think Underworld is a better vampire flick - perhaps the best I've seen yet.