Saturday, 15 December 2007

More Movies

Herself was away so I rented a pile of movies as I am wont to do on such occasions. In order of viewing: Underworld: Evolution, Ultraviolet, Resident Evil: Apocalypse, and Frank Miller's Sin City: Recut. Interestingly enough, that's also the order of my least to most favourite (perhaps I planned it that way).

Underworld: Evolution didn't turn out to be my kind of thing. I generally love vampire movies, but these vampires just didn't do it for me. Maybe I should have seen the first movie, but I don't think it would have mattered. I didn't think it was a bad movie - it just didn't really pop off the screen for me, and I didn't care about the characters much. If you like Kate Beckinsdale, maybe it's worth seeing.

I was mildly disappointed by Ultraviolet, although I'm not really sure why I didn't like it that much. I've always had a bit of a thing for Milla Jovovich, and the movie was definitely of the sort that I usually enjoy, but it left me a little flat. Nonetheless, it's a really good time. Think Madness, only it's a chick instead of Hank, and there's a trace of plot here and there to glue all the violence together (although the actual plot doesn't really matter).

Resident Evil: Apocalypse is the second installment in the trilogy. It's definitely different from the first picture, in that there are less surprises (and sadly, no Michelle Rodriguez of course), more contrived plot devices, and the action is... different, for lack of a better word. It's more like a zombie movie than the first, in a George Romero kinda way. It's fun, but not as cool as the first for sure. And no, I'm not one of those people who always claims that the sequels are worse than the original, because that simply is not always true (but mostly it is ;) )

Sin City. Totally made up for the other 3. This was based heavily on the original graphic novels by Frank Miller, and Rodriguez brought him in as co-director to ensure that they got everything just right. Makes a big difference, as it's really stylish and it feels like comic book. Tarantino stepped in as "Special Guest Director" for a scene, and if you pay really close attention, you'll probably be able to figure out which scene it was. I could go on and on about this flick - and I think I will...

I rented the 2-disc "recut" DVD set with all the usual goodies we've come to expect from Robert Rodriguez; one of the things I discovered is that he's really big on digital, and shot the move in HD. Also note that he has his own post-production studio, and over 95% of the movie was shot on green screen (apparently this saves a lot of dough in sets and sfx). The extras disc even has a "green screen" only version of the flick, so you get to see exactly which scenes were shot on sets (not many), and which had backgrounds added post production.

I have no real complaints about anybody's performance, but I was hoping for a little more from Alexis Bledel. She wasn't bad, but I would say hers was the least strong performance - maybe I just found it hard to believe her in that role, being as young and cutesy as she is.

Most everybody else was excellent, and with a cast list this long, it's better to just point out the really exceptional folks. Mickey Rourke was just outstanding as Marv - really funny and sincere, and over the top just enough to be a caricature. Benicio Del Toro was awesome as always; very sinister and very funny. I'm a big fan of Rosario Dawson, and she showed a lot of range in this picture - definitely her best performance IMO. Special mention to Elijah Wood, who didn't utter a single word, but was way creepier than I ever thought he could be.

Last, I really have to bring attention to Rutger Hauer's performance as Cardinal Roark; he only did one scene in the movie, and it reminded me so much of Marlon Brando in Apocalypse Now that I had to pop in the DVD and make a direct comparison, just to see if I was imagining the similarities. I wasn't.

To summarize: didn't much care for Underworld: Evolution. Glad I got it off the 7-day rack and wouldn't really recommend it. Ultraviolet was not what I'd hoped for, but perhaps I wasn't sure what I was hoping for. Resident Evil: Apocalypse was about what you'd expect (if you've seen the first), but doesn't quite hold up the same standard. Sin City kicked ass, you must buy the 2-DVD "Recut" set for your library and bow down to Robert Rodriguez, as he's clearly a more superior human being than you and I are. I give these flick 2, 2.5, 3, and 4 stars out of 5 respectively.

Saturday, 1 December 2007

Grindhouse

I rented the two movies that make up the Tarantino/Rodriguez double feature "Grindhouse" last week. A mini review:

Before I get into the movies themselves, I should note that you shouldn't feel obligated to rent them together (as I did); they both stand alone perfectly well. It's fun to watch them together as though you're actually at the double feature, but since some of the original elements from the theatre screenings are not present in the DVD release, the purists will be left wanting anyhow.

First off, Robert Rodriguez's contribution, "Planet Terror". It's essentially a zombie movie, but it's definitely Rodriguez's style and not George Romero. You still get some good B-movie quality bad acting, but there are some heavy hitters in the cast who kind of elevated it a little from pure B-movie. It's exceptionally good fun, and just weird enough in places to remain interesting throughout.

Rodriguez contributed a fake movie trailer, which also appears on the Planet Terror DVD. The fictional movie is called "Machete", and I can't really say much else without giving anything away, so I'll just say that it was awesome.

