Archives for December 2006

Nuts to superheros

Your results:
You are Dr. Doom

Dr. Doom
82%
Apocalypse
78%
Juggernaut
70%
Dark Phoenix
70%
Lex Luthor
67%
Magneto
61%
Venom
59%
Green Goblin
58%
Kingpin
58%
The Joker
52%
Catwoman
51%
Mr. Freeze
50%
Mystique
38%
Two-Face
38%
Riddler
36%
Poison Ivy
34%
Blessed with smarts and power but burdened by vanity.
Click here to take the Super Villain Personality Test

31/12/2006 09:18 by Matt Mower | Permalink | comments:

To die or not to die, that is the question

My own opinion about executing Saddam Hussein aside (I'm against state sanctioned murder) the process as outlined on Radio4 just now seems about as bad as I can imagine. Here is how it was described:

  • The court having issued sentence of death
  • The prime minister writes to the presidency council asking for a decree
  • The council then either signs it, or they don't
  • If they don't, after 70 days, the sentence is automatically carried out anyway
  • The president doesn't like signing death warrants so he gets his deputy to do it

The council doesn't have the right to commit the sentence or do anything to it except, it seems, hold it up for 2 months. What's the point of asking them? And what kind of president is not so squeamish as permit state sponsored murder but too squeamish to put his name to it? Brave man.

I don't think I've liked anything I've heard from Iraq since the American and British governments lied their way into invading and breaking that country. This is just the latest thing I don't like.

Update (30/12): More things that I don't like. From Euan I learn that Saddam Hussein has been hanged and that it was filmed. Euan and Dave Snowden both seem to share my disgust at the idea of state sanctioned murder. From the BBC I read George Bush's response:

"It is an important milestone on Iraq's course to becoming a democracy that can govern, sustain, and defend itself" -- US President George W Bush

I am not sure how to adequately express my feelings of disgust towards this man and what he stands for.

29/12/2006 17:19 by Matt Mower | Permalink | comments:
More about:

Imagining a future of slower, home-built, computers

I've just read a lengthy analysis of Microsoft's Vista OS premium content protection system. It's long and somewhat technical but it cuts to the bone of what is wrong about the relationship between the content & computer industries:

On-board graphics create an additional problem in that blocks of precious content will end up stored in system memory, from where they could be paged to disk. In order to avoid this, Vista tags such pages with a special protection bit indicating that they need to be encrypted before being paged out and decrypted again after being paged in. Vista doesn't provide any other pagefile encryption, and will quite happily page banking PINs, credit card details, private, personal data, and other sensitive information, in plaintext. The content-protection requirements make it fairly clear that in Microsoft's eyes a frame of premium content is worth more than (say) a user's medical records or their banking PIN.

and on revocation:

There is some confusion over exactly how much functionality gets disabled when a revocation occurs. The HDCP requirements are quite clear that once this happens (in technical terms once a revoked device's key selection vector (KSV, effectively it's unique ID) appears on a revocation list) the device is effectively dead since it won't be supplied with content any more. However the behaviour of devices subject to revocation in a mixed-content environment is made very unclear in the specs. Some documents imply that it's an HDCP-style kill switch ("Vista will [...] revoke any driver that is found to be leaking premium content [...] if the same driver is used for all the manufacturer's chip designs, then a revocation would cause all that company's products to need a new driver"), while others indicate that the device will still work, but be unable to render premium content. Exactly how well this hope can be realised in practice (if it can be realised at all) remains to be seen.

Revocation is a good example because it is a technology than no consumer could ever want. It may be that Microsoft/HDMI never plan on using it (but if so, why go to such lengths to introduce it?) but what about the hackers? Can you imagine the glee some teenage kid is going to get in publishing the secret keys used in a bunch of expensive components? Or using Malware to trigger revocation (if such a thing is possible, I don't know but i'm guessing that if revocation can be triggered by content then it may be.)

