Doug Bryant

Tech thoughts and notes

Office Revenge - Aluminum Foil Desk

When I first started at my current job, I was out sick for a couple of days and came back to my office totally re-arranged as a practical joke. Pictures were upside down, glasses taped to the desk, shoes hanging from the ceiling, and about 100 other small re-arrangements.

It took a while to get back at one of the instigators, but the opportunity finally arrived :) Deanna went on vacation last week!

A while back I had seen an email where someone’s desk was “foiled” and really liked the result. Total project time about 2 1/2 hours. So here it is: (all picts at flickr)

Interesting App - the Semantic Web

A friend of mine pointed me to an interesting app this afternoon. Piggy-Bank

The description from the site is
bq. Piggy Bank is an extension to the Firefox web browser that turns it into a “Semantic Web browser�

It seems to take the various website data (via screen scrape) create an RDF document out of it. That information is stored in a central location which can be queried by the said application. For instance, one of the pieces of data it collects is location. So it could collect the location of all the apartments for rent from the apartment rental website. It would also collect the location from the bus terminal website. Ultimately you could do a query to find apartments within a given radius of all the bus terminal in you location and display it on a google map.

It’s a very interesting concept. I have looked at semantic web stuff before and understood the basic concepts of the underlying technology, but did not get what it could be used for. This app makes it fall into place a little more than before.

One of the things I still fail to understand about the semantic web stuff is how to go about using the data that is published. Nobody would publish the RDF/OWL model in the same way, just as to developers would come up with a slightly different database structure. It all stores the same data, but in a different way.

Using the apartment for instance. Two different property management companies publish an RDF document for the web.

Propery Management site 1 comes up with a model like this
codepre
Apartment:
Address:
line1
line2
city

Specs:
square_footage
number_of_bedroooms

/pre/code

And Property Management Site 2 comes up with a model like this:
codepre
Apartment:
addressLine1
addressLine2
city

squareFootage
numberOfBedroooms

/pre/code

They both have exactly the same data, just modeled differently. One is more normalized than the other and the attributes/elements of the document are are slightly different.

Perhaps I am missing something but it seems that if you wanted a central storage location for semantic web stuff, you would have to do alot of mapping between one document and another. This would seem to limit the number of sites you could query because of the time and labor involved in mapping.

I really want to believe in widescale use of this technology, but I fail to see it right now.

New Toy

It was time for a new toy… Since the old digital camera was old and busted, it was time to bring in the new and shiny.

I wound up getting a Nikon Coolpix 4800

I really like this camera. They did a good job with controls on the camera. You don’t have to push too many buttons to do what you want and it’s pretty intutive.

And to christen the camera, I put created a flickr account

There is supposed to be a flickr feed on the sidebar, but it does not seem to be working now. Ah… something else to get working.

New Server

My host has moved locations and everyone is now running on new hardware.

The move was painless. For me atleast. Everything was working just fine when I tested it out a little while ago.

Hopefully the combination of new hardware and hosting facility will fix the downtime problems I (they) have been having.

From textdrive’s flickr account

Switched From Fedora to Ubuntu

I switched from Fedora to Ubuntu last week on my computer at work and I could not be happier.

Setup was simple. I really like the apt-get, gentoo portage and BSD ports model. RPM is just too much of a pain.

One interesting thing about Ubuntu is that there is not a standard root account. Just like you do with OS X, you have to sudo everything. That’s fine with me. And if you really, really need root, all you have to do is sudo bash and you are root.

This biggest annoyance is that I can not find a postgresql 8.0 package for ubuntu. I really don’t want to have to maintain all the startup scritps myself.

Otherwise, I’m very happy with it so far. Hopefully it will stay that way.

OSCON Slides

Update: Received an email from oreilly listing all the slides from the conference…

I have been meaning to go back and collect the ruby slides from OSCON and finally got around to it.

Dependency Injection: Vitally Important or Totally Irrelevant

Metaprogramming Ruby

Yield to the Block: The power of Blocks in Ruby

I could not find Dave Thomas’ slides on the net in 1 minute or less. But I did find a ruby presentation I did not attend…

10 Things Every Java Programmer Should Know About Ruby

And some ajax stuff too…

Learning Ajax

Postgres on OSX

I’m finally ramping up for longer term development on OSX. I have been impressed with the platform for the most part. Small things are annoying, like zip corrupting files you are zipping (a friend tells me this is in part due to backward compatibility with OS 9)

I’m doing all my database work with Postgres When I first went about setting up postgres, you basically had to compile it yourself or use something like fink. I was not really happy with those solutions. After coming back from OSCON, I discovered a postgres installer from druware.com. This rocks. Point, Click, Install. In recent years, I have grown tired of building software myself after doing it for so many years on linux.

Now to access postgres from ruby and rails, you need to install the postgres driver for ruby. Change the gcc complier to 3.3 and install the postgres gem. If you have not used used any ruby libraries with compiled C extensions, you must first fix the version of ruby that ships with Tiger. with RubyGems installed, do

precode
deathstar:~ doug$ sudo gem install fixrbconfig; sudo fixrbconfig (only if broken osx ruby)
deathstar:~ doug$ sudo gcc_select 3.3
deathstar:~ doug$ sudo gem install postgres — —with-pgsql-dir=/Library/PostgreSQL8
/code/pre

(You have to tell rubygems where druware installed postgres)

Now you are ready to start doing postgres development with ruby.

If you are using postgres on OSX, the installer from druware is definitely worth checking out.

Dependency Injection: Vitally Important or Totally Irrelevant

by Jim Weirich

Slides at http://onestepback.org/articles/depinj

Is Dependency Injection vitally important in a dynamically typed language

  • Short version – no
  • Medium version – maybe
  • Long version – don’t know

Who are you? Perhaps not who you think you are.

Building a computer controlled coffee maker. When coffee in put – burner should be on. When pot not in or no coffee in put – burner should be off.

Talks about the problem of Concrete classes being tied together and show some solutions in java and ruby (ruby modeled off java code). Push problem out by using interfaces, constructor args, getter/setters, etc but problem is just moved from one place to another.

One solution – factory pattern. But… cumbersome and invasive (examples)
Another solution – Service Locators – invasive, order dependent (examples)

Goes through a typical dependency injection system in ruby: DIY module

Gains: Flexibility and Testability Losses: complexity and indirection

This makes sense in java, but what about ruby?

Based dependency injection example in ruby on how java classes work.

Java classes are hard

  • Not objects
  • (mostly) source code constructs
  • unchangable at runtime
  • Class name directly identifies class

Ruby Classes are soft

  • Just objects
  • Runtime live
  • changable at runtime

Is Dependency Injection relevant in dynamic languages – perhaps on very large projects, but the jury is still out.