Thursday, October 30, 2008

"Fan menus" for user-interfaces

I just had a look on this page on pie-menus as an alternative to the usual 'vertical list' menus in most user-interfaces. I also had a quick skim of the comments, where there was some discussion about the pros and cons of both types of menus. E.g. while pie menus can be faster, the radial layout makes it harder to scan the available options.

And it made me wonder if there was a middle ground between the two. I have no idea whether this idea has been suggested before, but here goes... you might call these "Fan menus" (I'm thinking here of the asian foldable paper fans).

In this first picture, the user has clicked the mouse and the fan menu appears. Note that the main body of the menu itself appears to the side of where the mouse is clicked.

In this second image, the user has moved the mouse into the fanned out element for the third menu item. The selection process is similar to in a pie menu.

In this picture, the user has moved the mouse down to select the fourth item.

Naturally, there's potential issues with such a design, but I thought it'd be interesting to think about.

Unseen practice is easily mistaken for brilliance

as the title says

Unseen practice is easily mistaken for brilliance

This applies to sport, intellectual endeavours, etc

Monday, October 27, 2008

How to get rid of Vim's temp files

The default behavior in Vim when you save a file is to also put temporary files in the save directory. I'll explain how you can stop it from doing this. (I don't know Vim that well, but the following works).

What happens is that if you save a file called 'weeklyReport.txt' it also stores a temporary file with the same name appended with a tilde 'weeklyReport.txt~'. It also stores a swapfile there.

I found this really annoying, as it makes it awkward to scan the list of files in the directory (and the files were getting into my version control system - and yes, I'm sure I could find a way to avoid them getting in there, but I think the better solution is to not have them in the directory in the first place).

Here's a solution I found (I'm using it on Windows, but the only difference on other systems should be the file system syntax for specifying directories).

Open or create your settings file.

Here's some deails if you're not familiar with doing this.

When you install Vim, you've effectively installed two programs: Vim (the terminal version), and gVim (the GUI version), and each has its own settings file. For Vim, it's <VimDirectory>/_vimrc. For gVim it's <VimDirectory>/_gvimrc.

