Interplanetary billards

If you've ever wanted to play at being a god then perhaps you'll find the University of Chicago's
solar system simulator to be as much fun as I did. Here you get to set up moons, planets and stars, press the start button and see what happens. Most of the time it's a demolition derby. The bodies are obviously made of glue, because nothing escapes the frequent collisions.
Making any orbital system stable with 3 or more bodies is well known to be quite difficult. However, it's easy to see in the simulator that if you keep the masses of all the bodies but the central sun down then it gets much simpler, at least on the time scales on which I can be bothered to keep watching. Starting 3 planets at distances of 142, 100 and 50 with velocities of 130, 150, 170 gets you a nice 3-planet solar system which might be OK to live in as long as the planets are much smaller than the star. Increase their sizes and things get interesting in the sorts of ways that wouldn't give
evolution time to work its magic.
There are ready made systems with planets, moons and even a dual star where one of them has a planet. When I got tired of playing with them I tried making more of my own. Two planets at radius 140 and 160 with speeds of 137 and 103 will make a dual planet system that looks fairly stable. This would be something like having a moon the size of a planet, not entirely unlike the world in Ursula K. LeGuin's
The Dispossessed. Again, it works best with smallish planets.
The somewhat more serious, but not nearly as fun simulations at
Princeton also illustrate that making stable several-body solar systems is just not an easy thing to do. Even some of the ones that start off well, such as the 3-body Lagrange orbit or FigureEight5 quickly degenerate into what looks like a drunken game of pool, played with magnetic balls. Still, who would have thought that the figure of eight with 3 bodies was stable?
So it's vital that You budding solar system building deities note how important it is to keep the size of orbiting satellites down if You want more than two of them in your system. If You keep them small enough, You can even have a stable million-body configuration, as shown in
this paper about Saturn's rings. I may be
old-fashioned, but I always feel that having at least one planet with prominent rings in your solar system shows an attention to detail that is
appreciated by any sentient life You manage to breed.
Broken link of the day
Here in Denmark almost all our interactions with the state bureaucracy can be done online. We can do our taxes online, and a thousand other things. That's great.
Until now a lot of the web pages involved were on www.danmark.dk and www.netborger.dk (netborger = net citizen, nothing to do with the
Borg). Now they have been consolidated on
borger.dk. I suppose in some way this makes more sense, but it means that thousands of links have been broken. All links to places on danmark.dk now link to the front page of borger.dk. That's painful enough, but the netborger.dk domain has just been completely removed from the net. There's no clue as to where the content could have gone.
I just hope they haven't dropped the domain completely. Because it will be hawking online casinos really soon if they have.
Reuse of neurons
Few things are as annoying as having to switch between different keyboard layouts. It took me several years to get rid of the nervous twitch caused by switching between German
QWERTZ keyboards and non-German QWERTY keyboards. The nervous twitch when writing my name, worrying about whether I had yet again written "Corrz" has only recently worn off.
After leaving Germany I settled on the Danish keyboard. It's a great keyboard for English, Danish and German. For programming, the placement of the {} braces can be annoying so I have a couple of keyboard macros in my .vimrc file:
map! hh {
map! jj }
The letters 'jj' and 'hh' occur very rarely in normal text so this doesn't interfere with non-programming use of vim.
So, happy as I am with my new employer-provided MacBook Pro, I'm not happy about the differences between the normal Danish PC keyboard layout and the one the Mac supports. It's particularly annoying on external keyboards, almost all of which have the PC keycaps.
It's not that I am totally opposed to changes in keyboard layout if they are justified. The most obvious improvement to the standard Danish PC keyboard is to get the rid of the
currency symbol that squats like a belligerent drug addict in the penthouse of the '4' key. This symbol was invented as a placeholder for various local currency symbols in the days of 7 bit character sets on non-connected washing-machine-sized machines that processed accounts using reels of tape and chugged along with less processing power than a modern day SIM card. But now, what on earth could be the justification for a symbol that means "some currency, but we don't know which one". Find out and get back to us with the answer, dammit! In these days of Unicode and a
three-letter currency abbreviations the only reason for keeping the running pancake in such a prominent position must be anti-Americanism or a misplaced sense of vague internationalism. I suppose it could be to annoy
perl programmers and
vim users.
Unfortunately, instead of turning this piece of prime keyboard real estate over to the rightful owner, the dollar sign, the Mac people have replaced the currency symbol with the Euro symbol. While marginally more useful this is no help for those of us that need the $ symbol (relegated to shift-alt-3) and conflicts with the standard placement dictated by the Eurocrats (alt-e). Granted, the Euro placement is a hugely verbose demonstration of
why you shouldn't let bureaucrats design computer equipment (yes, it's a Word file), complete with a class system for keyboard symbols (level 1, level 2 and level 3 - it is imperative that the Euro shouldn't be on a less prestigious level than other major currencies). However, now they've settled on an standard, there are advantages to following it.
So without further ado, here are a couple of
MacOSX keyboard layouts for Danish keyboard layouts. If you are the sort of person who looks down while typing they will allow the characters on your unseen screen to match the keycaps you are looking at. If you have parts of your
reptile brain dedicated to the placement of the keys it will allow you to conserve neurons and nerves needed to learn a new layout and (not least) switch between the layouts. They are made with
Ukelele and can probably be usefully combined with the use of
DoubleCommand. I hope they are useful to someone other than me.
Labels: PC USB keyboard danish denmark layout command-tilde currency symbol ukelele macos mac os x macosx
Job at Google
Well, after a fairly long process, I finally got a
job at Google in their
Aarhus office. I'm very happy about this, but I can't say a lot about what I'm doing there. I'm employed as a software engineer, which won't come as a shock to anyone who knows me.
They interviewed me for around an hour on the phone, then for around an hour in Denmark, then flew me to Trondheim for several more interviews. Most of the interviews involved writing some code on a whiteboard in a language of my choice.
I've been there a month now and as always in a new company it's a challenge to get up to speed. So far, the best thing about it is the colleagues, and the worst thing about it is the version control system. There's an interesting video of Torvalds
talking about such issues on YouTube and probably
other places.
What I hope I can say is that, in my experience so far, Googlers take the idea of '
not being evil' seriously. But of course, if we were all evil then I would say that too!
Boggle your mind
Perhaps I'm the last in the
blogosphere to discover it, but this
art about statistics and the environment was very impressive.

Covering your Fannie
Over at
Mish's doom and gloom financial web site there's an interesting article
on GSE's. When I say interesting, I mean it's interesting to me. I'm the sort of person who like to read books like my
Christmas present this year, about how a bunch of very ambitious financial geeks nearly crashed the financial world in 1998. I also like other stories of financial
madness.
The essential point of Mish's and
William Poole's warnings is that when you are investing you have to balance risk against exptected return. If the investment is risky you expect to get a higher rate of return, and if it's safe you make do with a lower rate of return. Bonds from (ie. loans to) the government sponsored enterprises responsible for a large part of the mortgage market in the US have very low rates of interest. This indicates that investors think they are almost risk free. They think they are risk free because they imagine that the government is backing them and will
bail them out in the event their huge
bets derivatives positions go wrong for them. When I say huge, I mean (in the case of the two largest and most ridiculously named,
Freddie Mac and
Fannie Mae) around $4470000000000, which is about the same size as the
US public debt held by the public. Of course Fannie and Freddie also have assets, so we are not talking about net debt, but the comparison is just in case anyone got lost in the zeros.
If Fannie's and Freddie's debt (bonds) are much more risky than the investors think they are, then that's bad news for the investors. They are not getting the return they should from their investments. Looking at it another way, they are more at risk of losing their investments than they think they are. So who are these silly investors? There's a good chance that your pension fund is one of them. They are, after all, some of the biggest investors in bonds.
(It isn't just a phenomenon restricted to US monoliths with silly names either. Risk spreads (the premium you get for taking a risk with your money) are at a
very low level everywhere. In effect, the markets are saying things are
safer than they have ever been.)
Perhaps your pension fund told you that they have a guaranteed minimum rate of return on the money you are planning to
use for your retirement. So if they
lose a lot of money because they
underestimate risk then you still get to retire to the
Florida Keys (assuming they are
still there by that time. Or perhaps not.
At least here in Denmark, your pension probably only offers you a guaranteed average return, not a guaranteed return every year (
Danish link). And at some point in the future they might decide to
change that unilaterally (da). The first pension company has already
done that (da) here.
So please put your seats in a vertical position, fold up your trays, and
brace yourselves for a risk repricing event. Because if you
"misprice risk, don't come looking to [the central banks] for liquidity assistance". I hope you found the central bankers' advice helpful. Personally, I found it a little unnerving.
(Partial) Death of the Google Bomb
So Google
killed some of the best Google bombs.
A search for
"miserable failure" no longer links to
Dubya's official web page. The
search for
liar no longer gets you
Tony Blair's web page, and most of the other
Google bombs have stopped working too. I guess this is good news for
litigious bastards.
Still, it's a relief to see that you can still
search for
Internet Exploder and get the right page. Hmm. Now that I've pointed this out, will they tweak their algorithm again?
You are here
Ever wondered where you were on the net.
This page has a red dot showing your location in Internet address space. The map, from supergeek cartoon
xkcd uses a rather neat integer-to-space mapping, the
Peano curve. I used this mapping to map addresses to positions for a video of memory activity for the talk associated with my
ISMM paper. The paper was about
optimistic stack allocation for Java-like languages and here is
the video of memory activity. The pdf of the paper is subject to the following draconian
ACM Copyright Policy: "© ACM, 2006. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in
Proceedings of the 2006 international Symposium on Memory Management (Ottawa, Ontario, Canada, June 10 - 11, 2006). ISMM '06. ACM Press, New York, NY, 162-173. DOI=
http://doi.acm.org/10.1145/1133956.1133978."

The movie perhaps needs a little explanation. It shows the execution of the 213.javac benchmark from the
SpecJvm98 benchmark suite with the 10% data set. The rightmost column is the normal parameter/local variable Java stack (it's a single threaded benchmark). The next column is the allocation stack, where the system is stack allocating new objects. The next column is the
semispace based first conventional GC generation. The large area is the main heap, which is so large that it is never garbage collected. Grey means unallocated, green means allocated and white means recently accessed. The idea of using the Peano curve to map addresses to screen coordinates is to make it easier to see locality of reference at both the cache line and page level. The stack allocation heuristic being used is "caller" (see the paper for details).
At any rate I find it quite hypnotic to watch. The main visible activity is the semi-space collector ploughing through memory, and switching halves at regular intervals. In fact a large amount of allocation and deallocation is also taking place on the allocation stack (this is the entire point) but it's not as visible since it's taking place in a very small amount of memory (which is also the entire point). The scale is such that the semispaces are each 64kbytes large if I recall correctly.