expatiari expatria

Meter per degree longitude

Spurred by a mnemonic game while hiking in both fog and mountains, I am now trying to memorize GPS coordinates. But just how many of those little digits must I keep in my head? How big is a degree of longitude anyway?

Naively, we can divide the 40 megameter earth circumference by 360° and divide again by 60′ minutes and maybe 60″ again for seconds. And for latitude, that’s pretty damn close, about 15 cm short of a nautical mile. But like most spinning objects, the Earth is a little fat around the middle and not wrinkle-free, which throws a wrench in our trigonometry.

One latitudinal minute is 1842m on the equator, 1862 meters at the poles, with an average of 1852m defining a nautical mile, or roughly 111 km per degree. However, longitudinal lengths vary greatly as a trigonometric function of degrees from the equator, simplified as:

degree longitude = 111km * cos(latitude)

Using a bit more sophisticated equations, I’ve plotted a few longitudinal lengths (error < 1%):

latitude longitude (meters)
degree minute
111319 1855
15° 107550 1793
30° 96486 1608 (wiki: 1605.6m)
45° 78847 1314
60° 55800 930 (wiki: 925.2m)
65° 47176 786
70° 38187 636
75° 28902 482
80° 19393 323
85° 9735 162
90° 0 0

So, in Nuuk (64° North), a degree latitude is more than twice the length of one degree longitude (about 1858m vs. 815m per minute) and almost ten to one at 86°.

Putting a box around Nuuk, the downtown southwest corner is N 64°09.7 W 51°45.2 and the northeast corner (north of the airport and west of Qinngorput 2010) is roughly N 64°12 W 51°40. One significant decimal seems appropriate downtown for an order of 100m precision, while 1km precision should be good enough for finding an airport – on foot at least. Three significant decimals is more precise than GPS provides as of 2010.

Nuuk vejr

METAR, etc
2 day forcast3-9 day forcast

Xmonad on Lucid Lynx

While Gnome on Lucid Lynx is pretty and Gnome has a bunch of features that make window management a bit nicer than before (like Win-w,e,s,n,m) I immediately longed for a decent tiling manager. So, within ten minutes and without further regret:

Get the latest xmonad packages

Unlike Karmic, Lucid repositories have the latest version of Xmonad (0.9).

$ sudo apt-get update
$ sudo apt-get install xmonad dwm-tools feh

Switch window manger

If you’ve installed vanilla Ubuntu 10.04, you’ll want to switch from gnome-wm to xmonad.

$ gconftool-2 -g /desktop/gnome/session/required_components/windowmanager
$ gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string

Start xmonad from script

We’re changing one line of xmonad.desktop. Rather than start xmonad directly, we want to run the xmonad.start script.

$ sed s:^Exec=xmonad$:Exec=xmonad.start: /usr/share/xsessions/xmonad.desktop > ~/tmp.xmonad
$ sudo mv ~/tmp.xmonad /usr/share/xsessions/xmonad.desktop

$ sudo wget http://genaud.net/alex/2010/04/xmonad_files/xmonad.start -O /usr/local/bin/xmonad.start
$ sudo chmod +x /usr/local/bin/xmonad.start

Configure your own xmonad session

Note, you’ll need to type colon-quit (:quit) to exit the haskell compiler (ghci). Hopefully all modules load OK.

$ mkdir ~/.xmonad
$ wget http://genaud.net/alex/2010/05/xmonad.hs -O ~/.xmonad/xmonad.hs
$ ghci ~/.xmonad/xmonad.hs

Configure xmobar

Xmobar is activated from Win-p. Just start typing the first few characters of the command you want and hit enter.

$ wget http://genaud.net/alex/2010/04/xmonad_files/.xmobarrc -O ~/.xmobarrc

Finishing touches

Remove all the panel clutter and add pretty background image.

  • Delete the bottom panel ( Right click > Delete This Panel )
  • Autohide top panel ( Right click > Properties > Autohide )
  • Set a desktop image by uncommenting and modifying the “feh --bg-scale” line of /usr/local/bin/xmonad.start

Log in to xmonad session

The moment of truth… (oh wait, if you’ve never used xmonad before, take a look at the next section before it’s too late).

  • Log out
  • Click on your user
  • Select Sessions:xmonad (from the bottom, was GNOME)
  • Type password and Log In

Five important commands

There are more than a dozen commands. But that’s it. The steep learning curve immediately plateaus. Print a cheat sheet and you’ll be a tiling window master in no time. Here are perhaps the most important commands:

  • Win-Shift-Return – to open a terminal window
  • Win-Space – toggle between three columns, two columns, two rows, and full screen
  • Win-Return – make selected window the master window
  • Win-h – shrink master window
  • Win-l – expand master window

