Blog | Admin | Archives

I Am .mpg

You are .mpg You live life like it was a movie. Constantly in motion, you bring pleasure to many, but are often hidden away.

Along a similar vein… I think this one is a little more accurate than I might like, which is strange I think for a personality test which is mostly a gimmick. You too can discover your file extenstion.

I Am Debian Linux

You are Debian Linux. People have difficulty getting to know you. Once you finally open your shell they're apt to love you.

Via Dan and via Jack, I came across this quiz which tells you what OS your personality matches. Honestly, I’m quite happy being matched to Debian. Go find out for yourself what Operating System you are.

Seamless PHP 5

Unfortunately as I learned about a week ago, PHP 4 and PHP 5 don’t happily co-habitate. However, the switch between the two is about as seemless as possible. Compiling PHP 5 with the same config string as I used for PHP 4, I was able to switch over by simply changing a comment in my httpd.conf file from:

LoadModule php4_module modules/libphp4.so
# LoadModule php5_module modules/libphp5.so

to

#LoadModule php4_module modules/libphp4.so
LoadModule php5_module modules/libphp5.so

Linux isn’t always great, but sometimes it sure rocks my socks.

Nested LEFT JOINs to link three or more tables

I ran into another dilemma in SQL-land today. Working on a money-management application, I had three tables that I wanted to gather information from. This normally leads to some relatively straightforward SQL:

SELECT account.name, contact.name, date, amount, type
FROM transactions, accounts, contacts
WHERE account_id = accounts.id
AND contact_id = contacts.id;

However, this returned results only for transactions that had both matching accounts and matching contacts, while what I wanted was a single record for each transaction, regardless of matching accounts or contacts. For two tables, this would be straightforward with a LEFT JOIN:

SELECT account.name, date, amount, type
FROM transactions LEFT JOIN accounts
ON account_id = accounts.id;

Which would return a row for every entry in the transactions table even if no matching account was found. I tried extrapolating that two three tables, like this:

SELECT account.name, contact.name, date, amount, type
FROM FROM transactions LEFT JOIN accounts, contacts
WHERE account_id = accounts.id
AND contact_id = contacts.id;

However, this didn’t do what I wanted, and I was getting multiple entries for each transaction. So I googled for help, and Google delivered: Left Joins to link three or more tables. From the information in this article, I was able to develop the SQL code that did exactly what I wanted:

SELECT `accounts`.`name` AS account_name,
`contacts`.`name` AS contact_name,
`date`, `amount`, `type`, `detail`, `memo`, `cleared`
FROM (`transactions` LEFT JOIN `accounts` ON `accounts`.`id` = `account_id`)
LEFT JOIN `contacts` ON `contacts`.`id` = `contact_id`
WHERE `parent_id` = 0

This returns a single row for each entry in transactions, even if matching accounts and contacts are not found. Esentially, it is a nested LEFT JOIN. First, MySQL left joins transactions and accounts, then it takes this result and similarly left joins contacts. This way, every row in the leftmost table (transactions) is preserved. I might have simply linked to the site, but I didn’t like the naming scheme in the examples on that site (crypic names like bdg and dom don’t earn accolades from me), and I came up with a better article title, “Nested”.

LAN’d

Saturday night, I attended Colin’s LAN party. I expected to make only a few hours’ appearance – it had started at noon, and I had things planned for the next day. Then I played Homeworld 2, and I stayed until 6:00 am, when I fell asleep, not to be cognizant again until about 11:30. In Homeworld 2, there is a bit too much going on to really get your head around it all, as you try to control hundreds of fighters, resource gatherers, factory ships, frigates, corvettes, destoryers, and battleships. For an even crazier trip, try out the Warlords modification, which esentially makes the game into a giant Star Wars battlefield and can easily overcome even the most powerful modern computers. Its great fun, and has, of course, rekindled my interest in a much grander scale strategy game idea that I’ve tossed around for sometime.

SIFF 2005

It has been quite a while since I saw most of the movies, but I thought I should write down what I remember before any more time goes by. This year’s SIFF was somewhat disappointing after several phenominal films I saw at last year’s. I will use a similar format and the same 1-5 scale for this years films, as best as I can remember:

Shake Hands with the Devil – Hallowing Documentary – Canada – 3
Fly Filmmaking – Bad Narratives – US – 1.5
Being Caribou – Political Documentary – Canada – 3
Night of the Living Dorks – Over-the-top Comedy – Germany – 3.5
The Warrior – Hallowing Drama – UK – 4
The Circus – Chaplin Comedy – US – 3

Most notably, there were no fives and only one four. I also learned that six movies is my upper limit – I had eight tickets but didn’t make it to some of the movies, so I won’t plan on making that mistake again.

Software Test Intern

Nearly 18 months into my “3-6 month” internship at Microvision, I continue to find ways to impress myself with my software testing prowess. Details must remain hazy, but let me just say that a test I developed continues to have exact correlation with a much more time-consuming test that has been used for much longer. Yet the best part of the job is the nearly constant learning opportunities that I encounter. The weeks without something to learn are very few and far between. Combined with almost limitless flexibility and a great group of people to work with, what more could I ask for? Well, other than a reverse in the trend of the stock price, hey?