"Death Proof", according to Tarantino, is essentially him trying to best all the car chase movies of the 70's and 80's, while still paying homage to them. Whether or not he accomplished this is up for debate, but it does have a lot of good gags. It's standard Tarantino fare in that a.) it's very chatty, b.) each act of the movie is just different enough from the others that it could almost be a short film unto itself, and c.) the subject matter is still unique from all his other movies. Don't forget kids, this is the guy who won a Golden Globe for writing Pulp Fiction (yes yes, and an Oscar and a Golden Palm, but nobody really cares about those).

I'm not sure I've seen Kurt Russel as a bad guy in anything, and I wasn't sure he could pull it off, but he did. I felt his performance towards the end of the movie was far superior, but that's just me. As with some of Tarantino's other work, you have to wait for the payoff - be patient, because it's worth it. Pay very close attention at the end, as Rosario Dawson's character does something unexpected just when you think the movie's over.

Other bits and pieces:
Both movies used some aging techniques to make them look like overused, worn out films, although it's definitely more apparent in Planet Terror - it was more of an exploitation piece. Zoe Bell did stunts in both movies and stars as herself in Death Proof. Along with Zoe, Quentin Tarantino, Rose McGowan, and Michael Parks appear in both movies - Michael Parks even plays the same character! Rodriguez also cast his son Rebel, and his twin nieces Elise and Electra Avellan.

Both definitely worth watching. I give Planet Terror 4/5 stars, and Death Proof a 3.5.

Tuesday, 10 July 2007

Art 'n stuff

Went to the art gallery last weekend. I'm not particularly knowledgeable, so the critique will be in the realm of "I don't know much about art, but I know what I like".

Impressionism leaves me a little flat. I really wanted to like it, but it's just not interesting to me. One exception was James Tissot's "Juillet" - the detail is exquisite. However, I'm not sure it qualifies as Impressionist, so perhaps my opinion remains unchanged.

I liked Rodin's stuff - The Thinker was a lot smaller than I thought it was. Lori didn't care much for the bronzes, but really liked the marble stuff. They're all pretty interesting to me, and I'm glad I got the chance to see them.

I really dig Picasso, he didn't fuck around. Even the seriously cubist stuff that I don't really get was enjoyable for me. He used a lot of heavy lines and bold colours - some of the pieces are almost cartoonish. For some reason that spoke to me.

Something that I liked, and I have no earthly idea why, was Mondrian's "Composition with Red, Yellow and Blue". I still think abstract art is a bit of an intellectual put-on, but his other stuff was pretty forgettable, so I guess it's a good thing he decided to go with the lines and primary colours.

The prize for the most astonishing piece goes to Salvador Dali's La Reve (The Dream). Arguably as disturbing as any of his other surrealist works, the subject matter is either to your liking or it isn't. I'm not a huge fan of surrealism per se, but the painting itself is so beautiful and vibrant, it's hard not to like it. The guy did amazing things with colour, and nothing short of seeing it in person can really convey the raw power of this painting. Given the chance, I would definitely check out more of his work; if for no other reason than to see if they all have that same aesthetic appeal.

There endeth the tour. Go early on a Sunday and you'll practically have the place to yourself.

Friday, 16 February 2007

Is there such a thing as a "normal" reaction?

My mom had a heart attack last weekend.

No, that's not code for something else, and it isn't a joke. My friends will be wondering, "Why didn't you tell us? We'd like to have offered some sympathy and words of encouragement". I have no answer. Mea culpa.

The mind is a peculiar thing. When my sister called to tell me Sunday morning, the expected thing happened (well, what I would expect): I got that buzzing in my head that I get when a situation is too stressful for me. The entire world falls away, time stops, and all I can sense is that buzzing. Same thing happens before job interviews, asking a girl out for the first time, that kinda thing. I'm sure you have similar reactions to whatever stresses you out the most. That's not the peculiar thing.

Once I absorbed the news and realized that I had to do or say something, that eerie, preternatural calm that you feel when consious thought is mostly gone and your reptile brain takes over... took over. Presumably I told her something sensible and then packed a bag and made my way to Nanaimo. That's not the peculiar thing either - we're getting there.

I got to the hospital and my mom was sitting up visiting with my dad, and didn't have an inordinate amount of equipment connected to her. OK, we can downgrade to Defcon 2. Between the two of them, they explained how it all came to pass and how things looked at present. Minor heart attack, likely due to a blocked artery on the heart (as opposed to in the heart - much worse). Prognosis is good; blood thinners, clear the blockage, better than before.

So I went back to my sister's place and filled her in (my dad wouldn't let her up - she had the flu), and we both relaxed and had a reasonably nice evening, all things considered. But the reptilian brain doesn't go down without a fight once it's been woken up. This tiny little thought entered my head, just before I went to sleep that night:

