Sunday 30 June 2013

A Monster in the garden

There are many beetles in this world but this particular monster was in our back garden when we got back from our holiday last week.

It’s some kind of stag beetle although I’m not sure which species - there are a lot of them. I’m sure in some countries it would be considered a tiddler but for a British bug it was pretty big. Look at the mandibles on that bad boy!

Friday 28 June 2013

A Grand Day Out at Dublin Zoo

When we lived in Dublin, Dublin Zoo was always one of our favourite places to go. Membership is pretty good value and you don’t have to go many times to make it financially worthwhile, not to mention the fact that the money is going to a good cause. Being members also makes a trip to the zoo more enjoyable, I feel: it takes away the pressure to see everything in one trip and encourages more visits. It was therefore great to visit the zoo this week during our trip to Ireland.

Piglets

This time, we went with my niece and nephew (aged four and two), so the animal priority list was shifted slightly and we headed to the Family Farm first. Like a lot of the zoo, this has changed since our last visit (2007, maybe?) and features fewer guinea pigs and bunnies in favour of more real pigs and other farm animals - including some rather cute piglets (right).

Next up (on my priority list) was my perennial favourite, the Red Pandas. Whilst they eat bamboo and come from China, Red Pandas are actually more closely related to racoons that the Giant Panda, which is a bear. (Their lineage diverged from Giant Pandas somewhere in the order of 40 million years ago, versus 30-35 mya with raccoons and skunks.) Red pandas are a bit less fussy about what they eat than their fellow Carnivora namesakes and, unlike Giant Pandas, do also eat meat (birds, mammals and eggs) although they always look far to laid back to actually hunt for anything, so I am guessing this is primarily by scavenging. Like cats, they are very cute snoozers.

Sleepy red panda

Meerkat on sentry duty

Some excited noises alerted us to the sealions being fed and after watching them chow down for a while, we headed to the ever-charming Meerkat Restaurant for some nosh of our own. This is great for the kids because, in addition to child-friendly food, one wall of the restaurant is a large viewing window in the meerkat enclosure, providing entertainment too. Currently, this entertainment includes three little meerkat cubs (below). I was also impressed by the food itself, which was pretty good for a zoo - freshly cooked real burgers!

Baby meerkats huddled on rock

After lunch it was time to check out the new African Savanna section of the African Plains area of the zoo. This has been heavily reworked since we were last there and now features an elevated walkway around the giraffe, zebra and rhino enclosures, giving great views and potential close-ups of the giraffes. African Plains panoramic

Giraffe closeup

Another new development (since our last visit) was the nearby Gorilla Rainforest island (sponsored by Freddy Fyffe’s bananas!) It was great to see the Gorillas have more space to roam and they looked relaxed in their new habitat. I didn’t see the big guy (Harry) but we did see most of the rest of the troop. (The priority spot was little Kituba, who was born a couple of days apart from my nephew, who brought his own gorilla named Kituba to the zoo.)

I didn’t get any pictures of the gorillas but I did get a good one of Sibu, the big male Orang utan, who was seemed to be happily chilling out and possibly pondering the mysteries of life like a Zen master.

Wednesday 26 June 2013

Blogging at sea - the ferry versus flying for Southampton to Dublin

Southampton is a pretty good place to live when you have relatives in Dublin because there are direct flights. This trip, we decided to drive over and take the ferry from Holyhead instead. Apart from the long(ish) drive on the UK side, which is not so bad (especially if you splash out for the M6 toll road), there are some definite benefits to getting ferry.

For one thing, having a car in Dublin is really useful. I say this having lived in the city quite happily for six years without one. It is only going over and visiting friends and relatives with the car that I realise quite how much more you can do with a car - one of the great things about Dublin is all the great stuff on its doorstep.

The journey itself, although longer, is also more comfortable. (In a weather-dependent fashion, I suspect - we had good weather each way.) Although we made a poor coffee decision last time, the discovery of (proper barista) Costa coffee and onboard WiFi makes the whole experience much more pleasant than the short hop in a small plane - particularly for the period between boarding and departure.

