Archives for January 2008

Handier QuickLook

QuickLook is one of the better features in MacOS X Leopard.

There's something that perplexes me though.. where is the ability to specify a default mapping to use if no other plugin responds?

For example if I find a file .BD.fRS9fg lurking on my disk why is there no way to look at it with QuickLook? Opening the file is soo 2007!

Surely it should be possible to have a plugin that sniffs the file and, if it's text, uses the default text plugin and, if it's not, uses a hex/ASCII viewer plugin. This would be super-cool.

Also: What is up with Leopard including a QuickLook plugin for Word documents but not for Pages?!

27/01/2008 21:48 by Matt Mower | Permalink | comments:
More about:

You depress me unutterably

You know who you are.

You are the person who decided to make the Darwin (the variant of Unix that powers MacOS X) source code available only as hundreds of separate, largely unintelligible, file downloads, behind a login, with no way of downloading the whole thing, and no search, no map, no nothing.

Oh and you broke snagdar... again!

25/01/2008 22:26 by Matt Mower | Permalink | comments:

Any more of this and I'll have to change the name

I just released version 0.9.1 of my SimplyVersioned Rails plugin.

I got a report of an incompatibility with another plugin that was trying to do some special handling of a column value that didn't quite work. To work around this I have introduced the ability to avoid versioning some columns altogether using a new parameter

simply_versioned :exclude => [:awkward_columns,:go,:here]

Excluded columns do not get serialized into the YAML storage in the Versions table.

This kind of change had already been suggested to me by Brian Smith and I've also taken his suggestions about renaming the methods in the VersionProxy. For now I've aliased them so that:

thing.versions.current_version

is also available as the, neater,

thing.versions.current

At some point in the future I will switch the methods over and delete the more cumbersome names. I'd gone with those in order to be sure of avoiding future conflicts but Brian persuaded me I was being overcautious.

Another suggestion Brian had was to change the name of the Version storage column from yaml to something like data. I think it's a good idea, especially if YAML might not always be the storage type, but it will cause breakage for little obvious benefit and I don't want to make this an option.

In many respects this plugin, simple though it is, has been a pleasure to write. I think that's in large part because of the tests. Usually once I start trying to modify code after a few weeks away I get tangled up and quickly cautious as things break. The tests meant I could come back to it and tinker with some assurance. That's made it fun to develop in response to feedback.

That said I'm not looking to add too much more to this plugin before 1.0 or I risk having to drop the Simply part of it's name!

24/01/2008 23:24 by Matt Mower | Permalink | comments:
More about:

Have hat will travel

I've been living in Woodlands Park, in Maidenhead, for two years this February. In that funny way that you often find it seems, at the same time, a lifetime and as if I just moved in yesterday.

Unfortunately my landlord needs his house back and has given me 2 months notice. It was a bit of a shock since it's come out of left-field and I hadn't planned to leave. I think I will be quite sad to go, it's a nice house and the cats and I have been happy living here.

Still, life is change.

Now I face the pressure of finding somewhere new to rent. This is always stressful , no matter how many people tell you the housing market is now working in your favor. It never seems that way when you're in it. Also, if you have pets, the stress is doubled.

The head lease of most apartment buildings preclude pets and when you factor in landlords who just won't consider it you're basically looking at about 75% of properties on the market being unavailable to you before you even begin to consider issues like "Would I like to live around there?", "Is the place suitable?", and "Can I afford it?"

However over the next two months I am going to have to divest myself of some of the stuff I have accumulated lately and find a new place to hang my hat (and two food bowls).

23/01/2008 20:58 by Matt Mower | Permalink | comments:
More about:

Who came up with this shit?

So, the iPhone user-agent string (that Mobile Safari sends to the server to identify itself is):

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3

So it's Mozilla 5, but it's AppleWebKit, but thats KHTML, but like Gecko, oh and it's really Mobile Safari. I mean WTF?

