“Layer, highlight, repeat”

Communicating your work in a presentation is an essential skill in most professional fields. However, slide-show tools like Powerpoint are often seen as “necessary evils”, because they are frequently used badly.

Kieren Healy, a sociologist and data visualization expert, has a nice primer on how to make effective slides. One strategy in particular, “layer, highlight, repeat”, is something that I have found to be effective, but I’d simply never had a name for it. In his words:

One straightforward but effective technique is to build up your argument, your data, or your findings, by layering, content, highlighting new elements, and repeating methods of presentation or design elements so that your audience can follow the logic of what you’re saying.

Just as we guide our audience through our thought process by verbal explanation, we want to reinforce this with an appropriate visual metaphor. The “layer, highlight, repeat” strategy works more often than not because it maintains the thread between slides, helping the audience along.

Advertisements

What we need is a 9-cent coin

Lately I’ve been thinking about coins. They may be going out of style around the world, but where I am at least they are still a fact of daily life. After fumbling around with coins at the cashier trying to find the right change, I’ve often wondered whether we can improve a currency by changing the denomination of the coins.

For example, we encounter prices ending in .99 more often than, say, .37. Wouldn’t it make sense to have a 99-cent coin? How would one even go about trying to answer this question?

It took a long train ride with no Internet connection for me to sit down and start hacking out an answer. Other people have tackled it before (pdf), but there were some aspects that I felt were still left unexplored.

I’ve put my thoughts and explorations online at this website. In the process, I’ve come to a few conclusions:

  • The coins of the US dollar are not really rationally designed, but they are not bad when it comes to making change, in the trade off between the number of different types of coins, and the average number of coins needed to make change.
  • The optimal denomination that uses three coins is 1, 9, 30. This is when the real-life distribution of prices is taken into account.

I hope that you enjoy reading my analysis as much as I have had in working out the problem.

Changer-ranger – Fun with the optimal change problem

The most time-wasting command-line problem to diagnose …

If I had to vote for the computer problem that consumes the most time in diagnosis vs. the ease of actually fixing it, I would definitely choose the line termination issue.

It’s the simplest thing to understand, in principle. Different operating systems have different conventions in how they format their files, in particular plain text files. If you open up a plain text file in a editor application like Notepad on Windows, you’ll see the content as simple text characters without any formatting. There are also “invisible” characters, such as tab and “newline”, which affect the formatting of the text but aren’t really text themselves.

Windows uses two invisible characters, called CR (Carriage Return) and LF (Line Feed) to represent each new line. This dates back to the days when computers didn’t have monitors, but instead literally printed their output onto spools of paper. CR+LF were instructions to the printer to bring the printer head back to the origin, and feed the paper forward, in order to begin printing a new line of text.

Unix/Linux and Mac OS X have a different convention. They only use one character, LF, to represent new lines. (Even more confusingly, the classic Mac OS uses only CR). Therefore, when you have a text file from a Windows system on your Linux system, you’ll first have to convert the line endings first, or weird things will happen, and at first you might have no idea what is going on because newline characters are invisible, so the file will look completely normal when you open it in a text editor. Instead you’ll blame yourself, like the 99% of the time when things don’t work, because that’s usually some other fault in your code, like a typo in your elaborate regular expression.

Fortunately it’s happened to me frequently enough before that when things don’t work as they should on the command line, one of the first things I do is to check the file type. In Linux this is easily done with:

file FILENAME.txt

You should expect to get something like:

FILENAME.txt: ASCII text

But if you see this:

FILENAME.txt: ASCII text, with CRLF line terminators

Then it’s probably coming from a Windows system and needs to be converted before you work with it on Linux/Unix/Mac OS X.

It’s easy to fix if you have the dos2unix utility that’s bundled on many Linux systems.

dos2unix FILENAME.txt # Silently overwrite original
dos2unix -n FILENAME.txt NEWFILE.txt # Write to new file, keep original

The reverse can be done with unix2dos.

If you don’t have dos2unix, you can use sed. The escape character \r represents CR, so the following simply means “remove the CR character from each line”.

sed -i 's/\r//' FILENAME.txt # Overwrite original
sed 's/\r//' FILENAME.txt > NEWFILE.txt # Write to new file, keep original

Further reading here and on the manual page of dos2unix.

DIY Soy Milk

To use up some soy beans that had been lying around the house for too long, I decided to try making some soy milk. The recipe is really easy – the only special equipment you’ll need is a blender. It’s a fun project for a weekend afternoon, and by making your own you can control for example how much sugar goes into the drink.

2018-04-01 18.31.52

Continue reading

Seeking fresh vegetables

If you live in Germany, you’ll certainly have seen posters for Parship.de, a dating website based in Hamburg. Their posters all bear the tagline “Alle 11 Minuten verliebt sich ein Single über Parship” (A single falls in love every 11 minutes through Parship), and usually feature an attractive person (mostly women) on each poster (examples).

In recent months they seem to have gone all-out with the advertising campaign, and almost every bus or tram stop seems to have at least one ad. The repetitiveness of it has inspired some ideas for how they could branch out into other lucrative markets….

(Disclaimer: I am not associated with nor derive any profit from either parship.de or parsnip.de. This is purely for my personal amusement.)