It is easy to become complacent about technology but I think the modern age is pretty amazing when you can have internet access in the middle of the Irish Sea. As a result, I felt the need to give it a proper road (or sea?) test and see if it could cope with a blog post. Initial signs were good - it uploaded the screenshot OK - but as I have been typing this I have seen Blogger struggling to save the draft despite still being connected. I guess one disadvantage of the modern age is that when free WiFi is available, everyone logs on! (It took a few attempts to load up the link to my previous Irish ferries coffee post.)

Time to hit “Publish” and see if anything happens…

Tuesday 25 June 2013

Gull chicks for company at Dublin Marks & Spencer Rooftop Restaurant

Anyone who watched BBC Springwatch this year will know that gulls are increasingly nesting on the roofs of city buildings, which are safe from predators and provide lots of nice, flat nesting spots. Last week, we met a friend for brunch in the Marks & Spencer Rooftop Restaurant on Grafton Street in Dublin. The restaurant features an outside section overlooking Grafton Street and good for enjoying the rare bit of Dublin summer sun. At present, it also features a pair of cute little gull chicks, being reared on the flat roof section just beyond the barrier. The pictures below are a bit rubbish and out of focus but you get the idea.

Friday 21 June 2013

What do a Lurcher called Zak and a cheetah have in common?

Actually, these animals have lots in common - they are both mammals, carnivores etc. - but I'm thinking of something a bit more esoteric: both have had their locomotive performance measured by a special collar designed by Alan Wilson and the Structure & Motion Laboratory at the Royal Vetinary College in London. (The same technology was also used for the collars that tracked 50 cats from Surrey in the recent BBC Horizon, “The Secret Life of the Cat” programme, which is well worth a watch!)

The team have used the collars to study cheetah hunting behaviour, which was recently published in Nature and featured in the June 13th Nature podcast. The study itself is interesting and demonstrates how raw speed - the big thing the cheetah is famed for - is actually secondary to agility and power (i.e. acceleration and deceleration) when it comes to hunting success. Even so, the wild cheetahs still chalk up bursts of up to 59 mph (93kph) whilst hunting, which is not too far off the 65mph (105kph) top speed recorded in zoos.

The bit that really appealed to me, however, was how the collars were tested prior to being deployed in the field, which I find pleasingly elegant and effective. Prof Wilson’s pet lurcher, Zak, was given a run about on the beach whilst wearing a collar. (Two actually, as the new collar was being compared to older technology as well.) The data from the collar was then used to reconstruct Zak’s movements, which could be compared to the footprints left in the sand!

(The handsome chap in the photo above is not actually Zak but Dexter, my sister-in-law’s lurcher, on Dollymount Strand with a nice view of Howth in the background.)

Find more details of the study in Nature news, the podcast and, of course, the paper itself:

Wilson et al. (2013). Locomotion dynamics of hunting in wild cheetahs. Nature 498, 185–189.

There’s also some coverage on Why Evolution is True that appeared whilst this post was sitting in drafts.

Chic and cheerful at Urbun cafe, Cabinteely village

Continuing the good coffee theme, earlier this week we had lunch at Urbun cafe in Cabinteely, south Dublin. As befitting a cafe that started life as a market stall, the interior is simple but comfortable and, for want of a better word, wholesome. The knives and forks, for example, were brought to the table in a reused jam jar. (I think the decor might "urban chic" but I'm not really sure - I won't let that uncertainty interfere with a blog post title, though!)

The food was very good. I had the special - a tasty sweet potato and bacon frittata - and also got to sample some of my wife's club sandwich. The frittata was good but the sandwiches at Urbun are pretty special, served on thick slices of lovely fresh bread - highly recommended.

After lunch we had a coffee and that was also excellent. Their barista, Vini, had won third prize in the Irish Barista Championship and did not disappoint. Good stuff!

Wednesday 19 June 2013

Impressed with Cafe2u Coffee at the Southampton Kite Festival

I thought I should balance out my last post giving out about coffee on the Jonathan Swift by endorsing some surprisingly good coffee on the go. Last Saturday was the Southampton Kite Festival. Our friends, the Flying Fish Kiting Team, were performing so we went down to lend some support. (And a good performance it was too! Sadly, the weather was not quite so good, so no pictures this year.)