I can't see myself ever buying a computer that incorporates such technology and the costs it implies. It makes me angry to think about it so I think the idea of forking over good cash is unlikely. I love my Mac's but if Apple went down this road I think it would be a problem for me. But then it will be a problem for all of us because Microsoft's dominance of the OS market means that, in all likelyhood, all devices are going to end up compliant and incorporating these protections whether you want them or not:

The worst thing about all of this is that there's no escape. Hardware manufacturers will have to drink the kool-aid (and the reference to mass suicide here is deliberate) in order to work with Vista: "There is no requirement to sign the [content-protection] license; but without a certificate, no premium content will be passed to the driver". Of course as a device manufacturer you can choose to opt out, if you don't mind your device only ever being able to display low-quality, fuzzy, blurry video and audio when premium content is present, while your competitors don't have this (artificially-created) problem.

If hardware manufacturers are increasingly pressured to make compliant devices (and be ultra-secretive about how they work) what is the likelyhood they'll make non-compliant devices for building opt-out computers? Will those of us who don't want to join this HDCP compliant future be forced to go back to building 8-bit computers in our garage?

28/12/2006 13:12 by Matt Mower | Permalink | comments:
More about:

More overlords than you can shake a stick at

In a previous article I was toying with an "I for one welcome our X overlords." line before thinking it was too jaded. But it made me wonder what the name of the Simpsons episode was that introduced this phrase (turns out it was Deep Space Homer) and in the process I learned something about overlordism and Google.

From an article about the phrase itself I learned that:

Plugging this snowclone template

"I, for one, welcome our new * overlords"

into Google returns 1940 hits.

First the phrase has come along way since January 2004 and there are now 149,000 matches for that template. Second I never realised you could put a wildcard into an exact match phrase to form templates like:

"I, for one, welcome our new * *"

Which nets an addition 33,000 hits and is a pretty neat tool.

28/12/2006 10:26 by Matt Mower | Permalink | comments:
More about:

Tesla towers in 25 years?

The engineers behind eCoupled have been developing and perfecting the technology for many years. The product has been deployed in Alticor water treatment products for six years. Nearly a million devices with eCoupled technology, representing over $1.2 billion in sales, have been sold to date.

I'm not sure if I caught the link via a "vapourware of the future" article so I'm taking this (consumer delivery of a troublesome technology) with a pinch of salt but it appears that wireless power transfer may not be far off. As someone looking at far too many damn power cables it can't come soon enough!

28/12/2006 10:18 by Matt Mower | Permalink | comments:
More about:

A Ferrari what now?

Okay I'm puzzled... Why (unless it was free) would you want a Ferrari branded Acer laptop?.

I'd be in about as much of a hurry to get one of these as I would be to get a Microsoft/Acer branded Ferrari. What the hell do Ferrari know about making laptop computers or software anyway? (Disclosure: I prefer Apple branded laptops). Although one could ask the same thing of Microsoft I guess...

28/12/2006 09:48 by Matt Mower | Permalink | comments:

It's a funny thing about VC money

I just read this:

"...and the company is backed by early investors in Skype, Mangrove Capital Partners and Index Ventures."

in a Techcrunch piece about some company. It always puzzles me when I see these kind of words because it suggests it's supposed to mean something. Is the meaning supposed to be that, because these VC's were lucky enough to have invested in Skype, they have some magic start-up radar? If so it would surprise me because my experiences over the last few years leads me to believe that nothing could be further from the truth.

22/12/2006 18:18 by Matt Mower | Permalink | comments:
More about:

Google Reader has more tricks up it's sleeve

So Paul Cox dropped me a line in response to my post about how I am getting on with Google Reader and had a couple of great tips for me, one of which I have implemented already.

Your missing two of the real good features! First use the "star" item to have each item posted to your blog. I set the list to 50 which provides you a blog role of interesting articles. Second use the "Share" feature (shift - s) to have it posted to your shared website. Mine is at http://www.google.com/reader/shared/10790112903116327519 Finally if you put the "shared" reader url in your Google Co-op custome search engines you'll be able to quickly find that entry that you read a while ago

