[ Content | Sidebar ]

Archives for May, 2010

Kingston, Richmond, Kew

May 29th, 2010

It’s wet and miserable this weekend but last week it was exceptionally sunny! I’ve just realised I forgot to post my photos from my wanderings last Sunday when the weather was at its nicest.

I’ve been slowly making my way along the Thames Path and the next segment is from Kingston to Kew. This is a very pretty part of west London, and Richmond is particularly attractive. Unfortunately it costs a small fortune to live in this part of the world.

Giraffify

May 22nd, 2010

A few years ago blodgett and I developed a useful tool for visualising what would happen if you grafted someone’s face onto a giraffe. We implemented this ground-breaking tool in GIMP script-fu and promptly forgot about it. I only rediscovered it recently when clearing out my home directory. Here is the program’s best guess at what our beloved leader would look like were he a giraffe:

In the process of scraping off the bit rot from giraffify I remembered why we didn’t develop it further: although script-fu is joyous Scheme the interface to the GIMP is aggravating to say the least. Perhaps this is why they now have Python-fu.

If you want to perform your own giraffification simulations you need the following files:

  • giraffify.scm – place this in ~/.gimp-2.6/scripts
  • giraffe.jpg or another picture of a giraffe – place this in your home directory or GIMP working directory

To use, open your source image in the GIMP, select the “free select tool” and mark the border of the target face. Then go to “Script-Fu” then “Shiny” and the “Giraffify” and behold the startling results of giraffification!

Budapest

May 22nd, 2010

Final bit of holiday blogging! After Bratislava I went to Budapest. Although it’s not actually very far the journey seemed to take an eternity. Still, it was quite fun as the train had retro compartments and the route skirted the bank of the Danube most of the way which was quite pleasant.

While the weather had been nice and sunny for most of my trip, it all went downhill when I got to Hungary and rained most of the time. This was doubly unpleasant as I was there on a Monday when most museums are closed. However, I did manage to visit two outdoor museums: the “memento park” is a collection of salvaged communist era statues plonked on some scrub-land on the edge of the city, and the “MAV nostalgia park” which is the official museum of the Hungarian state railway. Both were OK, but would have benefited from captions or a guidebook or something. The MAV park has a fantastic logo:

I think this really captures the aesthetic I’m aiming for with TrainGame! Anyway, here’s the final set of photos:

Bratislava

May 16th, 2010

Next I headed to Bratislava in Slovakia. I really like Bratislava: it’s a bit like Prague or Budapest but quieter and more compact. There’s a castle, a bridge with a giant UFO on top, and a really cute old town. It’s also really easy to get a bus out to the countryside where there’s another castle. It even has a TV tower but alas I didn’t have time to visit it.

The hotel I stayed at, Hotel Kyjev, is a glorious/monstrous Soviet construction which proudly boasts of the “retro experience” of staying somewhere not renovated since 1972. It is also epically cheap. Perhaps for the same reason.

Speaking of communists, I saw some real life ones while I was in Bratislava on Labour day. Sadly, they were a bit disappointing. It would be generous to say there was 100 of them, and the average age was perhaps about 60. They did have some rather good banners which they waved around for a bit while a rotund man in a red T-shirt held forth on the subject of kapitalizmus. After he was done they all applauded, rolled up their banners, and went their separate ways. Not going to spark world revolution any time soon methinks.

When I was leaving my train was delayed. Not, I think, an uncommon occurrence: Slovakian trains are cute but trundle along at their own ponderous pace. I saw one train stop and a large man in an orange boiler suit got out and began bashing it with a hammer; then he got back in and the train left. Anyway, it was lucky my train was delayed or I wouldn’t have noticed this amazing mural in the hall of the train station depicting the achievements of socialism:

Here’s another collection of photos:

Salzburg

May 13th, 2010

After Munich I went to Salzburg in Austria. It was a very nice trip with mountains and such like. By far the best thing about Salzburg is its castle which I think is the best example of a castle that I have ever had the pleasure of visiting. Lots of pictures of it below.

Also somewhere near Salzburg is the “House of the Watchmen of the Cabbage Plants” according the the castle tour but I didn’t find out exactly where. Pity, seems like this would be an excellent tourist attraction. Also, one of the bishops who built the castle had a turnip on his coat of arms.

After Salzburg I went to Vienna briefly but I don’t seem to have taken any pictures.

Munich

May 11th, 2010

After Berlin I went on a train to Munich. Even on the zoom zoom ICE3 train it takes nearly six hours so I stopped off in Leipzig for a while. Leipzig was OK: it has a nice old town centre but the buildings round it are a bit grey and unloved. Also didn’t help that it was intermittently raining.

Munich itself was quite nice: some really good museums, a nice park, and little dancing clockwork people. Here are the photos I took:

Cute objcopy hack

May 7th, 2010

I learned a useful trick today for embedding arbitrary data in an ELF executable. This is an easy way bundle RAM disks and other resources when you’re running on bare hardware.

The first step is to turn our binary data into an ELF object file:

echo yahyahyah > yah
objcopy -I binary -O elf32-i386 -B i386 \
    --rename-section .data=.yah yah yah.o

The -I and -O mean we are converting from raw binary to our target format elf32-i386. The -B option sets the architecture field of the output file: this is required by ld. By default the binary data is placed in the .data section; --rename-section changes this to a name we can refer to in our linker script. You can omit this flag if you don’t care about the layout of your executable.

nick@pickle:~$ objdump -x yah.o 
 
yah.o:     file format elf32-i386
yah.o
architecture: i386, flags 0x00000010:
HAS_SYMS
start address 0x00000000
 
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .yah          0000000a  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, DATA
SYMBOL TABLE:
00000000 l    d  .yah   00000000 .yah
00000000 g       .yah   00000000 _binary_yah_start
0000000a g       .yah   00000000 _binary_yah_end
0000000a g       *ABS*  00000000 _binary_yah_size

You can see objcopy has created three symbols which we can use to access the data at runtime like so:

extern void _binary_yah_start, _binary_yah_end;
extern void _binary_yah_size;
 
void *yah = &_binary_yah_start;
size_t yah_size = (size_t)&_binary_yah_size;

By renaming the output section we can place the data wherever we like using a linker script like this:

.yah : AT(some_address)
{
    *(.yah)
    . = ALIGN(4096);   /* Optional */
}

What fun! Hopefully someone will find it useful.

Syncing SanDisk/GMPC cover art

May 5th, 2010

Do you have a SanDisk MP3 player? Do you use GMPC? Do you read this blog? I suspect that set is very small but if you are in this demographic here is a treat for you: a Ruby script to copy the cover art downloaded by GMPC onto your SanDisk device.

Here it is: sandisk-cover-sync.rb

Just run it with your device mounted under /media and it will figure out the rest.

It should be easy to hack to work with other devices or Amarok, etc.