As well as the kite skills of Flying Fish (and their four-man team, L-Katz,) one of the impressive highlights of the day was the coffee from the Cafe2u mobile coffee van that was there. (Last year's culinary stand-out, Biggles Donuts, were not there, sadly.) Proper, freshly made coffee, and not ridiculously overpriced. (I also like the smiling running coffee bean on their logo!)

Tuesday 18 June 2013

Irish Ferries coffee disaster!

We recently made a trip from Holyhead to Dublin on the Irish Ferries Dublin Swift. We had a couple of breaks on the drive from Southampton but were feeling in need of a good coffee pick-me-up by the time we had embarked. Having settled down in seats near the onboard "Cafe Lafayette", I unthinkingly assumed that (a) all the places serving hot drinks on board would essentially serve the same, and (b) if anywhere had more/better hot drinks, it would be the cafe. Big mistake on both counts!

If you travel on the Jonathan Swift and like your coffee, avoid Cafe Lafayette at all costs. The coffee tasted like burnt dirt. (It actually reminded me a of the odd occasion at work when I have made myself a cup of Senseo coffee and forgotten to put in a new pod!) Not good.

To rub salt into the wound, when disembarking the ferry we noticed that the "Temple Bar" on board was serving Costa coffee. Duly noted for future trips!

Sunday 16 June 2013

The Ehux genome is here and it looks epic!

In addition to my main research on Short Linear Motifs, I have a number of collaborations with environmental scientists looking at how various organisms, such as corals, might be affected by rising CO2 levels.

One of the more fun collaborations has been with Bethan Jones (now at Oregon State University) and Debora Iglesias-rodriguez (now at UC Santa Barbara), working on the marine phytoplankton Emiliania huxleyi. Along with Paul Skipp at Southampton, I was involved with with proteomic analysis of this small but important organism. This was challenging because, at the time, their was no annotated genome available - hence the need for some bioinformatics help. (The second paper from this came out in April but my planned blog post was postponed after the Boston marathon bombing and is now sitting on my To Do list.)

Happily, the genome is now out! As reported in the KQED blog post, Opening the Gene Box of a Key Ocean Species:

“This week in the journal Nature, a worldwide team of 75 scientists revealed the genetic blueprint of the one-celled alga Emiliania huxleyi, which may be the most important species you’ve never heard of. The genomes of the domestic dog and cat are interesting, but the E. huxleyi genome is a much bigger story. Some day this organism may become another of our partner species, as vital to us as yeast.”

Even more happily, Bethan and Debora are both authors on the paper (as part of the Emiliania huxleyi Annotation Consortium), Pan genome of the phytoplankton Emiliania underpins its global distribution, which reports “sequences from 13 additional isolates” in addition to the genome of the reference strain CCMP1516. Many years in the making, it’s a bit of an epic, and I look forward to learning some more of Ehux’s secrets.

h/t: Bethan. [Picture from KQED] Citation: Read et al. (2013). Nature doi:10.1038/nature12221.

Thursday 13 June 2013

Are "Happy Eggs" really happy? (And are Viva really pro-welfare?)

Like many people, I am concerned by animal welfare but also rely on official organisations like the RCPA and their Freedom Food campaign:

When you see the Freedom Food label you know that animals have been kept to strict RSPCA welfare standards. The standards cover the whole of an animals’ life, not just their time on farm. A stimulating environment and plenty of room to move around are just two of the many benefits.

Freedom Food can also be an affordable ethical choice, as they approve indoor as well as free range and organic farms. So, make one small change to your shopping and one big change to farm animal welfare.

With the horrors of battery farms so well documented, we are especially watchful when it comes to eggs and chicken, and have been buying “Happy Eggs” for some time. In their welfare page, The Happy Egg Co. state:

All our farmers are dedicated to the wellbeing of their hens and every farm has acres of outdoor space for our hens to roam free, plenty of playhouses, trees and foliage for them to explore and rummage around in, as well as indoor space with nest boxes to give them a little bit of privacy when they’re laying.

I was therefore shocked to read a Viva investigation of “Happy Eggs” farms, which is still doing the rounds online, in which they report:

“… a very different story – one of disease, incarceration, mutilation, short lives and electric shocks.”

It makes for some pretty uncomfortable reading and, if true, really is shocking. If it’s true. The thing is, the expose by Viva is not necessarily neutral - Viva is the “Vegetarians International Voice for Animals”:

“Eating meat; fish and dairy causes environmental destruction, damages human health, contributes to global hunger and inflicts immense suffering on billions of animals across the world.

Viva! believes that the solution to all these problems is in our own hands: the best way to stop the destruction and the cruelty is to stop eating animals now – go vegetarian, or better still, vegan.”

I actually agree with a number of their points but not to the point that I think going vegetarian is the answer. We should eat less meat, certainly - not every day - and there is no need for the cheap, budget meat that floods supermarkets. Animal welfare is very important - how an animal lives is more important in many ways than how it dies. (In nature, animal death is rarely pleasant.)

The worrying thing, however, is not that Viva appears to have an agenda to discredit poultry (and other meat) farming but rather than the RSPCA and Freedom Food considered legal action and accused “Viva and Channel Five of reporting out of context and of withholding important information about animal welfare.” The lack of context included one of the farms being “under veterinary supervision for an outbreak of erysipelas” - a disease that “can unfortunately cause high levels of mortality as well as feather loss”, which accounts for some of the unpleasant observations.

That’s not the worst of the counter-accusations, though:

But the RSPCA is seemingly most angered by the fact that Viva had sat on its findings for three months, only releasing them in early October - to conincide with British Egg Week.

“If Viva had footage that demonstrated a problem as far back as July, then it should have been reported immediately so that the appropriate action could have been taken,” said the statement. “It is disturbing that this information was withheld when there was potential for on-going suffering.

“As a result of the issues raised above and the manner in which Channel Five provided evidence, we are seeking legal advice.”

A separate statement from the Happy Egg Co said it regarded the happiness of its hens as its top priority and it had immediately put in place an audit of all its farms.

So, who to believe?

The closest I have found so far to neutral coverage is on the Spud and Spike blog, which (as far as I can gather) is a personal blog by a mum on the adventures of her two kids. In a post from about a year ago (the expose itself is from 2010) - “Our visit to a Happy Egg Co Farm!” - the author reports conditions much more akin to the Happy Eggs & RSCPA point of view.

Indeed, as she points out, Compassion in World Farming awarded a second Good Egg award to Happy Eggs “in recognition of the packer’s commitment to high animal welfare”. According to the CIWF website:

“Compassion in World Farming was founded over 40 years ago in 1967 by a British farmer who became horrified by the development of modern, intensive factory farming.

Today we campaign peacefully to end all cruel factory farming practices. We believe that the biggest cause of cruelty on the planet deserves a focused, specialised approach – so we only work on farm animal welfare.”

I still find the Viva report a bit worrying - some of the welfare breaches (or “non-compliance issues”) reported were confirmed by the RSPCA - as well as some of the other reports that the RSPCA Freedom Food campaign is not really doing what it says in terms of the depth and frequency of welfare checks. That said, when reports seem to be coming from biased and unreliable sources, it is hard to know what is true and what is not.

If Viva really did sit on their footage for two or three months then they should be thoroughly ashamed of themselves. Prolonging unnecessarily animal suffering is bad enough when it is done for food or for profit. If it is being done purely for publicity by an organisation that is nominally pro-welfare, that really would be unforgivable.

For now, I am going to continue eating Happy Egg Co. eggs - and I think I will be getting my future welfare information from Compassion in World Farming.

Wednesday 12 June 2013

Blogging in Markdown with Blogger and Markable (on a Mac)

In a recent post, I extolled the virtues of Markdown as well as the online Markable editor and the Markdown Service Tools available for Markdown to HTML conversion in Mac OSX. This got me to thinking whether I could use Markdown to speed up writing some of my blog posts.

For ease of controlling the layout and context - and potentially re-using text and HTML - I write all my blog posts in the Blogger HTML window rather than using the “Compose” tools. I’m not entirely sure why but I just tend to prefer the result. (Part of it, I think, is the purity of the underlying HTML - what that says about me, I’m not sure I want to know!)

I often email myself content and plain text notes to tidy up later (hence the massive pile of half-written draft posts that I have) but since (re)discovering Markdown, I have started making more notes in Markdown and wondered if I could harness that in my blog writing. Blogger does not have a dirext Markdown editor, sadly, but there does seem to be a pretty convenient solution for Mac users, at least.

1. Install Markdown Service Tools. Brett Terpstra’s Markdown Service Tools offer, among other things, the capability to direct copy Markdown onto the clipboard as HTML code or make the Markdown to HTML conversion in place.

2. Write your Markdown in Markable. Whilst not strictly necessary, writing the Markdown in the Markable editor will catch any problems with your Markdown as you go.

3. Convert your Markdown to HTML. Windows users might need to export the HTML and then open the file in a text editor to copy and paste into Blogger. On a Mac, with the Markdown Service Tool, it is a bit easier - although, sadly, not quite as easy as I had hoped. The Service to use is:

md - Convert - HTML to Clipboard

Unfortunately, this does not seem to be available for highlighted text in the Markable window. Instead, there is the need to first copy and paste the text to a regular text window. This is not so bad, as the regular Blogger window itself will do. You then need to use the conversion service and paste back into the Window. Alternatively, just use:

md - Convert - MultiMarkdown to HTML

This will convert the text in place. You can either use the Services menu item (or right-click), or you can setup a Markdown Service Shortcut to do it all with the keyboard.

4. Make sure that line breaks are used. One thing I noticed when converting the HTML is that it (sensibly) uses paragraph markers. If, like me, you use Blogger’s capacity to Press “Enter” for line breaks, you will need to change this. (The laziness and readibility this option enables are not needed when using Markdown anyway.)

5. Add pictures, tidy and post. With the main text, links and formatting in place, it is now a simple case of adding the pictures, tags etc., giving the post a quick preview (and tidy if necessary) and unleash it to the world. The added benefit, of course, is that you have an extra copy of your post saved in Markable in case anything goes wrong.

Disadvantages

As well as the line endings issue, there are a few disadvantages of doing things this way. One problem is that if you Preview a post and then spot an error, you have three obvious choices, none of which appeals:

  1. Edit in the Blogger window, which is easy, but then have different Blogger and Markable versions of the text.
  2. Edit in both Blogger and Markable.
  3. Edit in Markable and then repeat the text copy and conversion process.

The latter is obviously the best if the changes are large but what if you have already added extra pictures and things?

One solution is to convert your HTML back to Markdown to continue editing.

md - Convert - HTML to Markdown

This has pros and cons. One pro and con is that the new Markdown does not necessarily look like the original. This can teach you new Markdown but might also confuse!

The picture placement and formatting also does not remain quite the same and may need re-jigging once the Markdown to HTML conversion is repeated. This only seems to be a problem for left/right-aligned images, though. It's also a fairly easy way to get images into Markable files, if that is your goal!

It may not be suitable for every post, and there is a good chance I will end up going for tweaking option 1 (abandoning the Markable version) in most cases, but it could prove a useful way to write posts with a lot of links and formatting. If nothing else, it's another good way to develop some Markdown skills.

Monday 10 June 2013

Python in a Nutshell - free PDF available!

If you are a Python programmer, you might be interested to know that you can get a free PDF of Python in a Nutshell, 2nd Edition from IT ebBooks. It's a few year's old now but still has a lot of useful basic Python syntax. It doesn't cover Python 3, so if you are a newbie you might want to hunt down some specific advice about programming Python 3 compatible code in Python 2.7. (To be honest, I still haven't plucked up the courage to look at the Python 2 vs. Python 3 difference myself but it might be worth having a go at the Python 3 tutorial.)