Some more commands

  • Win-Shift-c – close selected window
  • Win-1 (or 2,3,4,5,6,7,8,9) – switch workspace
  • Win-Shift-1 (or 2,3,4,5,6,7,8,9) – switch selected window to another workspace
  • Win-j (or Win-Tab) – select next window
  • Win-k (or Win-Shift-Tab) – select previous window
  • Win-Shift-j – switch selected window with next window
  • Win-Shift-k – switch selected window with previous window
  • Win-, – add another window to master area
  • Win-. – remove a window to master area
  • Win-p – start typing a program name, say “nau” for “nautilus”
  • Win-q – restart xmonad (useful after modifying xmonad.hs config)
  • Win-Shift-q – quit xmonad (quick way to log out)

If you Win-(left-mouse drag) you’ll pop (un-tile) a floating window. You can Win-(right-mouse drag) to change the size and Win-t to set the window back into the tile layout. Some people like this and claim it makes working with Gimp or other dialog boxes easier. At least one person disagrees.

In the animated sequence below, we have three windows. The spreadsheet (white) is the master along with two terminals. The animation demonstrates toggling between two full screen windows, then cycling through four layouts from full screen, three column, two column, two rows, and back to full screen. From the keyboard that would be: Win-j, Win-k, Win-Space, Win-Space, Win-Space, Win-Space, ad nauseum.

toggling between four different layouts

Tea Science

tea + water + temperature + time

Steeping the perfect cup of tea is a science. Most important of course are the tea leaves (or tips and/or stems), then the water, then temperature, then time. However, whether due to laziness or to ignorance, emphasis is too often precisely backwards.

For example, let’s take a typical but hypothetical New Jersey suburbanite. She uses the lowest quality tea dust, the stuff that fell through every conceivable crack in the cultivation, transportation, separation, and oxidization process (aka tea bags). She then dunks this powdered substance into a cold cup of cold tap water. Finally, she microwaves the tea cup from cold to boiling in precisely 2 minutes and 22 seconds. Why this particular time? Perhaps because 222 is convenient and produces a slightly better cup of tea that 111 or 333. I don’t know.

Time and temperature

Bitter tea is a product of steeping too long and too hot. Steeping too short or too cool will not extract much flavour. Of time and temperature, temperature is most important. Buy a thermometer and always preheat your teapot.

Do not trust recommended temperatures. Well, none but mine, of course. The recommendation is often, but not always, too high (I’ve never seen a temperature too low). I suspect this is based on the assumption that the average consumer will not preheat the teapot. Experiment; Get to know your teas.

Water

Tea is what — 99% water? You can do everything else right, but if your water sucks, so will your tea. An unfortunate population must boil a bitter perfumed black tea to mask foul liquid they call water. If you can not afford clean water, there are people who can help.

Tea

Tea quality is not entirely subjective. First of all, what may be called tea is not always, in fact, tea. Herbal ‘tea’ is not tea. Jasmine is not tea, nor is vanilla, rooiboos, bergamot, any type of fruit, oil, scent, spice, essence, perfume, grain, nor chemical. Only one humble species of plant, Camellia sinensis, is tea.

C. sinensis, also exclusively know as tea, has a few subspecies which are processed in generally four varieties, depending on the level of oxidization: white, green, oolong, and black. The quality of the leaves range from whole tips and leaves to powdered dust. Tea degrades in light and moisture. Otherwise, there is great diversity of flavour, colour, feel, scent, texture, and other subjective attributes.

Choosing a tea

Price is a poor gauge of quality or likely preference. My every day ‘table’ oolong from Fujian is half the price of a popular but inferior grade tea (purportedly from either France or Russia) and a seventh of the cost of a famous Wudong oolong I find nearly undrinkable. My absolute favourite oolong from Taiwan is priced somewhere between the latter two.


price of most recently purchased teas, from least to most appreciated
least appreciated $ / 100g most appreciated
7 76 17 47 11 11 16 28 20 38

Find the tea variety you like best. Let me suggest some starting points. Silver Needle is the finest white tea by definition, otherwise White Peony is a fine choice. Gyokuro is the best Japanese green, but Sencha is the cheaper gold standard. Oolongs range anywhere between flowery perfume to rich caramel roasts. Wuyi Oolong (at 85 C) is my benchmark for all teas. Similarly, there is an enormous variety of black teas, from the light (technically oolong) Darjeeling to Keemun, Assam, and finally the powerful (almost fishy) shu pu’erh.

To understand teas, you must resist the temptation to cloak tea in scents, fruits, or oils. If your tea is unpalatable without sugar then (A) your tea sucks, (B) you’ve stewed it too hot, or (C) you don’t actually like tea.

Preparing tea

For sampling teas, I recommend the Gongfu Cha Dao method (yeah, that’s right, the kungfu of tea). While the Japanese, British, and others have ritualized tea making and pomp, only the Chinese ceremony focuses on flavour above all else.

