The random musings of a software developer

Of Dyson and Design

I’ve been thinking recently about the reasons why I’m so drawn to the Dyson family of household products. I believe it’s the elegance of superb industrial design applied to ordinary things about the house. We have a Dyson DC-17 Animal upright vacuum cleaner and here’s what I like about it:

  • when you turn it on, it starts in a known state – the vacuum begins ingesting dirt and the brush roller will come on when you lower the handle. This has been referred by many interface designers as the Law of Least Surprise. Some of the vacuums I have used power up in the state which you last left. Goodness knows what that might have been, given that it might have been a week or more ago!

  • it automatically adjusts for carpet height. The degree which you move the handle down sets the brush roller height to match the carpet height being vacuumed. My old Eureka had a dial to set the height – is this carpet a setting of 3 or 5? Who can tell?

  • it has a transparent dirt collection container. This to me serves two purposes: you can see the dirt being actually sucked in (yes, it’s working!) but more importantly, see when it’s full. My Eureka has a bag, tucked away on the inside, under a lid. Full, empty, or almost full – I have no idea.

  • The on/off controls for the vacuum and brush roller are easily reachable, clearly marked, and designed well. Yes, you can even turn off the brush roller for hardwood floors. My Eureka has a flap switch you step on the left to turn it on and off, and a round button on the right to unlock the handle. Both are not marked, you just have to know. It also doesn’t have a switch to turn off the brush roller.

  • Small things matter. The HEPA filter in the Dyson needs to be washed every 6 months. This filter is marked with the digit 6 with an underline beneath it to indicate not only the number of months but also to differentiate 6 from 9. There’s a tap icon to indicate what needs to be done, no words in multiple languages, just 6, an underline, and a tap. Details, I know, but it counts.

  • The new Dyson vacuums have a ball which contains the vacuum motor, it lets you manouevre the cleaner deftly. But did you know that Dyson invented the ballbarrow? Design reuse there!

  • Dyson has recently introduced a fan without exposed blades, the Dyson Air Multiplier which was an innovative reapplication of the vacuum cleaner motor. This fan was reinvented as the Dyson Hot which incorporates a heating element and became an electric heater which circulated warm air. There is a video and article from the Telegraph discussing the engineering in its design. There’s also the Dyson Air Blade – a neat way to dry hands in restrooms.

You can see where these design ideas can help us build more engaging and useful applications.

To wit:

  • Always uphold the Law of Least Surprise. Design for the most expected user experience. Take for example the iPhone camera activation button on the lock screen. If you didn’t know how to use it, you might tap the camera button and immediately see it bounce up and reveal a sliver of the camera app, a cue to perhaps think about sliding the button up to reveal the entire camera app.

  • Make things as intuitive and easy in the application interface. Hide complex computations and lookups so as to present results succinctly. Take guesswork out from the functionality exposed by the interface.

  • Show that the application is working – put up a spinning cog or progress bar. If the application uses storage – maybe a bar indicating storage space used would be beneficial, especially when the colour of the bar changes to say, red, when nearly full.

  • Make controls obvious in their use and stick with design guides and commonly expected behaviour (law of least surprise, again).

  • Details matter – it’s what separates the truly elegant applications from the run of the mill ones.

  • “Whevever possible, steal code” – Jon Bentley, Programming Pearls. Jon wasn’t referring to the misappropriation of software, but of the reuse of code. I’d also add “Whenever possible, contribute code” as a corollary.

  • Innovate. Come up with clever ways of doing things, and using things ingeniously to make other things

Fix for Dash PopClip Extension

My favourite extension PopClip has an extension for my favourite developer reference application Dash. However, with the 1.7.7 update of Dash there has been a subtle change in the name of the OS X Service which allows search in Dash. This used to be “Look up in Dash” and is now “Look Up in Dash” – notice the slight change in case. Unfortunately OS X Services are case sensitive and as a result the PopClip extension does not work.

I’ve tweeted the developer of Dash @kapeli and they’ll be issuing a fix to the extension. In the meantime, to fix it yourself:

  1. Quit PopClip

  2. Go to ~/Library/Application Support/PopClip/Extensions

  3. Control- or Right-click on Dash.popclipext and select Show Package Contents

  4. Open Config.plist in TextWrangler or some other text plist editor and change:

    <key>Service Name</key>
    <string>Look up in Dash</string>
    

    to:

    <key>Service Name</key>
    <string>Look Up in Dash</string>
    

    with a uppercase U in “Up” and then save the file.

    If you’re using Xcode, change the key “Service Name” to “Look Up in Dash” with the same uppercase U.

  5. Restart PopClip

WordPress client for iOS – Poster

Just checking out Poster. It uses Markdown to annotate the post. My plan is to use it as the primary posting app for Free Range Coder when I’m on the go. Will be giving it a shakedown at Macworld | iWorld this coming week. Most importantly, it supports TextExpander touch! And it’s a universal app too. What more could you ask for?

No comments

Markdown on Save Improved – improved!

A new version of the Markdown on Save Improved WordPress plugin has been released. This fixes the Remote client post problems. Hurrah! MarsEdit works again for Markdown posting!

Victoria Sandwich Cake

A traditional recipe in the British baking repertoire.

Makes 6-8 slices

Ingredients