Saturday 8 June 2013

Marvellous Markdown

Another positive outcome of the recent Software Carpentry boot camp was the excuse and opportunity to get a bit more to grips with Markdown. This is really useful pseudocode that retains a high degree of human readability in plain text form, whilst being easily converted to HTML and other rich text formats. I'd already used it a bit for some of my content on the University of Southampton Computational Modelling Group website but I'd never fully realised its flexibility, value and potential until I started writing README files in it.

I won't try to explain Markdown itself here. The Wikipedia article is pretty informative if you want to know more. Instead, this a quick post to highlight/bookmark some useful Markdown tools that I've come across.

Markable

The first is the Markable website.
Markable top
This is great if you just want to try your hand at a bit of Markdown and see what the HTML conversion would look like. Simply type your text in the online Markable editor and the HTML window will automatically update to reflect the changes! You can then copy the Markdown to the clipboard or export Markdown/HTML to a file.
Markable bottom
If you see yourself using Markdown a lot, as I now do, you can register and take advantage of a whole bunch of other tools, such as (auto)saving content to work on later or exporting the Markdown (or HTML) directly into Dropbox.
Markable screenshot of Python Markdown info

Markdown Service Tools

Of course, if you are like me then saving to HTML code might not be enough for you. You might want to see the HTML code and/or copy it for use elsewhere. (I write all my blog posts in the HTML editor, for example.) On a Mac there is the tremendously useful Markdown Service Tools by Brett Terpstra that, among other things, includes tools for precisely this. Simply download the zip file, unpack and then copy the relevant *.workflow files to your OS X System Service folder:
~/Library/Services/
(Brett has a description of how to install Services here. You might have to make the Services/ folder first - I did.) This makes those services available via the Services menu item (or right-click → Services) across a range of Apple applications. My favourite so far is the "md - Convert - HTML to Clipboard" service, which converts highlighted Markdown text to HTML and copies it directly onto the clipboard. In combination with the Markable editor, I think this could be really useful.