Until you’re a black belt kungfu tea master, you will require a thermometer, timer and a kettle. Additionally, kungfu tea requires a tiny teapot (1-2 dL), a cooling pitcher, small cups, and of course crisp spring water and fine tea leaves. The Taiwanese introduce a few other tools, though I insist only on a fair pitcher. If you’ve got a catching tray, lucky you; I use four plates on which I have a yixing teapot, two matching pitchers and on the last plate, four small thin wide cups.

Gongfu Cha animated

I pour hot (nearly boiling) water into the empty teapot and cooling pitcher. I place the thermometer into the cooling pitcher and wait for the appropriate temperature for the particular tea leaves (If I loose my zen, I may transfer some water between cups to accelerate the cooling process). When the temperature of the water in the cooling pitcher is almost perfect, I start boiling some more water and pour the teapot water evenly into the cups. In other words, get everything hot and slowly cool down.

I add the leaves to the teapot. Now the cycle begins.

I immediately pour the water from the cooling pitcher to the teapot (and tea). I set the timer (in reality, I just glance at the music player). I then refill the cooling pitcher with a fresh splash of nearly boiling water.

This last step is tricky and is what makes this something of an art. You want the cooling water to reach the perfect temperature at the same moment the tea has completed steeping. It’s actually a bit more complex than that; You don’t want to keep water perpetually boiling because it will loose oxygen and become flat, so you’ve got to sync the boiling, cooling, and steeped tea. This is kungfu, remember.

Anyway, once the tea has steeped at the perfect temperature for the perfect amount of time, pour your perfect tea from the teapot to the fair pitcher. Pour the perfectly warm water from the cooling pitcher to the teapot. Set the timer. Pour the tea from the fair pitcher to the emptied warm cups. Pour nearly boiling water from the kettle to the cooling pitcher. Enjoy your tea. Repeat.

To maximize this perfect absurdity, check out the Taiwanese additions which include scent cups. Each video on the net is worse than the next. Best of luck!

Xmonad on Karmic Koala

Xmonad is a tiling window manager that wastes neither time nor screen real estate. It does away with decorations, giving windows the space they need, but no more. The learning curve is a steep eight commands or so.

This tutorial should get you up to speed quickly with Xmonad on Ubuntu 9.10 Karmic Koala.

Several tiled and a floating window

You will be changing your window manager, which is a major part of your graphical user interface, where it’s far easier to get yourself into a mess than get yourself out. If that scares you or loosing all your data doesn’t sound like fun, then this may not be for you.

You may want to download the config files and read through the entire tutorial first. If you lack the luxury of two computers, I recommend printing this page out. Remember Ctrl-Alt-F1 through F6 are your terminal friends.

Get Xmonad 0.9

$ sudo add-apt-repository ppa:justinbogner/ppa
$ sudo apt-get update
$ sudo apt-get install xmonad libghc6-xmonad-dev libghc6-xmonad-contrib-dev dwm-tools feh

Set the Gnome window manager

Set to xmonad after printing the old windowmanager:
$ gconftool-2 -g /desktop/gnome/session/required_components/windowmanager
$ gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string

Karmic Koala comes preinstalled with a /usr/share/applications/xmonad.desktop file that should work just fine, though Haskellwiki recommends that X-GNOME-Autostart-Notify is set to false (I’ve noticed no difference either way).

Xmonad.start

You will have to change a single line of a different xmonad.desktop file. The Exec in /usr/share/xsessions/xmonad.desktop must be xmonad.start rather than just xmonad. Download this file or make the Exec change manually.

Download /usr/local/bin/xmonad.start and make sure it is executable.
$ sudo chmod +x /usr/local/bin/xmonad.start

Xmonad config header

Download and by all means customize ~/.xmonad/xmonad.hs . I changed the mod key from Left-Alt to the Left-Win key (mod4Mask).

Be sure to compile/link the header with:
$ ghci ~/.xmonad/xmonad.hs

If all runs OK, you can quit with a preceding colon:
Prelude Main> :quit

Xmobar

Download the optional ~/.xmobarrc for Xmobar (a text based quick launcher with other candy).

Finishing touches

I killed the default Ubuntu bottom panel (right click ‘Delete this panel’) because Xmonad has it’s own workspaces, makes the taskbar redundant, and makes cleaning the desktop unnecessary. Further I hide the top panel (right click “Properties” autohide) so that full screen lives up to the name.

You may get away with logging into a Gnome session, otherwise, set Session to XMonad (under the login prompt). Though the latter is probably optimal, it does require you to set your background image again, if you so desire. Just uncomment and modify the “feh --bg-scale” line of /usr/local/bin/xmonad.start.

Necessary reading

The configuration above is a mix and match from these four pages and my own seasonings.

I highly recommend this short tutorial (note that my configuration uses the Left-Win mod key rather than Alt mod key). Ten minutes later, you can check out the tiny manual.