Archive for February, 2005

Function Overloading in PHP5 and PHP4

February 12th, 2005

This is a solution to the problem of argument type based overloading in PHP. As far as I know this should work in PHP4 and PHP5.


class Viewer {
  function display($v) {
    $class = get_class($v);
    $function = "display_$class";
    if(method_exists($this, $function) ){
      $this->$function($v);
    } else {
      $this->display_default($v);
    }
  }
}

This class can then be extended and used like this:


class PDOViewer extends Viewer {
  function display_PDO($item) {
    echo "This is a PDO item";
  }
}
$viewer = new PDOViewer;
$viewer->display(new PDO);

The New PS3 Chip

February 10th, 2005

Brian Meidell has a brief write up about the new chip that will be in the PS3, while I don’t particularly understand the most technical parts of the 2 articles. I’m knowledgable enough to know it’s going to rock. Let’s see how the xbox responds, with a multipurpose computer or with something else?


Tagging Music

February 9th, 2005

With the advancement of tags (and here and here), I’ve been thinking about new ways to use them. The best use I have thought about came about through Dave and my quest to sort our Mp3′s into a meaningful mess. Tags could easily solve the majority of our genre woes.

I have thought about using them in the grouping or comment section id3 tag and then by using smart playlists and the “contains” rule I can create the playlist I want. The problem starts when you want to edit the tag, you can’t mass edit the tags if there is something already in them, it erases the tag.

The simplest problems can always be the hardest to fix.


Volleyball Training

February 7th, 2005

We had our first USQ volleyball training yesterday, we are hoping to train every Sunday afternoon almost for the rest of the year, it should be good. We tend to hit the pub afterwards.

There is a tournament in 2 or so weeks and we want to do pretty well.