October 24, 2004

Google SMS looks cool

I read this article today which told me that Google had a new SMS service. It's pretty sweet. You can access yellow pages, white pages, an English dictionary, Froogle prices, zip code lookups, etc...

Read all about it.

Posted by rob at 09:01 PM | Comments (0)

October 22, 2004

Killing The Undead

I ran into a big problem today on with my Windows XP machine. I was scanning something and OmniPage just went into a tailspin. It was eating 100% of the CPU and I couldn't get it to stop. It was hung. Normally, I would just get frustrated and reboot the machine, but I was actually doing something else in the background that I wanted to finish.

I thought, "No problem! I'll just bring up the Task Manager and kill it." Sounded good. But didn't work!

I read some more web pages and decided I should be able to do it from a command prompt. Learned about "tasklist" and "taskkill". Neither worked. Both aborted with some cryptic error about "server execution" or something that didn't make sense.

Then I found this and life was good. I don't even know what "ntsd" is. But it worked great to kill the unkillable OmniPage process.

I figure I won't remember this the next time I need it unless I write it somewhere.

Posted by rob at 06:28 PM | Comments (0)

October 18, 2004

The Pain of Object-Oriented Perl

I like Perl. I've used it since sometime in the late 80's. I don't use it everyday, but I use it when I want to munge some text in one way or another.

I recently wanted to generate some RSS feeds for a few websites that didn't provide their own feeds. That meant HTML parsing and RSS (XML generation) which sounded like a job for Perl. I actually considered Ruby and Python, but in both cases I found it difficult to do searches for modules that would do friendly HTML parsing and RSS generation.

So into the land of Perl I went armed with my O'Reilly books.

Having learned Perl in the Old Days before it was objectified, I still have a hard time when I try and use OO-Perl. This project was no different. In fact, I got extremely frustrated.

I had created a class using the Class::Struct package. This is a fairly neat little package that creates setters and getters for you. All you do is define the names of your ivars and their types (scalar, array, class, etc...)

The first bit of ugliness I ran into was when I wanted to create access my ivars. I had an ivar named 'classes' which was an array. An obvious first guess at how to do this would be:

$self->classes

but that would be wrong. Instead you need:
$self->{'classes'}

And, if that's not bad enough, if you actually want to use that expression somewhere in an array context, you need to explicitly state the context by doing this:
push(@{$self->{'classes'}, $foo);

Ugh. The pain. The pain.

I actually got used to (but not happily) the funky ivar access syntax, but I was constantly bitten by my failure to specify the array context syntax.

I did manage to get my projects finished. But, I'm just not happy about doing OO programming in Perl. It still feels clunky and leaves me too many places to do the wrong thing.

Posted by rob at 10:43 PM | Comments (0)