I bet this is Microsoft's fault. I bet some time back in the IE2 or IE3 days they did some stupid, slimy, "try and lock them in" asshattery that started requiring everyone else to bend the user-agent string until we end up with these wretched things which will probably plague us until someone invents the next web. By which time hopefully Microsoft will have made themselves an irrelevance.

If you're wondering why I'm frothing about this it's because I am parsing user-agent strings to make a guess about a type of codec to use (or whether a device can even use one) and the user-agent string is all we got.

This should not be required.

What these browsers should be passing is an HTTP header that specifies what standards they support, e.g.:

HTML3 # no exceptions
HTML4 +some_stupid_extension -bug1 -bug2
HTML5 +some_custom_extension -buggy_feature -not_yet -and_so_on

and, to make my life easier some kind of header that outlines the supported video and audio codecs. Although that would be much easier to deal with if user agent strings just unambiguously identified the device/browser instead of playing stupid compatibility games.

22/01/2008 16:48 by Matt Mower | Permalink | comments:

I hope TimeCapsule isn't it

TimeCapsule is a great name for Apples new backup drive come wi-fi router but I do hope it's either the first in a line or not the only way of doing network TimeMachine.

My problem with capsule as it stands is that, as I read the specs, it's a single drive. So if my TimeCapsule drive goes bang... my data goes with it. And I've been living with this "one drive as a backup" thing for too long.

Recently I've been considering either a Drobo or a Infrant ReadyNAS. I want some degree of disk redundancy in my backup solution. I can't afford either and both have drawbacks.

Ideally what I want is for Apple to release a bigger TimeCapsule with multiple drive redundancy.

21/01/2008 15:08 by Matt Mower | Permalink | comments:
More about:

It's funny but is it going to get them off their tractors?

From an article about the writers strike talking to network execubot Jeff Zucker:

Mr Zucker appears emboldened to make changes as NBC’s audience ratings have improved in the strike’s wake, mostly thanks to inexpensive reality shows.

I like shows that have writers: Futurama, Seinfeld, Heroes. Something where this actually some creative input.

Since I moved to this house in Feb 2006 I have not had broadcast TV, neither terrestrial or digital. I stream the odd show via BitTorrent but, other than that, watch only DVDs.

Nothing i am hearing suggests that I will ever want to let a TV network into my home again.

21/01/2008 09:29 by Matt Mower | Permalink | comments:
More about:

The quality of uninformed debate

in this country is going to the dogs. I just listened to a debate on, I think, Five live and not only did I not hear a reasoned argument from any of the callers or texters but most of them didn't actually listen to the points made so their blathering were, to boot, irrelevant. I think I'll stick to football phone-in's in future, they're more intelligent.

20/01/2008 11:59 by Matt Mower | Permalink | comments:
More about:

Safer driving

As I was driving along Thursday, in the filthy driving rain, and trying to check my blind spot it struck me that it should be very easy for my car to tell me if it's safe to turn.

Rear-parking sensors are becoming quite common, at least on luxury vehicles. I assume the same technology could be pressed into service for the two rear wings of the vehicle. Then activate one of them when the appropriate turn is indicated. If there's something in your blind spot you get some kind of warning signal.

I can think of two objections outright:

  1. The sensors might not be effective over the sort of distance you would need. I've never used a car with rear-parking sensors so I can't be certain that the technology would be effective. On the other hand, I can't believe we can't have such technology.

  2. The risk of failure. If we all get used to our car telling us when people are in our blind spot then a failure of that sensor could be very dangerous. So make sure they are reliable like the steering and brakes.

19/01/2008 10:15 by Matt Mower | Permalink | comments:
More about:

Prediction markets in software evolution

While chatting with Stowe and Andy the other night I mentioned an idea that had come to me while I was reading an article about Google and prediction markets that Euan Semple linked to.

In short what I was thinking about was using prediction markets to determine the course of a product or how it should be supported. You give, for example, beta testers and support customers the ability to "buy" tickets for features or bugs and drive your effort in the direction that they predict will have the most important effect for them.

I haven't quite thought through the feedback mechanism that changes the prices or how the economics of the market should work.