"You know this was just a dress rehersal for the real thing, right?"

It's one of those things that we occasionally think, but don't dare say. However, I'm not the superstitious type, so once I'd processed that thought the old ego defense came to the rescue and it's safely tucked away for another time when such a thought might be useful. Are thoughts like that ever useful? I dunno.

Anyhow, you'll be happy to know that it all went down pretty much the way the doc said it would back at Defcon 1: they shipped her down to Victoria for an angiogram, found & cleared the blockage with angioplasty, and my mom's back at home. Little tired, little freaked out, but probably in better shape than she was just before it happened. Happy endings do occur outside of Hollywood - they might not be as fabulous and captivating, but they're way better for being real.

Welcome home, Ma. Don't do that again, K?

Saturday, 3 February 2007

Of templates and tired old 'puters

roxy and roz are getting old. Granted, roz has a new-ish motherboard with all the usual gear that comes with that, but for most day-to-day Winders GUI type-stuff you need good I/O as well, and her old 12/19GB EIDE drives just aren't cutting it anymore.

roxy is just plain old. I'd forgotten how old until I realized that I actually have no idea what kind of hardware she's got. /proc to the rescue (edited for space):

[dante@roxy dante]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
model name : Pentium II (Deschutes)
cpu MHz : 448.059
cache size : 512 KB
bogomips : 894.56

[dante@roxy dante]$ cat /proc/meminfo
MemTotal: 257268 kB
MemFree: 47100 kB

[dante@roxy dante]$ cat /proc/partitions
major minor #blocks name
3 0 8257032 hda
3 64 14114520 hdb

Jeepers. You know you've fallen behind when you can buy hard drives 20 or 30 times the size of your largest existing model. I think there's iPods out there with more storage than all of my drives put together. And a P2 450Mhz? Does anybody measure anything in MegaHertz any more? Maybe mobile phones.

Anyhow, I usually don't care too much about that stuff; I'm not much of a gearhead, and I'm generally happy as long as I don't have to wait too long for the pr0n to load. However, I'm guessing that the good folks at Mozilla assume something a little larger and quicker than I've got, as it takes 20-30 seconds for my brower & email clients to fully come to life. Bleh.

The capper is that I've been writing some C++ code over on roxy lately (all Linux boxes love code), and it's fairly evident that I've left behind my old bare-metal C roots, as I can bog gcc down with a mere 2300 lines of C++ code.

[dante@roxy nibblebot]$ time make
real 1m30.611s
user 1m26.470s
sys 0m1.960s

It's all about the templates, man. You can write reams of C code and it might take gcc a little longer to read it off the disk (or not if you have large clusters), but not much longer to actually compile it. I can (and just did) *cross* compile a (GUI) Windows program three times as large in half the time. But throw some basic_strings and a deque in there and it's likely that the preprocessor just quadrupled the size and complexity of your code in 2 milliseconds flat.

So. It might be time for new hardware soon, I dunno. Anybody want some old Fujitsu EIDE hard drives?

Wednesday, 24 January 2007

Why spam a blog?

This has to be the lowest bottom-feeding trick in the book. As soon as the URL for my blog shows up on a search engine, I get comment spam. Do these dickheads actually think we're going to follow their links and buy into their retarded, broken English pitches?

So, fine. I close off comments to everybody but registered users. "But you could use spam filters!". I could, and in different circumstances, I probably would. Let's jump to a different part of the story for a moment.

I still have the first email address I ever had; it's been something like a dozen years. Back in those days, it was perfectly reasonable to post your email address on your web site or in newsgroups. Sometime between then and now, the spammers figured out that web pages and newsgroups were a good source of email addresses, so we all removed our email links and started using fake addresses on the newsgroups. I expect I still get a spam now and again due to some spider hitting The Wayback Machine.

That probably wouldn't be so bad, but like an idiot, I used that address to sign up for an MSN account. What the hell was I thinking? Either Microsoft sold their list, or somebody managed to access it, because since then my rate of spam emails has skyrocketed. At last estimate, it's about 75 a day. Ack.

Sure, the junk filters work great, but it's an inexact science. Software has bugs and spammers change their tactics. So while 95% of the spam gets binned, I still have to mark a few "legitimate" emails as spam, and (rarely) I have to rescue a binned message and mark it as not spam. So the only real difference between using a spam filter and not, is that now I have to check all the messages in two folders instead of one. How is this saving me any time?

Back to the blog. The concept is exactly the same; I could use filters, but I still have to check every post, just in case something legitimate gets binned, or something illegitimate doesn't. I'm told that many Captcha implementations have been defeated, and with that kind of AI it's a good bet that any similar sort of scheme will be beaten quickly enough. Screw it, I have better things to do - I'll just lock them out and be done with it. Cracking long passwords is still out of the reach of mere mortals, and the spammers won't bother - there's still plenty of people out there so desperate for attention that they leave their blogs open.

