Blog

June 26, 2008 04:47 +0000  |  Activism Family Work [at] Play 6

No, really.

This is the one birthday when everyone tends to think that you're lying about your age. For some reason, everyone wants to be 29, but not 30. I suppose I'll understand this more next year, but at the moment, it just seems silly.

First of all, I'd like to say thanks to all the people who wished me a happy birthday today. Facebook is especially scary, with no less than 54 posts to my wall. Corinne sent me a text message at 12amEST which was pretty cool, and Theresa even called me from London! It's so nice to know that I have so many friends all over the place.

I'm sitting here on the SeaWall watching boats in English Bay and evesdropping on the conversations of passersby while I write out this blog post to be uploaded later. Sadly, despite the symphony of wireless networks floating around me, not one of them is unencrypted and of a reasonable strength to connect. I suppose I could try hacking into the stronger WEP connections, but that takes too much time and I just want to blog.

So a quick update on what's happening in my life lately. I have a new roomate. Well not so much a roomate as family staying with me for a few months. My brother, aka "Butthead" has had some trouble with the girlfriend of late and so he's crashing with me for a few months so he can get his life in order. To be honest, I'm less than thrilled at the prospect of having anyone live with me (I dig the solitude) but when family needs you, you go... or in this case I guess you just give them a key.

On the work front, everything came to a head today. We deployed a big hunk of code that's almost completely dependent on some very cool kung-foo I wrote. Unfortunately, I missed a very minor detail and the whole project blew up for about 3 hours today until I found it, fixt it, and thanked the other teams involved for being patient with me. That was less than cool, but it's working now and the hiccup was documented. I really don't know how the Brass at the company feel about my work of late though -- there's an odd feeling I get when I walk into the office these past few days. My review is tomorrow though, so I guess I'll find out then.

My activism has taken a back seat to my day job over the past few months, but I intend to remedy that soon. The VPSN mapping group I'm in needs a bunch of stuff done and they need it soon, so I've promised them a working model by the 15th. Time to get my ass in gear.

On top of that, I have a new Big Idea that Melanie has convinced me to actually move on. I've documented most of how it would (theoretically) work, but I still need to do some research on practical implementation. I'll post the details soon.

As for my actual birthday, I've decided to take the evening and do close to nothing. I suppose that I should be at choir rehearsal right now, but I just don't want to socialise today. Vancouver's really quite nice when you want to "get away" actually. There are lots of places just to ride your bike to sit for a bit and enjoy the scenery. Maybe I'll go to Stanley Park later, or the Planetarium... I dunno. Does anyone else do the solo thing on their birthday? Is this odd?

Alright, sun's going down. I shall hop back on Syria and see where she takes me.

May 02, 2008 03:30 +0000  |  Geek Stuff PHP Programming Work [at] Play 0

I just wrote this nifty wrapper for Simpletest, a unit testing suite for PHP and thought that I'd share it here.

Basically, the text output for Simpletest is ugly. And it's kinda lacking in output for those of us who are visually gratified. I like to see my tests pass and I like to see something green when everything is ok. Mock me if you like, I dig the pretty :-)

To use this, just put the following block into a file and call it something like TextReporterWithPasses.php and then, where your test suite script looks something like this:

  $test = new GroupTest('MTV API Layer');
  // Some $test->addTestFile() stuff
  $test->run();

Do this instead:

  require 'TextReporterWithPasses.php';
  $test = new GroupTest('MTV API Layer');
  // Some $test->addTestFile() stuff
  $test->run(new TextReporterWithPasses());

And behold the pretty ;-) Here's the code:

