Python Cookbook

Cover of Python CookbookThis may be stretching your interest a bit dear reader, but I’ve convinced myself I need to write a quick review of every book I read and put it here. Not least so that I know I’ve read them. Age and lager can weary a memory you know.

I’ve recently finished reading the first edition of the Python Cookbook, just after the second edition has been published. I’d actually bought this book when it first came out, but it has been sitting in my to read list for over two years. In my defence a fair portion of that time was because we were in another country and this book was in storage.

In summary it’s a great book, indispensible to have around when you are actually doing any Python programming. If your interests are more likely to run to train sets, crocheting or the latest happenings in the big brother house (you know I’m talking about you I.M.O.T) then you may not share my enthusiasm.

The book is a collection of programming recipes, collected from people who use Python in a variety of situations and for varied purposes. It therefore reflects the best practices of the community garnered from many years of experience. The key to a book of this nature is good editing, selecting and weaving the best contributions from a number of different authors into a series of coherent chapters. Luckily messrs Martelli and Ascher have done a sterling job here. Nothing jars, and reading each chapter you could be forgiven for thinking they were written by the same author.

My test for technical books of this nature is whether they inspire me to take up the keyboard. At least once in each chapter I found myself reaching for the keyboard to try out a command or a technique. I’m sure this book will be a valuable companion whilst I’m knocking out my half cooked code.

ID Cards and the public

Oh dear, oh dear, oh dear. A selection of comments from the BBC who are running a vox pop on ID cards on their web site today;

"I give 100% support to ID cards as it would cut down on crime and illegal immigration. Also all the information will be on a single card which will be better for everyone.
Martin Williams, S Wales"

– Err, how exactly will you carrying a piece of plastic around reduce crime or illegal immigration?

"Why will the cost so much they are just a bit of plastic with some data on and will be manufactured by the million. Three pounds would be too much.
Bill Carney, North Lincs"

– Sorry, mustn’t laugh at the ignorant. They’ll cost so much because the information stored on the card will also have to be kept in a central database by your oh-so-trustworthy government. Which means a new department staffed with civil servants and advised by over priced consultants who will need to build a whopping great big database to store this information. This being the public sector it will take twice as long (and at least four times as much) as predicted to build it. Then they will have to spend some serious money to make it accurate, and secure.

"I fully support the introduction of identity cards. I have nothing to hide. As for the cost, the government should subsidise it and offset the cost against a reduction in benefit fraud and crime.
Al, London"

– See my first response about reducing crime. Although the prospect of armed blaggers showing their ID cards to the closed circuit tv cameras whilst they are robbing the local building society is certainly going to help the police catch them. As for the "government" subsidising ID cards – that’s you, you idiot. It doesn’t matter if you pay up front or in increased income tax. Every penny that’s spent on this white elephant will come directly from your pocket.

The URL you are looking for is http://www.pledgebank.com/refuse.

Update: Muriel Gray, in the Guardian has a very persuasive case for not having ID cards, because you may quite legitimately not want other people to know your name.

Bed Time Routine

IMG_2799Before bed each evening Alexander enjoys some traditional warm milk and, slightly more unconventionally, a few crackers.

More importantly I’ve just bought a new lens which is well suited to taking portraits. This is the first of what may be a long and illustrious line. If you’re really lucky I may even include other subjects.

A Portrait

IMG_2761I’ve been taking a photography course at evening school recently. This morning I was out at Dee Why beach learning a few practical lessons. I put some of them to use this afternoon with a couple of shots at Balmoral beach.

This shot is taken at the fish shop whilst we were waiting for our lunch to cook. The technically minded will note the almost correct proportions of the shot and the use of fill flash to avoid any shadows on JFGP‘s face.

If you click on the photo you’ll be taken to my pages at flickr where you can see the rest of the fruits of today’s work.

Sebastian Faulks – Birdsong

Cover page of Birdsong Time for an experiment. Here is my first book review on this blog. This isn’t a critique, more a set of notes to remember what I got from the book and which bits I liked.

I actually finished Sebastian Faulk’s Birdsong a couple of weeks ago but that time hasn’t dimmed it’s impact.

It’s strength, I think, lies in the depiction of life in the trenches in France and Belgium during the first world war, and in particular the first person description of the Battle of the Somme. This is the middle section of the book. It’s prefixed by a description of life in the same area of Northern France before the war (in 1911) and in the latter stages intertwined with the story of the main character’s grand-daughter.

The main message I got from this book is that regardless of life before the war those that take part in it are forever changed by their experiences, and usually not for the better. Particularly telling was the casual description of the lives of the soldiers after the war. A lot more could have been said, and the author could have omitted the first and last parts and still had a very good novel. On the whole the three facets of the story work well together and remind the reader that despite it’s terrible impact we do recover from war. Which is about as upbeat a message as you can get from this subject matter.

Nutbags

I couldn’t let this article on BoingBoing pass without a comment or two. It’s an excerpt from a new book called "The Worlds Worst" about the breatharian life style, claiming that it’s the world’s worst diet. I heartily concur, if not because of what it appears to do to your brain.

As some of you may know I once had the privilege of working with a chap who had wholeheartedly embraced this lifestyle. He hadn’t made it onto just fresh air but was several years into what he claimed was a twenty or so year quest to survive on absolutely nothing. He consumed only raw fruit and vegetables and drank nothing other than adam’s ale.

To say that he was a nutbag is doing a disservice to nutbags. Completely crazy. Barking mad. But good for plenty of material. A couple of examples;

Our subject (let’s call him "Dave") proudly stated that because he was following the breatharian lifestyle he would never get sick. The next day he came into work with bronchitis.

He once asked me, as the token pommie in the office and therefore an expert on the subject, where he should go to play professional football (or soccer as he called it). When I asked why he wanted to make such a radical career change, bearing in mind that he hadn’t even kicked a ball up until that point, he said that his psychic had told him to do it.

And there are more. A recent sighting of "Dave" was in Indonesia where he had, apparently, gone to buy a few acres of land somewhere in the archipelago to farm durian fruit. Apparently it was another hot tip from his spiritual adviser.

Boy in a Bed

IMG_2661Alex is moving up in the world. Here’s a picture of him relaxing in his newly installed bed.

Of course he’s also confused because we haven’t taken the cot down. So now he doesn’t know where to snooze and just thinks that this is a new play couch.

Clutching At Straws

It doesn’t come often, so when it does we must perform the ritual dance of celebration; England beat Australia in a game of cricket.

The predictable retort from the king of sledging at work was "well it’s not proper cricket is it". Who cares, we still won. I managed to be a dedicated fan and watch the game from 2:15 this morning – by proxy. Said proxy being my VCR which is replaying the match to me now at a much more reasonable time.

Uncle Giles!

IMG_2641 This one’s for Outraged of Poynings.

We’ve been trying to teach JFGP some tricks. So far he’s pretty good at counting from one to ten and saying "Daddy’s the king" but this one is his piece de resistance.

Although I’d say that it needs a little more work until it rivals the quality of his cousin Maddie’s work.