I have made my starred items public and used the Google code to add them to my blog, you'll see them in the sidebar. Since I am concerned about page-load times I've kept it to 10 items but it seems like the shared page, if you visit it, implements a blog format that allows you to browse backwards through all the starred items.

Colour me even more impressed with Google Reader, and thank you Paul!

20/12/2006 20:54 by Matt Mower | Permalink | comments:
More about:

Fixing my fixtures little wagon

I've been writing quite a lot of tests the last few days and a constant thorn in my side has been not loading all the fixtures I need. I think I've almost learned to recognize when this is the cause of test-failure but it's painful and, as I discovered from perusing the Beast unit tests, unnecessary. Rick Olson addresses the problem by loading all of his fixtures in one go:

class Test::Unit::TestCase
  def self.all_fixtures
    fixtures :forums, :users, :posts, :topics, :moderatorships, :monitorships
  end
  ...
end

this seemed like a smart idea to me which I copied. However when I was porting it over to Squib (which I am getting around to testing now) I reflected that this trick would still bite me on the day I, or one of my team-mates, added some vital new model. So I came up with this:

class Test::Unit::TestCase
  def self.all_fixtures
    fixtures Dir[File.join( File.dirname( __FILE__ ), 'fixtures', '*.yml' )].collect do |f|
      File.basename( f, ".yml" )
    end
  end
  ...
end

Seems to work.

20/12/2006 17:09 by Matt Mower | Permalink | comments:
More about:

Google Reader continues to do the business

Somewhat scarily Google Reader continues to be the cure to my RSS ills. Despite continuing to add feeds on a regular basis (I am up to a record high of over 250) I am keeping my unread items day-to-day at about 100 (if I get the count below 100 I tend to stop).

At the moment I have my feeds organized into 15 folders:

  • AI/datamining
  • Blogging
  • Comics
  • Deadpool (feeds I am planning to unsubscribe)
  • Development
  • Distractions
  • Ego-surfing
  • MacOSX
  • Marketing
  • Politics
  • Psychology
  • Ruby
  • Strategy
  • Tech
  • Work

Of these the biggest are Ruby (62 feeds), MacOSX (57 feeds), and Strategy (35 feeds). I tend to read a folder at a time and make exclusive use of the space bar to speed-read my way through most articles. My style these days is to ignore anything that doesn't really grab me by the throat. I make a conscious effort not to read but to scan titles and first paragraphs. When in doubt I star an item and move on. If I miss something interesting I live with it and assuming that really interesting stuff will pop up again and be more likely to grab my attention. About once a week (so far) I go back over my starred items and see if there is anything worth reading or posting about.