A few more thoughts:

  • It would seem to be beneficial to have a mix of employees as well as existing and potential customers in the investor mix.
  • The "price" of a feature or bug should be related to it's complexity
  • You are probably investing in the event "work will be started on this"
  • The starting "price" could be baised based upon the companies own strategy
17/01/2008 10:21 by Matt Mower | Permalink | comments:

Winning without understanding the game

I was just reading part of the genetic programming chapter of Collective Intelligence where the author has small programs evolve, by competing with each other, to win a simple game.

It struck me that a well written set of specs is, essentially, a game. Where you win by passing all the specs and your score is the number of specs you pass (we might also, for example, look at spec complexity as a factor in scoring).

My first thought was that the Rubinius specs are getting quite large and complete. Could you, perhaps, evolve a Ruby virtual machine to pass the Rubinius specs? This would, however, require manipulating C language operators, running compilers etc...

Maybe a better approach would be to evolve Rubinius in Rubinius. To implement the virtual machine using VM instructions hosted on Rubinius. Once you had a populating of passing VMs you could start adjusting the specs to include space/time trade-offs to try and evolve faster machines or smaller machines or what have you.

It's probably crazy or, at the very least, totally impractical but might be a fun project for a rainy day (or, more likely, a rainy decade).

17/01/2008 10:14 by Matt Mower | Permalink | comments:

Get it covered

I really like CruiseControl.rb. Despite running my tests locally it has caught a few things that differed between my MacOSX laptop and our EY staging (and production) slices. Also it's a comfort to know that the tests are guaranteed to be run.

Following instructions i found at the Dead Programmer Society I was able to integrate rcov into the process so that I automatically get coverage reports with each test run available:

CruiseControl.rb
Uploaded with plasq's Skitch!

That's pretty neat. Now there's two additional things I would like:

  1. I want coverage run across the whole application, not split into "unit" and "functional" tests (even allowing for the arguments about rails use of these terms there is no reason to split running the tests in cc.rb) because otherwise I think the coverage of things like lib/ is going to be faulty. Either that or it shows up a faulty assertion in my testing practice.

  2. I want CC.rb to automatically kick of a deployment to our staging server if the tests pass. Typically I check the tests run locally, commit, watch while CCMenu starts spinning then goes green again. Go back to iTerm and do a deployment to staging. Life would, I think, be simpler if CC.rb could kick off the last step for me.

There's two challenges to No.2 as I see it. The first is "How do I make CC.rb trigger a deployment?" and the second is "How do I make my deployment hands-off?" For example my current deployment requires a password to be entered to delete old versions. I can't see a way of doing passwordless sudo for that specific operation so I guess I'd have to remove that step from the deployment and then run it daily via cron or something.

Anyone else interested in this kind of thing? Or have a better process?

16/01/2008 12:05 by Matt Mower | Permalink | comments:

Mostly Harmless

Met with Stowe and Andy Gibson (of the School of Everything) last night.

We met up in the bar of Hoxton Hotel before moving on to the Great Eastern Dining Room for a rather lovely dinner. I can't tell you what wine we had but it was great and I never expect to taste it's like again (unless I get a happy IPO experience some day!) Stowe is always good company despite, Kato like, attempts to kill me and so was Andy who seems to have survived growing up as the child of a Philosophy professor rather well.

I was, however, quite crushed when our waitress Naomi, after hearing that I was learning karate, said, and I almost quote "But you don't look dangerous at all." How do you survive that? Cue silent but deadly gags from my co-diners.

As always tends to happen with Stowe, dinner conversation ranged widely and was most convivial. I look forward to meeting Andy again and, since HorsesMouth don't seem to be responding to my support requests, it looks like I need to take a serious look at School of Everything.

16/01/2008 10:09 by Matt Mower | Permalink | comments:
More about:

$9.99 is the mark

Hmm... I can't help feeling a little gypped that I'm going to have to pay $20 for five applications that were included with the iPhone. Let's also be clear about it, nobody is buying them for Stocks and Weather. The Notes app I may find useful even if I don't stop carrying my small Moleskine. But, if we buy this pack, we're buying it for Mail and Maps.

