fivemack: (Default)
Planning a cycle route out east of Cambridge, I notice that a field in the vicinity of Fulbourn, famed site of Cambridge's mental hospital, has been carved into the likeness of some cyclopean cephalopodic deity.

http://maps.google.co.uk/?ie=UTF8&om=1&z=18&ll=52.17686,0.220483&spn=0.002411,0.003449&t=k
fivemack: (Default)
So, I've inserted a picture, and carefully set it to the right size and position.

I then discover it's the wrong picture.

Is there any way of replacing the picture with a different file (of the same aspect ratio, and in fact probably the same size to within pixels ... these are all coming out of a complicated make-orchestrated pipeline with perl scripts and gnuplot and ghostscript in it, on a Linux box which doesn't run powerpoint, and being carried across the room many times on a memory stick), keeping the size and position?

At the moment I've been carefully remembering the size and position, deleting the old picture, inserting the new one, and re-entering size and position; by the thirty or fortieth repetition of this, the calm tranquillity instilled in me by infinite turkey over the festive period is really no longer to be seen.

I have spent three days producing this blasted presentation. It's only 20 slides long, but has filled the muscles of my shoulders with stress much more than previous three-day episodes of coding up complicated analyses of the neighbourhoods of metal ligands across the entire protein structure database in C++ managed. I'm not giving it, nor even attending the conference it's being given at!

But it is the weekend now. The Met Office says the entirety of England will be afflicted with violent gales and strong rain, so I won't be able to take my new tripod to photograph ducks at Wicken Fen; I think I will mostly hibernate, though I need to venture out of the house to buy a new microwave. I have five and a half David Attenborough DVDs to watch, and comforting books to read, and there is lots of curriable chicken in the freezer and much curry sauce in the fridge.
fivemack: (spiky)
What I want: a subroutine footle such that, if you call footle(a,b) twice with the same a,b, it does nothing the second time

What I did:
use strict;
sub footle
{
  my ($a,$b,%done) = @_;
  my $concat = $a.$b;
  if ($done{$concat} == 0)
  {
    print "footling $a $b";
    $done{$concat} = 1;
  }
}

my %isdone = ();

footle("bootle","bumtrinket",%isdone);
footle("bootle","bumtrinket",%isdone);

But this doesn't work because parameters are passed by value.

But if I call as footle("bootle","bumtrinket",\%isdone), which passes isdone by reference, it still does the footling twice.

Even if I put $_[2]=%done before the end of the subroutine, it still does the footling twice.

And if I put print join "*",(keys %done); at the start of the subroutine, it says HASH(0x8188110)footling bootle bumtrinket

So how do I really pass the parameter by reference, as if I'd said void footle(int a, int b, set<string>& done) in C++?
fivemack: (Default)
My .emacs file contains the line

(set-default-font "7x13")

and indeed whenever I load a file into emacs, it comes up in 7x13.

But if I do C-x 5 2 to get another emacs window, the file in that window appears in a much larger and uglier font with inelegant serifs. How do I really set the default font?

[note: I don't run emacs-client, I edit files with 'emacs foo' on the command-line, so often I have lots of separate emacs processes; also, by 'window' I mean a window-system window rather than whatever emacs's internal jargon 'window' means]
fivemack: (Default)
It's christmas-card time; I have a great pile of blank christmas cards, a long list of people to write to,

and the sudden realisation that most of the people I know, I know on-line; they move a fair amount, and I don't know their current addresses. I'm not really sending cards to people in Cambridge; mostly I meet them at parties and can give them chocolate-coated toffee, which seems to me tastier and more companionable than a Christmas card.

[livejournal.com profile] huskyteer, [livejournal.com profile] taimatsu, [livejournal.com profile] antinomy, [livejournal.com profile] annafdd: I'd like to send you cards, but I'm incompetent and haven't got your current addresses. Could you tell me at tom@womack.net? I promise to write them down in AddressBook.app so I don't have to bother you next year.

It's too late to get cards to the Americas in time for Christmas, I think, though I've sent some anyway: [livejournal.com profile] darcydodo, I'm sure I ought to have your address but I can't find it.

Aha!

Dec. 15th, 2006 05:00 pm
fivemack: (Default)
I know why the older proteins described in the PDB file format end each line with the PDB code of the compound and the number of the line in the file.

It's so, at the dawn of time when you carried around protein structures in boxes of punched cards, you could sort on the field at the end of the line and get the cards back into order if you dropped the box.
fivemack: (Default)
My middle brother James had his DPhil viva at Oxford this afternoon; he passed! And with typos but no corrections, which is more than I managed.

The thesis is on W H Auden and translation; James also writes poetry, and book reviews fearsome in attack and erudition alike. He's a good translator, too; if you have a quantity of Russian which would suit your purposes better in English, maybe you can hire him.
fivemack: (Default)


The oscillations of period 2 around the really smooth moving average look like an inadequately damped feedback system; I wonder what sort of thing would work as a damper?
fivemack: (Default)
This weekend, I have bought stuff for cleaning camera lenses, a useful box for storing documents in, a giant stainless-steel clothes drier, stuff for cleaning toilets, cakes of purple and of yellow soap from Lush, food for the week and a bottle of relatively indelible black ink.

I have transferred about three strata of documents from my table to the useful box, cleaned my camera lenses, put away two loads of laundry, cleaned the toilet that the letting-agency complained about in the inspection last Friday until it gleams, festooned the drier with clothes from a third load of laundry, filled both my nice fountain pens and covered my fingers with ink, and given myself a pleasant lavender fragrance with the purple soap.

Also went to [livejournal.com profile] beckyc and [livejournal.com profile] ewx's parties, discovered that my flapjacks are received even better if I put far too few oats in them and end up with large slabs of chocolate-coated toffee, chatted to [livejournal.com profile] acronym about music until 3:30 on Sunday morning, and had a lovely Sunday lunch with my parents and brothers.
fivemack: (Default)
My brothers, playing Frisbee while standing on rocks on the black basalt beach of Vik in southern Iceland, a small fraction of a second before a gale-driven breaker of unusual size knocked James into the North Atlantic.



They're fine, though the North Atlantic in Iceland in December is not the warmest ocean of the Earth, and James's trousers were soaked; we made a ten-minute mercy drive to a purveyor of large furry beach towels and wrapped his legs in one of them, instead.

It's a good beach, if a tad over-dramatic



Something of a change from this time last year:



(near Ubud, Bali, Indonesia; thirteen thousand kilometres and about thirty centigrade away)
fivemack: (Default)
Mars Global Surveyor, unsurprisingly given its name, surveyed the whole globe of Mars in 1999.

After this, it still had plenty of fuel, so looked at a wide variety of parts of Mars in greater detail; enduring further, and the scientists having run out of really exciting parts of Mars, it was returned to surveying, and covered 30% of the whole globe of Mars before breaking down last month.

It's not too difficult a job for a computer to check what's changed; sediment seems to have been deposited in various gullies, which are presumably now very high up the list of Places People Want To Visit, but being gullies on the steep sides of craters are a bit difficult for current robots to get to.

And there have been 20 new craters formed, including one about fifty metres in diameter with a debris trail half a kilometre long

http://mars.jpl.nasa.gov/mgs/gallery/20061206a-impacts.html#allimages

It would be moderately inconvenient if a fifty-metre hole appeared randomly on Earth every year or so, but meteorites that size burn up in the atmosphere, with a flash of the energy of a modest atom bomb but far enough up that it's noticed only by such organisations as interest themselves in knowing with alacrity whenever anything atom-bomb-like has happened, and admitted to the public only when a functionary at such an organisation has nothing better to do; thank Boreas, Zephyr, Notus and Eurus for arranging Earth an atmosphere a hundred times denser and more meteorite-proof that Mars's.
fivemack: (Default)
Specifically, a Lacie Firewire external hard drive case.

You'd probably want to put an ATA133 hard drive in it; it has rather too many gnawable little wires to be an adequate case for carrying around fancy mice, it's a bit too small for a hamster, and has too many air vents to be used for displaying a collection of multi-coloured sands.
fivemack: (Default)
The harbour is full of these eider-ducks


The lake in the city centre was yesterday full of these elegantly raffish waterfowl

and I'd like to know what they are; they were gone today.

We got up at 1pm, met up with James's friends Brendan and Lauren, and breakfasted on lobster soup and minke-whale kebab in the self-proclaimed Best Lobster Soup Shop In The World, before wandering around the town some more




The sun set elegantly over the sea, we headed to a supermarket and got the makings of cup-cakes, and plan for an evening involving mostly baking.

Reykjavik

Dec. 3rd, 2006 12:24 am
fivemack: (Default)
I'm in Iceland, visiting my brother James who's been here learning Icelandic on a Government scholarship since the beginning of September.

Got in yesterday evening, the light dying as the clouds broke to reveal a landscape of lava with a thin ribbon of street-lights across it, and the bright lights of the big city of Reykjavik shining off low cloud; Thai-style lamb stew for supper.

Today we've wandered around the city; most of the waterfront is working docks, but there's a bit of it you can walk along, with a steel sculpture inspired by Viking longships


and a superb view across blue water to marvellous snowy stratified mountains in the distance.



I've indulged my inner meerkat with a trip up the cathedral tower, swum in a geothermally-heated pool, lounged under the stars in geothermal hot tubs, and taken very sulphurous geothermally-heated showers; it's great to be with both my brothers, I think this is the first holiday I've been on with both of them and without our parents. We've cooked, conversed, not killed one another yet, met James's colleagues from the five corners of Europe and the top and bottom of North America, and drunk mediocre Icelandic beer at £4.50 the pint, or a positively reasonable £3.75 in the student bar.

(Ben and I, by the sculpture)

The hope, if we all wake up at sensible hours tomorrow, is to rent a car and go down to the south coast; the puffin chicks left months ago, but the mountains should be there in unlessened splendour.
fivemack: (Default)


Draw a square; in the centre of it, draw a circle. In the largest remaining area of the square, draw a circle. Carry on until you run out of pixels; in the posted image I ran out of pixels fairly early, in the thing I've linked to you'll find the first 128 layers but you'll be able to see the smaller ones only if you've got an SVG editing application. Be warned that rendering images this complex makes Firefox rather lethargic, and may require a plug-in on lesser browsers; don't worry, it hasn't crashed.

If you set up the problem in a computer-algebra package, you find that the centres and radii of the circles, which are defined by sets of three simultaneous quadratic equations and so you might expect to live in an ever-deepening hierarchy of extension fields, are in fact all defined over Q(√ 2); the denominators don't even get too hairy, the largest in the first 128 layers is 257762.

If you don't have magma, you might want to see the log of the run; the layout of the log is obvious from the source code. I know the code's deeply inefficient, I'll need to improve that if I want to go more than a thousand iterations deep, but I don't know of languages which have both a decent Gröbner-basis library and reasonable handling of linked lists and priority queues. Writing priority queues in Magma is probably less painful than writing Gröbner-basis code in C++, but neither's very appealing at 1am, nor my first choice of entertainment at more reasonable hours.

If anyone's got the facility to print images onto large-poster-sized paper in a way in which millimetre-high letters are readable, I'd be interested to see what the highest-depth version I can generate looks like as a physical object; had I rather more energy than I think I do, I'd at least write a Java applet where you could zoom in and pan around ten thousand layers deep.
fivemack: (Default)
Here are some pretty pictures of proteins and electron density which I generated today.

http://www.globalphasing.com/~twomack/radx/

They have little to do with what I actually do all day, but quite a lot of that is commercially sensitive, and quite a lot of it is deeply esoteric of interest only to crystallographers, and quite a lot of it is throughly boring and involves debugging reams of shell-script, and once you've removed those three parts there's little left.

The sticks are protein structure (green is carbon, red is oxygen, blue is nitrogen, orange is sulphur); Didier Nurizzo at the ERSF laboratory in Grenoble measured by X-ray diffraction the amplitudes of the Fourier components of the electron density in a crystal of the protein thaumatin, Global Phasing's software figured out the distribution of the electron density in space and the placement of the atoms within the electron density, starting from a model of thaumatin measured in a different-shaped crystal by someone else ten years ago, and the green chicken-wire clouds represent the portion of the electron density that our refined model of the atom placement doesn't explain.

Specifically, we measured electron density before and after radiation damage, and then fitted a model where a bit of the protein we'd expect to fall off with radiation exposure wasn't present; so you'd expect to see a bean-shaped blob at the end of the horizontal green stick in the centre of each image with 'ASP' or 'GLU' in the left column ('TYR' was for a different experiment, and is here mostly because the phenyl group looks nice), and you'd expect the blob to look skinnier in the right-hand image where the radiation has made the bit of protein fall off -- in fact, I was expecting the blob to go from bean-shaped and attached to the stick to medicine-capsule-shaped and separated from the stick, but that doesn't seem to have happened.
fivemack: (Default)
If I reach down with a camera and take a flash photo of the gas meter, I can read the figures much more easily than if I bend down and use my eyes; also, I have a permanent record.

So now I know that it takes 1.15m^3 of gas, for which I pay 50p, to heat a languorous warm bath [1]. Possibly I need to get a better deal from my gas company.

Time for some nostalgic Elementary Chemistry. Natural gas is basically methane, molecular weight 16; I hope I can assume the cubic metres I'm charged for are of 1-atmosphere gas, so 0.024m^3 per mole, so 1.15m^3 is 48 moles, or about 750 grams.

Methane yields 900kJ per mole when burned, so 44 megajoules, which is enough to heat 100kg of water by, ah, 4.2kJ/kg/C, about 100C ... since I am not more thoroughly boiled than a lobster, I feel there's an inefficiency somewhere. I've no idea how much water there is in a languorous bath; my water is unmetered and my curiosity doesn't extend to filling the bath using a measuring-jug, and besides I tend to run some water out and run hot water in as the bath cools.

I've contributed 48 moles of CO2 at 44 grams per mole to the atmosphere, or rather over two kilos; offsetting this at a rate of £9 a ton costs about 2p per bath or three pounds a year, which makes me wonder why the gas company doesn't just offset all its CO2 emissions, produce an environmentally sound press release on recycled paper, and raise prices 5% to more-than-cover it.

[1] I cannot help thinking that I've misspelled that, and sung the praises of a warm bath full of large grey aggressive monkeys of the sort that haunt Indian railway stations. More, or less, fun than a barrelful of monkeys?
fivemack: (Default)
I bought an external hard drive on 8 November 2004.

Trying to do a backup to it this evening, I find that it has stopped working.

Looking at the place I got it from, I discover that its warranty was for two years.

Hard discs cost so much more than hamsters that you would hope they would live longer, but it is not to be.
fivemack: (Default)
Last weekend Dan and I went to Hull, where Chiara, who I met in Nottingham some years ago and with whom we both must have drunk two-thirds of an ocean of coffee, is now ensconced in an amazingly stylishly furnished house and a lectureship at the university.

We visited the aquarium which is Hull's major tourist attraction.



We made curry (Dan's contribution) and apple crumble (mine) for eight, and had a cheerful party, with various fanciful answers to Chiara's question of why sharks have two penises and many sophisticated and intellectually stimulating games.



And we went walking along the coast to the lighthouse at Flamborough Head.

Larger photos follow )

March 2024

S M T W T F S
     12
3456789
10111213141516
17181920212223
24 252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 3rd, 2026 12:05 am
Powered by Dreamwidth Studios