I think the key wins for Google Reader has over Bloglines are:

  • The Google reading process works really smoothly for groups of feeds which I never found it did in Bloglines.
  • Posts are marked read as I read them, I never have to manage read status
  • Starring an item lets me trust I can find it again without it staying around (in Bloglines I'd have to mark an item keep)

Looking to the future Google Reader still isn't very smart. I'm having to skim my way past a boatload of stuff that I have no, or passing, interesting in. The tagging features seem useless to me as I'd have to slow down to use them - prioritizing interesting posts (a kind of interest based waterline) might give me the time to tag or, at least, experiement with the tagging. On the other hand I trust that Google can do search and I'll always find stuff again -- eventually.

I'm still on the lookout for something better but, for now, Google Reader is doing a good job for me. Thanks again to Rick for giving me the nod.

20/12/2006 16:16 by Matt Mower | Permalink | comments:
More about:

Another TextMate bugbear

Funny, when I wrote about the things that bug me about TextMate the other day I left off the most important one. That is I forgot to mention how TextMate regularly misses the tab trigger used to expand templates like do ... end.

So, when writing something like:

assert_difference Model, :method do<cursor>

you expect, on hitting Tab to get:

assert_difference Model, :method do
    <cursor>
end

whereas quite often I end up with:

assert_difference Model, :method do


<cursor>

this is even more annoying when you use the doo form to insert block arguments, here:

collection.each doo<cursor>

should tab-expand to

collection.each do |<cursor>|

end

and not:

collection.each doo
<cursor>

This happens frequently (several times a day) and on more than one machine and with most versions of TextMate I've used up to the present 1.5.4 (1324).

I'm really hoping this bug gets fixed.

Once again I'd like to point out that I love TextMate. It's one of the apps I use every single day and feels like the best editor I have used since Brief (a DOS based programmers editor I loved back in the 80's). This is an ongoing lovers quarrel not a "Dear John" letter!

20/12/2006 11:02 by Matt Mower | Permalink | comments:

Some things that suck about TextMate

Because I am feeling grouchy here are some things that suck about my favourite editor, TextMate:

  1. TextMate doesn't care that I ( like to put spaces inside my brackets )
  2. TextMate sometimes forgets the system has a clipboard and I can't C&P between other apps and TextMate. This really sucks
  3. You can't split TextMate windows to look at two files at once
  4. TextMate will gaily try and syntax highlight 125mb of SQL file or XML. Good luck with that!

I love TextMate but these things suck. I don't feel better now.

14/12/2006 16:07 by Matt Mower | Permalink | comments:

No loyalty

I hate to say it because it shows there is no loyalty in Web2.0 but, after a month of using Google Reader, going back to look at Bloglines today felt like stepping into the past. The Google interface is slick and polished and lets me whiz through thousands of items really fast where they would languish in bloglines until I was sick of the idea of checking it. In almost every respect I that impacts my day-to-day use I find Google Reader a superior product. Sorry Bloglines.

13/12/2006 17:26 by Matt Mower | Permalink | comments:
More about:

When map gets expensive

So a problem I was looking at today was how to find the result of a calculation on an array. Typically in Ruby you do this with Enumerable#map as in:

[1,2,3,4,5].map { |e| e * e } => [1,4,9,16,25]

Now what about when you are trying to find out when that result reaches some kind of threshold. I won't go into my specifics, let's just assume you want to know when the result is greater than 10.

[1,2,3,4,5].map { |e| e * e }.detect { |e| e > 10 } => 16

The problem here is that although we have the answer we want, what we don't see is that the map operation will also have generated the value 25 because it has mapped the original value 5. In this case that's not such a problem but we can imagine that if the source was a much larger array with an operation slightly more expensive than e^2 that we might not be so sanguine.

What I needed was something with the stopping power of detect and map combined. This would be easy enough to do if Ruby offered a neat way of passing two blocks to a method. Although it's possible, syntagic sugar support is only available for one.

So I started looking for hacks. Here is what I came up with:

module Enumerable
  def map_first
    value = nil
    detect { |e| value, stop = yield( e ); stop }
    value
  end
end

The hack here is in the block you pass to map_first to make it work, e.g.

1,2,3,4,5].map_first { |e| v = e*e; [v,v>10] }

This uses a return tuple to control halting as well as passing back the result of evaluating the expression. It's probably no worse a code smell than having to remember to return the result in an inject block, yet I wasn't satisfied.

A possibly much better approach came from Tom Ward (tomafro) and looks like this:

module Enumerable
  def lazy_map(&block)
    LazyMap.new(self, &block)
  end

  class LazyMap
    def initialize(enumerable, &mapping)
      @enumerable = enumerable
      @mapping = mapping
    end

    def detect(&block)
      @enumerable.each do |x|
        mapped = @mapping.call(x)
        return mapped if yield(mapped)
      end
      nil
    end
  end
end

This allows for a more natural looking syntax:

[1,2,3,4,5].lazy_map { |x| x * x }.detect { |y| y > 10 }

using detect while the LazyMap ensures that no more expressions are evaluated than required. Of course the detect is hardwired which might lead you to assume you were dealing with an enumerable but that's perhaps a minor point.

I think Tom's hack is much nicer than mine. Of course if Ruby made passing two blocks syntactically sweeter you could have something like:

[1,2,3,4,5].map_first { |x| x * x }, { |y| y > 10 }

which today would have to be written

[1,2,3,4,5].map_first( Proc.new { |x| x * X } ) { |y| y > 10 }

which is slightly too ugly for my taste. For now at least, the hack stays.

Update: Apparently I guilt-tripped Tom over the Enumerable thing because he came back with a new version of his lazy_map that makes it properly Enumerable. Since I wasn't also able to guilt him into actually blogging this himself (+1 guilt ray only) here is his revised effort:

module Enumerable
  def lazy_map(&block)
    LazyMap.new(self, &block)
  end

  class LazyMap
    include Enumerable

    def initialize(parent, &mapping)
      @unmapped = parent
      @mapped = []
      @mapping = mapping
    end

    def each(&block)
      @mapped.each do |entry|
        yield(entry)
      end

      while entry = @unmapped.shift
        @mapped << @mapping.call(entry)
        yield(@mapped.last)
      end
    end
  end
end

Tom says he knocked it up in 10mins which is pretty impressive to me.

13/12/2006 17:04 by Matt Mower | Permalink | comments:
More about:

A lot older, a little wiser

Today is one of those days that reminds me I am 34, not 24. Last night I was hacking on algorithm for our project till 3am which is not something I have done for quite a while. Consequently at 8.15am this morning I felt like crap and have continued to feel crap pretty much all day.

I decided to have a quick powernap and realised - horror of horrors - that I didn't get round to installing Pzizz on the MacBook Pro yet! I quickly downloaded a copy only to realise my license keys didn't work any more.

It seems pzizz are having some piracy problems and are expiring licence keys a few days after they are generated. In general I am not overly comfortable with this approach. In the past I have fallen foul of companies who do this going bust and taking your ability to install software you paid for with them. The Pzizz license key renewal server doesn't inspire much confidence either, I don't think it's ever recognized any of the keys I've had :-)