I guess this means that the price of a decent iPhone/iPodTouch (I wish there was a generic term to refer to the platform) is being set at $9.99.

Okay, okay, I can get over paying the $20. It's worth it not to have to go through hacking the damn thing again. If I can just figure out how. I have 1.1.3 firmware installed, I've clicked the pack on the iTunes store, but I didn't see any "buy now" type links.

Come on Apple, the RDF is slipping, make me feel good about this again.

Update: Okay so shortly after writing this Software Update popped up to say iTunes 7.6 was ready to install and, after a reboot, iTunes has popped up with the iPod Touch update. The price is £12.99 which, by my reckoning is somewhere closer to $25 than $19.99.

I've decided to put off buying it. I don't get a wireless signal often enough when I'm out and about to make paying £6.50 each for Mail and Maps really worth it. I have a GPS that does maps when I need them most (i.e. in the car) and I already get Google mail.

I'm sorry Apple but you haven't persuaded me on this one.

16/01/2008 10:00 by Matt Mower | Permalink | comments:

Off to see the wizard

Heading off into town in a little while for dinner with the wizard of Oz.

15/01/2008 16:28 by Matt Mower | Permalink | comments:
More about:

The information diet

Following on from yesterday I was very pleased this morning when I was able, in less than 20 minutes, to go through my unread RSS and knock 'em all off. I don't think I've done that in years.

Buoyed by that I unsubscribed from about a dozen mailing lists that I was a member of. They were all for topics that interest me, but i just don't have time to read the messages and so they build up to wild levels like four and a half thousand threads in one of the cocoa-dev lists.

Whenever I looked at them I felt a weary sense that one day I was going to have to climb the hill and "catch up." Also they were there for me to search. But I never did search, I always went to Google first and I don't really think I ever worked out how I would catch up.

So I've binned all the messages from lists I'm not actively tracking (e.g. ruby-talk) and unsubscribed at least until I have time to be an active participant.

I feel much better.

15/01/2008 13:11 by Matt Mower | Permalink | comments:

iWatch lazyweb?

Okay so further to my previous post about promptness I have been looking for a watch.

My needs felt simple but, apparently, watch technology hasn't moved much in the last decade. Maybe tomorrow will yield the iWatch? No, probably not.

What I want is a small, light, watch that keeps good time and has at least half a dozen weekly (not daily!) alarms. All the watches I've seen that have alarms have daily alarms but that's no good to me. I want to be able to set an alarm for specific events in my week. It would be helpful if alarms were fairly easy to set on the fly. As to other features, as long as it's waterproof at street-level that's all I need.

I would have said "Bonus marks for syncing alarms from iCal via Bluetooth" but some spade work with Google suggests I was barking mad to have even imagined such a thing.

Are weekly alarms such a strange thing to want? Any suggestions?

14/01/2008 12:55 by Matt Mower | Permalink | comments:
More about:

I love design like this

Peak bath, saves water, supports knees.

14/01/2008 12:33 by Matt Mower | Permalink | comments:
More about:

Create your own kata

Creating your own kata sounds like rather an advanced exercise to me since I am still struggling to learn the basic Heian kata's (at the moment Heian Sandan which is an odd beast).

But Dad bought me Shotokan Karate: Unravelling the Kata for christmas which I have been reading and it's got quite a lot of interesting history about kata and the development of karate generally.

The question of where the kata derive from and why they are the way they are is an interesting one. Perhaps each student discovers it for themselves in practice.

Update: I think it's worth pointing to another article, this one by Rob Redmond, from 24 Fighting Chickens about kata applications:

Eleven years ago I receive an email from Elmar Schmeisser introducing himself as a Karate instructor with a similar background to my own. Eventually, I invited Elmar to instruct an all-day class in kata applications. His class was like nothing to which my previous JKA-style Shotokan Karate training had ever exposed me. Elmar showed us how to turn rather absurd looking two-arm positions into joint locking applications and other ways of opening our minds to the endless possibilities that the kata provided for creative interpretation and effective empty-handed application. The experience was very good for my students. One of them remarked, “I truly enjoyed that class. It was very, very violent. I’m not sure I could actually do that to another human being without throwing up.”

