Wednesday, June 30, 2010

Riley Freeman is The Karate Kid

I just got some spam from Sony Pictures for the "remake" of The Karate Kid (note: there is no karate in this film, it's all kung fu) and there was a photo of Will Smith's kid Jaden who plays the protagonist alongside Jackie Chan. If you're a fan of Adult Swim's The Boondocks you'll recognise this kid immediately.

Yes folks, that kid is the spitting image of one Riley Freeman, the wannabe gansta youngest grandson of Robert Freeman. Check it...

What makes this even more humorous is that both the film and the TV show are property of Sony Pictures International. Cross promotion maybe?

Friday, June 25, 2010

Excel Formulas are Like Latin

I'm doing a spot of data manipulation and importing for MotorShout at the moment and am currently importing every Mercedes-Benz ever. Sounds like fun? Not really. Anyway, the source data is in an Excel spreadsheet which I'm modifying to match up with our existing SQL Server input table. The input data for Mercedes-Benz is missing the car name’s prefixes. e.g. "CLK500" is missing the “CLK” but I do have the "500" and the “CLK-Class” family name in other columns. I want to merge the “500” with the “CLK” from the family name to get the model name. Easy peasy? Hardly!


Here is the alien Excel formula that rubs my 15 years of coding experience the wrong way:

=CONCATENATE(IF(ISERROR(SEARCH("-Class",B2)),"",SUBSTITUTE(B2, "-Class","")), D2)

Why is this alien? Well for a start a simple Replace() method would have done this job fine except Excel already has a REPLACE() function... which replaces text at the given indexes, WTF? OK, so they have SUBSTITUTE() that does what I want, fair enough, let's get on with it.

OK, now what if the family name doesn't contain "-Class"? I don't want to prefix the model name in that instance so my first thought is I'd use an InStr(), or IndexOf() or Contains() method to check if the string is in the family name, sorry wrong again! I have to use Excel's SEARCH() function. But do you know what makes SEARCH() oh so special? If the string isn't found in the source it THROWS AN ERROR! The endlessly helpful #VALUE! error, fun times indeed. In their wisdom Microsoft therefore ensured Excel has an ISERROR() function which, you guessed it, checks for an error. Sorted!

Finally, a simple IF() statement wrapping that ISERROR() condition and we're almost there. Just need to concatenate (yes, the function uses that name) the newly trimmed out family name with the model name and voila! Simple!

*sigh*

This is what I would have liked to write (C# mashed into Excel please!):

=B2.Contains("-Class") ? B2.Replace("-Class", " ") : "" + D2;


Wednesday, June 23, 2010

What Is Wrong With Alan Wake's Facial Animation

Last night I played the first couple of hours of Alan Wake and the game is good fun. A little bit of Left 4 Dead mixed with a dash of Doom 3's flashlight and other bits and pieces. The game was originally intended to be the big DirectX 10 demo for Windows Vista but somehow wound up being an Xbox 360 exclusive.

The locations and environmental effects in the game look fantastic but there is one thing that stands out as freakishly bad (other than the Lincoln, Sync and Energizer product placements), the facial animation! Every time I watch a cut scene I cringe, here's why.

I've just recently finished Mass Effect 2 and Final Fantasy XIII, here's what their facial animation looks like as a comparison for the horror that follows.

Mass Effect 2

Final Fantasy XIII

Now, my friend says Uncharted 2 on the PS3 looks amazing and who am I to disagree?

Uncharted 2
(not sure if this is ingame but it looks it to me)

...and now Alan Wake *shudder* (make sure you wait to see Rose)

So as you can see... FREAKY! It reminds me of this classic