Ugh. I've always hated the word 'blog'. In any case, this is a chronologically ordered selection of my ramblings.
A few weeks ago I went on a recruiting thingie at the Cambridge Computer Lab. As well as trying to recruit grads, it's a chance to grab freebies from other stands. I got a nice Rubik's Cube, which gave me a bit of a flashback.
When I was small, I got a Rubik's Cube, but never solved it. Fun, but frustrating. When the Rubik's Magic came out, I sidestepped the whole puzzle element, and got it with a book solving it. I think I missed the point a bit there, but it was a good fun toy. When the Rubik's Clock came out, I finally solved one. Got it Christmas Day, solved it Boxing Day, my family thought it wasn't good value for money, but I rather enjoyed it. A couple of years later, I got a little book on solving the Rubik's Cube, but didn't actually work out how to solve it myself. Ho hum.
So, this time round I thought I'd solve it properly. My plan was to grab a few basic sequences, and then build it up into a full solving sequence. First, a bit of notation. The front and back faces are F and B. L and R for left and right, and U and D are the top and bottom. Edges pieces can be specified with two letters (e.g. UR), and corners with three (e.g. URF). I'll write a particular face rotation with either a positive sign (e.g. +U) for that face being rotated clockwise, or minus for anticlockwise. I'll use '3X' to mean repeating the sequence 'X' 3 times.
So, after a few simple experiments, I find the sequence 3(+L+L+U+U) swaps FU and BU, and FL and BL. The other sequence I used was based on explicitly trying to shuffle some of the squares around. The sequence is +L+F+F-R+F+F-L+F+R-F, and what it does to the top is... complex. We'll call this sequence 'X'.
It's easy enough to get one face sorted, so that one third is right. Put that face on D and then line up the centres of the non-U faces to match the colours on the lower edge. Then all you need to do to get the middle sorted is to fix the edges in the middle layer. You can do this by arranging it so that the ones you want to swap are at FR and UL, and then do +L+U 3(+U+U+F+F) -U-L. Once you've done that for all the middle edges, it's only the top to go!
We can now use this 'X' sequence to tidy up the top. X will shuffle around various edges and corners, and change which face of them faces where, but main thing to note is that URB stays where it is (turning in place), while the other corners rotate round. So, by putting the appropriate top corner into URB and applying X, you should be able to get the corners into place for the appropriate colours. However, they won't yet be facing the right way up.
Applying X 3 times shuffles puts the corners back where they started, but facing different ways up. More specifically, URB is identical to how it was before, but the other three corners are turned clockwise on the spot. By repeatedly carefully choosing the corner to be URB, and then applying 3X, you'll now have everything complete but the top edges. The top edges can now be completed by variations on the 3(+L+L+U+U) sequence. If you want to swap two pairs of faces, it then becomes quite simple: Find a short sequence which places those pairs you want to swap into FU/BU and FL/BL, apply the swap sequence, and then undo your original sequence by running it backwards (unturning faces in the reverse order). My group theory is more than a little rusty, but the operations you can create this way are the conjugates of our original swap operation. This is the technique we used to fix up the middle-layer edges.
This will do a certain amount of edge-swapping, but we can end up with situations where we want to rotate around three edges, and the swap operation doesn't make this look easy. Can we do it? We can't do it by just swapping top edges, but we can temporarily untidy the middle. Let's say we want to cycle UL, UB and UF. We'll choose two more 'victim' edges, whose roles are to be swapped at appropriate times, but end up where they started. These will be FL and FR. Then we arrange a pair of those conjugate-based swaps, to achieve the cycle. In the following table, each new row represents two sets of edges being swapped around. The swapped elements are in bold:
UB | UL | UF | FL | FR |
UL | UB | UF | FR | FL |
UL | UF | UB | FL | FR |
At the end, we've cycled those three pieces around. While I haven't proven it, this appeared to be the final piece I needed, and I've been able to solve the cube several times using the above toolkit. It is, however, a very unwieldy toolkit. The sequences chosen are built by incremental construction from smaller sequences, rather than finding the shortest sequence to do the job. The idea was to see how much I could build up starting with only a very small set of 'primitive' operations. If you're interested in solving the cube quickly, the booklet I bought all those years ago, 'Resolving Rubik's Cube' by Jon Millington, does the job most effectively, although not with much in the way of motivation. There's plenty of fun in finding your own way to solve the cube, though.
Posted 2007-12-10.
The other day, someone I used to know at uni and I were discussing the "St. Petersburg Game". Basically, you repeatedly throw a coin until a heads appears, and then you pay out 2^n, where n is the number of tails thrown before the heads appeared. How much would you pay to play this game? In theory, the expectation of this game is infinite, so if you're fully risk neutral and everyone will always be able to pay up, you'd pay any amount.
So, there are two ways to generate a more realistic price to pay the game. My argument was that I'm risk-averse, and so I have some utility function for my money. I might buy a 1 pound lottery ticket with a million-to-one odds for a million pound payout. I wouldn't buy a thousand pound lottery ticket with a thousand-to-one odds of a million payout. My argument was that for one go at the game, I wouldn't want to pay more than 3 or 4, because I'm not really interested in remote chances of earning vast amounts, I'm interested in a reasonable chance of not making a big loss.
His argument was that credit needs to be taken into account. Beyond a certainly point, you would go bust. So, I might as well truncate the series that generates the expectation at that point. In other words, if you can only pay out a million, (2^20), the fair value is 11. This only makes sense if I'm playing repeatedly, but apparently that's the case he was thinking about. Certainly, if I'm playing repeatedly, I'd pay more than 3 or 4, since I'd have a much better chance of seeing some of the big payouts which make it worth it (this may sound woolly, but I'll try to make it a bit more concrete later on).
So, if we're playing repeatedly, fair value isn't what we care about, really. What we care about is the end-state. We assume that the two players will keep going until one of them gets wiped out. Unfortunately, my maths isn't good enough to work out closed form solutions for probabilities of wipe-out given different starting account values, so I wrote a simulation instead. I hacked it up fairly quickly, so it's probably annoyingly buggy, but I hope I haven't made an error fundamental enough to invalidate the whole thing.
What I'm doing is a set of simulations, where for each simulation I find the break-even level, where if I paid more I'd go bust first, and if I paid less you'd go bust first. I collected the results for 1000 simulations, assuming that I have one million and you have one million, to start with. I then took some percentiles, and prices:
Percentile | Price |
10% | 9.948271666 |
20% | 10.18424126 |
30% | 10.43704421 |
40% | 10.66959518 |
50% | 10.98563359 |
60% | 11.36414737 |
70% | 11.84457506 |
80% | 12.97528121 |
90% | 16.04786940 |
Price | Percentile |
10.5 | 32.90% |
11 | 50.20% |
11.5 | 62.7% |
So, 10% of the time, if we both start with a million, I'd lose even if I paid 9.95, and 10% of the time, you'd lose even if I paid 16.05. It looks like the price which gives us even chances of wiping out our opponent is actually near 10.99, which looks suspiciously like our fair value!
This is, of course, assuming that I'm willing to risk losing a million in order to gain a million. What happens if my pockets are much deeper, or shallower, than my opponents' (Or that I just want to place my stop-loss closer)? Why, I'll just run my simulation again with different parameters... first up, I have 100K with which to steal your million:
Percentile | Price |
10% | 8.288661462 |
20% | 8.560000916 |
30% | 8.744448393 |
40% | 8.959470526 |
50% | 9.151535916 |
60% | 9.403354633 |
70% | 9.664265445 |
80% | 10.00022710 |
90% | 10.78195451 |
So, even if I paid 10, rather than the fair value of 11, I'd still get wiped out 80% of the time. And if I have 1M with which to try to remove your 100K?
Percentile | Price |
10% | 10.13697085 |
20% | 10.64982176 |
30% | 11.07549714 |
40% | 11.53903907 |
50% | 12.14243862 |
60% | 13.05499767 |
70% | 14.48813500 |
80% | 16.87636127 |
90% | 25.58518196 |
So, if I were willing to lose 1M half the time, in order to win 100K the other half, I'd be happy to pay about 10% over the fair price associated with you having 1M. Not surprising that I'm willing to pay more if I'm happy to take the same risk for less reward. However, another way to look at it is that if we both had 100K, I'd be willing to play around 9.3 to play for a 50% chance of winning - i.e. an expectation of 0. At the 1M level, this price is now 11. If I want the expectation to be zero for winning 100K or losing 1M, I need to win 90.9% of the time. At that percentile, I'd be willing to pay 10.1. This happily sits between the two bounding situations. No real shock, there.
Switching tacks, one of the things I noticed when running these simulations is that it can take several million plays to bankrupt someone if you start with a million each. If you really are throwing coins, you'd be giving up rather sooner. Another way of approaching the problem is to see what the percentiles are for the break-even prices if make each game consist of a certain number of plays. I've plotted the percentiles of prices for 1K, 10K, 100K and 1M plays per game:
Percentile | Breakeven on 1K | Breakeven on 10K | Breakeven on 100K | Breakeven on 1000K |
10% | 4.552 | 6.1909 | 7.83347 | 9.517169 |
20% | 4.946 | 6.6637 | 8.35954 | 9.914645 |
30% | 5.275 | 7.0939 | 8.69940 | 10.315357 |
40% | 5.739 | 7.5291 | 9.09153 | 10.684029 |
50% | 6.158 | 7.9714 | 9.54439 | 11.188397 |
60% | 6.802 | 8.5406 | 10.34503 | 11.798191 |
70% | 7.626 | 9.5700 | 11.02936 | 12.726459 |
80% | 9.012 | 11.0576 | 12.58205 | 14.213793 |
90% | 13.258 | 14.5263 | 15.83425 | 18.443645 |
As you can see, the amount it's worth paying per go to break even at each percentile level even increases with the number of goes you play before stopping. Why is this? As I said woollily before, the longer you play, the more likely you are to actually see one of the big payouts. In a way, the behaviour of this thing is rather like a log-normal distribution, where the mean and median are in different places, but more so. In each case, the mean payout is infinite, but the median starts to slide upwards with the number of goes.
Another thing to notice is that the increase in payout with number of steps matches the appearance of less-likely cases. So, if you're truncating at a certain level of unlikeliness, doing 1000 times as many games means truncating 10 steps later (2^10 being approximately 1000), and thus the price being 5 greater. Look at the price difference between the 1K and 1M column, and this is what you see. Extrapolating back, if I'm willing to pay 3 or 4 to play the game once, I'm effectively at the 75 percentile price. Which sounds about right - I would only be willing to lose three quarters of the time in order to get a hopefully pretty impressive payout that last quarter of the time.
I think this approach provides a slightly different way of looking at the game. Remember, the above prices are without bounding the pay-offs, so we're not taking the credit approach. The expected payout is still infinite. However, if we're only interested in what happens in sensibly common cases, this is more useful. This is basically a VaR approach. The credit approach can also be looked at as finding the expectation, contingent on being in particularly large percentile. Mathematical modelling of finance has always been rather poor at getting the behaviour in the tails right....
Posted 2007-12-09.
I am now engaged. So is Caroline. We are engaged. To each other. It's great. This is actually surprisingly old news, having happened on 30 June, but I've just been taking my time getting around to writing this up. This says less about our excitement at getting engaged, so much as my incredibly slack process of writing things up.
I think it was all rather good. We'd gone up to Cambridge for a long weekend to celebrate our third anniversary, and had a nice meal at Midsummer House. Then I proposed, and Caroline accepted. We were both very happy. The food's really very good.
So. Hurrah. We're now looking at a wedding date of 7 June 2008, at St. John's College chapel.
Posted 2007-11-24.
I wrote this a few weeks ago, but never stuck it up:
I'm reading Joel on Software at the moment. It's quite interesting, and I'll no doubt review it at the appropriate juncture. What I have noticed, however, is how product-focussed he is. With user interfaces and stuff. We don't really do that. While we kind of have users, we really have people who interface with our code, and in the distance we have the angry shouts of actual end users. In other words, we are doing Enterprise Middleware Development. It's that polysyllabic. We're also not coding for the long term - the codebase isn't static and requirements are always changing. Anyway, I thought I'd share some of the thoughts I've had:
Posted 2006-10-21.
Matt Kelly and Cat White got married. I was present. It was great. I don't really have a huge amount to say about this beyond the fact it was in Wales, the service was lovely, the food was tasty, and the evening was most entertaining. Especially Ben. I hope the couple are enjoying themselves in, um, Thailand, I believe.
Posted 2006-09-19.
It's a bit of a random link, but I've recently been trying to remember a talk I saw at the Computer Lab about the horrendous state of software reliability. I've finally tracked the author down, and Professor Les Hatton has a fascinating view on this stuff that just makes you want to give up and do something completely different. He's a bit of a polymath, so it looks like there's some other cool stuff there, but I haven't really had an in-depth dig. The paper on optimising your phone tariff versus the phone companies' obfuscated talk plans, for example, is quite fun.
Posted 2006-07-21.
We went to New York just over a couple of months ago. I've just finished writing it up. On the other hand, it's about 5000 words scraped out of odds and ends of time. There are pictures, too, so don't worry too much. So, without further ado, what we did on our holidays
Posted 2006-04-26.
On Saturday, I attended Matt and Cat's engagement party in the relatively spiffy surroundings of New College, Oxford. It's not bad, as far as the Other Place goes. Matt was a housemate in St. John's Road when we were grad students, and Cat was his girlfriend then. So, it's great news and a good excuse for a catch-up. I'm very much looking forward to the wedding in September.
Matt berated me for not putting more random rubbish on my website, so presumably I'm supposed to mention things like last week Caroline bought me a deep-fat fryer for my birthday, and today the kitchen cupboards fall down (well, only partially - we took them down before they totally collapsed).
I'm probably also supposed to mention pet peeves, like the chunky protective cases people have for ipod nanos, and other similar goods. Why do these thing exist? These electronic goods are designed to be small, and will be worthless in a couple of years anyway. So, you're adding totally unnecesary and pointless bulk. Nice.
Posted 2006-04-24.
They do. You may think being off work sounds fun, but it's actually surprisingly boring and you don't get to catch up on the stuff you'd like to because you're actually lying around in bed. Even the Winter Olympics is inaccessible because the TV is downstairs and that's basically too big a move to shuffle a duvet/blanket/whatever. Darn.
So, if you're thinking of getting a sore throat, my advice: Don't.
Posted 2006-02-14.
Dr. Simon Frankau, I'll have you know. I've been doctorified for about a month now, and the novelty still hasn't worn off. Well worth however many years of my life it was... :)
Posted 2005-11-16.
I am moving to a new job. This news is a little less exciting than one might expect. My old job has been very good and has given me lots of experience, but a few people moving on made me think about where I wanted my career to go, and I want to do stuff with more maths in. So, I got a job with more opportunities for maths. I'm sad to leave, but I'll have to see how it goes....
Posted 2005-09-25.
Some time ago, Caroline and I had a most excellent short break in Vienna. Since then, I promised I would write it up, but then I've taken forever to do this, and since my memory's not excellent, I'm going to be reconstructing it all rather flakily. I should, however, point out that Vienna's a great place to visit. 'cos it is.
Tuesday 24 May: We arrive in Vienna. The flight wasn't particularly eventful, and we take the super double-decker express train into town which takes 15 minutes. The downside is that there's 30 minutes between departures and we just missed it. Not really a worry, since I'd just bought a Su Doku book in London, and was busy getting addicted. The view from the train is initially rather industrial, switching to alien suburban (the architecture being reasonably different to the UK, if quite nice) and finally urban. We get off, orient ourselves, and walk towards the hotel. Initial impression is... European city, really.
Walking through the historic centre, we don't really look at much in detail, but it all seems very pleasant. The city seems a good choice. But then... we try to find the hotel. The street I thought it was on is being repaved, and is partially closed. Could this be why we got such a good rate at a 5 star hotel (well... we thought we'd push the boat out a little on a short break :) ? It really didn't help that I hadn't printed out a full itinerary, or indeed the hotel's address, having been in a bit of a rush. We went up and down the street (most difficult, given it was mostly closed). No sign. We asked in another nearby hotel. Our hotel was backing on to the street in question, and was just round the corner, quite open, and looking rather nice.
Being rather tired, and perhaps a little emotionally strained, we checked in, cleaned up a little, and went for supper. I think I had something approximating steak and chips. Since it was quite late, the big restaurant was closed, so we were eating in a smaller, simpler restaurant. The language was alien, and it was difficult to tell if we were gently having the piss taken out of us, but it wasn't unpleasant and we toddled off for some well-earned rest.
I should probably mention that before going on holiday I was 'warned about the people'. While a few of the Viennese were a little brusque, generally they were very pleasant, especially given the amount of stress we must have been causing them with our language skills (having said that, Caroline's got a freaky ability to pick up a new language in about 3 days - by the end it appeared she could pretty much understand anything). It could well have been the areas we were wandering around (the rather expensive central part), but people were generally very smart and stylish. So, there you go.
Wednesday 25 May: Surprisingly for us, we got up in the morning. We started off with a trip round the ring road. Ring roads always make me think of the M25 and Milton Keynes for some reason, but this is something else entirely. A loop of pleasant buildings round the old centre. We saw the university, and the rather splendid town hall (Rathaus), and the Burgtheater, as well as the pretty gardens placed between them. It was now about lunchtime, so we popped into a nearby cafe for a drink and cake. Their legendary cake-making status is well-deserved - I had my first slice of Sachertorte and, well, wow.
Following on from this ever-so-healthy lunch, we walked through the Volksgarten, towards the Hofburg palace. The weather was pretty much fantastic throughout our stay in Vienna. Incredibly warm and dry. So, walking through big, pretty, well-maintained gardens. Such a chore, obviously. Having survived the onslaught of so many roses and a couple of fountains, we found ourselves at the Hofburg, palace of the Hapsburgs, and general all-round Impressive Big Place. I think we may have had a quick look at the Maria-Theresien Platz, staring at statues and the outside of the natural history museum and art museum, before passing back through the Hofburg and more into town.
It was about here that we lost our proper-historic-tourist footing, and just ambled around amongst the shops, getting quite impressed by expensive jewellry. We found St. Stephen's, whose roof pattern reminded me of lego. I suspect, in retrospect, there may have been a model of this building in legoland when I visited, or something. Either way, quite a fun blocky pattern. We later had a peek inside, and... it was churchy. Some of the stained glass was rather good, though.
From there, we wandered around and found the Albertina, an art gallery on the South end of the Hofburg complex. There was a Mondrian exhibition on, which was amazing, as it showed his development, and his early work was completely different to the style for which he's famous. You get the impression of a man on a long quest to find his own style. Some of his Braque-like work was quite fun, but the white-background geometric style for which he is known was the definite show-stealer.
From there, we saw an odd exhibition stretching from early art to modern. It was most interesting looking through the styles, and seeing what we liked and didn't, and finding out, unsurprisingly, that famous artists tended to produce better stuff than those we hadn't heard of. In the modern end, there were some unimpressive Picassos, some Giacomettis I rather liked, and a jaw-dropping work by Francis Bacon. It was one of his Popey ones, and it was horrendous, but amazing. So, so visceral. Pastel on black paper, or something like that, it was simultaneously blurred yet sharp. A nightmare on paper.
We finished the Albertina by looking through their bog-standard collection. Plenty of pictures of landscapes and people, arranged in state rooms that were themselves quite impressive. What I liked the most, though, were drawings by Durer. I can very much do without his paintings, in all their gaudy, weirdly-unrealistically-arranged glory, but the sketches were so detailed and personal, that they really did seem to reach across the centuries.
We went back to the hotel, exhausted, for a rest, before going out in the evening for a meal at a cafe. I risked the boiled meat with creamed spinach and potatoes, and it was really very nice, unexpectedly. The Viennese food is slightly unexciting, but generally very tasty for all that. After that, of course, we had cake. I had something a little chocolatey and alcoholy, while Caroline has tiramisu. We were both very happy.
Thursday 26 May: This was the day we saw the Schonnbrun palace, which was quite amazing. Since it's not in the old centre (I don't think they'd have room for it), we took the tube out, which was pleasant enough. When we got there... it was big. And very yellow. Bright yellow. Apparently it was a bit more baroque in earlier times, but one of the previous tenants made it a little more tasteful.
Having walked through the main court, we started off with the garden. It's huge and very nicely kept. Walking straight from the back of the palace, we reached the fountain. Or, as it seemed to me, a small lake. It was rather cooling, given the boiling weather. From there, we walked up a carefully-arranged hill, to the folly. Which, of course, had its own pond. The view of the palace from there was pretty stunning. After resting a while, we descended through a more shaded route, and grabbed some ice creams. Caroline appeared interested in the zoo, but somehow we escaped it. On the other hand, we never saw the maze, either.
Walking back to the building, through the shade, we worked our way around and bought tickets for the tour of the house. Having queued for the tickets, we discovered they were time-stamped, and we would only be let into the tour proper at the appointed time. Most odd, but at least it meant we got audio-guides. The tour was pretty impressive, going through a good set of huge rooms, with a reasonable amount of background information on the Hapsburgs. The ballroom area was probably one of the high points, but also very interesting were the slightly quieter bits, that gave an insight into the personal lives of the residents.
From there, we ventured out into the cafe for lunch. Rather pleasantly, the food didn't just appear to be an excuse to extract money from desperately hungry tourists. Yay.
Once we'd seen enough of the Schonbrunn palace, we made our way back into town. About this point, my memory becomes hazy, but I wouldn't be at all surprised if we just wandered back to the hotel, knackered from the heat, walking and splendour of the buildings.
After recuperating, we went out for an evening meal of 'klein' schnitzel, as it was described. It was sticking over the edge of the plate in most directions. It was about this point that I learnt again that 'lemon beer' is not some clever local concoction, but basically shandy. Fortunately, Caroline didn't laugh at me much, and was most willing to help me out with it. Shandied up, we made our way back, via the Viennese stock exchange, the outside of which I had a quick stare it. I'm still not sure why I found the whole concept quite so alien.
Friday 27 May: This was our last full day, so we were determined to make the most of it. Heading down towards the Hofburg, we went to see the Kunsthistory musem (an art gallery). The building was most fine - plenty of marble and the like, and a great place to hold the artwork. The art again provided an opportunity to discover that famous artists do tend to produce more impressive paintings than those less famous ones.
It was very interesting to see the Breugels. Personally, his stuff leaves me cold, but Caroline is apparently a great fan of the 'little people with pointy sticks' (which I must admit most aptly describes much of his work). Seeing them in the flesh, though, was much less offensive than I thought they might be. Another highlight was the set of paintings by Rubens. The first room we saw, we were massively unimpressed by his work, but this only emphasised his development - the second room was pretty breath-taking.
After touring the paintings, we had a quick meal, and went through the egyptology stuff. Unsurprisingly, this wasn't quite the same after the Egyptian museum in Cario, but there was still some very cool stuff there. From there, we raided the gift shop and wandered out dazed into the bright sunlight.
Next up, butterflies. There's a big butterfly-glasshouse-thing (I'm sure there's a German word for it) next to a garden behind the Albertina, and this is where we went. There really are some immensely beautiful butterflies about - something I hadn't really realised until going through this place. Such varied shapes, such bright colours... and some of them are about the size of bats! Towards the end one deemed me worth landing on (I suspect, given the heat and the humidity, that my perspiration might have been making a good lunch for it). Three or four people seemed to think this was worth taking photos of, and when we decided to leave I had to give it a certain amount of persuasion before it would detach. I don't think the owners would let me take it with me....
After some cafe-based recuperation, we tackled the Royal apartments. The rooms were generally similar to those in the Schonbrunn - a mixture of the impressive and the personal. Later in the tour was the 'Sisi museum'. Sisi (Elizabeth) appears to be something of a national figure - something akin to Diana over here (ahem), despite the fact that Sisi was many, many decades earlier. She apparently had a bit of a tragic life, in between being made to look immensely beautiful. She didn't eat much and exercised to keep her figure, refused to be painted or photographed beyond a certain age, and was killed with a file (yes, as in a small wood-working tool). Most interesting. Having done that, we took a quick turn of the royal silver (so many plates!), and the Hofburg was done.
That evening, we had our final Viennese supper at the hotel where we first asked about the location of the hotel at which we were staying. We sat outside, watched evening turn to night, and ate some rather good food. Afterwards, we had a bit of a walk, to the Danube (or at least a branch of it), across it, and back. It appears the river-side was where all the cool kids hang out.
Saturday 28 May:
Saturday was half a day's zip around before returning home. We started off with a trip to Freud's house, aka The Freud Museum. I'm not a massive Freud fan, but he's supposed to be really influential or something, and it was quite interesting to have a look around the place, anyway. There were some good resources for those who are deeply into his history, a fairly amateurish but nonetheless interesting selection of odds-and-ends, but I think the highlights were the areas preserved in original form.
Next off, we went over to the Freyung, a oddly-shaped square surrounded by palaces, churches, pleasant tourist traps, etc. This was a square we'd been through (and admired) a few times, although this time we went for a particular display: There was an exhibition of Magritte paintings going on. Initial inspection revealed a small selection of pretty unimpressive paintings. Uninspiring early works. I felt let down. Round the corner, there were some more, and these were getting to be things that did look like Magrittes, and not amateur knock-offs. Was that it? I finally realised, no, they actually did have quite a bit more, hidden round a corner, and some of them were pretty darn excellent. Yay.
Following that, we toyed with the idea of a horse ride round the city, as we'd been planning for a couple of days (or rather, Caroline had been persuading me, and I'd been lamely claiming that another time would be preferable). Sadly, we were both getting pretty nasty hayfever (with horse straw the prime suspect), so we skipped that idea. About now we were starting to run out of time, what with the remaining time for food, getting to the airport, etc., so we had our final look around the city, buying a Sacher torte, collecting our bags, and off for the flight home. That was pretty uneventful, and our holiday was done. Ho hum. Until next time....
Posted 2005-08-30.
Over the weekend was the tenth anniversary of my mother's death. Not the kind of thing I normally put here, and not much I can say, but there you go. She was an exceptionally kind and loving mother, and an all-round great person. I can't believe it's been so long.
Posted 2005-08-02.
Having basically completed my PhD, bar the administrivia, I've got myself a job. It was surprisingly simple. A trader e-mailed me asking if I'd like a job working on a fairly interesting project, I said 'maybe', I came for an interview/look round, and I got a part-time job. 6 months later I went permanent and full-time.
I'd never really considered investment banking before, as I'd always been put off by the recruitment stuff looking for highly-motivated go-getting blah blah leaders of tomorrow, rather than people who want to write good code. Fortunately, it turns out they hire those too occasionally. The industry has constantly surprised me (in both positive and negative ways).
So, what's my job? It's working on a Monte Carlo farm. What's that? It's a way of using several hundred PCs to work out how much complicated deals are worth (pricing), and how to manage them so the bank doesn't fall over when the stock market moves (hedging). It's all actually quite neat.
Posted 2005-03-24.
Not particularly surprising, given the number of people who do it, but it really is great, and I feel annoyed that I hadn't done it for so much of my life. You can pick up the basics in a matter of hours, and then the satisfaction of improving is great - almost as much as how fun it is to just go sliding downhill on snow. I'd been for a couple of introductory lessons on a dry slope before, but it just does it absolutely no justice.
We (Eben, Liz, Caroline and myself) went to Heavenly, on the South of Lake Tahoe, the California-Nevada border (plenty of casinos nearby), and the scenery is absolutely stunning (beautiful snow, skies, lots of lovely trees), and the scale of the runs just makes the dry slopes seem comedy. I'd always thought of Winter as dark and gloomy, but this was Winter at its very best - pretty much Summer, but not too hot, and with soft, fluffy snow everywhere.
Well, that's not strictly true. On our final day it snowed quite heavily, and Eben and I were determined to make the most of it. It was actually very fun, in a freezing cold white-out kind of way. The blizzards cleared briefly, giving an absolutely amazing view of Nevada. Anyway, rewind to the start of the holiday....
Lessons are well worth it. They're not cheap, but I suppose the whole holiday thing isn't particularly. On the other hand, they're a great way to get started quickly. In a week I got from pretty much nothing, through greens to simple blues, although my impression is that Heavenly is a fairly fluffy resort, ratings-wise. Myself and Caroline learnt to ski, while Eben learnt to snowboard. Liz planned to snowboard, but reverted to her skiing roots (yay).
I should probably also point out that winter sports are a great way of getting injured. Somehow (without any obvious instant where it started), my ankle started to hurt, so that I couldn't walk in boots. Skiing, fine, walking normally, fine, walking in boots, big pain. Fortunately, it didn't affect me too much, after a day off. Eben and Liz had their own accidents, and it seems Caroline, who seemed to have the most conservative approach, was the only one of us to come out unscathed. Although she did get quite tired quite regularly. :)
Having said that, so did I. After a day of skiing we couldn't manage much more than supper and bed. How people do apres-ski, I have no idea. On the other hand, Americans really know how to do food. Their steaks are just fantastic, and I'd recommend Echo at the Embassy Suites, Fire and Ice, and the Hawaiian sushi place whose name I've forgotten. Cecil's bar and grill was disappointing. Oh, and the food on the piste is pretty poor, too, but you'll be too busy skiing, won't you?
It was my first holiday in the US mainland, and Caroline's first visit to the US, and although there's probably some skew from the fact it's a holiday resort, the whole place was just so... American. Everything was bigger, the people insanely friendly, and everywhere there were little touches that just kept making us want to pinch ourselves, see if it's a dream. Ok, so maybe we're a little easily-pleased by that kind of stuff. :)
Finally, I think I should give a bit of a run-down of the runs I'd been down:
Posted 2005-03-24.
I went to Edinburgh with Caroline for a week to see the Fringe. It was much fun. Having not been to Scotland before, it was a most interesting experience. Coming from Cambridge, Edinburgh is incredibly vertical. Perhaps it's not much compared to some other bits of Scotland, but still... wow. Literal high points were the Castle itself, Carlton Hill and Arthur's Seat. Interestingly, Arthur's Seat had some very steep edges, but not a single safety barrier in sight. Similarly, you could climb all over the pseudo-classical ruins on Carlton Hill. It's almost like people have to take responsibility for their own safety. Quite different from most English tourist sites.
It's not only the landscape that's vertical. There are some very tall buildings. Some are 8 or 9 storeys tall while carrying it off as if they were only 3 floors high. The architecture is generally wonderful, making it a very pleasant place to walk around. On the other hand, there was a surprisingly large amount of obesity. Or perhaps not so surprising, given the legend of the deep-fried Mars bar. Perhaps it's defence against the cold weather. Oddly, while we were there, the weather remained quite dry, and even reasonably sunny. Excellent.
Some time later I'll review the shows we went to see....
Posted 2004-08-28.
Caroline Parr is a very nice human being, and (rather to my surprise) my girlfriend. She seems to like my web pages, and so now gets to feature in them (don't you feel lucky, Caroline? :). She has a job where she simultaneously saves the planet and organises parties. How cool is that? She's also great in ways too innumerable to mention, so I'll stop here (there's only so much being smug you can do before your friends kill you).
Posted 2004-07-13.
The RIAA and/or MPAA seem to have cottoned on to the existence of IRC, and now have machines that trawl IRC, presumably for fserves. Of course, they don't do it obviously, but instead use anonymous bots which regularly change through nondescript names.
I'm on a channel which I use to keep in contact with my uni friends, on Quakenet. It's fairly close-nit, with regulars, so we tend to notice random people who pop in, say nothing and then leave. I used to think 'how rude', but then I noticed that some were the same IP repeating. It appeared to be a bot which kept joining, but doing nothing... so I thought I'd investigate (eventually). And then I noticed there were at least a couple which'd been popping in:
Posted 2004-06-15.
Thetrainline.com is an online ticket selling company. You book tickets online, collect them from a machine at the station, and go on your way. The online system gave me a cheapter option than I'd managed to find searching through the touch-screen gui, so I thought I'd try to use it. However...
They don't let you collect tickets in Cambridge. They take 2 hours (!) to transfer the information from their database to the machines. They charge 10 pounds for cancellation, even if you never collected the tickets. So, when I ordered tickets in the evening in London before going home, I was totally screwed. I've been charged 10 quid to have a couple of lines entered into a database and removed a while later.
Mysteriously enough, while debiting my account was pretty instant, the refund process is insanely slow. For some reason, it involves phoning up a national rate number in order to cancel. That is, to cancel an online order. The website says it may be possible to change the ticket type. Nope, not a chance, despite the fact that no tickets had been issued.
My only possible interpretation is that the service is deliberately crap, and they plan to make their profit using refund charges from disgusted customers. Well, they got me. Bastards. I should have used a credit card for the order, and cancelled the item through that.
Posted 2004-05-24.
I have just returned from a fortnight in Egypt (more specifically, in Cairo, with a a day-trip to Alexandria). I'll probably do a write-up of what I saw and did later, but in the mean-time I thought I'd share some random odds-and-ends.
The whole thing was a big lump of culture shock for me. I'd never been outside of the "Western" world before (just Europe and a brief conference in Hawaii). As such, everything was a bit stressful. Enjoyable, fun and highly worthwhile but also very tiring.
People are friendly! But aggressively so! It's a friendliness that is quite unnerving, especially when combined with the concept of 'baksheesh', or 'getting a tip for doing very little, and certainly nothing you want'. Stand still too long in a railway station, people will help you out without asking, and then want money for it. Take a photo near the pyramids? People will want money if their camel appears, or if you took it from 'their' spot. The amount people want is generally small, and this is their livelihood - the gap between rich and poor seems huge. But... it's just very stressful if you're not used to it.
Of course, why settle for a fixed amount if you can get a percentage? In the souk, if you express interest in something they don't have, will they point you to who has it? No, they'll lead you there. How kind. The fact that they'll hang around while you buy stuff, and the prices mysteriously inflate is besides the point. Alternatively, you will stay at the original shop, and they'll fetch stuff for you. Again, most kind, apart from in the financial aspects.
The souk is probably the most scarily-friendly-because-we-want-your-money place. You very quickly harden up to all the invitations, compliments and so on, if you wish to survive. Dark glasses are a good idea, as simply looking at a shop can cause the owner to pounce on you (this even happens to a lesser extent at some of the high-street stores). The quality of spoken English is really very good - apparently there is a good free education system, so the tourist-pestering scum you encounter may well be highly educated. And when Japanese, Spanish and so on appear... they get their native language used too. Highly impressive.
The above may make the country sound like a nation of money-grabbing insincere sales-weasels, but it's not like that. Those who aren't selling things are just as friendly as those who are. Indeed, it's quite difficult to not be insulting having got used to the souk, ignoring people who really are just wishing you well, rather than trying to rip you off.
The universal catch-phrase is 'Welcome to Egypt!'. I suspect they must be trained at school, so that a foreigner pops up, and all the children have to shout 'Welcome to Egypt!'. The fastest gets a lollipop, and the slowest beaten, or something. Adults often want to shake your hand (and I'm talking about strangers on the street, here), while children will also try out 'What's your name?' and 'Where are you from?'. Big smiles all round.
The traffic is lethal. It appears road-markings are an approximate guide, and cars will fit into any space they can (more or less). There's hardly a car that's undented, and horns are in permanent use. Indicators mean nothing, but that's okay, 'cos I've no idea how to indicate for pulling across 3 rows of traffic (fitted onto 2 lanes), and performing a random u-turn. Most roads are one-way, presumably because otherwise all the cars would just mingle together in opposite directions.
Taxis are extremely popular. They were painted black with white panels, and were generally the most beaten-up vehicles. Ancient Ladas and all sorts are in use. Many have fur-covered dashboards and danglies from the mirror. A tissue box on the dashboard is universal, and seat-belts... uncommon. Various taxis are kitted out with dodgy 'sports' extras, blue neon lights, etc. However, they seem to have totally ignored tuning the engines, which spew out plenty of pollution. Cairo has limited visibility in the daytime, good sunsets, and washing your hair will result in much grey water.
Back to taxis: Egyptian prices are unavailable to tourists, who instead resort to haggling. Haggling causes me pain, since I always end up feeling I must have got a rubbish deal. Sometimes later, I find that I have. There's always an extra 100% profit margin more than you think. Fortunately, I went with an arabic-speaker, which made life much simpler.
Of course, there's money to be made in Westerners, so you get nicely obnoxious taxi-drivers hanging around outside tourist traps, offering you taxis, at impressively extortionate (for Cairo - very cheap for anywhere else) rates. If you don't ignore them, they'll follow you, and make sure any other taxis you try to pick up know that you deserve a 'very special price'. Perhaps they'll want a commission on whatever you finally get. If you do ignore them, they'll still follow you, but not quite so far.
If you stand by the side of the road, the taxis will also be keen to get you. This complicates the other interaction with Cairo traffic: crossing the road. The basic technique involves estimating a gap in the traffic, and boldly strolling across the road. Drivers expect this, and will drive around you, as long as you keep moving. Hesitation will confuse them and could be messy. Guess what my UK-trained instincts tell me to do, in the face of speeding rust-buckets? Of course, timing the gap is difficult if half the traffic is taxis trying to pick you up. At peak time, you may have to cross the road a lane at a time, with the traffic flowing around you. Again, this is complicated by the way that flows of traffic and marked lanes have nothing like a one-to-one correspondence.
Having said all that, we didn't experience a single crash while we were there. I suppose it just goes to show that with infrequent events, perceived risk can get really screwed up. I'm sure the accident rate is many times that of the UK, but people are prepared to accept it in that situation. Moreover, people are used to that style of driving, and so expect things that would be unimaginable on English roads. One result is that cars just seem to be expected to get bashed. When parking, the 'keep going until contact' mechanism appears universally used. Kerbs are high, so that it is quite easy to scrape the underside of bumpers and so on, but people just seem to accept it.
I may sound very negative of Cairo, but these are just the aspects I found most alien, and since they're so strongly ingrained in me, I suspect I'll view anything different as somehow wrong. Having said that, I greatly enjoyed my holiday, and indeed much of what I have been ranting about. The differences were most interesting, and made the holiday worthwhile, but also oh so tiring.
Posted 2004-04-07.
Havoc Pennington has written an article on the future of languages on the open source desktop. Everyone's having their say, so I thought I would too.
I feel it's missing the point or something. He's looking towards deciding what will be the higher-level language to replace C. However, people will always want to write code in a their favourite language (or even... a language appropriate to the task at hand). This isn't just talking about possible future languages for writing parts of the core gnome system, although it may eventually move to that. It's about random external programmers who want to build on the gnome libraries.
So, gnome has a standard for linking things together: standard object files and C linkage conventions. This is fine as long as all the libraries are written in C (or can export a C API), and every language you use to create application has people patient enough to knock up bindings. This is somewhat sub-optimal.
First, these interfaces are often not naturally expressed in C. Many of them are object-based. Yes, C can be mangled to deal with this, but it is a hack. Second, interfaces can get complicated. If you want to pass things across the interface, you've got to match them up somehow. Do you want to pass things by reference? Data structures that you may then wish to traverse? Starts to look like you're opening a whole can of worms. Once you start creating libraries using higher-level languages, it starts to look messier and messier. Do you really want a library that has its own runtime system? Multiple libraries, each with its own runtime?
I think this is where .net starts to look good. It defines a way of linking things together, at a much higher level than C. It provides a way to pass complex data structures around. It provides a runtime environment, so that garbage collection and so on doesn't have to be reinvented all over the place. The unmanaged code aspects make it possible to support C-like code. Stuff like IKVM makes it possible to run Java on .net, something that looks rather more painful the other way round.
.net is obviously no panacea. It is good for Java and C#-style languages, and can cope with C and most of C++. Fundamentally, it's only good at, what, the languages used for 95% of industrial programming. Functional languages, for example, get ugly. But what do you expect? Trying to write libraries with C interfaces in an obscure language, complete with runtime and bits of marshalling could be pretty horrific too. Moreover, it's still more or less possible - people have done it for a variety of weird and wonderful languages. And if everything gets too hairy, non-CLR languages could be bound to CLR interfaces just as C libraries are bound to non-C languages, except we should hopefully have a more expressive interface.
The CLR may not be the solution, but I think it's worth thinking about how you want to be able to link together libraries from a selection of languages. C is a solution, but a fairly weak one. I'm sure there are reasonable approaches involving IDLs, and marshalling, but it can get very complicated. And it's still not going to be as good as having a common linkage format and interfaces that actually say what they mean and use objects.
I fear that people mistrust the CLR as a MS invention. The Open Source community, often quick to deride companies as having Not Invented Here syndrome could be falling into the same trap. MS are heavily betting on .net. It gives them a common compiler back-end, and a single point to concentrate their optimisations on. They need not worry about upcoming platforms. Hello AMD's 64-bit extensions, hello ia64. And if they really want to, goodbye ia32. There are some very cool tricks that using something like .net allows. You can sandbox untrusted code, but have it linked directly to trusted code. Debugging can use a common infrastructure, and the extra type information should make life less painful. You want to write a compiler? No need to worry about optimising code generation. You want to write an interpreter? Emitting CIL should give you a free cross-platform JIT.
Having said all that, real-life .net will probably turn out to be irritating. Things won't work out right. People don't like the idea of using the CLR and playing catch-up to Microsoft. But if no similar system is used, we won't even be playing catch-up. The current compile-link-execute model is 70s technology. It's good 70s technology, but things have moved on. I think the VM stuff is mostly a red-herring, since executables can just be compiled to native code (even if it's described as a JIT 'cache').
We need a way of linking code from different languages together that doesn't suck. A runtime that prevents each high-level language from reinventing the wheel would be useful. In short, this is what the CLR provides, and this is what I think gnome needs. If the CLR isn't adopted, it should be because something technologically better is.
Posted 2004-03-18.