1 cup (250g) butter, softened
1 cup (250g) granulated sugar
4 eggs
1 ½ cups (250g) self-rising flour
1-2 tbsp milk
4 tbsp seedless raspberry jam
granulated sugar to decorate

Oven temperature: 350°F / 180°C
Baking time: 25 mins
Cake pans: two 8in (26cm) round pans, greased and lined

Storage: Keeps for 2-3 days
Freezing: Freezes for 3 months undecorated

Method

  1. In a large bowl, beat the butter and granulated sugar together until pale and fluffy. Beat in the eggs, one at a time, adding a little of the flour if the mixture begins to separate.

  2. Sift the remaining flour over the surface of the mixture and fold it in, followed by a little milk to give the mixture a soft dropping consistency.

  3. Divide the mixture in half and spread it evenly into the prepared pans. Bake in the preheated oven for 25 minutes, or until pale golden and soft and springy to the touch.

  4. Remove from the oven and invert onto a wire rack. Let cool. Carefully remove the lining paper and spread the bottom of one cake with the raspberry jam. Cover with the second cake layer, transfer to a plate, and sprinkle the top with granulated sugar to decorate.

Kirschen’s Notes

Any kind of jam can be used – I particularly like strawberry.

If you have non-stick pans, just grease them with the remnants on the butter wrappers, don’t need to be lined.

Instead of using granulated sugar, I use powdered / icing / confectioners’ sugar and sift that over the top using a sieve.

Source: Ultimate Cake by Barbara Maher, published by DK Living

New England Maple Bread

Ingredients

2 cups all purpose flour
4 teaspoons baking powder
½ teaspoon salt
⅓ cup butter or margarine, melted
¾ cup milk
¾ cup maple syrup
1 large egg
1 cup golden raisins, scalded and dried
1 cup chopped pecans

Method

Preheat oven to 350 degrees F. Brush a 9x5x3″ loaf pan with melted butter or coat with vegetable spray.

In a mixing bowl combine the flour, baking powder, and salt, and blend well. Set aside.

In a separate bowl stir together the butter, milk, maple syrup, and egg. Beat well and with a rubber spatula add to the dry ingredients, stirring quickly until well moistened. Fold in the raisins and nuts.

Pour the batter into the prepared pan, spreading evenly. Bake one hour and test for doneness. Remove bread from oven and cool in the pan on a wire rack 15 minutes. Turn the bread out on the rack to finish cooling.

A delightfully simple bread with a charming, light flavour of maple syrup

Recipe from Quick Breads, Soups and Stews by Mary Gubser, Council Oak Books, 1991

To scald raisins – put the raisins in a colander and pour hot water over the raisins. Drain and place on paper towels on a plate and pat dry.

To test for bread doneness, insert a skewer (bamboo or metal) into the bread and remove. If it comes out cleanly with no trace of batter, the bread is done.

Enjoy!

Image Title updated

I’ve put in an update to Image Title in my software page. It now shows both the Title and Alt text if they’re defined. Moved the source to my GitHub repository. Share and enjoy!

When Software Update doesn’t work…

Sometimes OS X Software Update might think it has downloaded and installed the update, especially for pre-Mac App Store applications such as the iLife programs. The way to resolve this is to go to Apple Support Downloads and download the individual update. You can also get the OS X Combo Updaters this way.

Where’s Subversion gone in Mountain Lion?

I tried to use the command line Subversion application svn in my recently updated installation of OS X 10.8 Mountain Lion. Couldn’t find the command at all. Hmm… used to be pre-installed in Lion and previous versions. Looked around the interwebs and found this reference: Where is SVN on OS X Mountain Lion?. You have to install Xcode from the App Store and then download the command line utilities. svn will get installed in /usr/bin and thus appears in the default PATH.

Unit Testing in Xcode 4

One of the nice things in Xcode 4 is the integration of the OCUnit, or SenTestKit, Unit Test suite into the environment. My last foray into unit testing was with JUnit in Eclipse. I’m currently working on an Objective-C library using JSON for data transmission and needed to test its methods.

Here’s a good guide on setting up a project to use OCUnit and OCMock for mock objects – Unit Testing in Xcode 4 Quick Start Guide | Ray Wenderlich. The article also mentions GHUnit which has some additional features over OCUnit – will have to look at that too!

So I’ve written my test cases and run them. I then see several test failures which seemed out of the ordinary. Now, the test cases are written in the order I expect them to run in the file, and I noticed that they were being run in an order other than the sequence in the file, which is what I was used to in JUnit. The Unit Test documentation on the Apple developer site Xcode Unit Testing Guide doesn’t mention anything about the order of test case execution, and I could not find anything relevant on the ‘net.

After scrutinising the test case run order, I came to the conclusion that it was in alphabetical order! And now I’ve taken to numbering the test cases thusly – test_0010_xxx and so forth – shades of BASIC line numbers!

And there’s more – unit tests are by their intent, tests for a unit. Each is a single entity which performs a set of operations as an independent standalone code segment. I had instead written test methods which were dependent on the previous method’s results – not a real unit test at all, and therefore a new lesson learnt! In fact, Apple documentation states: “When Xcode runs unit tests, it invokes each test case method independently.” Might not need those line numbers after all…

So chalk this one up to experience, and blog it for all to find out!

Powered by WordPress