Sunday 3 November 2013

Most useful phrase


On our recent holiday to Barcelona, Jess and I got to pondering one of those questions that people like us sometimes like to ponder: what is the most useful phrase to learn how to say in a foreign language?

All this started because we began by discussing the "uselessness" of the phrase "do you speak English?" (or it's equivalent, in whatever language). This phrase is functionally completely useless, because the answer is only useful if it is yes. You don't lose anything in pure communication terms by asking "Do you speak English?" in English, rather than, say, "Hablas Ingles?". There are social reasons why "Hablas Ingles?" is not actually completely useless - people are likely to be better disposed to you if you bothered to learn how to ask even such a basic question in their own language, but for the purposes of this discussion, let's assume that people are all Vulcans, and that language is only used to convey information, rather than having any cultural or social function.

What phrase might be useful to know in Vulcania (not sure why I just invented a place where Vulcans live, instead of going with the more usual Planet Vulcan)? You could know how to ask directions to the bank, but there are hand gestures, and various other ways you could manage to get that information across. If we're talking about somewhere on Earth, then the chances are that you'll be able to find someone that knows the English word for "hospital" or "taxi". Actually, the word for "hospital" is likely to be irrelevant - if you desperately need a hospital for some reason, you're probably bleeding or screaming out in pain, or otherwise going to be able to indicate what the issue is. The only thing I managed to come up with that might be useful is if you have some specific medical condition - might be good to know the word for insulin if you're diabetic, or for peanuts if you have a severe allergy. Other than that, I'm stuck trying to think of the one phrase I'd absolutely need to know. 

On a related note, the phrases I actually do know how to say in more than three languages are "I love you" (totally useless, I'd have thought), "kiss me" (not quite as useless, but again, non-verbal communication might work better for that), "f*ck off" (again, can usually be expressed non-verbally)  and how to count to 10 (pretty much totally useless, given that I have 10 fingers on each hand). Wonder what I'd learn next.

Saturday 5 October 2013

Living in the future

By now, it's probably pretty banal to observe how awesome it is to live in the future, what with self-driving cars, and working exoskeletons, and all that jazz, but I'm going to write a post about it anyway. It's partly inspired by Steve Landsburg's posts on progress

I went to Barcleona last weekend. This would have been impossible for anyone at all before about 1950, and impossible for anyone who wasn't a lot richer than me before (I'm guessing here) about 1990. So that was awesome. What was even more awesome (in a sci-fi sort of way) was how much of the process of going all the way to Barcelona (that's just over 1000 miles each way, if anyone's counting) could be done without my having to interact with another human being.

I booked my tickets online at the Ryanair website. This was entirely computerised, and I'm pretty sure Ryanair would have charged me extra if I wanted to talk to another human at any point in the process. Jessica also booked the accommodation we stayed in online (AirBnB), although that did involve picking up the key from the person whose flat it was.

I then set off for Barcelona with the only information about how I was going to be meet up with Jess being that she was at a conference at the World Trade Centre in Barcelona. That was it. I didn't arrange where to meet, or bother finding out where the WTC was, because I knew that I could figure all of those things out when I got there, with the awesome personal computer that I carry in my pocket everywhere I go. So that was nice.

I bought my train ticket from a real person, in order to get the half price tickets for going to Prestwick Airport, but obviously that's a process that has been automated. I bought some food from Tesco on the way to the train station - again, no need for human interaction. I did have to give my boarding card to a human being, but I'm pretty sure this is mostly anachronistic. Then when I got Barcelona, I bought my train ticket from a machine, went into the city centre, and got walking directions to the World Trade Centre from Google once I got off the train.

Think about just how much more difficult this would have been if we were restricted to 1986 technology. Firstly, we wouldn't have been able to afford to fly to Barcelona. Secondly, we would not have been able to find anywhere similar to stay, as AirBnB didn't exist. Thirdly, I'd have had to make sure to go to a bookshop somewhere (probably in the UK) in order to buy a map, so that I could get off at the right train station in Barcelona to be able to find the World Trade Centre. We'd have to had to carefully arrange a meeting place in advance, and that meeting place would have had to be more specific than "near the World Trade Centre", which would have been quite restrictive for one of us, as I didn't have a very accurate model of how long it was going to take from the plane landing to me being in Barcelona centre.

In fact, this would have been enormously more difficult even if we were restricted to the technology available in 2006. In 2006, we couldn't have used phone navigation, AirBnB or possibly even been able to afford to use our phones abroad. We couldn't have relied on communicating by email using the WiFi networks that exist basically everywhere, and we couldn't have leveraged those WiFi networks with Viber, or Skype (I don't think it was working on mobile phones by then - it was only 2 years into the iPhone existing).

Anyway, I just like to rhapsodise about the awesomeness of technology, and avoid worrying about the fact that it appears to be making humans obsolete, so


Sunday 29 September 2013

Sainsburys self-checkouts and lazy UI design

So, I know it's almost a cliche to complain about the self-checkout machines in supermarkets, but I generally find them incredibly efficient. I'm going to try and write this entire post (which won't be very long) without mentioning "unexpected items" at all. 

As I said, I usually find the process very efficient - at our local Tesco, it means one staff member can be serving about 15 customers at one time, and I very rarely have any major issues, although I guess I am younger and more tech-savvy than the average person, so it's possible there are some features that I just sort of take for granted which are in fact confusing. There's an interesting article at coding horror on this. However, there is one feature of the Sainsbury's version of this machine which I find extremely annoying. 

When you have scanned all your shopping, and pressed the button which takes you to the payment screen, if you insert your card into the card reader, you get this message.


As you can see, this message annoys me enough that i took a photograph of it. In case that's not legible, it says "Please press the card button". Now, I know for most people reading this it will be immediately obvious why this is terrible, so please excuse me while I rant for a moment:

The machine knows that I entered my card into the card reader. It knows that every time anyone ever enters their card into the card reader, they should have pressed the card button first. So why the hell doesn't it "press the card button" for me? 

I really only think of one plausible explanation - the way the person writing this software had implemented the "card button", it was much easier to put in this intermediate screen and have the user go back and physically press the button than it would have been to automate the process. I can think of no possible good reason. (I can actually think of one other bad reason to do this - it was somehow part of whatever specification the developers were working from that people had to explicitly push the card button to pay by card - but that just pushes the incompetence up a level). 

As evidence that there is no good reason, the machines at Tesco do display the sensible behaviour - if you insert your card once you'e gotten to the payment screen, they behave in exactly the same way as if you'd pressed the card button first. 

Now, assuming my laziness explanation is correct, this is really, really lazy. This is the sort of lazy that I probably wouldn't try to get away with if I were writing an Excel macro to be used by half a dozen people in my office. How on Earth did someone get away with it when writing software to be used by the general public, for one of the biggest retailers in the country? Perhaps the World is Mad after all (incidentally that is a reference to a future post that I haven't written yet, maybe it will work as some sort of commitment device...).

Thursday 19 September 2013

The first 100 hours

So, I recently read The First 20 Hours, by Josh Kaufman. This books is very weird, in that it basically seems to consist of Josh Kaufman coming up with one pretty interesting idea, which can be written in about two sentences, or at most two paragraphs, and then trying to figure out a way to spin it out into an entire book.

The idea, basically, is that you will get surprisingly good at things surprisingly quickly if you just commit to practising them on a regular basis for a reasonable amount of time, and if this practice is sensibly directed. These ideas are amply summarised, along with several anecdotes, in the first 39 pages of the book, (which, incidentally, is in large type). In fact, the enormous majority of it is summarised in these 10 tips: 
  1. Choose a lovable project.
  2. Focus your energy on one skill at a time.
  3. Define your target performance level.
  4. Deconstruct the skill into subskills.
  5. Obtain critical tools.
  6. Eliminate barriers to practice.
  7. Make dedicated time for practice.
  8. Create fast feedback loops.
  9. Practice by the clock in short bursts.
  10. Emphasize quantity and speed
And yes, I agree, most of these are pretty obvious: I mean "obtain critical tools"? Here's me thinking I could learn to play the guitar with just a piece of string and some chewing gum...

The rest of the book is 5 examples of Kaufman applying his methods - he learns to play Go to a not-totally-terrible standard, buys a yoga mat (this is almost literally accurate - he "learns" yoga in a total of 3 hours practice, incidentally, his wife is a yoga instructor...). builds a simple website, learns to play the ukulele from scratch, and learns to windsurf.

Of these, the only one that is actually impressive is the ukulele - he goes form nothing to playing in front of a fairly large audience in literally a week which, while it is obviously possible when you stop to think about it, sounds exceedingly daunting the first time you hear it.

Anyway, pretty much the most important sentence in the book is one which I don't think is even in the book (I mostly skimmed it), but is certainly in his TEDx talk.
The major barrier to learning something new is not intellectual... it's emotional... feeling stupid doesn't feel good.
I'm not even entirely convinced that it's fear of feeling stupid. It's just easier to sit and watch TV than it is to pick up the guitar and play some terrible approximation of Au Clair de la Lune (because you haven't even started to learn tunes that you actually want to be able to know how to play), or try to figure out how to install an API so you can write your first Android app, or drop juggling balls all over the floor. I think the key idea in the book is that you should commit to spending 20 hours learning something (and admit that it's ok to be terrible at it for a good portion of those 20 hours), and just see how far that takes you.

So, anyway, I've decided to learn some new things. 20 hours a month is 40 minutes a day (which is conveniently just about the time I have left for myself if I come home in my lunch hour). I have decided to spend 100 hours over the next 6 months (allowing for the days when I don't get round to practising, etc) learning 5 new skills. I'll be keeping track of the time carefully (principles 7 and 9, I think).

I haven't yet decided what the 5 new skills are, but I think the first one will be playing the guitar. I bought a toy guitar from John Lewis a few months ago, and haven't played it at all because I can't tune it. When I recently got a new phone, on which the tuning apps actually work, it became much more appealing (obtain critical tools; remove barriers to practice). On the principle that generalists ship, and even though I'm very clearly in the dabbler phase right now. I'll try to record a video, or at least an audio recording of me playing something when I get to my 20 hours, and I'll post that, along with an update on what the next skill is going to be.

Friday 13 September 2013

A return to blogging (for a while)

When I was in California a couple of years ago, Michael Vassar said something to me that pretty neatly summed up some vague thoughts I'd been having myself. Describing my existing blog (which has since gone on hiatus), he said that the majority of it was "like shooting fish in a barrel", and he's right. Most of my blog posts are about how crazy homeopathy is (shocking!) or how some immigration is probably a good idea, or nuclear power just isn't that dangerous. Now, some of these ideas might be part of the correct contrarian cluster, but most of them aren't even that - certainly not among the people I usually mix with. Most of them are part of the correct non-contrarian cluster. Pretty much everyone I know would agree with pretty much everything I've ever written on this blog. I've no idea if I should consider that a bad thing. I've been considering starting writing posts regularly again for a while, and haven't for three main reasons. One of them is that I expect that for a while, the posts would end up being navel-gazing rambles about why I haven't been blogging for a while*.  The second is that I was looking for work in relatively mundane professions, so was being fairly careful about my web presence. I'm now pretty settled in in my current job, and hopefully next time I'm looking for work, it will be somewhere where an interesting web presence is a bonus, rather than a hindrance. The third is that I'm just not sure that I'm right about as many things as I was sure about even two years ago, and I'm even less sure that the things I'm sure I'm right about are the areas where my ideas are interesting/entertaining/important. A few of the posts I'll write over the coming weeks will touch on this theme, but don't worry, I'm sure there'll still be some shooting of fish a barrel.

Anyway, to avoid this turning into a seriously long rambling introspection, I'm going to stop there, and commit (semi) publicly to writing at least one blog post a week until the end of the year. Hopefully at least one or two people still check in here every now and then, and if I do manage to keep up one a week, I'll probably start telling people about some of them. Also, bizarrely, I've still been getting 15+ hits a day even though I haven't been writing anything for about two years - Google is powerful!

* On this note, and to avoid saying it elsewhere - I was genuinely surprised by the number of people who noticed when I stopped posting a couple of years ago - come on people, how do I know you're reading this if you don't tell me until I stop writing it?

Sunday 18 November 2012

CJ Cregg and the Intermediate Value Theorem

I have started watching the West Wing all the way through, and just got to an episode entitled 'Evidence of things not seen', in which one of the subplots is CJ claiming that it is possible to balance an egg on its end only at the Equinox. The rest of the President's staff is reassuringly dismissive of this idea. CJ is the gullible one (she was shocked to discover that the Mercator projection is not the only way to draw a flat map of the Earth). However, they were wrong in thinking that this feat is never achievable (to be fair, I'm not sure if that Snopes page was written when that episode of the West Wing came out). However, that was not the bit that was interesting to me. There was another thing CJ said of which the staff was equally dismissive. She said:
There's a point on the Earth where the temperature is exactly the same as the temperature at point you'd get to if you drilled right through.
CJ was laughed at for this claim. Will Bailey's immediate response was "no there isn't". My immediate response was "that sounds eminently plausible". Perhaps that's why I have a degree in maths and Will Bailey is a fictional character with a degree in law.

Now, I'm guessing that this is also eminently plausible to the majority of people reading this, as I'm guessing the majority of people reading this also have maths degrees. However, I'm going to expand a little, and mention in passing a few other somewhat surprising facts which are true for exactly the same reason. That reason is something called the Intermediate Value Theorem.

The intermediate value theorem states that for any value between the minimum and maximum value of a continuous function, there is some point where the function takes that value (a continuous function is, basically, one that doesn't jump around - a slightly more formal definition (in fact, a very good approximation to the actual formal definition) is 'a function where small changes in the inputs result in small changes in the outputs')).

 It's one of those theorems that is insanely obvious, but mathematicians like to prove anyway (not to quite the same extent as the Jordan Curve Theorem, but still). The intuition for the theorem is very powerful. Basically, it says that if you start here, and walk to somewhere that's 100m away from here, then at some point you were exactly 50m away from here. Obvious, but powerful... Now, draw a circle around the Earth, and consider any continuous function which takes a value above zero somewhere on the circle, and a value below zero somewhere else on the circle. This function must take the value zero somewhere on the circle. 

Now to prove CJ's Antipodean Theorem, just consider the function 'the temperature here minus the temperature at the point directly opposite here on the surface of the Earth'. This is pretty obviously continuous (to a good approximation) - temperatures don't just suddenly jump as you move a few centimetres around the Earth, and it's pretty obviously higher than zero at some point on the Earth and lower than zero at some other point on the Earth (just pick any two points which are opposite each other and have *different* temperatures). QED. Note that this proves not only that there is a point somewhere on the Earth with this property, but also that there's a point *on every single great circle around the Earth* with this property.

There are several other fun real-world applications of the intermediate value theorem. For example, there's the wobbly table: if you have a well-made table, then you can always balance it somewhere on any surface, however uneven. The Ham Sandwich Theorem: If you place a piece of ham on a slice of bread, there's always one vertical cut which will divide both the ham and the bread exactly in two. There's also the Beer Glass Balance trick, which I've always thought of as vaguely related to the IVT, but never quite figured out why.

Incidentally, it's actually quite easy to balance an egg on its end - although it has nothing whatever to do with the equinox. Don't believe me? Try it.

Thursday 7 April 2011

Things that might be as wrong as racism

In The Descent of Man, Charles Darwin wrote:
"At some future period, not very distant as measured by centuries, the civilized races of man will almost certainly exterminate, and replace, the savage races throughout the world. At the same time the anthropomorphous apes, as Professor Schaaffhausen has remarked, will no doubt be exterminated. The break between man and his nearest allies will then be wider, for it will intervene between man in a more civilized state, as we may hope, even than the Caucasian, and some ape as low as a baboon, instead of as now between the Negro or Australian and the gorilla."
We now consider this to be not merely morally repugnant, but factually incorrect (and, yes, I did mean to put those two clauses in that order). However, when Darwin wrote this passage, such racist statements were commonplace. There was nothing even vaguely controversial about the idea that white men were better than Negroes. This poses an interesting question: what moral or political positions do we hold today that will, or might, be as utterly repugnant to future generations as Darwin's casual racism is to us? I can think of a few:

Patriotism

It is currently considered perfectly acceptable for Walmart to declare that they try to "Buy American", and for British politicians to claim that products made in this country should "proudly display the Union Flag". This is exactly as immoral as racism, for exactly the same reason. (Steve Landsburg has been pointing this out for a while - see, eg, this video). I can only hope that there will come a time in the future when such blatant tribalism: the utterly deplorable idea that I should care more about a complete stranger who happens to have been born on the right side of some arbitrary line, is considered every bit as heinous as the utterly deplorable idea that I should care more about some complete stranger who happens to have been born with the right colour skin.

Drugs

It is currently considered immoral to ingest certain substances. So much so that we have passed laws banning the ingestion of said substances. This strikes me as bizarre. It seems eminently likely that, at the very least, the substances which we consider it immoral to ingest will change over time.

Transplants

There are people who seriously suggest that it would be immoral to switch the law regarding transplantation from a default "no" to a default "yes". This is plainly ridiculous, as is the idea that a market in organs is immoral. However, I can actually imagine future generations going one step further, and being utterly horrified at the idea that we let people die from lack of transplants when there were perfectly good organs rotting away inside human carcasses: as if the dead people had some use for them! Compulsory post-mortem organ donation is certainly a plausible moral imperative.

Meat

We bring sentient beings into existence, feed them, house them, and kill them just in order to eat their dead bodies. I can easily see how a future society in which either meat has just dropped rapidly out of fashion, or in which meat production no longer requires the participation of sentient beings, might hold us to account.

Children

I am not the first person to have noticed that children are essentially treated as non-people in our society. I can easily imagine the way we allow parents to completely dictate their children's lives could be considered morally repugnant. Also relating to children: it seems quite plausible that our current attitude to Child Sexual Activity is somewhat misguided (see, eg Rind Et Al) - the very fact that I'm almost afraid to write that statement in public without a string of caveats should tell us, at least, that society's current attitudes to CSA are too emotional to be completely rational.

Other things

Almost all of the examples I've managed to come up with are examples in which I'm fairly sure that the current mainstream moral opinion is actually wrong, or at least in which I'm fairly sure it could be wrong. Clearly this is a failure of imagination on my part - there is almost certainly at least one thing that wouldn't even occur to me that will be seriously considered to be a moral issue in, say, 250 years' time - anyone have any ideas what it might be?