Kristin’s Birthday

It was two years ago today, almost to the minute, that Kristin came into this world.  Back then things were great.  We had just bought our house and we had just brought a new, beautiful child into the world.  Our future as a family looked bright and limitless.

I had hoped to see Kristin by now… especially on her birthday… but that doesn’t seem like it’s going to be the case.  I’ll hold on to her presents, though, in the hopes that I will get to see my baby girl soon.

Fun with Perl Event Listeners

I got tired of passing around object references in my feed engine project at work so I decided to implement my own event handler/listener system (see snippet below). I should now be able to go back and simplify a lot of ugly code :P

package listener;
use base ('FeedEngine::BaseObject');

sub OnHelloWorld($$)
{
	my $self = shift;
	my $event = shift;
	my $msg = shift;

	if(ref($self) =~ /listener/)
	{
		printf("%s says, \"I just heard %s say '%s'\"\n",
			ref($self), $event->{Caller}, $event->{Parameters}->[0]);
	}
	else
	{
		printf(”%s says ‘%s’\n”,
			ref($self), $event->{Parameters}->[0]);
	}
}
1;

package talker;
use base (’listener’);
1;

package main;

my $alice = listener->new();
my $bob = talker->new();

# Alice is now listening for Bob to fire off ‘HelloWorld’
$bob->AddEventListener($alice, ‘OnHelloWorld’);
$bob->TriggerEvent(’HelloWorld’, ‘Heh, there!’);

# Alice is now listening to everything bob has to say
$bob->AddEventListener($alice);
$bob->TriggerEvent(’HelloWorld’, ‘Heh, there’);

Yields output:
talker says ‘Heh, there!’
listener says, “I just heard talker=HASH(0×2356cc) say ‘Heh, there!’”

Spoke Too Soon

Well, summer WAS here briefly, but I guess I spoke too soon.  It was back to gray and yucky again today.  Anyway!

I should get to bed, but I just had to say I finally accomplished my goal of getting Apache 2.2 and PHP 5 to run on Windows tonight… it only took like TWO HOURS!  It all came down to one optional module I tried to install during the PHP install process:

[PHP_THREADS]
extension=php_threads.dll

Ugh.  Pages would serve up half way and then PHP would make Apache throw a nasty exception… it went so far as to kill the server process.  After a lot of trial and error (taking modules out, puting them back in, etc) I finally narrowed it down to this one.

I was actually hoping to have access to threading, too, but whatever.  My target development platform is Linux anyway… but I was hoping to develop on Windows.  Hmm.  Fine if I don’t use threads, I guess?

Summer… for real this time?

Those of us living in western Washington have been experiencing a very mild spring/early summer, but as of this last weekend the weather seems to have turned the corner into summer… hopefully for good, this time!

I’ve been keeping busy lately by working on home coding projects (a pure JavaScript application for a friend as well as my political empowerment website). I’ve also been trying to get a handle on the yard. There is a lot of work to do there, though, and never enough time.

What else… not much else to say. Oh yeah, I found out my brother and his wife are expecting again! The new arrival to the Oye clan is expected sometime in November, I guess.

Anyway. More nothing to come later.

What’s New?

As you all may have noticed, I haven’t had a whole lot to write about lately. I’ve been trying to keep myself busy with Age of Conan, movies, work, and exercise.

This last weekend was the birthday of one of my best friends, Chris Brown. He turned a ripe, ol’ 35 years old! Woo hoo! Hard to believe we’re only a few years away from 40, now. Crazy! We went to the Outback as a group for dinner and otherwise had a good time.

Age of Conan: It is a very stunning game in terms of graphics and game mechanics, but oh man, the PVP is brutal. When you venture out to your training grounds as a newbie, you have to keep one eye on the monsters, and the other for cloaked players who are there to kill you for no readily apparent reason. It’s still a fun game, but it can be frustrating when you get ganked repeatedly by groups of players well above your level.

There is not much else to report right now, but I wanted to say thanks and hello, again, to all my friends and family!

Out With the Bad

I have decided to purge my blogs of all the negative stuff. There isn’t anything I can do to change the bad stuff in my life, so I will try and focus on the positive stuff. I still have my family (… sort of) and I still have my friends and that will not change.

I am trying out a new MMORPG: Age of Conan. I was curious to see if it could be a serious contender to take on World of Warcraft and so far my impressions are good. I don’t know if it will de-thrown WoW just yet, but with some polishing it could be strong competition (while the game is pretty and the game content is good, the UI is a bit clunky).

