Monthly Archives: August 2011

Terminological diversions

After seeing some excruciatingly obtuse jargon discovered by David Waldock today [1,2], I was reminded of Sir Winston Churchill and his lifelong love of words, as well as being a fount of delicious anecdotes and epigrams. There is a story that an American general once asked Churchill to look over the draft of an address he had written. It was returned with the comment: “Too many passives and too many zeds“. The general asked him what he meant, and was told:

Too many Latinate polysyllabics like “systematize”, “prioritize” and “finalize”. And then the passives. What if I had said, instead of “We shall fight on the beaches”, “Hostilities will be engaged with our adversary on the coastal perimeter”?

(aside: this is of particular relevance, as many scientists (myself included!) are guilty of using unnecessarily baffling terminology and phrasing when writing papers; I highly recommend a presentation by Simon Peyton Jones (Microsoft Research Cambridge) on How to write a good research paper)

Churchill’s ability with words was not only employed in his speeches, but also in his impish (indeed, often childish) sense of humour. He could not resist making a quip — to the extent that over the years many witty remarks whose provenance is in fact far from certain have been ascribed to him. A further example that I have always appreciated is given in one of the many documents that came across Churchill’s desk; a civil servant has gone out of his way to be grammatically correct, and had clumsily avoided ending a sentence with a preposition. Churchill scribbled in the margin:

This is the sort of English up with which I will not put.

Churchill was also the progenitor of the delightful phrase terminological inexactitude, used as a euphemism or circumlocution meaning a lie or untruth (referring to the government’s denials in 1906 of the exploitation of Chinese coolies in South Africa).

Winston Churchill

“Men will forgive a man anything except bad prose.”

(These quotes have been taken from the excellent The Wicked Wit of Winston Churchill, compiled by Dominique Enright)

Tagged ,

Angry people

From The Restaurant at the End of the Universe (Chapter 1), HHGTTG:

In the beginning the Universe was created.

This has made a lot of people very angry and has been widely regarded as a bad move.

I’m not trying to espouse nihilism or trivialise recent events (especially in conjunction with my previous HHGTTG post) — I’m well aware I have a penchant for describing current (any?) events and people’s actions through the medium of xkcd or HHGTTG — some of the sights over the past five nights have been profoundly distressing and frustrating (as has some of the reporting).

I’m just not quite sure how to reconcile how I feel about the recent riots (but yes, I truly believe it is rioting/looting and most definitely not “protesting”), without going all Daily Mail (which appears to be fairly standard practice across a number of social media platforms of late).

Comments gratefully received…

Tagged , , ,

Powers of two

I was looking back through some C code I had written a while ago and found a concise little function for calculating whether an integer is a power of two. In general, there are two main ways to do this: either using its decimal or binary representation. The former approach can be more human-friendly, but generally less efficient; the latter approach is more machine-friendly, but tends to be more efficient. Since integers are stored as binary values in C (precisely how is dependent on the machine architecture), you can see why slicker methods are possible using binary. Essentially: an unsigned integer is a power of two if and only if it has exactly one 1 bit.

int isPowerOfTwo (unsigned int x) 
{
    return ((x != 0) && !(x & (x - 1)));
}

There are two halves to the expression: x != 0 and !(x & (x – 1)). The first half makes 0 a special case, since the second part of the expression only works correctly for positive numbers. The second half is true when x is a power of two and false when x is not. It turns out that this decrement and compare function is how the power-of-two check is implemented in malloc in the GNU C Library (glibc); let’s see how it works.

Let n be the position of the leftmost 1 bit in x. If x is a power of two, its lone 1 bit is in position n. This means x – 1 has a 0 in position n (recall how binary subtraction works: when subtracting 1 from x, the borrow propagates all the way from position n; bit n becomes 0 and all lower bits become 1). Now, since x has no 1 bits in common with x – 1, x & (x – 1) is 0, and !(x & (x – 1)) is true. Since subtraction borrows from the lowest 1 bit, when x is not a power of two this will be before position n, so it will not propagate. Now x and x – 1 have at least one 1 bit in common (at position n), so x & (x – 1) is non-zero, and !(x & (x – 1)) is false.

Here are some simple 8-bit unsigned integer examples to illustrate:

x x - 1 x & (x – 1)
00000001 00000000 00000000
00000011 00000010 00000010
00000110 00000101 00000100
00001000 00000111 00000000
00001011 00001010 00001010
10000000 01111111 00000000
11111111 11111110 11111110


