ideas in the shower

By , November 19, 2010 7:01 pm

Ever noticed how all your best ideas come in the shower? Well, this morning I had an idea in the shower … it was actually an idea about having ideas in the shower. I was thinking “I wonder how many good ideas I get here and then forget as soon as I walk out?”, and then the solution popped into my head – waterproof whiteboards!

After wasting a few more minutes under the showerhead concocting highly delusional visions of setting up ShowerBoards’R’Us® to patent, manufacture, and market this revolutionary concept, making zillions, and retiring earlier, I had breakfast, got to work, and promptly forgot about the idea … until later, when in an ironic twist which perhaps demonstrates its worthlessness, I remembered it again and did a bit more research.

So it turns out that it’s not a remotely original idea (hey I didn’t say that all ideas originating in the shower were good), and in fact it’s very well documented that the shower is conducive to fresh thinking. Mitch Ditkoff suggests 20 reasons why the best ideas come in the shower, although I have to say I can’t agree with #19 – “if you shower with a friend, and he/she happens to be in a brainstorming mode, lots of great ideas get sparked”. If I’m sharing a shower with someone, brainstorming is not going to be the top priority.

There are plenty more blogs on the same topic. Andy Hunt’s highly original book about the brain suggests that using involving multiple senses during problem solving activates more neural pathways, and quotes the example of one study which showed a 500% improvement for students using multi-sensory techniques. Clearly being in the shower activates different senses to sitting motionless staring at a monitor or book.

As a result, it’s not surprising to find that many people have already invented water-compatible solutions to this idea capturing problem. For instance, on the forum belonging to David Allen‘s Gettings Things Done (GTD) company, there is a whole thread which suggests ideas such as voice-activated dictaphones, scuba diving slates, waterproof notepads and zip-lock bags, even memory tricks such as mnemonics and visualization. One guy has even installed an entire office wall next to his shower, which is pretty hilarious. In fact there are so many waterproof notepads that I am going to have to buy one and spend a lot more time in the shower to have any chance of an early retirement…

Share

open letter to Avaaz

By , October 21, 2010 1:14 pm

Dear Avaaz,

I am a huge fan of Avaaz and regularly sign petitions. The beneficial changes the organization has achieved so far across the world are truly staggering and inspirational.

However the latest email I just received from you entitled “Hilton sex slaves” did not quite meet the high standards that I customarily expect, and in fact demand from an organisation whose now enormous membership base enables it to wield immense global political power.

The language used in the email sounds worryingly similar to the kind of article frequently found in the UK tabloid press, which deliberately uses sensationalist language (and frequent use of bold typeface) in order to manipulate the reader into agreeing with the writer’s viewpoint.
Continue reading 'open letter to Avaaz'»

Share

Maven fail

By , October 7, 2010 8:18 pm

In my recent work I have encountered Apache Maven, and I think the following snippet of real-world Maven code nicely sums up why Maven is not the idea replacement for the horror that is ant:

  <profiles>
    <profile>
      <id>unix</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>set-run-file-perms</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>chmod</executable>
                  <arguments>
                    <argument>0755</argument>
                    <argument>${project.build.directory}/foo.sh</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

Dear god. 34 lines and a plug-in, just to change the permissions on a file in a platform-specific way??

I should add that the above was written by an extremely smart guy who is a top-notch programmer; no, I don’t think the author is at fault here. Even if there’s a more concise/portable way of achieving the same result in Maven (and there might well be – I admit I’m still a Maven newbie), there’s still the undeniable fact that XML is horrendously verbose, and any code written in it is by nature unnecessarily difficult to maintain. To this end I applaud the ongoing efforts supporting the use of YAML to implement the Maven POM.

It’s worth seeing what the above would look like if we wrote it in rake:

require 'pathname'

desc "Make binary executable"
task :chmod do
  File.new(Pathname.new(build_dir) + "foo.sh").chmod(0755)
end

I don’t think I need to make a case for which is more legible or maintainable. Oh, and the Ruby version is cross-platform.

To continue an anti-XML rant which has been made countless times already: what the ant and Maven people don’t seem to realise is that XML is not a real programming language and is therefore not expressive enough to deal with many cases that a build system needs. The clue’s in the name, guys! “M” is for “markup” not “Turing-complete“. That’s why every time you need to do something vaguely unusual for which there isn’t an ant taskdef or Maven plugin, you have to write hundreds of lines more Java/XML just to cope with that case. That’s why Maven needs so many damn plugins.

The accidental silver lining to this is that because it takes so much effort to accomplish simple tasks, Maven developers find themselves compelled to reuse and share plugins, and to be fair, Maven has some good ideas on how to do this, even if the implementation isn’t always the best. For example, the built-in plug-in repository management and plug-in dependency management seem to work nicely, but unfortunately for some reason it has a propensity to download plug-ins on most runs, far more frequently than any sensible caching layer should.

DSL issues aside, I’m not convinced by the fixed lifecycle philosophy behind Maven either. I wonder if it was borne out of frustration with the lack of proper dependency checking in ant.

That said, I do like how Maven encourages standardization of the build lifecycle and phase namespace thereof, since newcomers to a project immediately know some familiar entry points. But the same could be said of 99% of projects which use Make and use standard rule target names such as install and clean. And I suspect that many developers suffer when they try to shoe-horn their own project’s build requirements into Maven’s standard lifecycle.

My concern with this phased approach is that it is too linear.  The expectation is that a build process is a one-dimensional sequence of steps, and you get to choose your starting point but not much else.  This seems fundamentally wrong to me.  A build dependency tree is well understood to be a DAG, and any build system which doesn’t model this properly seems to me to be burying its head in the sand.  On the other hand, if it does model it properly, which includes implementing proper dependency resolution, the required build lifecycle should emerge naturally without having to dictate that generate-sources comes before compile which comes before test and so on.

I’ve had some ideas of what the ideal build system looks like, and how to get there from the conventional Java world. More on that soon.

Share

announcing rypper (again)

By , May 20, 2010 10:54 pm

Back in August 2009, I announced the release of a simple script called rypper which I wrote to wrap around zypper and provide the ability to make batch operations on repositories. Here are some example usages:

# list all disabled repos
rypper -d

# list all enabled repos with autorefresh off
rypper -e -R

# list all repos which have anything to do with KDE
rypper -x kde

# list priority and URIs for all repos whose alias contains 'home:'
rypper -a home: l -pu

# enable autorefresh on all OpenSUSE Build Service repos
rypper -u download.opensuse.org -R mr -r

# remove all repos on external USB HDD mounted on /media/disk
rypper -u /media/disk rr

I only got one response so I assumed it wasn’t that useful to other people.

However here I am at BrainShare EMEA in Amsterdam surrounded by like-minded geeks, and in a fit of enthusiasm / procrastination, I have finally got round to learning how to build openSUSE Build Service packages, and so proudly (?) present my first OBS package release: the 1-click install version of rypper. Enjoy!

UPDATE 21 March 2011: based on feedback from SLE Product Management, I have submitted a formal request to have zypper extended to include this kind of functionality.

Share

don’t use Orange abroad

By , April 3, 2010 5:10 pm

Ouch.  Arrived back home to a nice letter from Orange:

Great news. Every year we invite an exclusive group of customers to join our Premier Service for 12 months – and this year you’re one of them.

It went on to offer me a dedicated customer services and a USB dongle providing 3 months’ free mobile broadband, then 2p per MB after that.  Amazingly generous, no?  Then I realised why they’re being so nice to me:

Share

Panorama Theme by Themocracy