As a beginner I've not had much experience with applications yet although we've had a couple of fascinating classes where Sensei Hughes showed us some applications of the first couple of Heian katas. I was learning Heian Nidan at the time and I remember it being quite exciting so see how the rather stylised movements of haiwan-uke, ura-zuki, and tetsui-uchi translate into something you might do.

14/01/2008 12:15 by Matt Mower | Permalink | comments:
More about:

Following Terry's example

Among other information dieting tactics Terry has cut his RSS feeds down to something like a dozen. I'm not quite in his league but, in preparation for leaving Google Reader soon, I thought this was a good opportunity to take a leaf from his book and rationalize.

Over the last year or so I got up to maybe three or four hundred feeds and routinely (especially with some hosepipe feeds like the delicious tag for MacOSX) had thousands of unread articles.

Because of this I had my feeds organized into tags like 'blogging', 'macosx', 'ruby', 'software development', 'AI', 'my stuff', and so on. But even with this I often find myself having to hunt & peck because I didn't have enough time (or patience) to weed an entire tag.

Today I have pruned like mad and now have 120 feeds (of which about 10 are vanity searches, service status, etc...) and on 281 unread items.

My next feed reader is going to have sampling capability. That is, after subscribing, at periods like a week, a month, and six months it's going to ask me whether I still want the feed or not. That way I shouldn't keep accumulating feeds that, while they may have great posts from time to time, don't deliver enough value to be read daily.

Update: Once I got rid of all the stupid "Friend shared items" rubbish from Google Reader I am down to 117 new items. I loved Reader a few years ago when it first came out, now I can't wait to dump it. If nothing else I will be glad to get rid of the "Oops something bad happened, please try again" messages that plague Reader.

14/01/2008 11:31 by Matt Mower | Permalink | comments:
More about:

Don't log passwords stoopid

Great tip from fearoffish. So obvious in retrospect yet it never occurred to me. And who even knew Rails even had this built in?

I'll be setting mine to filter both password and password_confirmation.

13/01/2008 15:04 by Matt Mower | Permalink | comments:
More about:

Experimenting with Git

All the cool kids are doing it so, despite having a fair old investment in Subversion, I am now experimenting with Git. Since I have spare Peepcode credits I got the Git peepcode which turns out to be a great introduction to what Git does best: easy branch and merge.

At the moment I am trying to work through how deployment with Capistrano is going to go. My first thought is to have a "deploy" branch from which all deployment happens. Every time you want to deploy you merge to the deploy branch then fire up Capistrano. Is that more work than I need? The alternative is just deploying from master but that seems a little haphazard.

I'm also weighing up how to collaborate. For some projects setting up a central repository to track the master branch using SSH and git-shell is appropriate. There is also Gitorius which looks promising for open source projects and GitHub which looks awesome for all kinds of projects. One of the ideas I always liked from Darcs was the ability to send patches via email. That always struck me as a good way to bootstrap a project. Perhaps with Gitorius and GitHub that's not really needed.

Early days but I like Git so far.

13/01/2008 11:57 by Matt Mower | Permalink | comments:

Getting the skinny on E2.0

My friend Dan Keldsen works for AIIM a, non-profit, organization with a long history. When they founded in 1943 they were the National Microfilm Association. Later they became the Association for Information and Image Management and probably thought they had their bases covered. But even that wasn't enough and now they have cut to the chase and call themselves "The Enterprise Content Management Association". Should be good until the next information age!

One of their current interests is determining whether people see a valuable substance in what has been labelled "Enterprise 2.0" or if, now that the dust has settled a little, people still think it's just a fad marketing term. To this end they are running a web survey that takes about 30 mins to complete.

I ran through the first few questions but it was quickly clear that I do not have the insights they are looking for. I don't even have an Enterprise 2.0 topic on my blog and haven't worked in even a moderately large organization since 2000.