A note on what I mean by <VimDirectory>: the actual exectuable files are stored in a directory containing the vim version number - on my computer it is C:\Program Files\Vim\vim72. This is not the <VimDirectory> I'm referring to - the one I'm referring to is the parent directory of that, in my case C:\Program Files\Vim
Add the following lines to it (it shouldn't matter where):
" turn on backup
set backup

" Set where to store backups
set backupdir=c:\temp

" Set where to store swap files
set dir=c:\temp
This will store the tilde and swap files in c:\temp - you can change the directory location to wherever you want.

I found this soultion here, via this, and that via a google search.

Saturday, October 25, 2008

Apple's design lesson

It used to seem that plain, unadorned design

had to mean dull looks and boxy shapes.

But Apple have shown us that plain, unadorned design

can mean sleek and sexy.

I'm sure Apple aren't the first or only people to do this, but has anyone else made the point so strongly?

Tuesday, October 21, 2008

Moving the cursor around in the vi text editor

Moving the cursor around in the vi text editor

Note: so far, this is an incomplete list, and I'm experimenting with the way of presenting the keystrokes - the keys to press are specified in superscript text. Hopefully it's not too hard to work out.

There’s the usual options

  • lefth or rightl, upk or downj
  • start/end of: 0line$, {paragraph} or [[document]]
But also more powerful control
  • start/end of: bprevious-wordge or wnext-worde
    where a ‘word’ is anything delimited by non alphanumeric chars.
    There’s a parallel set of commands for which a ‘words’ delimited
    by whitespace:
    • start/end of Bprevious-wordE or Wnext-wordE
  • first non-whitespace char^ on line
  • end of the nth line downn$ from the current one
  • nextf<char> or previousF<char> occurrence of char on the line
    • or the character before the nextt<char> or previousT<char> occurrence
    • the nth next occurrence of char on the linenf<char>

Colin Powell's endorsement of Obama (video)

Sunday, October 12, 2008

Coconut milk, garlic and chilli dahl

updated, 9.4.09

Garlic, green chillis and coconut milk against the subtle background of the lentils. The overal flavour is more subtle than bold, but it's still quite flavoursome.

The chilli is there more as a flavouring than for the heat. You often don’t notice the flavour of chillis in a dish, but it really comes out in this one, and goes well with the garlic and coconut milk.

This dish is also quick and easy to prepare -- no need to fry garlic and onion or any spices, basically just throw the ingredients together with some water and simmer it. It takes about ½ an hour in total, but that's mostly it simmering.

Thanks goes to Mangalam for the recipe.

  • Red lentils, 1 cup
  • Garlic, 5 cloves, finely chopped
  • Onion, a small amount – like a wedge ½ a cm thick at thickest edge, finely chopped
  • Tumeric, ½ tsp
  • Green chillis, 1 or 2
  • Coconut milk, about 100ml.
    • for a richer flavour you can add more, or use coconut cream instead
  • Salt
  • Black pepper
Notes: if you want to add some vegetables, cauliflower goes well with it - add some chopped cauliflower a couple of minutes before the end. Make sure you use green chillis rather than red chillis. The recipe needs the stronger flavour of the green chillis. The red ones don't have much flavour. Also, you don't want to chop the chilli up into smaller pieces because the skin on chillis is a bit tough, and against the smooth texture of the dahl it isn't very pleasant.
  • Start off the lentils
    • Wash the lentils
    • Put in a saucepan and add enough water to cover top of lentils by about 1cm.
      • The idea is to have enough to cook the lentils, but if you’ve put in too little you can always add more later, and if you’ve put in too much you can just cook it longer to evaporate them.
    • Put it on a high heat
  • Onion, garlic, tumeric
    • Meanwhile, chop the onion and garlic and add it to the pan.
    • Also add the tumeric.
  • Bring to a boil then turn the heat down to a brisk simmer
    • Stir occasionally so it doesn’t stick to the bottom.
  • Chillis.
    • Slice them in half and take the seeds out.
    • Once the lentils looks cooked – about 20 – 25 mins (the lentils should have broken down so you have a fairly smooth mixture), add the chillis and then cook for 3-5 mins.
  • Then add the coconut milk, stir and cook gently for another couple of minutes.
  • Add salt and pepper to taste, then it’s ready to serve. Take out the pieces of chilli if you want.

Friday, October 10, 2008

SvN: 'Do it yourself first'

Do it yourself first

You should never hire anyone for something you haven’t first struggled to do on your own. It’ll teach you most of what you need to know to actually interview candidates, it’ll allow you to understand the nature of the work better (do I even need to hire or can we outsource?), and you’ll know exactly what a job well done will look like. It’ll also give you a sense of whether the job is big enough for a full-time hire yet or if you can skimp by on your own (the latter is preferable if possible).
Sounds quite sensible. He also talks about the benefits for managing the roles and being able to empathise when the going gets tough.

Monday, October 06, 2008

Sweet Potato and Bean Enchiladas

Sweet Potato and Bean Enchiladas

In this vegetarian dish you get a nice melding of the flavours of the sweet potato and the beans.

Based on this recipe.

Makes 12 enchiladas

  • orange sweet potato, enough to fill 4 cups when mashed.
  • vegetable oil, 1 tablespoon
  • onion, 1, chopped
  • garlic, 4 cloves, minced
  • canned kidney beans, 6 cups, drained
    • Or some other beans like black beans or pinto beans. You could also use refried beans, or a mixture of kidney beans and refried beans. Just remember that a can of refried beans contains a greater volume of beans than a can of whole beans would -- so, for example, if you used 4 cans of kidney beans, you might use 3 cans of refried beans.
  • water, 2 cups
  • chilli powder, 3 tablespoons
  • ground cumin, 3 teaspoons
  • mustard, 4 teaspoons
  • soy sauce, 3 tablespoons
  • flour tortillas, 12 (10 inch), warmed
  • cheddar cheese, 225g, grated (you don't really need to measure this - just grate as much cheese as you like over the enchiladas)
  • Preheat oven to 175 degrees C
  • Prepare the filling
    • Bring some water to the boil, boil cubes of the sweet potato, drain out the water, then mash it.
    • Heat oil in a medium frying pan, and saute onion and garlic until soft.
    • Stir in the chilli powder and cumin, and continue stirring for a bit (probably a bit less than a minute would be enough).
    • Stir in the mustard and soy sauce.
    • Stir in beans, and mash.
    • Add in the mashed sweet potatoes.
    • Gradually stir in water, and heat until warm.
  • Make up the enchiladas
    • Divide the mixture evenly between the warm flour tortillas.
    • Top with cheese.
    • Roll up the tortillas (you want to make something a similar size to cannelloni -- I think the flavour/texture suits making them this size rather than something too much bigger in diameter) and place on a baking sheet.
  • Bake for 12 minutes in the preheated oven, and serve.
Can serve with sour cream, chopped spring onions and salsa. One of the comments on the original recipe suggests serving with fresh mango slices and avocado slizes sprinkled w/ lime & salt.

Thursday, October 02, 2008


Wow. It’s a pretty impressive film, especially when you consider how unpromising the setup sounds.

The two main characters are robots. WALL-E is a waste compaction robot whose body is essentially just a cube. He has two arms but catipillar treads for legs. He has two lenses for eyes but no other facial features. Eve is a egg shaped scout robot who flies around the place and whose body is pretty much featureless except for two arms and a pair of glowing eyes.

There's hardly any dialogue; pretty much the only things WALL-E and Eve ever say is their own name or the other’s name. They do express a lot of body language, though.

Most of the action takes place on a desolated future earth, covered with garbage (WALL-E’s job is cleaning it up) and devoid of life. There are some humans, later on in the picture, but they’re secondary characters – and have little traditional appeal (they’re lazy and obese, not good looking).

But with all this Pixar have put together a wonderful movie – a love story between the two robots – that is both very funny and quite touching.