I’ve had some fun creating plots in gnuplot lately, and happened across one of those “it works everywhere but not for my setup” type problems. Here’s my setup/aims:
using Mac OS X 10.6 and gnuplot 4.6
generate plots to use in LaTeX, i.e. either PDF or EPS output
change the standard ratio of the plot canvas from around 4:3 to “a bit wider and less high” (in order to fit the standard width of my 1 column LaTeX text without taking up half of the page)
have no or only little unnecessary whitespace around the plot
This seems to be impossible in gnuplot, as the usual (since gnuplot 4.4 or so) way to change the plot and canvas size “set size …” works differently for the postscript terminal. You can change the plot size or aspect ratio, but not the canvas size, which results in lots of whitespace around the plot, see the picture below where the blue frame marks the bounding box of the resulting eps.
This is obviously not great, but there seems to be now way around it other than manually removing the whitespace, e.g. in Preview. After some digging, however, I came across the eps2eps tool (happened to be installed on my machine already) which “fixes” the bounding box and removes unnecessary whitespace. Unfortunately, for some unknown reason, it also rotates the resulting image by 90 degrees clockwise and there are no options to rotate or prevent rotation of the output. Ugh.
After some more digging, I found yet another tool, eps2pdf, which converts an EPS image to PDF – and happily accepts a rotation parameter. I simply downloaded the EPS tools package and copied the three files into /usr/bin and made them executable to run them. Et voila, I’ve got a 3-tool-pipeline for generating margin-less plots – see the resulting graphic below.
In the plot file:
set size ratio 0.6
set terminal postscript enhanced color
set output 'frequency.tmp.eps'
My script (plot.sh) for generating the PDF output:
I just installed Raspbian for the second time on my Raspberry Pi (I needed the SD card for my digital camera a while ago…) and had some troubles at first getting the SD card to work on Mac OS because of a “Read-only file system” error. Here’s some instructions, in case you happen to come across the same problem!
Unzip the file you’ve just download – you will get a file with the extension .img.
Make sure the little lock on the SD card is in the “unlocked” position.
Plug your SD card into your card reader.
Check if the SD card is writable: Open the “Disk Utility” on your Mac and click the SD card, then go to the “Erase” tab. If the “Erase…” option (see image) is grayed out, the SD card is not writable. Also, if you try to delete or modify any existing files on the SD card, you may receive a “Read-only file system” error.
I don’t know exactly what causes the “Read only file system” problem, but fortunately I found a solution online:
Plug in the SD card and go to “System Preferences” > “Sharing” on your Mac. Select “File Sharing” and then the little + sign under “Shared Folders”. Here, you can select the SD card (in my case it’s named “CAMERA”) as a shared folder (see image below). The SD card will now be writable!
Close the System Preferences and return to your Terminal. I got the following instructions from Dag-Inge Aas’ website.
Change into the directory where you have downloaded and unzipped the Raspbian image. In my case I saved the file in “Downloads”: cd ~/Downloads
Identify the device name of the SD card by typing: df -h
The device name will probably be something like disk1s1 or disk2s1. Then unmount the disk, using the SD card’s device name if it is different from “disk1s1”: sudo diskutil unmount /dev/disk1s1
And finally, install the disk image file to the SD card. Make sure the raw disk name, that is the “rdisk1” at the end, is right. It will be rdisk1, rdisk2, etc. depending on the device name above: sudo dd bs=1m if=2012-12-16-wheezy-raspbian.img of=/dev/rdisk1
Wait for a few minutes until the image is installed on the SD card. You will then see a message right at the end.
Eject the SD card, plug it into your Raspberry Pi, and off you go!
The next stop on my travels around Europe this year was Rome. I took Latin and Italian in school and had been to (Northern) Italy countless times, but for some reason never made it all the way down south to Rome. Fortunately I had the chance to visit the city for a conference in June, and the trip turned out to be one of my favourites of 2012.
Despite being a large city, the central areas of Rome make it feel relatively small compared to other European capitals – considering there’s about as many people there as in Paris, seems a lot more walkable. Many of the streets, especially in the city centre, are narrow and despite the heavy traffic it’s generally quite easy to get around by foot (which is good, since there’s only 2 metro lines anyway and bus services in unknown cities are always a bit of a mystery to me). I stayed at a room at the ‘Roma Vintage B&B’, an apartment which is conveniently located near one of the rare metro stops, and only 20 minutes walking distance away from the Colosseum. I shared the flat with 3 other guests and a fantastic coffee machine, which made up for the otherwise lacking breakfast – well, I suppose biscuits already count as breakfast in Italy.
The first day took me right to the Colosseum – it being a Wednesday afternoon in term time, there happened to be hardly any queues, and within a few minutes a was inside what is probably one of the most famous ancient buildings in the world, fully equipped with an iPod touch as video guide. I’m a sucker for audio guides, so I paid for one when I bought my ticket, only to find that I had accidentally paid for a video guide, which the rather flirtatious Italian at the audio guide booth was more than happy to hand over and explain to me. It turned out that the video guide was actually pretty awesome, with an interactive map and little movie snippets of Spartacus playing at the right locations in the Colosseum. I also met the official Colosseum Cat which had either fallen over or just fallen asleep in the sun.
After my trip to the Colosseum, I moved across to the Roman Forum (they do a combined ticket) and spent several hours wandering around gardens and ruins of old temples on a lovely sunny afternoon, which was pretty amazing. I’m wondering what today’s equivalents to the Roman Forum – a crammed area full of temples, statues, government buildings and memorials – would be. Probably something like the Printworks. Another thing to note in Rome is that there are drinking water fountains everywhere (even on the side of roads – there was one right outside my apartment), so save your money for bottled water and just keep an eye out for a free refill.
I only just realised that I spent most of my time in Rome outdoors (well, expect for the conference days) without paying a lot, since a good number of the attractions are temples, squares, churches, or ruins thereof, which are often freely accessible. I also paid a visit to the “Torre Argentina”, a cat sanctuary located in – what else – the ruins of an old temple, had a wander round the Vatican, went up the Gianicolo hill, went on a open top bus tour down the Via Appia (organised by the conference), and visited countless churches from the past few centuries.
In the evenings, the focus shifted quickly from ancient ruins to the one other thing Italians are pretty good at: Food. Luckily we even had a native Roman tour guide – well, one of my fellow PhD students – who was happy to take us to some of the nicest pizzerias around. Having said that, they’re probably all nice. We gatecrashed a pizzeria opening where I had some of the most amazing pizzas I can remember eating (and I mentioned I’ve spent practically every summer of my childhood with my family in Northern Italy), went to another pizza place where we placed our orders on iPads, visited what is said to be the best tiramisu place in Rome – twice (man, that pistacchio tiramisu… THAT PISTACCHIO TIRAMISU!!!), and went to a family run trattoria (this time without our Italian speaking guide) where we communicated with the incredibly friendly host via gestures, pointing, random words, and a lot of laughter.
Am I glorifying Rome a bit? Maybe. It’s quite dirty. We are actually surprised to see how much rubbish there was around and how run down some areas look. The traffic is insane – in order to cross a street, you basically just walk and hope for the best while cars are swerving around you. Some people are rude and give you funny looks when they notice you’re foreign. But then again, I get funny looks all the time. But, well, I can live with that. Can I come back to Rome now, please?
Part 2 in my “European Travels” series is the most expensive city I’ve ever been to: Oslo, the capital of Norway.
I travelled to Oslo in April 2012, as part of a spontaneous “let’s do something fun” trip with my best friend, which took me from Manchester to Berlin to Oslo and back to Manchester within less than a week. The first thing I noticed on my way to Oslo was the ubiquitous wifi. Have you ever made a FaceTime call on a plane, showing your friend who’s sat on his desk in Berlin a view of the landscape from 10,000 ft altitude? It’s possible with Norwegian Air – they offer free wifi on their flights, which is not particularly useful on short flights but definitely fun to play around with. Next stop was the shuttle train from the airport to Oslo city centre with more free wifi, and our hotel with, yes, more free wifi. We stayed at the Comfort Hotel XPress which was cheap and cheerful, and by cheap I mean “real cheap”, not just “cheap for Oslo cheap”.
Oslo is a lovely little place and absolutely perfect for a short city trip. We went to quite a few places during our stay: The Viking Museum, which I really enjoyed, the Jewish Museum, the modern art gallery, and my favourite, the Vigeland Sculpture Park. Since there is so much water around Oslo, water transport is simply part of public transport, so we took a boat across the fjord to Bygdoy, a peninsula in the west of the city which houses several museums. Another nice part of Oslo is Grunerlokka, a trendy quarter with plenty of restaurants and bars, alongside some reasonably priced cheap eats.
I even managed to find some vegetarian food, which, given that it’s all about fish and seafood in Norway, was fairly difficult. HappyCow pointed me to “The Fragrance of the Heart” just behind the town hall, a nice little cafe that serves affordable vegetarian food. I can very much recommend the omelette and their quiche in combination with several pots of hot coffee!
If you’re visiting Oslo be prepared: It’s expensive. Not just a bit pricey, like, say, Paris or London, but everything is practically twice the price of what you would pay elsewhere. So if you’re not on a Norwegian income, eating out or having drinks hurts a little – after the first day we just stopped converting prices from Norwegian crowns into Euros, which made us a lot poorer, but also a lot happier.
I’ve just installed the Stardog RDF database for the first time (painless. Download, unzip to some directory, set an environment variable, done. TAKE A NOTE, triple stores.) and on server startup I was greeted with this wonderful peace of ASCII art:
You’ve just won me over.
Edit: Downloaded, installed, and loaded one of the example files with Stardog in 2 minutes. User-friendliness win. Now, if you could perhaps explain what that mysterious “-t D” flag is…
I travelled to Galway (Ireland) in early October for the First International Workshop on Debugging Ontologies and Ontology Mappings, or WoDOOM 2012 in short, which was co-located with EKAW 2012. With around 20 attendees and 4 speakers, the half-day workshop was fairly small, but it was definitely an interesting start for, hopefully, more workshops to come.
The invited speaker was Bijan Parsia, who gave a rather awesome talk laying out the landscape of what we generally refer to as ‘errors’ in OWL ontologies. We can categorise errors into logical and non-logical errors. Logical errors include the ‘classical’ errors such as incoherence and inconsistency, wrong entailments, missing entailments, but also less obvious problems such as tautologies and ‘concept idleness’. Non-logical errors are problems that we might not think of straight away when we talk about debugging; these include wrong naming of concepts and properties, structural irregularities, and performance problems.
The first research paper by Valentina Ivanova, Jonas Laurila Bergman, Ulf Hammerling and Patrick Lambrix was dealing with the debugging of ontology alignments based on an interesting use-case (ToxOntology, an ontology describing toxicological information of food). The main idea was to validate mappings based on the structural relations of concepts in the ontology. Valentina also demoed a prototype of the RepOSE tool which nicely combines the “accept/reject” task of debugging alignments with a graph-based user interface (see screenshot below), making the job slightly less painful.
Next up was Tu Anh Nguyen from the Open University who presented her work on justification-based debugging using patterns and natural language. The approach taken to measuring the cognitive complexity of justifications is very appealing: They first identified a set of frequently occurring patterns in justifications which were sub-sets of justifications of maximally 4 axioms, using justifications from around 500 ontologies. The 50 most frequent patterns were then translated into natural language and evaluated using a mechanical turk style web service by presenting the ‘rule’ to a user, then asking them to decide whether a given entailment followed from that rule. This is quite close to what we did in our complexity study, but with the advantage that the natural language rules could be presented to a much wider audience than our DL/OWL Manchester syntax patterns. The result of the user study was a ranking of the most frequent rules, which can be used to rank the complexity of OWL justifications – at least in their natural language form. It would obviously be interesting to find out whether the complexity measure translates directly to Manchester syntax as used in Protege, for example.
And finally, I presented my paper “Declutter your justifications“, which deals with grouping multiple justifications based on their structural similarities. My talk followed on quite nicely from Tu Anh’s presentation, as she basically solved the problem of “obvious proof steps” using her natural language approach to testing justification sub-patterns. The slides for my presentation are available here.
In summary, this first WoDOOM turned out really well, and the papers presented were very interesting. I also have to admit that I was very pleased with the rate of 75% female speakers / first authors, which is pretty awesome. I’m hoping that we’ll have some more papers next year, as at least two had a very similar approach to debugging (justifications!), especially given Bijan’s highlighting other errors which are currently not considered in most debugging approaches.
To those who argue programming is an essential skill we should be teaching our children, right up there with reading, writing, and arithmetic: can you explain to me how Michael Bloomberg would be better at his day to day job of leading the largest city in the USA if he woke up one morning as a crack Java coder? It is obvious to me how being a skilled reader, a skilled writer, and at least high school level math are fundamental to performing the job of a politician. Or at any job, for that matter. But understanding variables and functions, pointers and recursion? I can’t see it.
…
An interesting blog post by codinghorror.com’s Jeff Atwood on why not everyone should learn to code. I generally agree with the points he makes (don’t learn to code for the sake of it, and don’t do it for the “fat paychecks”), but I also believe that even just the simplest attempts to learn how to code will give people insights into how computers work. This, in turn, will take away some of the myths surrounding computers (“don’t touch that! It will break!”) and maybe lead to a better understanding of what’s going on inside those boxes – we need not only more good programmers, but also digital literacy of the wider public!
I left the house. Oh yes, I did. I got out of my pyjamas, brushed my hair, and left my dark, dingy, and damp thesis writing cave, not only to go to the shop and buy some milk or a huge box of caramel short breads, oh no, I went into the centre of Manchester and spent a whole (GASP) 12 hours there. And it goes a little something like this:
After a quick (the eating, not the waiting) breakfast at Trof’s new place Gorilla on Whitworth Street West (ex The Green Room and is it just me or is Trof slowly taking over every single empty bar space in Manchester seriously this is a lot of Trofs just for one city right I mean the first couple were nice and then the Deaf Institute seemed like a good addition but now they’ve got the Sal and Gorilla and that huge place on Peter Street and WHEN WILL IT STOP?) we made our way into the depths of the Northern Quarter to hang out with some indie kids at “A Carefully Planned Festival”, which I had wrongfully titled “A Fairly Well Organised Festival” when mentioning it to friends the day before.
The first band on was “This Town Needs Guns” which is kind of a funny band name if you imagine they’re from Manchester, but it turned out they were from Oxford and I don’t think Oxford ever had the nickname Gunsford, so I guess that’s okay and they might in fact really need some guns in Oxford. Who knows. Oh yeah they play math rock which in this case is just another name for instrumental guitar music and those two songs that I managed to hear were actually quite good. The audience at 2022nq definitely seemed very excited, despite it being 1:52 pm on a Sunday afternoon. Not that you can’t get excited about a band at 1:52 on a Sunday afternoon, but, well, you know what I mean. I’ll stop now.
A short walk down the road we gatecrashed the Bad Language poetry session at the Castle Hotel where my favourite weirdo writer Fat Roland(bottom third pictured above)happened to be reading bizarre tweets by David Cameron (“David Cameron”), an epic diary of a failed marriage in list form, and other ramblings, followed by the strangely enticing Jemima Foxtrot who half* sang half* acted half* recited slam poetry about her life as an actress, and topped by the stupidly amazing duoLes Malheureux, consisting of the writers Sarah-Clare Conlon and David Gaffney, who entertained us with a rather brilliant performance of poetry reading set to a background of playful organ tunes. Yeah. That.
After the Bad Language session, we settled for a game of scrabble just round the corner at Nexus Art Cafe, which was packed with people sinking into sofas while eating cake and drinking tea. My kind of rock music festival. Having moved our armchairs to make room for Nexus’ faithful and utterly off-tune piano, we watched some of Ajimal’s set who happily alternated between his guitar and the piano. In combination with the still ongoing scrabble war, the arm chairs and the cozy atmosphere at Nexus, this made for a rather marvellous time. But even without scrabble and cake, he’s pretty good. You should listen.
The evening was concluded by a birthday dinner at Jamie’s Italian on King Street (recommendable if you want to eat a scrotum-shaped deep fried courgette flower stuffed with tons of ricotta. It’s an experience.) and half of Tall Ships‘ set, which was kind of okay but oh whatever, guitar bands, eh, before it was back to the cave for me. Thanks, Careful Planners. I enjoyed this festival quite a bit.
You must be logged in to post a comment.