However a quick email to Pzizz or, since I saw Edward online, a quick ping and I had a fresh set of keys which worked fine. I may not be keen on all this key business but Edward & co. are pretty hot on keeping you a happy camper. More power to them for that.

Pretty soon I was luxuriating in a mellow soundscape and drifting away. I think it is rare that I actually fall sleep during these naps but at some point my brain reaches some place it needs to be and time gets suspended for a little while. I invariably come back more alive & alert than I went in and was grateful for that today.

Another nap and an early night and I hope tomorrow everything'll be shiny!

13/12/2006 16:14 by Matt Mower | Permalink | comments:
More about:

Does faith belong in this argument?

On Friday I wrote a short harangue about public funding of religious groups to which I got a couple of comments that I amount more or less to a defence of religious organisations providing public services.

This seemed to hinge upon the assumption that the funding they are receiving is for the delivery of public services. My recollection of the radio item (fuzzy as it is) revolves around the term "public funding." If it's for delivery of public services rather than simply "doing the Lords word/Allah's will/whatever" then I may be more sympathetic to their aims but my basic argument still stands.

As readers will know I am not a fan of a taxation based society. It seems to me that if faith based organisations offer the best way of delivering services people want then people should be free to give them the money to do so. Why then do I end up paying the governments man for this?

The problem I have with tax money being given to unelected, faith-based, "civil servants" is that it's money taken from me without my consent and given to people with whom I may share little or no common ground and used without recourse to my wishes. This seems to me to be fundamentally wrong.

Now the very fact that this is happening proves that giving the money to the government is no more fundamentally sound. The government does not care any more about my wishes than the Church of England, the United Hebrew Congregations of the Commonwealth, or the Muslim Council of Britain. Hence my, in principle, argument against taxation and how tax money is spent.

Everything seems geared towards a society in which the individual has less and less control and responsibility. The answer to me lies in repatriating control and responsibility with the individual and taxation and how taxes are spent seems to be at the heart of that.

Or am I crazy?

11/12/2006 11:49 by Matt Mower | Permalink | comments:

Chopping down milk wood

So Twitter was kind of fun to play with for a couple of days. However once the novelty wore and my friend list got bigger what was left was a neverending stream of housekeeping interruptions. I have enough trouble focusing on doing what's important without adding new distractions.

Reading Kathy Sierra's post about the Twitter Curve the other day brought that sharply into focus and made me resolve to leave the service [1].