Adventurers in Irrigation

Two out of three zones of my sprinkler system have died in the last few months.

After a little trial and error with the one good zone, I found that the solenoids in the control valves had gone bad. Bah. To make matters worse, the manufacturer (Rain Bird) apparently has re-standardized all of their parts which made it impossible to buy a replacement solenoid for the unit I already have. So that meant I got to upgrade the system!

The one good thing about tinkering with stuff is that you actually get to learn a bit about it. Not only did my friend and I replace the faulty valve, but we replaced the goofy maze of pipe that the contractor put in to reroute the one sprinkler head back a few feet in my yard. We got our DIY gold star for the day… and the sprinkler system actually works again!

At some point in the future, I am going to extend the lawn and a real garden down to the lower level of the yard. By then, I think I will feel comfortable putting in yet another, complete watering zone.

Safari: First Impressions

I have started to work on my social networking site again and so I have been downloading and trying out different web browsers for compatibility reasons. So far, the site works well with Firefox, Internet Explorer, and Konqueror (Linux/KDE browser). The only major browser I was unsure about was Apple’s Safari.

“Thankfully,” Apple has released their Safari browser to the Windows platform. My first computer was an Apple, but I have no special place in my heart for the company or their religion. I decided I should download the browser and give it a whirl.

Safari started up pretty quick and it seems to render pages pretty fast, but thirty seconds after logging into my site I realized I already had a number of issues to try and fix in order to support this browser. My third party WYSIWYG editor was having issues (e.g. would not start). It was a JavaScript issue. I figured that would be easy to troubleshoot. Oh, wait, Safari doesn’t have a standard JavaScript debugger? Wait, no DOM Inspector, either? WTF?!

Now I have spent a couple of hours trying to find documentation on how to develop using Safari and so far I am SOL. I have found plenty of documentation on how I should be able to turn on JavaScript debugging, but so far it hasn’t worked. I have slapped the following two lines in just about every configuration file I can think of (per the on-line docs) and still no luck.

<key>IncludeDebugMenu</key>
<true/>

[Another jab: What is up with this ridiculous XML schema in the "plist" files?]

Hmm. Now I am pissed. So what are my first impressions? Not good! First off, Apple insisting on using its own Widget set for the UI is annoying. Second, the standard tools I would expect to find in a browser are not present or flat out do not work. Also, if you are going to put in debugging functionality, why not provide controls for turning it off and on? Why make a person edit configuration files manually in order to enable/disable features? And if you DO insist on making a person manually edit files, make sure your on-line docs are up-to-date.

To sum up: sure, the browser loads fast and renders quick, but if I can’t troubleshoot my code in order to support it, or, if features found in other browsers do not work, why would I want to bother?

Perl Weirdness

I feel like I have to write something to break up the monotony of my sad story. So here’s some techno-babble to mix it up a bit. I have been working to improve memory usage by my new feed engine (which I’ve been working on for nearly two years, now). I found today that Perl has issues with reusing the same symbol for file handles… even in different scopes. I declared two methods in the same object. Both times, using the symbol FH to denote an open file handle:

sub AddEventLogText($$)
{

open(FH, “+>$fileName”) or die(”Could not open $fileName for writing.”);
$self->{EVENTS}->{$eventName} = \*FH;

}

sub RenderHTMLFile($+)
{

open(FH, “>ParseLog.htm”) or die(”Could not open ParseLog.htm for writing.”);
while(my ($event, $fileHandle) = each %{$self->{EVENTS}})
{
while( <$fileHandle> )
{
print FH;
}
}

}

So previously I had been storing event text in memory while my data was loading, but for some data suppliers the memory overhead became huge (750+MB). I decided instead to stream out the data to file and then read it back in when generating reports. I figured that I could use the symbol FH in two different scopes to represent two different file handles, but Perl did not see it that way ;-) Despite opening a second file, I found that both my stored file handle and my newly opened file handle both had a globular reference to the same address in memory (0×2050858). So while I thought I was reading from one file and writing to a second, I was in fact, reading and writing to the same file (which made for some ugly reports). It only took me an hour or so what was going on :P Argh!

So let that be a lesson! Never use the same file symbol twice! Either that, or use the Symbol module to generate anonymous globs (which I just read about).

Next thing to fix: circular object references. Perl garbage collection works by counting object references. I tend to use circular references to allow easy data/method access between objects, but that also short-circuits Perl’s garbage collection. Weak!

Next Page »