life.i.think -

He's Only "Mostly Dead"
Scribbled on October 22nd. 0 comments.

This morning I participated in my first triathlon .. and against unbelievable staggering odds, am only mostly dead after attempting to complete the event after only 4 days of training (1 bike ride, 2 swims, and a run)!

I felt great on the swim. It was a bit cold during the first transition, but once I was on the bike I felt amazing. The run was less than fun, as my legs began to cramp up and, much to my frustration, simply did not listen when I yelled at them to go faster.

I’d like to thank my good friend Chad for telling me about the event, picking me up and driving to Fort Knox, and then soundly beating my time by great measures. I’d also like to thank my coach Christina, whose endlessly good company prevented me from spending time I’m sure I would have used training. And lastly my parents, for waking me up at 6am and taking numerous photographs of me in agonizing pain.

All Signs Point to No!
Scribbled on October 22nd. 2 comments.

Laadiieess and geennttllemen! Hailing from an unknown location …. Weighing in at one hundred and eighty five pounds … Raised by a pack of hungry wolves, no social skills to speak of .. He only trained for one week! Will he survive this gueling test of raw speed and physical endurance!? Tune in tomorrow to find out!

VMware Player on Ubuntu Breezy
Scribbled on October 20th. 2 comments.

Today Philip Langdale of VMware announced the free VMware Player. Cool!

On Ubuntu Breezy, the configuration from the tarball goes fairly smoothly, until:

Your kernel was built with "gcc" version "3.4.5", while you are trying to use
"/usr/bin/gcc" version "4.0.2". This configuration is not supported and VMware
Virtual Machine Player cannot work in such configuration. Please either
recompile your kernel with "/usr/bin/gcc" version "4.0.2", or restart
/usr/local/bin/vmware-config.pl with CC environment variable pointing to the
"gcc" version "3.4.5".

Luckily the vmware-config.pl script respects the CC environment variable (although debian does not), so this can be fixed with:

$ export CC=gcc-3.4

Then it continues to ask a lot more questions I wasn’t exactly sure the answer to so I mostly went with the defaults (I’m not the only one!).

A few minutes later, and we have Ubuntu in Ubuntu!

Alias is Not Just a Campy TV Show
Scribbled on October 19th. 1 comment.

Often in Ruby/Rails we want to override inherit class methods, like AR.find or AR.destroy (to find by another id type or not actually DROP the record but flag it as deleted via a boolean column, for example).

class Script < ActiveRecord::Base
  class << self
    alias :old_find :find
  end

  def self.find(*args)
    self.old_find(*args)
  end
end

Ruby loves talking with Microsoft Small Business Accounting (thanks XML-RPC!)
Scribbled on October 10th. 2 comments.

Today I played around with XML-RPC for the first time. We recently started using Microsoft Small Business server to track lots of things, most notably time spent on projects. Unfortunately, the provided interfaces to fill out timeslips … well, I’ll be nice in saying that they’re slightly lacking. (SBA seems like it has the potential to eventually become a fairly nice suite) My first run at things was to do a web interface in ASP.NET. A couple hours later and I reconfirmed my dislike for the framework, but I’ll leave that for another post.

So I wrote a quick XML-RPC interface to the Microsoft Small Business API using XML-RPC.NET. All total about 60 lines of code, which allows one to, in Ruby, do something like:

s = XMLRPC::Client.new2('http://voltaiccommerce.com/sba')
@customers = s.call('getCustomers')

This then returns key/value pairs for all of our customers in the database in the form of a list like:

[['1', 'Client1'], ['2', 'Client2'], ... ]

Combine this with LDAP Authentication and there are some pretty interesting possibilities.