You can find more tips and tricks like this in the original HAKMEM (or updated HAKMEMC), as well as the book Hacker’s Delight by Henry S. Warren.

(A big thanks to Rick Regan and his in-depth Ten Ways to Check if an Integer Is a Power Of Two in C blog post)

Tagged ,

Natural leaders

From The Restaurant at the End of the Universe (Chapter 28), HHGTTG:


The major problem — one of the major problems, for there are several — one of the many major problems with governing people is that of whom you get to do it; or rather of who manages to get people to let them do it to them.

To summarise: it is a well-known fact that those people who most want to rule people are, ipso facto, those least suited to do it. To summarise the summary: anyone who is capable of getting themselves made President should on no account be allowed to do the job.

To summarise the summary of the summary: people are a problem.

N.B. I had always thought this was a truism (albeit slightly tongue-in-cheek), which (cynically) went hand in hand with “quis custodiet ipsos custodes?”.

Tagged , ,

2011 British Science Association Media Fellowship

This week I am starting my 2011 British Science Association Media Fellowship with BBC Wales. The Media Fellowships aim to create a greater awareness and understanding of the workings of the media amongst practising scientists, social scientists, clinicians and engineers. The Media Fellows spend 3 to 8 weeks working within the national press, broadcast or internet media to better understand how scientists can interact with the media (increasingly relevant for academics), as well as learning how to produce accurate and relevant pieces about developments in science. The scheme has been running since 1987 and reflects the British Science Association’s wider commitment to working with the media to build greater understanding between science and society. The Media Fellows will also attend the British Science Festival 2011, to be held in Bradford in September, reporting for their hosts.

My six week placement with BBC Wales will be predominantly with BBC Radio Wales in Cardiff, working on Good Morning Wales and Good Evening Wales. I will also be spending a week in Wrexham with Science Cafe, BBC Radio Wales’ weekly science and technology programme, as well as some time on TV with BBC Wales Today (the BBC’s national news programme for Wales) and online with BBC News Wales. BBC Wales do not currently have a dedicated science correspondent, so I hope to try and increase and broaden their science output by highlighting relevant research and policy developments in Wales.

I have already been working on Good Evening Wales for two days last week, taking a news story from inception to broadcast: with the publication of the Bateson report [PDF] on primate research last Wednesday, this raised wider discussions about the effectiveness and importance of animal research in the UK. This was in light of a recent YouGov poll, in which 69% of the British public support the Government taking action to replace and reduce experimentation on animals (albeit with a slightly leading question IMHO). I arranged an interview with the communications and public engagement manager from Understanding Animal Research (with thanks to the Science Media Centre!), which went out live at 5:40pm. It was interesting to see how a story develops from the morning production meeting to going out on air in the evening, as well as how news is prioritised (especially during a busy news week).

I will be blogging throughout my time with BBC Wales, so keep an eye on the Media Fellowship tag. You can also contact me on my swanky BBC email address: dr.tom.crick@bbc.co.uk (N.B. I did not request this! But I appear to be in rather illustrious company).

The ten 2011 Media Fellows are:

  • Ms Leila Battison (Department of Earth Sciences, University of Oxford), with BBC Radio and BBC News Online.
  • Ms Amy Chesterton (Department of Chemical Engineering, University of Cambridge), with the Naked Scientists.
  • Dr Tom Crick (Senior Lecturer in Computer Science, UWIC), with BBC Wales.
  • Dr Nathan Green (Northwest Institute for BioHealth Informatics, University of Manchester), with the Guardian.
  • Dr Elena Hoika (Lecturer in Developmental Psychology, University of Stirling), with the Scotsman in Edinburgh.
  • Dr Hamish Pritchard (British Antarctic Survey), with BBC Radio and BBC News Online.
  • Dr Amy Strange (Wellcome Trust Centre for Human Genetics, University of Oxford) with the Irish Times in Dublin.
  • Dr Lee Sweetlove (Reader in Plant Biochemistry, University of Oxford), with Nature.
  • Mr Richard Walters (Department of Earth Sciences, University of Oxford), with the Times.
  • Dr Andrew Wright (Reader in Building Engineering Physics, De Montfort University), with the Times Higher Education.
Tagged , , , , ,
Follow

Get every new post delivered to your Inbox.

Join 348 other followers