Follow the money.

Building a bot, part... ah, screw it

I've been pounding on the "database-centric" portions of my new bot. It wasn't quite as simple as I thought it was going to be, but it is coming together pretty well. I found a MySQL API bug along the way, so I'm pretty pleased with myself.

It's a good thing I upgraded to MySQL 5.0, as there's a feature I absolutely had to have to pull this off in a reasonable manner: multiple statement execution. The idea is that I want to execute a bunch of statements with a single call to mysql_real_query() so that I can pull a single line - containing multiple queries - from the database and just execute the whole business at once. It's a lot less back-and-forth, and allows me to say, "OK, here's a bunch of statements. Execute these and just give me the result of the very last call".

The API bug I mentioned earlier is that if you have multiple statements and any but the last query returns a result, the final call to mysql_more_results() will crash. The manual recommends the use of mysql_next_result() instead, which is fine unless you don't want to iterate past the last result set, which I don't. I'm hiding all these hideous details in a separate class, and I want the results from the last query to be available once the query is done executing, and mysql_more_results() lets me do this, but mysql_next_result() doesn't. Anyhow, I came up with a reasonably elegant workaround, so all is well with that.

I've discovered the joys of SQL variables. I wanted the database to do all the work, allowing me to add, remove and fix features without having to recompile & restart the program. However, it got a little tricky at some points that require me to insert or update before selecting any rows, and you you simply can't do that with joins and subqueries. So you save in variables whatever you would have in code, and Bob's your uncle.

Regex is always your friend. Without regex matching, I'd have to execute all queries for any given event and then undo anything that shouldn't have been done in the first place. Instead, I can "SELECT query FROM events WHERE 'channel message' REGEXP `msg_match`".

Most of the previous bot's functions have been replicated in SQL, so I've chucked him and the new code will be running full time now. He's not quite ready to replace the old eggdrop, but I'm reasonably happy with the progress so far. I've still got 17 or 18 IRC "events" to cover in code before I can start writing queries for them, but the really hard ones are done, and I've learned most of the gotchas now. So it should go quickly (in theory) if I can stop writing queries for the implemented events.

Saturday, 20 January 2007

Building a bot, part tres

After much study and some soul-searching, I've decided to cut the scripting engines from the nibblebot. It pains me to do so, but there's a couple good reaons:

  • The Perl intepreter adds about 1MB to the runtime binary, and

  • there's no way to implement a truly persistent interpreter, so you'd have to fork() a lot.


When you put those two things together, it means that you'd potentially have a fork() and then a bunch of database activity for every incoming line of IRC text, and it's just too heavy and slow.

So, my approach will be a little different. I've pretty much covered all the RFC-defined stuff in a base class now, (class Bot), so now I'm going to extend that class (class NibbleBot), and mostly all it will do is consult the database for what to do next. The idea is this: set up a "scripts" table that can act as an interpreter of sorts.

We'd have an `event` column, in which you'd have things like 'onJoin', 'onPart', 'onChanMsg', 'onKick' and so forth. The next column would contain a query that the bot should execute after substituting the appropriate information in special "macros"; for instance, perhaps you'd have something like "SELECT * FROM `users` WHERE `name` = $NICK", and $NICK would be replaced by the nickname of the user who uttered the line that activated this "script".

Next column over would contain the `action`, i.e. where the result from the query (if any) should be directed (or not). So perhaps we have an enum like, 'chanMsg', 'op', 'topic', etc, and if the query returned any results, the bot would do the appropriate thing with the resulting rows. Add on a final row - `priority` - which would dictate the order in which the bot should execute multiple scripts for a particular event, and you could have the bot doing all sorts of stuff when something interesting occured.

I think this will work for most things; there may be a few special cases, but I think for the most part everything I want to do can be accomplished in this manner. So in theory, once I have all the core code for this in place, I'll still be able to re-program the bot on the fly. Good for me.

Tuesday, 2 January 2007

Vacation is a two-headed beast

Happy New Year. Are you all settled back into your job, rested and ready to hit the ground running? Me neither.

Taking a week or more off work really screws with my head. Everybody needs a vacation now and again or they'll find themselves on the roof of a water tower with a high-powered rifle, and I'm no different. However, it's always an uphill battle to get back to "real life". I'm a slave to my habits, and as soon as I deviate from my usual routine I have to create new habits to adapt. Good survival technique, but it always ends with me having to go back to work before I've adapted back to my normal routine.

So I'm laying in bed this morning thinking, "Do I really need this job? No really, do I? Do I really?" Obviously good sense won out, as I did eventually show up to the office, but it wasn't early and it wasn't easy. January sucks.