Monday, 30 June 2014

Flagging Demand


England car flags being sold for a discount at a supermarket in London, after England's first-round exit from the Football World Cup.

If I had any sense I would buy the lot, and sell them before Euro 2016 at a 700% profit.

Saturday, 21 June 2014

Seasons 2: Island Gardens, London

Move your cursor over the image below, and it should change to another image of the same scene in a different season. (If it doesn't work, check that your browser has JavaScript enabled.)


Base photo:31 May 2014
Mouseover photo:13 November 2011
Approx. coordinates:51.487°N, 0.008°W

One day in the autumn of 2011, I mentioned to my cousin that lots of people walk their dogs in my neighbourhood park. She likes dogs, so she asked for photos. The mouseover photo in this post is one of the few photos I took that day which does not have a dog in it. Summer is my favourite season in London, but there's no denying that the sugar maple trees in the park are at their best in autumn.

The base photo was taken last month, but I thought summer solstice is as good a day as any for a Seasons post.

Happy solstice, everyone!

Friday, 20 June 2014

The Roti Algorithm

Rotis (by which I mean the thin, circular rotis cooked without oil, called ruti in Bangla) are made by rolling atta (unleavened wholegrain wheat) dough into thin circular disks, which are then cooked over a dry tawa.

Cooking one roti at a time is inefficient because firstly, you waste time placing each roti on the tawa and then taking it off, and secondly, by the time the last roti is cooked, the first one is no longer warm. It is possible to cook several rotis on the tawa simultaneously, but to be properly cooked, each side of each roti must be in contact with the tawa for roughly the same period of time. Like most experienced roti-makers, my mother achieves this by flipping the rotis in a complex sequence. But when I asked her, she could not tell me what exact sequence she follows, because the technique, born of long experience, comes naturally to her.

So I gave some thought to the problem, and came up with an algorithm for cooking any number of rotis on the tawa at the same time, thus bringing advanced techniques within the grasp of even the most hapless roti-noob.

The algorithm is best illustrated by a flowchart:


A couple of definitions which are used in the flowchart or later in this post:
"Lowest Side" means the lower side of the bottom roti in the stack (i.e. the side in contact with the tawa).
"T" means the time taken to cook the Lowest Side, and is counted from the instant of completion of the most recent flip of all the rotis in the stack.

Some notes on the algorithm:
•As it is inconvenient to flip or remove rotis which are in the middle or bottom of the stack, I designed the algorithm so that (a) the flip operation only involves flipping either the top roti or the whole stack, and (b) once a roti cooked on both sides, the next action always brings it to the top of the stack whence it can easily be removed.
•On high heat, the Lowest Side gets cooked before it can conduct much heat to the roti above it. So while the Lowest Side is being cooked, the states of any rotis above the bottom roti are not significantly affected.
•To make multiple rotis at once, the dough has to be fairly dry so that the rotis in the stack do not stick to each other. If they're still sticky, it helps to spread a thin film of dry atta on each roti.
•It is rarely necessary and never practical to cook more than 5-6 rotis at a time, because the time thereby saved is offset by the difficulty of flipping several rotis at once. But the algorithm works for any number of rotis.

The algorithm is actually easier to master than the flowchart might suggest. Once you get the hang of it, the next step is obvious even without referring to the flowchart.

To give you an idea of how the algorithm works, I made a short animated video (0:36) for 6 rotis. Each side of each roti is represented by a black rectangle, which turns red when it is cooked. T in the video is 1.5 seconds, which is shorter than the actual time it takes to cook one side of a roti in real life.

Friday, 13 June 2014

Atheism and the En Dash

There was an odd article in the Guardian today which argued that "there are no atheist babies". Specifically, the author took issue with a Richard Dawkins quote: "When you say X is the fastest growing religion, all you mean is that X people have babies at the fastest rate. But babies have no religion."

'Atheism' can mean either a rejection of the existence of deities (explicit atheism) or, more inclusively, an absence of belief in the existence of deities (implicit atheism). The article is odd because it argues that babies are not explicitly atheist, while Dawkins was only saying that babies are implicitly atheist.

But my main quibble with the article is the paragraph below:


Not one but two consecutive lines begin with an en dash. I really think that a self-respecting newspaper should precede a parenthetical en dash with a non-breaking space so that a line can end – but never begin – with an en dash. In HTML, it is coded as  – followed by an ordinary space.

In some of my old posts you might come across a spaced en dash not preceded by a non-breaking space, but there is an explanation for that. Anyway, I must not get complacent; I learn new things all the time. In a recent post I wanted to use double quotes followed by a left parenthesis, and I realised that some browsers might insert a soft return between the two punctuation marks. In case the information is of use to anyone, I got around it by coding the text thus: <nobr>"(S)he</nobr> did it!"



Edit: I have just learnt from Tommy that <nobr> has been deemed a non-standard element, but the same effect can be achieved with CSS:
<span style="white-space:nowrap;">"(S)he</span> did it!"
Like I said, I learn new things all the time.

Wednesday, 11 June 2014

Bellingham, 12:53 pm


On the drive down from Mount Baker, I saw a good example of a 22º halo, an optical phenomenon caused by the refraction of sunlight by hexagonal ice crystals in a layer of cirrostratus nebulosus cloud. The inner edge of the halo is red and the outer edge bluish, though this could be seen more clearly with the naked eye than in the photo.

The 22º halo is actually a fairly common phenomenon, occurring up to 100 days a year in temperate latitudes. If you haven't seen it, it's probably because you are wise enough not to stare at the sun.

Saturday, 31 May 2014

Tuesday, 27 May 2014

Seasons 1: Parade Gardens, Bath

Move your cursor over the image below, and it should change to another image of the same scene in a different season. (If it doesn't work, check that your browser has JavaScript enabled.)


Base photo:20 January 2013
Mouseover photo:26 May 2014
Approx. coordinates:51.382°N, 2.357°W

I am hoping to make Seasons an occasional series, so keep a weather eye on this blog.

Sunday, 25 May 2014

Six Days in Kyoto

A friend of mine who was travelling to continental Europe for the first time recently asked me for advice on how to plan her trip, specifically, whether to cover lots of cities, or visit fewer cities but spend more time in each. As someone who likes to travel but is perenially constrained by holiday and budget limitations, this is a problem to which I have devoted much thought. And my musings have led me to come up with the Urban Travel Enjoyment Curve (UTEC).

The exact shape of the curve depends on a number of factors including personal preferences, the city in question, and the expense of travelling to and living in the city, but the form of the curve (for me, and – I believe – for most people) is something like this:


If, for instance, I misguidedly planned a trip to Paris where I would only get to spend 30 minutes in the city, my enjoyment would actually be negative. The time, money and effort expended in travelling to Paris and back would outweigh any enjoyment I might derive from my 30-minute visit. So for small values of t, UTEC lies below the t axis, i.e. enjoyment is negative.

At a slightly higher value of t, perhaps around 30 hours, UTEC intersects the t axis. This is the point where I would be indifferent between going and not going for the trip.

Initially, each unit of time spent in the city produces increased enjoyment, and the rate of increase is positive (i.e. UTEC is convex downward). Then it reaches an inflection point, after which enjoyment still increases but the rate of increase is negative (i.e. UTEC is concave downward). Finally, after I have had my fill of the city, my enjoyment peaks and then goes downhill because of mounting hotel costs, foregone opportunities to visit other places, and so on.

If only we had a formula for each city's UTEC, trip-planning would be reduced to a simple optimisation problem. Since we don't, we have to rely on guesswork, which means UTEC – like most things on this blog – is mildly interesting but ultimately useless.

One trip where I got my planning absolutely spot-on was in the summer of 2011, when I was living and working in Tokyo.

For the six-day Golden Week holiday, I toyed with the idea of visiting several cities, but eventually I decided to spend all six days in Kyoto. Kyoto has dozens of wonderful things to see and neighbourhoods to explore. Besides, it would be ironic to do a whirlwind tour of, of all things, Zen temples and rock gardens built for contemplation.

With the luxury of six full days at my disposal, I took in the sights at a leisurely pace, spoke to many people I met, and slept in parks when I tired of walking. Some of my nicest memories are of places I would probably have left out of a tighter itinerary. Here are three such stories.

A Chance Encounter

For reasons not entirely clear to me, Japanese visitors to Kyoto sometimes like to dress up as geishas and stroll around Minami Higashiyama.


Many photos of "geishas" taken by foreign tourists are in fact of tourists in costume; real geisha are elusive and few.

But late one evening in Gion, returning to my hostel after dinner, I unexpectedly saw a real geisha. We crossed each other in a narrow alley; I hadn't noticed her until she was five feet away. It seemed disrespectful to take a photo, and in any case, I was too awestruck to do anything.

Friends have asked me how I knew she was a real geisha. There was something about her walk, her poise and the way she wore her clothes; I saw her and Knew.

Philosophy and Tortoises

My favourite walk in Kyoto is Tetsugaku no Michi (Philosopher's Path), a pedestrian path along a cherry-tree-lined canal. The path goes past temples, shrines and back-gardens, and is named after a Zen philosopher who used it for daily meditation.

It was a pleasant walk, but more than that, it was fun because I found myself ascribing philosophical implications to the most mundane things I saw or heard: the overheard conversations of other walkers, a spider ensnaring a butterfly, a swimming tortoise.

Actually I might have missed the tortoise, if not for the two Japanese guys who were observing it with interest.


The tortoise was trying to swim across the canal but the current impeded it, and though it had nearly made it to the other bank, the little guy was evidently at the end of its strength. One time it clamped its jaws onto a reed, but the reed broke off and was swept away with the current. Finally, after a supreme effort, the tortoise safely reached the bank. The Japanese guys looked at me delightedly and said, "Yokatta!" Which means something like "(S)he did it!"

The Cutest Thing I Ever Saw

Shimogamo Jinja is not as spectacular or historically significant as some other shrines in Kyoto, but I wanted to visit it because behind the shrine lies a sacred grove known as Tadasu no Mori (the Forest Where Lies Cannot Be Concealed). Not surprisingly, it is a popular spot for settling disputes and for first dates.

But I had an unexpected treat in store. There was some kind of competition going on, and the courtyard in front of the shrine was filled with young kendo trainees.


Scores of toddlers wearing balloons on their helmets and bashing each other over the head with sticks – if there is a cuter sight than that, I am yet to see it.