However if Enterprise 2.0 means something to you (even if that's just spitting feathers) I'm sure Dan would appreciate your contribution. AIIM will be publishing the survey results and including it in their free webinars.

13/01/2008 11:34 by Matt Mower | Permalink | comments:
More about:

Addiction as a disease

Very interesting article from PsychCentral about discoveries related to addictive behaviour:

...

"Our data suggest there may be a cognitive difference in people with addictions," reports lead scientist Charlotte Boettiger, PhD. "Their brains may not fully process the long-term consequences of their choices. They may compute information less efficiently."

...

While decisions were being made, the imaging detected activity in the posterior parietal cortex, the dorsal prefrontal cortex, the anterior temporal lobe and the orbital frontal cortex. People who sustain damage to the orbital frontal cortex generally suffer impaired judgment, manage money poorly and act impulsively, the scientists noted.

...

Read the rest of the article if you are interested in the details, it's quite short, but here is an interesting prediction from one of the researchers, Charlotte Boettiger:

"It wasn't that long ago that we believed schizophrenia was caused by bad mothers and depression wasn't a disease. Hopefully, in 10 years, we'll look back and it will seem silly that we didn't think addiction was a disease, too."

When I was studying psychology one of my lecturers was involved in a study looking at genetic factors in alcoholism. What always puzzled me about that was how you link the gene to the behaviour.

My own experiences with addictive behaviour suggest that it's a "mental image" thing involving, it seems, your moment to moment map of who you are and what you want. I could never quite see how to connect that to genetic factors. But a genetic factor that leads to a susceptibility to impairment of the orbital frontal cortex seems quite plausible to me.

An alternative that occurs to me is that the cortex is under-developed. It's development occurred in a period in which there were orders of magnitude less stimuli for humans and survival & procreation were pretty much the only goals available. It didn't have to worry about self-actualization and whether you were a good human being or not. Maybe it's just not up to the job (yet).

I look forward to reading a lot more about this line of research.

13/01/2008 10:22 by Matt Mower | Permalink | comments:

Well deserved

Congratulations to Ezra and everyone at EngineYard on their funding deal. They get the job done and they do it right which is everything you want in a hosting company.

I can think of no better recommendation than that I choose them for reeplay.it and recommended them at my last company as well.

Now I'm really looking forward to seeing that Rubinius based stack!! ;-)

12/01/2008 10:07 by Matt Mower | Permalink | comments:

RJS testing with assert_select_rjs seems to be a frustrating waste of time

Okay I seem to have spent the majority of this afternoon trying to work out whether testing RJS with assertselectrjs actually works or is even worth doing.

I have an action that issues:

page[dom_id].visual_effect( :fade, 3 )

but can I figure out how to test this properly? I cannot. So I tried what seemed the more simple:

page[dom_id].remove

but this wasn't testable either. It seems that assertselectrjs has no knowledge of visual_effect at all and while the above RJS code becomes:

$(\"contact_aaron\").remove();

the assertion code is hardwired to expect:

Element.remove( .. )

At this point I feel like I've wasted a lot of time trying to test something totally stupid and trivial and not gotten much for my time.

Does anyone do RJS testing? Do they test visual effects? How?

11/01/2008 16:20 by Matt Mower | Permalink | comments:
More about:

Making creative space

Terry and I have been friends for quite a few years and a topic of a lot of our conversations either serious, or in jest, is productivity and productivity books, tools, and approaches.

He was telling me the other day about a book that had made an impact upon him called "The 4-hour work week" and, by golly, it has:

I immediately called Sprint and knocked $90 off my monthly cellular bill. I contacted my shopping cart service (for another site I run) and downgraded the service to a Basic package for a savings of $40 per month.

That $130 will get me a Basic-10 package at GetFriday.com, which includes 10 hours of labor per month for whatever tasks I need.

10 hours per month isn't a huge amount (although Terry is already looking for other fat to cut to generate more time) but if those 10+ hours clear away blocking tasks that you're just not doing they could be critical.

I'm going to be very interested to see how this works out.

11/01/2008 10:07 by Matt Mower | Permalink | comments:
More about:

BBC iPlayer sucks

Well. I'm watching Doctor Who on BBC iPlayer. And I'm able to write this in the long pauses during playback. Just as I get into the plot, it freezes. Then starts again. I get a little further. It freezes. My first thought was my ADSL connection but it seems fine. What a craptacular experience.

11/01/2008 00:02 by Matt Mower | Permalink | comments:
More about:

Promptness shows respect

Hmm... I just came across Eric Zorn's 50 things I've learned in 50 years. While the list is claimed to be in no particular order my suspicion is that by about no. 36 you're struggling while items at the top of the list spring up because they're key. Anyway.

No. 2) Promptness shows respect.

This one tickled my conscience a little. I think because promptness is not an area I can claim much credit in and it does imply something. I am always either very possibly going to be late, or, very actually late. It's actually become a little stressful and that's quite funny to me.

My Dad, upon whom a lot of this lateness falls, thinks it's because I don't wear a watch. In fact I haven't worn a watch since some time before 2000. The reason I stopped wearing a watch was because I had become very stressful about time and the watch become a focus of that stress.

Not wearing a watch felt magical. At least, I think it did. Anyway I never felt the need to go back to one.

Until now.

Now my stress is not about time, and the passing of time, but about a feeling that, if I do respect someone, that means respecting their time as well.

I think it's time to wear a watch again.

10/01/2008 10:42 by Matt Mower | Permalink | comments:
More about:

States, Versions, and to_proc

I released version 0.7 of the SimplyVersioned plugin this evening in response to some feedback from Josh Susser that I was making his code look bad. Not being one to tolerate such things I paid to have him silenced took another look. Indeed there was something ugly.

I had included a method without_versioning that went like this:

def without_versioning( &block )
  versioning_was_enabled = self.versioning_enabled?
  self.versioning_enabled = false
  begin
    &block.call( self )
  ensure
    self.versioning_enabled = versioning_was_enabled
  end
end

If you wanted to save a model without generating a new version it was simple:

thing.without_versioning { |t| t.save }

but what about a conditional?

if some_expr
  t.save
else
  t.without_versioning { |t| t.save }
end

which is a bit ugly. So we changed without_versioning/1 to with_versioning/2 and jimmied around with it a bit so that you can now call:

t.with_versioning( some_expr ) { |t| t.save }

and the result of the evaluation of some_expr determines if a version is saved. But Josh also pointed out to me that this was a good opportunity to use the Ruby Symbol#to_proc hack to tidy it even further and we end up with.

t.with_versioning( some_expr, &:save )

Which is very neat I think. I've been a bit suspicious of the to_proc hack up to now but examples like this are really turning me around. And thanks Josh for letting me know my code was bad so that I could fix it ;-)

In addition I have released another plugin called Enhanced Acts As State Machine which adds state awareness to ActiveRecords find method so that you can do stuff like:

Widget.find( :all, :state => { :is => [:worn,:rusty] }, :conditions => 'age < 5' )

It's just a very small enhancement but I find it enhanced the clarity of my state using code. Check out the README for more details.

04/01/2008 22:17 by Matt Mower | Permalink | comments:
More about:

It's not about better search hits

There is a new contender to the crown called Blekko which is by the way a very cool name, like a detergent from the 1950's ;-)

Unlike PowerSet and Cuill I think they've cottoned on to the idea that "providing better search hits" is the wrong game to be in and not the way to attack Google:

Google was built to index a web that no longer exists... a web where people still engaged in social linking behavior, for one thing. --- [Rick Skrenta]

My guess, based on my vast storehouse of search knowledge & experience, is that PowerSet and Cuill will - if they survive long enough - be absorbed by Google (or one of the other existing search players) for whatever technical enhancements they've come up with. Cuill seem particularly designed for acquisition since, it is claimed, that they emphasize reducing the costs of indexing.

Mahalo, despite everything that is wrong about it (and that's just about everything), seems to me, nevertheless, to be point at what will change the game: synthesis.

The fractal nature of the web means that it is, as time goes on, less and less likely that any page, or even a series of interlinked pages, is going to be "the answer to your query." So that the goal of "finding the right page" is not even the right starting point.

What is needed is an engine that can synthesize, from the store of information available, answers to your questions that take into account your need, your experience, and your bias (conscious and unconscious). That's a pretty tall order but I think that's the territory that search will be fought on in five to ten years time.

The problem with Mahalo, and the reason it will be a footnote, is that it uses human editors to synthesize a single viewpoint. You only have to look at how Wikipedia's crown has become tarnished in the last few years to realize that won't scale both because the web is too vast, and because a single viewpoint cannot be achieved on any topic of substance. At best Mahalo might survive, in limited and highly specialized domains.

I've no idea if Blekko is working to solve the problem of algorithmically synthesizing knowledge from the web in real-time but Skrenta hints that they may be trying something different:

Basically, trying to make algorithmic sense of the vastness of the web is a difficult but really interesting problem. So is tilting at the biggest brand on the web. It's all just plain fun, which ideally should be the point of working. ;) [Rick Skrenta](http://www.skrenta.com/2008/01/why_search.html)[]

Am I reading too much into the phrase "make algorithmic sense of the vastness of the web"?

Where I think Arrington may have it wrong is that Blekko won't be a company to watch in 2008. I'd be surprised, if they are doing something game changing, if they'll be a company to watch in 2009 either. Maybe in 2010.

That was supposed to be the year we went to Jupiter again so a better search engine isn't so much to ask, is it? ;-)

04/01/2008 08:47 by Matt Mower | Permalink | comments:

Is 56 days a form of torture?

The government wants to extend the period in which an individual can be detained under anti-terrorism laws from 28 days to 56. So I wonder: Why?

I have seen no evidence, let alone clear evidence, presented about how those additional days will lead to new evidence being discovered that might lead to charges. If you can't find the evidence in 28 days, why 56? Why 90 (the original proposal)?

Is it perhaps that detention without charge is a form of psychological torture? That by holding the individual long enough away from friends, family, and support and by questioning them, harrassing them, and controlling their detention you aim to break them?

My guess is that 28 days probably isn't long enough for this if you aren't able to employ Gitmo style tactics although I suspect it's harrowing enough.

I further guess that the original proposal of 90 days was a bargaining tactic. The government knew it would face stiff opposition so they went for 90 knowing they'd be argued down to something approaching the current proposal.

Is there some reason, other than it's psychological impact on the suspect, why 56 days will work? I'd be interested to hear if there is.

01/01/2008 13:55 by Matt Mower | Permalink | comments:

The Who and How of it

Listening to a debate on Radio 4 about the new European treaty one of the respondents (I think a former Liberal Democrat whip) raised an interesting point. Paraphrasing:

What is important in a democracy is that the people can decide how they are governed and by whom.

What concerns me about Europe is not closer trade alliances with European countries, not whether we drive on the left or the right, not what language documents are officially written in, not even whether we have pounds or Euro's, no. What concerns me is how we are governed.

Up to a point, that which moves the locus of control of government further from the governed seems to be me to be a bad thing. Is there any chance that ordinary people like me will be able to read and comprehend this new treaty?

I tried to have a go at reading it myself but ran into a fundamental language barrier:

Microsoft VBScript runtime error '800a004c'
Path not found
H:\CMS3\COUNCILCMS\CODE\WEB\FRONTOFFICE../include/generatePage.asp, line 37

Which tells you all you need to know about my impact on EU procurement processes!

I've heard that the new treat was written by politicians and lawyers for politicians and lawyers and that it's incomprehensible to mortal man. Has anyone read it and can comment?

I already believe that the Westminster government has too much power and the parliament too little oversight. My suspicion is that the actuality of the Lisbon treaty will be a one-way transfer of further power toward an even less accountable EU bureaucracy. I struggle to see the positive in this situation.

01/01/2008 13:43 by Matt Mower | Permalink | comments: