Wednesday, 14 September 2011

Oh, how I love selected parts of your law!

All Scripture is God-breathed and is useful for teaching [...] I give you this charge: Preach the Word.
—2 Timothy 3:16–4:2
When was the last time you heard a sermon on Zephaniah? Or Philemon? How about the second half of Daniel?

We pay lip service to the inspiration of the whole of Scripture, but I wonder whether we really believe it. Do we use the whole Bible, or do we just pick out the bits we like? One way of gauging this is to look at what passages we preach on: if we take seriously our charge to use all of Scripture for teaching, then you would expect to find that, over time, our sermon texts would bear that out. We should probably not expect a completely flat distribution: it is perhaps reasonable to expect sermons to cover the gospels more often than Leviticus, since the gospels more clearly and directly reveal Jesus. But if we believe that all Scripture is God-breathed, then we should not expect to find that some parts of the Bible receive all our attention and some are essentially ignored.

Finding good aggregated statistics on what is preached in churches around the world is difficult, simply because churches don't publish their sermon plans in any systematic fashion. But there are ways of getting a useful indication.

The Gospel Coalition web site is an excellent resource for finding, among other things, sermons preached in evangelical churches worldwide. I use it all the time, and I have found it invaluable. As of September 2011, it lists around 34,000 sermons, most of which can be downloaded and listened to. That is a vast number—more than there are verses in the whole Bible. It also acquires its material from a large number of churches and an even larger number of preachers, and thus one would expect it to be representative of the state of evangelical Christendom as a whole, and not susceptible to the biases and tendencies of one particular church or minister.

So what does its database reveal?

Below is a Wordle, showing how often each book of the Bible is represented in the database. The size of the font is proportional to the number of sermons taking its primary text from that particular book.

What do we preach on? (PDF)

The image is quite striking. The New Testament dominates to a remarkable extent: only Genesis and the Psalms can compete, and even they are some way down the list. The minor prophets are almost non-existent.

But there are other points of interest. It is perhaps not surprising that we spend most of our time in the gospels; but notice how far behind the rest Mark lags. And who would have expected such a difference between Ephesians and Colossians?

Of course, some books are much longer than others. One would not expect a series on 2 Thessalonians to contain as many sermons as a series on Exodus, simply because there is less material to cover. A sermon series that went through the entire canon at the rate of one chapter per week would quite sensibly spend one week on Obadiah and nearly three years on the Psalms. So perhaps we should weight the entries according to the length of each book.

This second Wordle does just that. Each book is weighted by taking the number of sermons on that book in the database divided by the number of words in the book (in an English translation). This should have the effect of controlling for book length: if books were favoured simply according to their lengths, the Wordle would have all entries in the same size font.

Taking book length into account (PDF)
Notice what has changed and what has not. The Old Testament is still largely absent, and has faded even more now that Genesis and the Psalms, two of the longest books in the Bible, have all but disappeared (see if you can spot them). Jonah is the only one that catches the eye.

But what has happened to the gospels? Mark is now able to keep pace with the other gospel writers—perhaps we soft-pedal him only because his gospel is shorter than the others—but all four have been left in the shade. Word for word, we spend far longer on the epistles (which now dominate the image) than we do on the gospels.

What about choice of passage within a book? Do we demonstrate there that we believe the whole book is inspired, or do we cherry-pick the "good" bits?

This graph shows, for each chapter of Isaiah, how many sermons there are in the Gospel Coalition database taking that chapter as the primary text.

The keen-eyed will observe that the graph is not flat. Some chapters receive significant attention, whereas others are passed over. Three chapters, in fact, have no sermons on them. The six most famous chapters in Isaiah are probably chapter 1 ("Though your sins are like scarlet..."), chapter 6 ("In the year that King Uzziah died..."), chapter 9 ("To us a child is born..."), chapter 40 ("Comfort, comfort my people..."), chapter 53 ("He was pierced for our transgressions..."), and chapter 55 ("Come, all you who are thirsty..."). These chapters are represented by the six biggest peaks in the graph; and on average, there are 50.2 sermons for each of these six chapters. For the rest of Isaiah, there are 6.8 sermons per chapter.

Isaiah is not the only book to show wildly uneven treatment. There are 106 sermons on Psalm 1; sixteen Psalms are covered in only one sermon, and Psalms 64 and 70 have no hits at all. There are 199 sermons on Acts 2 (Pentecost) and 24 on Acts 12 (Peter's escape from prison).

It would be easy to make too much of this. There may be any number of reasons for some of these effects. For instance, any responsible sermon series that goes through Isaiah must take in Isaiah's commission in chapter 6; and it would be unreasonable to expect every series to cover every chapter. So it is unsurprising that chapter 6 gets more hits than any other. And there is good reason for giving greater prominence to the clearer parts of Scripture, so it may well be appropriate for Ephesians to receive more air time than Ecclesiastes. Perhaps 2 Chronicles receives less attention because it duplicates much of the material in 2 Kings.

But I am not convinced that all of it can be explained in such terms. What is striking is not that the distribution is uneven, but that the unevenness is so stark. It surely cannot be right that you are over 13 times as likely to hear an exposition of Matthew 5 (the start of the Sermon on the Mount) than of Matthew 19 (divorce). One can hardly make out that divorce is pastorally irrelevant today.

So why is this happening? Let me suggest three reasons.

For one, familiar bits of Scripture are easier to understand. Preaching on a text involves understanding it in its context; that, of course, is much easier to do if you already know the context. So whilst preaching on Ephesians 2 might involve some wrestling with the text to understand the finer points, it is unlikely to require significant blood, toil, tears and sweat to come to terms with the overall message of Ephesians. But now imagine that you have been asked to preach on Nahum 2. You have a good deal of work ahead of you before you start trying to unpack chapter 2. Who was Nahum? Northern kingdom or southern kingdom? What time period? Who were his primary audience? Can I even find Nahum without looking in the index?

Secondly, for exactly the same reasons, familiar bits of Scripture are easier to explain. A typical church will not need reminding every week that Acts details the growth of the early church after Jesus' ascension. But start a series on Ezekiel, and you have a lot of historical background to fill in before you can get to the text itself.

Thirdly, familiar bits of Scripture are easier to preach without rocking the boat. Honestly, who wants to preach on divorce? Or hell? Or the Canaanite genocide? Much easier to tackle something light and fluffy. The last thing you want to do is to raise difficult pastoral issues.

This is a dangerous game to play. The clear message we give off is that most of Scripture is theoretically inspired but not really worth bothering with. Zephaniah simply has nothing to say to us. Titus is boring. Matthew's worth preaching on, but do skip the tricky bits.

Man does not live on bread alone but on every word that comes from the mouth of the Lord.
—Deuteronomy 8:3

Do we really live on every word? Or do we eat the middle and leave the crusts? Stop playing with your dinner and eat it properly.

Sunday, 14 August 2011

Post-Camp Blues: be careful, it's boring out there...

Yesterday, I came back from what I think is my 25th CYFA camp! I've now spent a total of more than six months on camp.

The first time I went, I was pretty nervous about it. I didn't know what to expect, and I didn't know whether I'd manage to make friends with anyone. But it didn't take long for that to pass. Now, some of my best friends are people I met on camp, and some of the others (including my wife) are people I met in a roundabout way via camp. God has also taught me, through camp, more than I can ever remember to thank him for. And he has granted me the wonderful privilege of serving him through chatting with people, praying with people, washing up, and pouring buckets of water on people's heads. Blessings all mine, and ten thousand beside.

Going to camp is now easy, and something I spend 51 weeks of the year looking forward to. What is much more difficult is coming home afterwards. On camp, you can feel close to God and close to others, and there's no time to catch your breath, let alone get stuck for things to do. But suddenly you're at home, and you remember how boring the real world is. Where did God go? Where did my friends go? What am I going to do for the next 51 weeks?

Post-camp blues is something that members, helpers, leaders and cooks all go through, and I don't have an easy answer. I think that when I find coming home from camp easy, that's when I'll know it's time to stop going. But there are some things you can do to make it at least not quite so horrible.

Remember what God has done

I cried out to God for help; I cried out to God to hear me. I thought about the former days, the years of long ago; I remembered my songs in the night. My heart mused and my spirit enquired: "Will the Lord reject for ever? Will he never show his favour again? Has his unfailing love vanished for ever? Has his promise failed for all time? Has God forgotten to be merciful? Has he in anger withheld his compassion?" Then I thought, "To this I will appeal: the years of the right hand of the Most High." I will remember the deeds of the Lord; yes, I will remember your miracles of long ago. I will meditate on all your works and consider all your mighty deeds. (Psalm 77:1, 5–12)

We tend to think of bible times as being an endless flow of drama and miracle, as though every moment were an exciting demonstration of God's presence and power. But, of course, it wasn't like that at all. The bible covers thousands of years of history, and most people's lives, most of the time, would have been quite ordinary.

The Israelites had the same temptation as we do: to forget what God had done for them. They constantly needed reminding to look back at how God had been faithful in the past so that they would trust that God would remain faithful in the future.

Coming back from camp can leave us so flat, and can leave God seeming so distant, that we quickly forget the blessings God rained down on us at camp. We start to wonder where God is. "Will he never show his favour again? Has his unfailing love vanished for ever?"

We need to be taught to remember what God has done, both in history in sending Jesus, and in our own lifetime in the ways he has drawn close to us on camp and elsewhere. Meditate on how God has blessed you in the past, and use that to help you trust him for the future.

Anchor yourself in Jesus' blood, not your own feelings

When I see the blood, I will pass over you. (Exodus 12:13)

There are so many things on camp that can give you a sort of spiritual buzz. It is so uplifting to hear an inspirational talk, or sit around a camp fire late at night singing "In Christ Alone" with fifty of your friends. These are all good, and God works through them to build us up and bring us closer to him. But they also have a significant danger: we can start to base our faith and our confidence on our own feelings. And when we come home and the feelings disappear, we start to question whether we're really Christians, or whether God really loves us. Feelings come and go; and if your confidence in God's love is based on feelings, it will come and go too.

When the Israelites came out of slavery in Egypt under Moses, they were told to kill a lamb and spread the blood on their doorposts. God was going to come through the land that night and bring judgement on the Egyptians by killing the firstborn son in every house. But for the Israelites, the lamb would be a substitute: God would see the blood of the lamb on the doorposts, and pass over without killing the firstborn son.

I should imagine that many of the Israelites were very scared that night. They had seen enough of God's judgement to know that it was real. What if they didn't believe strongly enough? What if they didn't feel close enough to God? What if their faith let them down, and God brought judgement on them during the night?

But what saved the Israelites from judgement was nothing to do with their feelings. What saved them was not the strength of their faith but what their faith was based on: God had promised that he would pass over when he saw the blood. However scared they might have been, however faithless, God was faithful to his promise.

So with us. We are saved because God sees Jesus' blood and passes over. Our salvation is not grounded in the strength of our feelings but in the death of Jesus, our Passover lamb and our substitute.

Get involved with others around you

"You will all fall away," Jesus told them, "for it is written: 'I will strike the shepherd, and the sheep will be scattered.' But after I have risen, I will go ahead of you into Galilee." Peter declared, "Even if all fall away, I will not." "I tell you the truth," Jesus answered, "today—yes, tonight—before the cock crows twice you yourself will disown me three times." But Peter insisted emphatically, "Even if I have to die with you, I will never disown you." (Mark 14:27–30)
Peter began to call down curses on himself, and he swore to them, "I don't know this man you're talking about." Immediately the cock crowed the second time. Then Peter remembered the word Jesus had spoken to him: "Before the cock crows twice you will disown me three times." And he broke down and wept. (Mark 14:71–72)

Part of what makes coming home so difficult is that we've been surrounded by other people for a whole week. There's always someone to talk to on camp. You come back, and suddenly you're on your own. The love and support you enjoyed so much is whipped away from under you, and it can be a very lonely place to be. The temptation then is to grit your teeth and tell yourself you'll get through the next couple of weeks on your own by sheer willpower: "Even if all fall away, I will not." Peter tried that; it didn't work.

The bible never teaches us to go it alone. God made us to relate to one another, and to love, encourage and support one another. Jesus did not die to make you an individual Christian, but to make you part of his body. You won't survive apart from the rest of the body; you weren't designed to do so.

There isn't anything quite like camp for mutual encouragement. But unless you live on a desert island, there are other Christians near where you live who are important for your sanity and your continued growth. Get stuck into a church. Go to a youth group. Ring your friends and tell them what you learnt on camp.

Focus on God's word

These commandments that I give you today are to be upon your hearts. Impress them on your children. Talk about them when you sit at home and when you walk along the road, when you lie down and when you get up. Tie them as symbols on your hands and bind them on your foreheads. Write them on the door-frames of your houses and on your gates. (Deuteronomy 6:6–9)

A week of reading the bible together is brilliant, but it's not supposed to stop there.

Moses didn't teach the Israelites to have a quiet time, as though they should spend ten minutes each day thinking about God and then forget his word for the rest of the day. Moses taught them to saturate themselves with Scripture. God's word was to be in their hearts, not on their smartphones. It was to be their chief topic of conversation at breakfast, lunch and dinner, in the car, at school, and throughout the day. They were to superglue it to their hands and nail it to their heads. They were to scribble verses on their bedroom walls, and chisel them into their front doors.

Make it your business this week, this month, this year, to read your bible till it falls apart. If you're not sure where to start, try Mark's gospel, and then the letter to the Colossians. If you're not sure how to read your bible, ask your dorm leader to send you some bible reading notes. If you'd like to get some yourself, you might like to try the Explore series. For something more crunchy that will take you through the bible in a year, get hold of Don Carson's For The Love Of God.

And never decide not to read your bible because you've "done your quiet time today". I promise you, the more you read it, the more you will learn to enjoy reading it. Talk to your friends and family about it. Meditate on it day and night. Write it up and down the road in alphabetti spaghetti. Nourish yourself from the food that God has given you.

Be careful to follow every command I am giving you today, so that you may live and increase and may enter and possess the land that the Lord promised on oath to your forefathers. Remember how the Lord your God led you all the way in the desert these forty years, to humble you and to test you in order to know what was in your heart, whether or not you would keep his commands. He humbled you, causing you to hunger and then feeding you with manna, which neither you nor your fathers had known, to teach you that man does not live on bread alone but on every word that comes from the mouth of the Lord. Your clothes did not wear out and your feet did not swell during these forty years. Know then in your heart that as a man disciplines his son, so the Lord your God disciplines you. Observe the commands of the Lord your God, walking in his ways and revering him. For the Lord your God is bringing you into a good land—a land with streams and pools of water, with springs flowing in the valleys and hills; a land with wheat and barley, vines and fig-trees, pomegranates, olive oil and honey; a land where bread will not be scarce and you will lack nothing; a land where the rocks are iron and you can dig copper out of the hills. When you have eaten and are satisfied, praise the Lord your God for the good land he has given you. Be careful that you do not forget the Lord your God, failing to observe his commands, his laws and his decrees that I am giving you this day. (Deuteronomy 8:1–11)

Thursday, 7 July 2011

Heatherweight Encryption: Provably Brilliant Crypto

James Heather (No Institute Given**)

[This is the complete text of a paper to appear in due course in the highly esteemed Journal of Craptology.]

Abstract. Most fashionable cryptosystems suffer from many drawbacks: they produce inefficiently long ciphertexts, they take a tediously long time to perform their basic operations, and they are vulnerable to any number of troubling attacks. In this paper, we1 propose a cryptosystem that excels in every respect. We give proofs of optimality of security, algorithmic complexity, and ciphertext size.

1 Introduction

The world has long suffered under the weight of such behemoths as RSA, ElGamal, the so-called ‘Advanced’ Encryption Standard, the so-called ‘Secure’ Hashing Algorithm2, and that one where you wrap a strip of paper round a pencil. Every one of these is so inefficient as to be amusing. They take far too long to encrypt, produce ciphertexts that are big and unwieldy, and can be cracked with minimal effort. A small personal case study will serve to illustrate.

Mr Fardoso on his way to the bank
Last year I received an email from Mr Daniel Fardoso, the terminally ill nephew of a deceased Nigerian diplomat, who needed my help in shifting a large quantity of money so that he could live out his remaining months in peace and comfort. Modesty forbids recounting the many reasons that Daniel gave for choosing me to entrust with this task; suffice it to say that he seemed to have every confidence that I had the qualities he was looking for. He asked me to fill in a simple and supposedly secure web page with my bank details, my mother’s maiden name, my passport number, and my name and address. Naturally, I concurred; and, when I clicked on the ‘Submit’ button, a window appeared telling me that it was encrypting the file for safe transmission to Daniel.

Until that point, I had expected that modern cryptographic methods would work securely and efficiently. Much to my disappointment, it was still encrypting the file some three hours later when I retired for the night. In the morning, on discovering that the encryption still had not finished, I sent Daniel an email expressing my concern; he reassured me that there was no sign of any problem at his end.

You can imagine my shock when I received a phone call from the police that afternoon, informing me that £35,000 had been cleaned out of my account! It distresses me to say that they tried to blame first Daniel, and then me, for the security breach. My complaint that I had taken every precaution to encrypt the file securely fell on deaf ears.

So much, then, for current encryption systems! Two honest, law-abiding citizens attempt a supposedly secure transaction, and the hackers take full advantage. One cannot help concluding that if the encryption had been faster, then Daniel and I might have had time to stop the theft; and if it had been more secure, then the hackers would not have been able to break it in the first place.

2 Analysis of current systems

Figure 1 gives more technical insight into the inadequacy of currently available cryptosystems.

Figure 1: RSAges-to-encrypt

The graph is self-explanatory. Small wonder that hackers are winning the battle against security experts, the banking system is in crisis, teenagers lurk around every corner drinking Hooch and smirking, and I wake up screaming in the night, scared of my own hands. A radical new approach is needed.

This paper solves all these problems. It is no exaggeration to say that the encryption algorithm proposed here does for cryptography what Isaac Newton did for physics, what Alexander Fleming did for medicine, and what Monica Lewinsky did for Bill Clinton.

3 Heatherweight encryption

We have seen that existing algorithms are both heavyweight and cumbersome. In this section, we give the details of Heatherweight3 encryption, a simple and yet effective reinvention of the field.

The encryption algorithm is perhaps the simplest algorithm one could ask for. To encrypt a message m using key K, we calculate
EK(m) = <>

In other words, the ciphertext is the zero-length bitstring.

4 Proofs of optimality

We now give proofs that Heatherweight encryption is optimal in terms of ciphertext length, algorithmic complexity of the basic operations, and security.

Theorem 1 (Optimality of length of ciphertext): Heatherweight encryption produces ciphertexts that are of optimal size for data transmission and data storage.

The whole Internet, safely encrypted
Proof. Ciphertexts are zero length, regardless of the length of the input message. This means that the encryption also provides a level of compression that would make Huffman weep horrible tears. Any number of ciphertexts can be transmitted in zero time, and can be archived on even limited capacity storage media without using up any space. Using Heatherweight encryption, one can compress the whole of the Internet, and scribble the resulting ciphertext in full on the back of an envelope—without even needing a pen!

Theorem 2 (Optimality of algorithmic complexity): Heatherweight encryption and decryption are optimal in their time complexity.

Proof. It has long been assumed that the very best one might hope for, in terms of time complexity of encryption and decryption, is linear, simply because the algorithm needs to examine the whole plaintext to construct the ciphertext. However, the genius of Heatherweight encryption is that it produces ciphertexts that are independent of the plaintext. Encryption can therefore be done in constant time:
public byte[] encrypt(byte[] key, byte[] plaintext) {
    return new byte[]();

But what about decryption? It is obvious that for many encryption systems, the main security weakness is the decryption algorithm. Sometimes this is because of a flaw in the algorithm itself that allows an attacker to break the ciphertext without needing the key; but there are also timing attacks and suchlike to consider. Even in the absence of these tactics, there is still the possibility that the key will leak, or that the keyholder will be tortured and forced to send the key to the attacker along a rubber hose.

Heatherweight encryption solves these problems by simply not providing a decryption algorithm. Security is considerably tightened by this technique, as we shall see.

This means that decryption can also be considered a constant-time operation:

public byte[] decrypt(byte[] key, byte[] ciphertext) {
    throw new OperationNotSupportedException("meh");

Theorem 3 (Perfect security): Heatherweight encryption provides perfect security.

Proof. An attacker with access to a decryption oracle is unable to distinguish between EK(m1) and EK(m2), because all encryptions are the same, so it is impossible to distinguish anything at all. Note that we have not reduced this simply to an underlying hard problem, but to an impossibility.

This even thwarts a 24 attack. Normally Jack is able to beat the decryption key out of anyone, and Chloë can crack any encryption, though usually not until 23:59:57. However, with Heatherweight encryption, even if Jack makes me send him the key down the rubber hose, and Jack then sends it through the hose to Chloë, she is not going to be able to get anything other than OperationNotSupported exceptions.

5 Conclusion

Heatherweight encryption changes everything. Just as everyone remembers where they were when they heard that JFK had landed on the moon, so everyone will remember the day when they entrusted all their backups to the power of Heatherweight encryption.

6 Future work

Almost too good to be true
Research is already underway to construct a hash function based on Heatherweight encryption. I conjecture that the Heatherweight encryption algorithm itself could be used directly as a constant-time hash function; but I need to spend some time convincing myself that it would be collision resistant.

Infinite-capacity hard drives with transparent Heatherweight encryption will soon be available. A prototype is already in existence; write speeds are nothing short of phenomenal, though we are having teething trouble with the read operation, which for some reason keeps throwing OperationNotSupported exceptions. An investigation is underway.


The author is grateful to Antonio Banderas for inspiration. It was while watching his performance as Zorro that the zero function first surfaced as an idea for an encryption algorithm. Previous meditations on his co-star had led to consideration of the zeta function ζ(s) = Σ 1/ns, which did not work nearly so well.


**The University of Surrey’s legal team has formally requested that this work be submitted in a purely personal capacity.

1I use the royal ‘we’, but the sad fact is that I was unable to persuade anyone to act as co-author. My initial aim was to break the world record for the number of authors on an academic paper, but, owing to what must be considered a terrible short-sightedness on the part of the eighty or ninety people I approached (including my own mother), the current record must stand.

2SHA is currently on its 256th version! The first 255 versions go belly up, and they expect us to take SHA256 seriously!

3I am indebted to Peter Ryan for the name ‘Heatherweight’. Nonetheless, the University of Luxembourg’s legal team has asked me to clarify that ‘this does not reflect recommendation or endorsement of any of the rather confused ideas represented in this paper’. One is reminded of Decca Records’ decision in January 1962 not to offer the Beatles a recording contract.

Thursday, 16 June 2011

Conversion Of A Sad Man

What's the most theologically correct way to become a Christian? Are there tried-and-tested techniques? Traps to beware of?

As far as traditional options go, consensus among theologians is that the three most prestigious methods are:
  1. Seeing A Blinding Light;
  2. Climbing Up A Tree;
  3. Being Healed Of Paraplegia.
Obviously the third takes a little preparation and involves a certain amount of risk. You will need four friends and a big hammer.

At the other end of the scale, common schoolboy errors include:
  1. Building Some Barns;
  2. Putting One's Hand To The Plough And Looking Back;
  3. Going Away Sad.
These generally lead to trouble, and are to be avoided.

But what of the modern Gentile? How is he or she to move from darkness to light?

I can only offer you the benefits of personal experience. The following short video clip (I had no idea I was being recorded!) details my own conversion, and even the exact moment of regeneration.

I believe this is the first time that the precise mechanics of quickening have been captured on film. Scientists will no doubt get straight to work attempting to reproduce the phenomenon under laboratory conditions.

Monday, 6 June 2011

Anatomy of a ballot form

I still have a few Santander shares, ultimately dating back to the carpetbagging era and the sad demise of the Alliance & Leicester Building Society.

Recently I received my ballot paper for the forthcoming Santander AGM; and it represents a masterpiece of ballot design. There are twenty-five resolutions up for debate, with the self-explanatory names 1A to 12. I am supposed to reflect prayerfully on each, and then indicate whether I am in favour of the motion or against it. So far, so good: each resolution has a For box and an Against box to assist me in informing the General Secretary of the results of my twenty-five coin tosses.

For or against?

But wait! What if I'm unable to decide? Shouldn't I be allowed to abstain on some of the motions, and leave the decision to wiser heads? Should I just leave both boxes blank?

Careful: my eye catches sight of Note 1:
If you return the form and do not mark a box for an agenda item it shall be deemed that your vote is in favour of the Board proposal.
So a blank vote is the same as a vote in favour! One wonders why they need the For box at all. But back to the question: how can I abstain? Fret not: they've thought it through, and added a row of Abstain boxes below the For and Against boxes.

For or against or abstain? Or just leave it blank if you want to vote in favour.
That's a relief. Spurred on by the promise of "this fantastic credit/travel card wallet*" for returning my ballot paper,

*Stocks are limited.

I can now get down to the serious business of voting.

Hang on, though: what's that fourth row of boxes doing? Thoughts of that fantastic credit/travel card wallet can wait until I've sorted that out.

Should I tick the Blank box? Or just leave it blank?

So I can vote For, or vote Against, or Abstain, or leave it blank (which is the same as voting For), or I can vote Blank. That's the same as leaving it blank, right? So it's a vote in favour?

According to the By-laws of Santander, any proposal at the Annual General Meeting may be voted in favour, against or in blank. From a practical viewpoint, a vote in blank effectively works like an abstention.

So voting Blank is not the same as leaving it blank. "Voting in blank" (i.e., voting Blank) is the same as voting Abstain, whereas leaving it blank is the same as voting For. Got it. I can almost feel this fantastic credit/travel card wallet*

*Stocks are limited.

in my pocket.

But I needn't bother with filling in the paper at all: Santander, being efficient and eco-friendly, provide a means of voting online, and I, being married to a treehugger, feel compelled to take advantage.

The online voting web site offers many blessings unknown to the traditional voter. Not only does it provide effective protection against paper cuts, and the promise of a credit/travel card wallet every bit as fantastic as the one enjoyed by paper voters; the web site also fulfils its disability obligations by catering for those with split personality disorder. For each resolution, I can vote against myself by allocating some shares For, some Against, some to Abstain, and some Blank! Any unused shares will presumably be treated as blank (not Blank). No more worries about whether I did the right thing: I can hedge my bets and cancel myself out. Just a word of caution: remember that blank is the same as For, and Abstain is the same as Blank. So a truly agnostic vote doesn't allocate 1/5 of one's shares to each box: you want 1/6 of the votes For, 1/3 Against, 1/6 Abstain, 1/6 Blank, and 1/6 blank.

Maybe voting against myself is a little over the top. Let's hang the notion of voting against myself, and make a firm decision on each resolution. In which case I have twenty-five resolutions, and five options for each; so let's fill in the form like this:

That, according to the stated rules, is five resolutions marked For, five Against, five Abstain, five Blank(=Abstain), five blank(=For). So that's more positive than negative, but presumably the Board know roughly what they're doing, so maybe that's fair enough. I wouldn't want to be so spineless as to be overall neutral. Let's go ahead and cast the ballot.

And now the crowning irony. Here's the confirmation page:

D'oh! Your vote has been counted (errors and omissions excepted)...

Sunday, 8 May 2011

When Stroke Strikes, Act F.A.S.T. (2011 edition)

Every so often, something comes along to revolutionize medical science. In 1928 it was the discovery of penicillin; this week we found out that coffee, nose blowing and sex are nigh-on certain to give you a stroke.

This necessitates some sort of public health campaign to make people aware of the dangers. The NHS's "Act F.A.S.T." poster will, of course, have to be redesigned.

Fortunately, I've managed to get hold of an early draft of the new version. Expect to see this on bill boards around the country soon.

Thursday, 5 May 2011

Take your pen and your ballot paper, shut your eyes, and...

One of the most debated points about AV is whether it is too confusing for members of the public to understand. Nick Clegg says it's dead easy; David Cameron says it's much too complicated. Who is right?

Cameron looking confused

Clegg says that it's as easy as 1, 2, 3: all you have to do is to rank the candidates in order of preference. And once you stop having preferences, you stop ranking. It's no more complicated than asking someone to get you a cheese sandwich, and telling them that if there are no cheese sandwiches left then you'll have a tuna one instead. How can that be hard to understand?

Cameron, on the other hand, quotes from a book explaining AV:

As the process continues the preferences allocated to the remaining candidates may not be the second choices of those electors whose first-choice candidates have been eliminated. It may be that after three candidates have been eliminated, say, when a fourth candidate is removed from the contest one of the electors who gave her first preference to him gave her second, third and fourth preferences to the three other candidates who have already been eliminated, so her fifth preference is then allocated to one of the remaining candidates.

He's read it several times, he says, and still doesn't understand it; and he suspects most people will have similar trouble. How can anyone say that AV is easy?

So who's right?

Clegg looking simple
Essentially, they both are: they're talking about completely different things, one of which is simple, and one of which is complicated. Clegg says that AV is simple because it's easy to understand how to vote; Cameron says that AV is confusing because it's difficult to understand how the votes are added up. What you will have to do at the next general election, if the referendum gets through, is just not that complicated, and pretty much anyone can do it; but understanding how the numbers got turned into results is much harder, and is highly likely to fox a large proportion of the electorate.

So where does that leave us? The key question underlying this is: what should voters be expected to understand? Is it enough that they understand how to vote, or should the vast majority of voters also be able to understand how the votes are tallied?

One could make a good case for either side. One might well argue that as long as enough people understand the system and are satisfied that it is fair, then it doesn't matter if some other people don't understand the full details, as long as they are able to cast their vote. But it could also be argued that the democratic process should be transparent to everyone, that I have a right to understand what happens to my ballot paper after I drop it in the box, and that if the process is too confusing for me to follow then I'm denied full participation in the election.

I don't know the answer. But it is rather disappointing that the question hasn't been discussed, because it is an important one.

If you think that everyone should be able to understand how the votes are tallied, then AV is, as Cameron says, too complicated, and I don't see how you can support the referendum.

If, on the other hand, you think that that is unnecessarily strict, and that it is sufficient for voters to understand how to cast their votes, then AV is, as Clegg says, perfectly simple, and you might be happy to support the referendum (though this would only rule out one argument against it, rather than provide a conclusive argument for it).

But that's something you'll have to think through for yourself.

Oh dear. Confusing, isn't it?

Thursday, 7 April 2011

The Bottom Line: which cubicle?

One might think that a couple of months in Australia would be relaxing and refreshing, with freedom from the worries of everyday life. Unfortunately, it's one difficult decision after another.

Playing The Odds: In Search Of A Royal Flush
Yesterday, I was faced with a serious problem. I badly needed to take a dump. At home, that's not too much of a problem: realistically there is only one toilet that can be considered adequate, so there is no decision to be taken. Also, there is no danger of contamination: there are only two of us who live there, and I have reluctantly learnt to embrace Helen's bum as if it were my own. But I was at the University of Melbourne, and the situation called for some careful thinking: five communal toilet cubicles, and I knew nothing of their history. Where should I park?

As you enter the little boys' room, you are met by five cubicles on your left, with sinks on the right. The cubicles are not all equidistant from the entrance; and this is what gives the problem its crunchy texture. How do you find the least-used toilet?

Let me present you with my own reasoning, and then give you a chance to decide for yourself.

Pure Gamble? Let's Shoot Some Craps!

Obviously Cubicle 1 is out. It will receive far too much traffic from unthinking visitors who rush in where angels fear to sit. Pass by on the other side.

Doing one's business in Number 2 would have a poetic ring to it, but would also be misjudged. Plenty of customers will no doubt sensibly rule out the first toilet, but take the analysis no further, and dive head first into the second one. Besides, whenever the first cubicle is occupied, thoughtless types are going to be drawn to the second.

Now it gets harder. I suspect that the furthest cubicle would attract the naturally reclusive and socially withdrawn; and there are plenty of them in a typical computing department. So it, too, probably gets more than its fair share of attention. Number 5 would be a bum steer.

That leaves us with Cubicle 3 and Cubicle 4. What to do? It is tricky to make a strong case for one over the other. For a while, there was a serious danger that I would stand fixed for ever, equidistant between the two cubicles, like Buridan's famous ass. But at least the worst his ass had to look forward to, in the short term at any rate, was getting a bit peckish: my own ass, analogically speaking, was likely to force the issue if it didn't get some outside direction soonest. I had to make a choice.

Why would someone end up in Number 3? There are two plausible reasons:
  1. Someone is occupying Number 1 (highly likely), and our new chap wants to place a respectable distance between himself and the current occupant of Number 1. My guess is that in this case he would be likely to go for Number 3 (sufficient distance) or Number 5 (as much distance as possible).
  2. When all cubicles are empty, going in Number 3 preserves the symmetry. It may well appeal to a certain mathematical way of thinking that could be prevalent among computing academics.
Neither of those is a watertight argument, but on the other hand, I couldn't see any reason at all why someone would end up in Cubicle 4.

So, flying, to some extent, by the seat of my pants, I made friends with Number 4.

But I couldn't sleep last night.

The nagging thought: did I get the wrong one?

Have I embarrassed myself with foolish reasoning?

What would you have done?

Thursday, 31 March 2011

There are no non-Christians here...

One of my weekly lessons when I was at school was called 'Personal and Social Education'. Its goal was to ensure that I wouldn't end up as a geek.

I remember the teacher one day calling for meditation on the day's Blessèd Thought:
There are no strangers here; only friends we haven't met.
It was an embarrassingly crass and schmaltzy statement. What did he think the word strangers meant? It must have held some meaning for him, otherwise it wouldn't have made much sense to say that there were no strangers there. Anyway, we'd all met each other, and we certainly weren't all likely to end up as friends. As well as playing fast and loose with the meaning of strangers, it rather cheapened the meaning of friends to imply that everyone could be and should be friends with everyone else.

Recently I went to a church whose service sheet mentioned a weekly meeting for prayer for 'the chronically ill and not-yet Christians'. Praying for those who are ill (James 5:14), and praying that people would become Christians (Matthew 9:35–38) is, of course, an essential part of the Christian life, and I'm sure that the meeting itself was wholesome and honouring to God. But not-yet Christians? I can almost see my teacher nodding approvingly:
There are no non-Christians here; only not-yet Christians.
It's not the first time I've heard the phrase. It seems to turn up more and more, mainly in the context of spurring people on to evangelism. Google hits for the phrase are well into six figures.

But for all its optimism, I do find this language rather disturbing. This isn't mere linguistic pedantry: the language we use to describe people affects our perception of them, and eventually affects the way we treat them.

So what's wrong with describing non-Christians as not-yet Christians?

For one, it's horribly patronising. It's roughly equivalent to telling a child: I know you don't agree with me at the moment, but one day you'll see that I'm right. I'll explain when you're old enough to understand. How does that sound from the receiving end? How would I feel to know that my atheist friends describe me as a not-yet atheist, and my Muslim friends describe me as a not-yet Muslim?

Secondly, it demotivates our evangelism. It is odd that the phrase gets used mainly in the context of encouraging Christians to spread the gospel; it certainly doesn't have that effect on me.

Jesus sees those who live without him as lost sheep (Luke 15:3–7), as in mortal peril (Luke 13:1–5), as in imminent danger of being cut down (Luke 13:6–9). This is what gives evangelism its urgency: time is short. Any view of non-Christians as simply Christians-in-waiting may be very comforting, just as it may be more comforting to ignore the warnings on cigarette packets; but it is a dangerous game to play.

But finally, and most importantly, it contradicts Jesus' teaching. Describing non-Christians as not-yet Christians suggests that it is only a matter of time: eventually all non-Christians will become Christians. Jesus' love will win through in the end: just trust him to do what he has promised.

The trouble is that he has promised no such thing. There are narrow and broad roads (Matthew 7:13–14); there are good and bad trees (Matthew 7:15–19); there are solid and weak foundations (Matthew 7:24–27). At the last judgement, there will be a final separation into two groups (Matthew 25:31–46). Some of those for whom we pray will eventually become Christians; some will not. Christian faith is about trusting God to do what he has said he will do; trusting God to do what he has said he will certainly not do is pure self-deception.

Contrast the biblical Jesus with the not-yet Christian view of Jesus. Hear the words of comfort our much nicer, softer, all-inclusive Jesus brings us:
“Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but only the one who does the will of my Father who is in heaven. Many will say to me on that day, ‘Lord, Lord, did we not prophesy in your name and in your name drive out demons and in your name perform many miracles?’ Then I will tell them plainly, ‘There are no strangers here; only friends I haven't met.’ (Matthew 7:21–23, Not-Yet Version)

Tuesday, 29 March 2011

How to use your Android phone as a Linux live USB stick

Two of the things I carry with me everywhere are a USB stick containing a live Linux installation (so that I can boot Windows machines into Linux and get to my own desktop and files), and my phone. This week, in a fit of ruthless efficiency, I discovered that it's possible to do without the USB stick: I can plug my phone into a computer, and boot directly from it.

My wife's Windoze laptop, booted into Fedora using my phone
When I connect my phone (an HTC Desire, but this should apply to all Android phones) to a computer and set the phone to 'Disk drive' mode, it exposes the whole SD card as a block device. That means that you can do pretty much anything to it that you could do if it were a USB stick. Format it, partition it, boot off it...

That opens up a world of possibilities. Effectively you can carry your computer round in your pocket, with all the programs you want, and all your documents safely encrypted. For bonus marks, you can set your phone up to read the encrypted image and get access to your documents directly from your phone.

Here's what to do to get your phone set up for booting.

  1. Prepare a Fedora ISO image that you'd like to boot from. I've got my own that I built, with the programs on it that I generally use, but the easiest way to get one to experiment with is to download the live CD image from the Fedora web site.
  2. Make sure there's enough room on your phone's SD card. To play this game properly, you'll need enough space for the installation image (~650MB for the live CD), some space for a persistent overlay so that you can install and remove other programs and edit system settings (~350MB should be plenty), and some space for an encrypted filesystem containing your documents; so maybe 1GB plus document storage space. You don't need to repartition: this can all go on the FAT32-formatted partition you already have. (The whole process is non-destructive.)
  3. Set the FAT32 partition on your phone's SD card to be bootable. Plug your phone into your computer, put it in 'Disk drive' mode, and then use parted on Linux, or a GParted live CD, or whatever you Windows types use for partition management.
  4. Now install the image. I'm using Fedora, so the gubbins I need to perform the installation is already there, in the livecd-tools package; the command I use to install onto a USB stick is
    livecd-iso-to-disk --reset-mbr --overlay-size-mb 350 --home-size-mb 1024 whatever.iso /dev/sdb1
    Be very careful to get this right! You need to replace '/dev/sdb1' with the device representing your card's FAT32 partition. The '--reset-mbr' isn't as scary as it looks: it doesn't destroy the partition table, but it does set the master boot record to something that you can boot from.
  5. Reboot your phone to convince yourself you didn't brick it.
  6. Now boot your computer from your phone! Set your phone to 'Disk drive' mode again, reboot your computer, and hit F12 or whatever lets you choose a boot device, and select 'USB device' or equivalent.
I've found that it is a little slow when booting up, but operates at a fair old lick when running. Read performance isn't too bad, and write performance is hugely helped by the cacheing, as long as you don't do anything to hammer the disk. For web browsing, editing OpenOffice documents, programming and pretty much anything, it works very nicely. I even compiled a kernel and it coped just fine.

Answers to questions for more excitable types:
  • Do I need to have rooted my phone? No. All you're doing is using it to store some files. On the other hand, if you have rooted your phone, you'll be able to access the encrypted files directly from your phone.
  • What happens if my phone battery runs out? It won't. On my phone, at least, the USB port supplies more than enough power to keep it operating as a disk drive, so it'll charge up rather than drain.
  • What do I do if the phone rings? Answer it. There's nothing to stop you using your phone as a phone, as long as you don't unplug it, reboot it or turn it off 'Disk drive' mode. (That does mean that your FAT32 partition won't be mounted on your phone, so any apps that you've got stored on the SD card using the native Froyo system won't be operational. If you've used an A2SD-style separate partition, your apps will all work fine.)
  • What's the best way to make use of all this? That rather depends on what you want to do. I use Unison to sync my files so that everything's up to date, but you could equally use Dropbox or similar. Really, the sky's the limit: you can use it to do anything you could do with your normal computer.
  • How do I mount the encrypted partition directly from my phone? This takes a little bit of planning, and I'll write a full article on that soon. You need four things to get it to work:
    • a rooted phone;
    • a cryptsetup binary compiled for ARM (download);
    • a recent busybox binary (if you haven't got it already, install from the Market or download);
    • a phone kernel with compiled-in support for the encryption present in the encrypted partition.
    If you don't already have the first, you probably shouldn't be messing with this low-level stuff. The fourth is the trickiest, but not impossible; and by far the easiest approach is to change the encryption to match your kernel rather than change your kernel to match the encryption. Here's the rough outline of what to do to open the image, and how to change the encryption if necessary. It assumes some familiarity with doing bad things to your phone:
    1. Use adb shell to get a terminal on your phone.
    2. Map the encrypted image to a free loop device:
      1. Use busybox losetup -f to find a free one.
      2. Create it if necessary: busybox mknod -m 0600 /dev/loopx b 7 x (replacing 'x' with the number of the first free device, if it doesn't exist).
      3. Check that the one you've created is still free! It should be, but for some reason, when I create /dev/loop0 through to /dev/loop3 on my phone, they all get eaten straight away. Anything numbered from 4 upwards works fine for me.
      4. Map the device: busybox losetup /dev/loopx /sdcard/LiveOS/home.img
    3. Try to open it: cryptsetup luksOpen /dev/loopx enchome
    4. If you're lucky, it'll open fine, and you won't need to change the encryption. If you get an error telling you to check your kernel for the right cipher support, it means you're going to need to change the encryption. If you've stored anything important in the encrypted image, stop and copy it out, because this will destroy it (but you only have to do it once):
      1. Format it with a different cipher:
        cryptsetup --cipher=aes-cbc-benbi luksFormat /dev/loopx
        You might need to try different cipher specs till you find one that your kernel supports. You could try 'aes-cbc-plain' or just 'aes' or even 'twofish'. A look at /proc/crypto will give you some clues as to what's available, but it's not easy to work out exactly what it all means. Make sure you stick to something that gives you a decent level of security.
      2. Try opening it again, using the luksOpen command above.
      3. You'll now need to format it again, with
        busybox mke2fs -m 0 /dev/mapper/enchome
        If you get an 'applet not found' error, your version of busybox isn't recent enough.
    5. Once you've successfully run the luksOpen command, you can now mount the image. Make an empty directory somewhere that you can mount it in (say, /sdcard/encimage), and then mount it with: mount /dev/mapper/enchome /sdcard/encimage
    From now on, you should be able to follow this procedure (without needing to change the encryption every time) to mount the image with full read/write access. This really needs automating, and a little GUI putting together... I'm working on it.