Units

I recently re-installed the units utility to do some temperature conversion. I could do this by hand but 9/5 + 32 is just complicated enough I prefer to ask a computer to do it for me. The biggest problem I have with asking a search engine about this is knowing how to spell 'fahrenheit' and 'celsius'. I'd be ok if we just moved to kelvin - it's much easier to spell.

Units is an old school GNU utility. I've been using it forever, but I've never explored the depths of its conversion database.

To use it, type units and you'll be dropped into a prompt where you can type what you have and what you want. Here's an animated example:

I encourage you to explore the units database. It can do crazy things

The area of sheets of paper:

You have: 3 lettersize
You want: ft^2
        * 1.9479167
        / 0.51336898

Just hitting 'Enter' at the 'you want' prompt will show you the definition.

You have: eggyolk
You want:
        Definition: 18.6 grams = 0.0186 kg

The weight of scooped flour (not to be confused with sifted or bread flour)

You have: 2 cups flour_scooped
You want: grams
        * 283.49523
        / 0.0035273962

In a recent discussion on lobste.rs, someone mentioned the frink database. Frink is a programming language designed to do these same sort of calculations. It's closed source, but there's an open source clone called rink. The rink page has an example of computing the surface gravity of the moon if it was made of solid gold.

> volume of moon * (19.283 g/cm^3) * G / (radius of moon)^2
approx. 9.365338 meter / second^2 (acceleration)
> ans to gravity
approx. 0.9549987 gravity (acceleration)

The frink database is a similar text file, but it has much more colorful comments. I encourage you to check out the editorializing around Candela and Hertz.

Incidentally both units and frink/rink have a workaround for the difficulty of spelling temperature units.

You have: tempF(250)
You want: tempC
        121.11111

Rink uses 'degC()' and 'degF()'