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 green-chilli dahl

updated, 9.4.09 and 21.01.2020

This dish is near perfect. It's so simple, yet so good. It's surprisingly flavoursome, given that it's only lentils, garlic, onion, green chillis, tumeric and coconut milk. Somehow the flavours combine so well, and the fragrance of the green chillis adds so much.

It's also very quick and easy to prepare, compared to most Indian dishes or other dahls.

If you cut most of the seeds from the chillis (as I do) the dahl isn't chilli hot. The flavour of the dish doesn't suit being too chilli hot.

Thanks to Mangalam for the recipe.

  • Red lentils, 1 cup
  • Garlic, 5 cloves
  • Onion, a small amount (cut out a wedge ½ cm thick at its thickest edge)
  • Tumeric powder, ½ tsp
  • Green serrano chillis, 1 or 2
    • it's important to use green serrano chillis, not jalapenos or red chillis. So much of the flavour and fragrance of this dish comes from chillis, and jalapenos don't have the right type of flavour or fragrance, and red chillis don't impart much fragrance or flavour.
  • Coconut milk, about 100ml
    • for a richer flavour, you can add more, or use coconut cream instead
  • Salt
  • Black pepper

Green serrano chillis.
Use these for this dish, not jalapenos or red chillis.
(image source)


Add the lentils to a saucepan and wash them till the water runs clear.

Add enough water to cover the top of the lentils by about 1cm.

Put it on a high heat.

Finely chop the onion and garlic and add them to the pan.

Add the tumeric.

Once it's boiling, turn it down to a brisk simmer. Stir occasionally so it doesn’t stick to the bottom.

Slice the chillis in half and take the seeds out.

The lentils should take about 20-25 mins to cook. You want them to be fairly broken down, so the dahl is relatively smooth. It's no big deal if they're still a bit rough, however. Add more water if it gets too dry at any point. If it's still too liquidy after 20-25 minutes, cook it longer to evaporate more of the water.

Once the lentils look cooked, add the chillis and cook for 3-5 mins.

Add the coconut milk, stir and cook gently for another couple of minutes.

Add salt and pepper to taste.

Remove the chilli pieces.

It's now ready to eat.


Notes:
  • If you want to add some vegetables, cauliflower goes well with it. Add some chopped cauliflower a couple of minutes before the end. The base recipe is so perfect, though, that I prefer it without any additions.
  • The chillis only need to be chopped in half because their function is to infuse their flavour and fragrance into the dahl. We remove them at the end. Their texture wouldn't be very nice to eat and they wouldn't add anything to the end result. You don't want to chop them into smaller pieces and leave them in the dahl, either. Their skin is a bit tough, and wouldn't be very pleasant to eat (it's not -- I've tried it), against the smooth texture of the dahl.

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

WALL-E

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.