<?



  /**
  *
  *   Author: Daniel Quinn (daniel.quinn@donatgroup.com)
  *  License: GPL-3 "Information wants to be Free"
  * Function: Prettifies Simpletest's text output
  *
  */


  class TextReporterWithPasses extends TextReporter
  {

    private $_colours;
    private $_testCount;
    private $_errors;

    public function __construct()
    {
      parent::__construct();

      $this->_testCount = 0;
      $this->_errors = array();
      
      $this->_setColours();
    }


    public function paintPass($message)
    {
      $this->_passes++;
      print ($this->_testCount == 0) ? '  .' : '.';
      $this->_manageWrapping();
    }


    public function paintFail($message)
    {
      $this->_fails++;
      $error = new stdClass();
      $error->message = $message;
      $error->breadcrumb = "\tin ". implode("\n\tin ", array_reverse($this->getTestList()));

      $this->_errors[] = $error;

      print $this->_colours['red-light'];
      print ($this->_testCount == 0) ? '  x' : 'x';
      print $this->_colours['grey'];

      $this->_manageWrapping();

    }


    public function paintHeader($name)
    {
      if (!SimpleReporter::inCli())
      {
        header('Content-type: text/plain');
      }

      print "\n  ". $this->_colours['white'] . $name . $this->_colours['grey'] . "\n  ----------------------------------------------------------------------------\n";

      flush();

    }


    public function paintFooter()
    {

      if ($this->getFailCount() + $this->getExceptionCount() == 0)
      {
        print "\n\n  ". $this->_colours['white'] .'[ '. $this->_colours['green-light'] .'w00t!'. $this->_colours['white'] ." ]\n";
      }
      else
      {
        print "\n\n". $this->_colours['red-light'] ."  The result was less awesome than you might have hoped :-(\n\n". $this->_colours['red'];
        foreach ($this->_errors as $e)
        {
          print "  $e->message";
        }
        print "\n";
      }

      $status = array(
        'run' => $this->getTestCaseProgress() ."/". $this->getTestCaseCount(),
        'passes' => $this->getPassCount(),
        'failures' => $this->getFailCount(),
        'exceptions' => $this->getExceptionCount()
      );

      print $this->_colours['white'];

      print "\n  Test cases run: $status[run], Passes: $status[passes], Failures: $status[failures], Exceptions: $status[exceptions]\n\n";

      print $this->_colours['none'];

    }


    // Private methods -------------------------------------------

    private function _setColours()
    {
      $this->_colours = array(
        'black'       => "\033[0;30m",
        'blue'        => "\033[0;34m",
        'blue-light'  => "\033[1;34m",
        'green'       => "\033[0;32m",
        'green-light' => "\033[1;32m",
        'cyan'        => "\033[0;36m",
        'cyan-light'  => "\033[1;36m",
        'red'         => "\033[0;31m",
        'red-light'   => "\033[1;31m",
        'purple'      => "\033[0;35m",
        'brown'       => "\033[0;33m",
        'grey'        => "\033[1;30m",
        'grey-light'  => "\033[0;37m",
        'pink'        => "\033[1;35m",
        'yellow'      => "\033[1;33m",
        'white'       => "\033[1;37m",
        'none'        => "\033[0m"
      );
    }


    private function _manageWrapping()
    {
      // Poor man's wrapping
      if (++$this->_testCount == 76)
      {
        print "\n";
        $this->_testCount = 0;
      }
    }


  }


?>

Isn't it cool that I work for a company that supports the Free distribution of code?

April 23, 2008 08:58 +0000  |  Geek Stuff Toronto Work [at] Play 4

I'm back online! Yay for me! It's also really late though and I have to go to work early tomorrow (the hours were changed out from under me) so I really can't write much so here's the gist:

I went to Toronto and had a lovely time. It's funny the kind of perspective one gets on their home town by living elsewhere. Ask me about it sometime... I promise a healthy rant. It was wonderful to see everyone again too, and not surprisingly, staying with Melanie was um... interesting. I reconnected with almost everyone and got to play tourist in my former home. I even went up the CN Tower (yay!).

Pictures of all of this will follow of course, but later. I need sleep.

My server (Moulinrouge) has been completely rebuilt and now sports a clean slate and a whack of services (Apache, Bind, DHCPd, Dovecot Imap, Exim, Fetchmail /w Procmail, MySQL, NTPd, Subversion and SSHd). My wireless is offline for now though since it would appear that I've run out of outlets on that side of the room. I left my good power strip at Melanie's so I'll have to go out and buy one tomorrow.

Things at the office are going very well. James and I are writing the Free software policy of the company and I got to write the preamble. When it's published, I'll post a link 'cause I'm rather proud of it.

That's it for now, to bed with me :-)

January 31, 2008 05:14 +0000  |  Drupal Employment Perl Reinvent Work [at] Play 8

Those of you who aren't privy to my less-than-public posts, you might wonder what the heck happened to Reinvent and why I'm suddenly talking about The Donat Group. Obviously, it's probably a Bad Idea to talk about the nuts and bolts of it all publically, but here's the gist in my generation's favourite format: point form.

  • Reinvent is a fun company with lots of smart people
  • It's also run by management that feels that expanding their business into Software patents makes for an acceptable business model.
  • I disagreed. I've worked for a lot of companies who did things I felt were Not Good, but there are a few things I won't do... supporting software patents is one of them.
  • So I went looking for a company whose morals where more in tune with my own and I found one in The Donat Group.
  • I handed in my resignation, offered to work 2weeks before I left and they declined. I guess the brass weren't happy with me.
  • I started at Donat today and they seem pretty cool. Very dot.com startup-like but with actual paying clients.
  • They like Drupal though, which from what I've seen, is really not good. My first impressions of Drupal is that it's a bunch of non-programmers pretending that they can write real software. Function and variable names bleeding into everything else, no objects, and horror of all horrors: their coding standard requires a two-space indent.

I made a work around for the back-assward indenting thing though. I call it undrupal. Basically it uses a regular expression to strip out the space-based indents and replace them with tabs. Then you can write your code in a sane environment, then use the same script to re-crazy it with spaces again.

Ok, so my first day didn't exactly have me neck-deep in super-advanced code, but hey, it's the first day. I'm really looking forward to this job though, the boss is pretty cool and his politics are more in line with my own, and even more fun is the fact that I'm now labled "Senior Developer" and I'll be able to actually head up new projects and such.

That's it for me now. If you want more details, just gimme a call.