Archive for December, 2007

Koldskål 2:4:6

Posted in Food, Friends on December 22nd, 2007 by Steffen – 2 Comments

We use Palle’s mom’s recipe as it is so easy to recall. So easy that it’s sometimes hard to remember and begs to be mod’ed. Erm.

Koldskål

It’s: 1L yogurt, 1L buttermilk. That makes 2L of cow stuff. Then the double of chicken stuff, ie. 4 egg yolks. Preferable without salmonella. Then 6 spoonfuls of sugar. And finally at least 1 spoonful of vanilla. You could go with less, like 1 tea-spoonful, vanilla if you’d approach the real mom recipe. The easiness is in the relation 2:4:6, if you notice. Now stir. Then eat with so called kammerjunker (can be seen in the above picture) — preferable on a sunny day.

Scale — “digits, yes please”

Posted in Programming on December 15th, 2007 by Steffen – 6 Comments

Just now and again one need a one-liner [0]. Just now and again it’s executed in bash [1]. Just now and again it involves some calculation. And just now and again it easy to do those things with bc [2] as it can read from standard input [3]. But at exactly those “now and again” times I normally find that bc truncates and returns only the integer part. Which at a subset of those “now and again” times are just not good enough. F.x.: one might be fuzzy about the resolution when counting how many keystrokes there are to go in order to have produced the scheduled amount of text for the day.

But fortunately I today got wiser; I met the scale variable in bc. It properly still truncates but now I can set a resolution that at least satisfy my fuzziness issue, which means I can now M-! my way to the following one-liner to get what i want.

C=`wc -c main.tex | cut -c 4-8`; P=`echo "scale=4; ${C}/2400" | bc`; echo ${C}c, ${P}p

Bliss. Back to work.

[0] http://en.wikipedia.org/wiki/One-liner_program
[1] http://www.gnu.org/software/bash/
[2] http://www.gnu.org/software/bc/
[3] http://en.wikipedia.org/wiki/Standard_input#Standard_input_.28stdin.29