Python-Markdown

It's worth quickly mentioning that there's a Markdown Python library, if for no other reason than that is appears in the Markable screen grab above! This can be used for easy conversions between formats, which might be handy for coding up batch conversions of *.md to HTML README files etc. I really need to save this one for another day as I am still getting to grips with it and working out how/where it can be useful for me.

Friday 7 June 2013

Putting Archaeopteryx back on its perch?

Around this time last year, the sad news came out that South Korean textbook publishers were removing examples of evolution following pressure from Creationists. [Soo Bin Park (2012) South Korea surrenders to creationist demands. Nature 486:14.] One of the examples to be dropped was Archaeopteryx, on the grounds that it might not be an ancestral bird after all. I am not sure how they will respond to last week's news that recent research puts Archaeopteryx back in the bird lineage, as opposed to being "just another feathered dinosaur". (Just‽)

The study in question, A Jurassic avialan dinosaur from China resolves the early phylogenetic history of birds [Godefroit et al., Nature (2013) doi:10.1038/nature12168], describes a 170-million-year-old fossil (below). Twenty million years or so older than Archaeopteryx, Aurornis xui is touted as the earliest definite early bird. (Artist's reconstruction, above.) Furthermore, the traits it shared by the two seem to put Archaeopteryx fully back within the ancestral avian lineage.

The authors include one of my Southampton colleagues, Gareth Dyke, and you can hear him discuss the paper on the Nature Podcast at the Nature News article, New contender for first bird. You can also read a summary in the Science news of the week - Science 340:1024-1025, Earliest Birdie? [Pictures from the linked Nature and Science news items.]

Of course, whether or not Archaeopteryx is an ancestral bird or not, that does not alter the irrefutable fact that birds did evolve from dinosaurs. The real solution to the challenge by Creationists should not have been to take Archaeopteryx out of the textbook but to put more fossils into the textbook. Teach the actual "controversy", such as it is: from which dinosaurs did birds evolve?

Wednesday 5 June 2013

Six useful things I have learnt at Software Carpentry boot camp

Monday and Tuesday this week, I attended a Software Carpentry boot camp at the University of Southampton. Topics covered included bash, shell scripting, Git and writing/testing reproducible code. The event was well-attended and whilst making an event like this relevant to everyone is obviously a challenge, they did a great job. I certainly learnt some useful tips even for the topics that I knew a fair bit about.

As well as the SWC presentations themselves, it was good to get tips from fellow programmers as well as "UNIX and Perl to the Rescue!: A Field Guide for the Life Sciences (and Other Data-rich Pursuits)", which I brought along for some browsing. Here is half a dozen random things that I picked up over the two days...

1. Useful grep flags. I've used grep to pull out matches from text files a fair amount and was familiar with a few of the flags that I use a lot:
-i = case-insensitive search
-v = inverse search
-A n = return n lines after match
-B n = return n lines before match
I learnt a few more useful ones, though:
-w = match whole words only
-n = show line numbers
--color = highlight matches in colour
-r = search subdirectories (recursive)
2. Useful ls flags. ls is another must-have part of the UNIX users toolkit. There were still a few useful flags with which I was unfamiliar and am likely to use in future, though:
-G = colour-code directory contents
-F = appends / to directories
-R = recursive ls including subdirectory contents
-1 = one entry per line
-a = show all files including hidden files
Along with my old favourites, of course:
-l = "long" mode (more info)
-r = reverse sort
-t = sort by time
-S = sort by size
-h = user-friendly file sizes
3. Catching the standard error and standard output. I've seen this a few times but for some reason this was the first time it really sunk in. Most UNIX users will be familiar with redirecting the standard output from a command into a file using > file (or >> to append). Catching the standard error is less obvious/common. This can be done using 2> to catch the stderr alone, or &> to catch both stdout and stderr at the same time. If you want to redirect them both into different files, do something like this:
[cmd] 2> error.txt > stdout.txt
The stdout will slip by the first redirect and then get caught by the second. Of course, you can have those the other way round if you wish!

4. Navigating the terminal. This one actually came from "UNIX and Perl to the Rescue" but I discovered it at the boot camp:
Ctrl+a = move to start of line
Ctrl+e = move to end of line
Ctrl+w = delete previous word
Ctrl+l = clear screen (clear works too)
Ctrl+r = search through previous commands one letter at a time (this was an SWC revelation)
Using Ctrl+a and Ctrl+e seems to work in a number of other Mac editors too - including this blogger HTML window! If you are a Mac user, just make sure that you don't use cmd+w by mistake - this will close the current terminal window with much wailing and gnashing of teeth!

5. Reversing Python strings. In the past, I have reversed a python string by converting into a list, using the list.reverse() method and then string.join() to convert it back. But there is a better way!
string[::-1]
I've used string slicing loads before but never realised that you could add a step to this syntax as with the range() method! (string[::-1] translates as string[start=end:end=start:step=-1].) Now I am wondering where else in my code I can use this knowledge!

6. Changing the command prompt to $. Sometimes, the command prompt is too long (or the terminal window too narrow) so that almost every command wraps around in an annoying fashion. To replace with a simple $ character, just type:
PS1="\s"
PS1="\$ "

I must admit that I do not (yet) really understand exactly what this does and how it works but it does! (And if you now get lost as to where you are, just remember that pwd gives you the full path to the working directory.

There were more but I think that's enough for now! If this is the sort of thing that floats your boat, you can find useful stuff like this plus a whole bunch of lessons at the Software Carpentry website:

If you get the chance to attend a boot camp yourself, my advice is: do!

Tuesday 4 June 2013

Warhammer Quest for iOS is here (if a bit buggy)

I posted a while back about about the Warhammer Quest iPad App, which is now out. I've had it a couple of days (despite only getting the email today!) and early indications are good. It's quite old school but that's actually part of the appeal, and it doesn't look too old school.

The game is a little buggy (and not just because of the giant bats, rats and spiders) but the occasional crash is not a problem as it saves progress after every turn with iCloud so a quick restart sorts it out. Gameplay might be a little repetitive, with fairly standard fare of visiting settlements, picking up quests and using the spoils to upgrade the skills and equipment of your party of warriors. It's good, though, and the quests are short enough to make it ideal for a quick go now and again without (necessarily) being sucked in for hours - ideal for a mobile device.

As with Hunters 2, Rodeo Games have made a good-looking game with a simple but effective combat system. Well worth the £2.99, I think. The iPad is the perfect medium for turn-based tactical games and I look forward to more of its ilk from the genre. (Particularly X-Com!)

Monday 3 June 2013

McGuigan Estate Shiraz

Tonight was a steak night, which called for a hearty red wine. With the forthcoming move Down Under, an Aussie number seemed appropriate.

I'm not sure how much it's drunk in Australia itself but the McGuigan Estate Shiraz is on offer at Sainsburys at the moment and has a couple of IWSC trophies to its name. I can see why - it's full-bodied, robust and packed full of flavour.

It pairs well with a juicy steak but easily has enough flavour to hold its own for some quality quaffing in its own right. One more reason to look forward to the move later this year!