I'm making fun of Twitter, but this isn't really a funny topic. Moore's law for the brain doesn't quite work. We're evolving much, much, much too slowly... Brain 2.0 isn't coming anytime soon. And we're all feeling the enormous weight of not being able to keep up. We can't keep up with work. We can't keep up with our social life. We can't keep up with the industry, our hobbies, our families. We can't keep up with current events. We'll never read a fraction of those books on our list. And we are hurting.

Worst of all, this onslaught is keeping us from doing the one thing that makes most of us the happiest... being in flow. Flow requires a depth of thinking and a focus of attention that all that context-switching prevents. Flow requires a challenging use of our knowledge and skills, and that's quite different from mindless tasks we can multitask (eating and watching tv, etc.) Flow means we need a certain amount of time to load our knowledge and skills into our brain RAM. And the more big or small interruptions we have, the less likely we are to ever get there.

One of the values of blogging (I now realise) is that the threshold for writing a post is generally just high enough that I need to feel I have something to say before I write it. At the end of many posts I say "nah" and close the browser window. Likewise I control the inbound flow of information through my reader's tools for organizing and skimming feeds.

By lowering the producer/consumer barrier to such a degree Twitter makes it possible for you to create something akin to a stream of consciousness only, from the consuming side, you are presented not with one stream of consciousness but (in my case) a dozen interwoven strands of thought. It's like Under milk wood on steroids only without Dylan Thomas' deft touch.

I'm glad I tried Twitter but I'm going to stick with blogging and RSS for now.

[1] I finally figured out how to do this. Their help claims there is a "delete me" link on the account settings but I couldn't find one anywhere. The other instructions were for SMS which I never setup. However I guessed that the same instructions would work for IM and, to my relief, they did.

11/12/2006 11:18 by Matt Mower | Permalink | comments:
More about:

Why am I supporting religious groups?

On the World at One just now I heard Tony Blair quoted as saying something along the lines of "in the future religious groups would have to prove that they promoted tolerance to receive public funding." Hmm... What I want to know is this:

Why on earth is any of my tax money going to fund religious organizations at all!?! If people want to contribute to faith based organisations that's their choice. Why am I, an atheist, forced to contribute to their coffers?

08/12/2006 13:07 by Matt Mower | Permalink | comments:
More about:

Cluelessness is a systemic vice

In a short, pithy, piece about anti-PR Stowe said something that resonated with me:

My natural tendancy -- I have a bad temper and I don't suffer fools gladly -- is to write these guys off. I now expect that they will be clueless in general, not just in this specific area, since in my experience cluelessness is a systemic vice.

08/12/2006 09:03 by Matt Mower | Permalink | comments:

An unexpected piece of joinery

Yesterday I found myself wanting to build a tree structure in a relational database and I needed to update the rows of the database with a parent_id column. The values for this column come from the same database table based upon a shared value. After thinking about it for a few minutes I came up with this (Names of tables and columns have been changed to protect the innocent):

UPDATE things SET parent_id = (SELECT id FROM things WHERE value = x) WHERE value = y

The nested SELECT was supposed to look up the ID of the parent row so that the UPDATE could assign it to the child row. This seemed to make sense to me but MySQL wasn't having any of it:

ERROR 1093 (HY000): You can't specify target table 'things' for update in FROM clause

This had me scratching my head for some time. I hit the MySQL documentation and, after some browsing, realised that you can do joins in UPDATE queries. Not something that I think would ever have occurred to me independently. The working solution looks something like this:

UPDATE things t1, things t2 SET t1.parent_id = t2.id WHERE t1.value = x AND t2.value = y

Quite a neat trick. Of course an hour after I figured this out I decided to completely change my approach to the underlying problem so it was a complete waste of time solving the problem. Oh well!

07/12/2006 14:56 by Matt Mower | Permalink | comments:
More about:

Wooden pixels trump interactive pillows

I like both the woodpixel and the interactive pillows.

05/12/2006 11:04 by Matt Mower | Permalink | comments:
More about: