Begin main content

"Good to Great" is, well, great!

It's far past my bedtime, but I have been reading Good to Great by Jim Collins. It's the first non-fiction book that I have been unable to put down since Surely You're Joking Mr. Feynman!.

Good to Great has been on my must-read list for some time since reading an interview with Jim Collins in Strategy & Business Magazine by Booz Allen. Thanks to Mike for lending me his copy :)

It is well-paced and well written. The findings are intriguing, even the descriptions of the analysis methods are informative and useful! Many of the principles are just as applicable to your life as your business.

I can see that I will be up late reading the next few nights...

08:42 AM, 22 Feb 2005 by Mark Aufflick Permalink | Comments (0)

Logging and our Environment

I was decrying the illegal logging activites in Indonesia to a colleague (where old growth forests the size of Switzerland are being cleared each year - allegedly none will be left in Sumatra by 2005 - see comments for references).

Then he sent me this SMH article about Australian agriculture:

The collapse of the wide, brown land

I need to be careful given who my friends and family are ;) but here is a quote from the article:

While 60 per cent of Australia's land area and 80 per cent of its human water use are dedicated to agriculture, the value of agriculture relative to other sectors of the Australian economy has been shrinking to the point where it now contributes less than 3 per cent of the gross national product. That's a huge allocation of land and scarce water to an enterprise of such low value. Furthermore, it is astonishing to realise that over 99 per cent of the agricultural land makes little or no positive contribution to Australia's economy. It turns out that about 80 per cent of Australia's agricultural profits are derived from less than 0.8 per cent of its agricultural land ...

Note that I have not tested or substantiated these figures, but assuming they are true then we are little better than the over-protective Europeans with their farmers.

Maybe we should just be paying the farmers in Asia and Africa a reasonable price for their produce - possibly introducing incentives for them to invest in eco-friendly farming.

Food for thought, so to speak.

Update: It occurs to me that the point about the water is a furfy - it's not water per se that is scarce, it's water in particular catchment areas. With the exception of a few particular river systems, rural and non-rural water usages are from different sources.

05:03 PM, 21 Feb 2005 by Mark Aufflick Permalink | Comments (3)

Ruby on Rails, Postgres & other musings

Just had a rambling (as always) conversation with my friend Rusty that bears documenting. This is an outline which hopefully I will find time to exapand on.

It always starts off innocently

Bamboo ScaffoldingIt started, innocently enough, with a discussion about the way that Ruby on Rails does database persistance of Ruby objects. It's simple and clean, but one thing that had bothered us both was the way that ActiveRecord required a table to contain columns for every property of every subclass of a root class. It uses a type column to store what class a particlar serialized object is. This kinda sucks. It just doesn't seem right. While reading the ActiveRecord API docs, I noticed an offsite link about single table inhertance. This document starts with the statement "Relational databases don't support inheritance".

A good inheritance and a good relationship

Many relational databases do, however, support inhertiance - albeit in differing non-standard ways. Why, we thought, should an implementation be limited across all databases just because it wants to support MySQL and DB2. One nice solution that occurs to me is to use table inhertance in Postgresql. A child table inherits all the columns of it's parent but can also implement new columns of it's own. A table scan of the parent finds all the rows in the child, but introspection on the relevant tables will show the appropriate columns. It is also much more efficient if you have a lot of children with a lot of properties, since the parent table isn't clogged with all those empty columns. By better mapping reality (which is after all what OO is supposed to do), everything works better with implicit constraints on allowed properties etc.

As Rusty pointed out, it would make scaffolding pages much nicer too since the db table introspection would only show the relevant fields. Without investigating too hard, it would seem quite simple to implement this by sub-classing some parts of ActiveRecord, thus not breaking any existing code or db support. Careful note would probably need to be made of the Find method.

You don't want limitations in your scaffolding

Our thoughts then turned to the limitations of using the Ruby webserver WEBrick and the way that Apache rewrite rules are used to make the various controller url formats work. The thing that attracts me to WEBrick is one of the reasons I love AOLserver - that the webserver functionality is under the full control of an interpreted language which means you can literally do what you like. Want to implement a request processor right in the webserver? Go ahead! I contrasted this with the hoops of writing an advanced request processor in a traditional scripted web environment like PHP or Perl's mason or Template::Toolkit. mod_perl gives you much more ability to do what you want, but eventually you start asking the question "What is it that Apache is doing for me?" and the answer seems to be "not a whole lot". Which is particularly grating when it sometimes makes your life hard.

3 habits of highly effective servers

Sure performance could be an issue, but that leads to our next point of discussion - the division of labour between the web application server and the database server. We talked about implementing a Ruby/ActiveRecord object server that would connect to the database and dish up objects on request, sent over the network in some serialized form. I assume Ruby has an equivalent of Perl's Storable, I just don't know what it is.

And that about sums up our conversation until it was time to go and do some real work.

As I said, I hope to get time to write up something more formal and try to kick of some discussion. Of course it's highly likely these are not original thoughts. Someone probably already has a patent on them ;)

11:48 PM, 18 Feb 2005 by Mark Aufflick Permalink | Comments (2)

I can't say I always agree with Richard Stallman, but this is an excellent article .

It has always seemed clear to me that anyone who supports patents that cover software is either naive or is happy to use a law past it's intent in order to hinder competition.

Now we know Bill Gates is not naive, and thanks to the historical context in the linked article we know that Bill Gates is well aware of the negative power of software patents.

Here's what Bill Gates told Microsoft employees in 1991:

"If people had understood how patents would be granted when most of today's ideas were invented and had taken out patents, the industry would be at a complete standstill today...A future start-up with no patents of its own will be forced to pay whatever price the giants choose to impose."

Which makes it odd that Bill suggested that anyone opposing software patents must be a communist. Actually it's not odd—it's exactly what you expect since honesty and clarity aren't exactly hallmarks of Microsoft spin.

In fact what does surprise me is that Gates chose to backpedal furiously in an interview with Gizmodo. As summarized by Linuxworld:

Gates's point, he said, is that there's a spectrum of viewpoints on this issue, from the extreme of believeing that there should be no patent system at all to the opposite extreme (he didn't specify how that would be characterized).

More commentary of Bill's "Communist" outburst at Thinking Monkey.

10:58 PM, 16 Feb 2005 by Mark Aufflick Permalink | Comments (0)

Custom Apache logging with values from your mod_perl code

I recently had a need to create a custom Apache log which contained data from within the perl code for a page request.

It turns out to be rather simple, using the Apache concept of notes.

Anywhere in your perl code, you need to add a snippet like this:

$r->notes( foo_log_info => $foo_value );

If you are using mod_perl your handler is a good places to do it, mason users could also use their autohandler, but you can really put it anywhere that you have access to the $rApache::Request object.

In your httpd.conf section, do something like this:

SetEnvIf Request_URI "\.html$" foo_log_this_page
SetEnvIf Request_URI "/$" foo_log_this_page
LogFormat "%h %{foo_log_info}n" foo_log_format
CustomLog foo_log foo_log_format env=foo_log_this_page

See the apache docs for info on what the other fields mean ( ), but the important things are these:

  • The SetEnvIf directives, along with the env= tail to the CustomLogdirective make sure that you are only logging html files (or directory indexes). You may need to change this depending on what files are served by mod_perl in your setup.

  • The %{foo_log_info}n is the note that you set in the perl code appearing in the LogFormat.

  • CustomLog sets up a new log file based on our custom format (log file path is relative to your ServerRoot).

07:12 PM, 02 Feb 2005 by Mark Aufflick Permalink | Comments (0)


Blog Categories

software (41)
..cocoa (23)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (26) and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)


Icon of envelope Request notifications

Syndication Feed


Recent Comments

  1. Mark Aufflick: Re: the go/Inbox go/Sent buttons
  2. Unregistered Visitor: How do make a button to jump to folder
  3. Unregistered Visitor: Note I've updated the gist
  4. Unregistered Visitor: umbrello is now an available port on macPorts
  5. Unregistered Visitor: Updated version on Github
  6. Unregistered Visitor: Modification request.
  7. Unregistered Visitor: Accents and labels with spaces
  8. Unregistered Visitor: Mel Kaye - additional info
  9. Unregistered Visitor: mmh
  10. Mark Aufflick: Thank you