Strange days

I walk down a narrow, high walled alley of some Mediterranean village. The sun beats down through the topless canyons, a harsh glow, warmth evaporated, an exuberant promise unkept.

Energy suddenly drains from me instantaneously, my legs sag and I flop against the blue wash wall, totally spent, the bag that I’m carrying falling limply to the ground. People stroll pass; some look at me, but through me, no recognition apparent, no friendly hand or aid. The remainder continue on oblivious. I’m not going any farther; this is where I’m going to stay, anchored to this ground, destination unknown and irresistibly unreachable.

Two young girls ride pass on bikes, they giggle as they pluck the sunglasses from my face. The sun flares in my eyes angrily, yet its heat still plays truant. Cute I think and wait for them to return them to me, but they don’t – they ride off, content with their spoils, unsympathetic to the fire in my mind. How could they? I ponder as if it really matters.

Time passes; an age; an instant. I return and I’m still affixed. I look down to my bag, the pound cake I was carrying is gone, no evidence of its existence, unless a bent clipboard and a crumpled piece of paper are a new confection.

I’ll go no farther I think, this is where I’ll stay.

Dear mister turdburger

To the turdburger who lives in my apartment block,

I know that you might think it’s funny to press all of the eight lift floor buttons just before you get out at the ground floor but I’ll tell you something: it’s not, especially when you’re waiting in the basement for that lift which is already one of the slowest lifts in the world. Luckily on this occasion I didn’t have any takeway food with me that was diminishing in quality due to those peskily irresistible laws of thermodynamics but let me tell you this: if I actually catch you doing it you will get a very rude education in what a man with a loud, booming voice and some very choice words can do to your quaint sense of humour.

Cheers,
Your fellow lift user and the voice of fucking reason,
Chris

JavaScript reduce

Tonight Matt posted a JavaScript solution to a problem he saw described elsewhere. Here’s a version that I whipped up to use JavaScript 1.8’s new Array.prototype.reduce function.

var arrVal = ["a", "b", "c", "c", "d", "e", "e", "e", "e", "e",
  "f", "e", "f", "e", "f", "a", "a", "a", "f", "f", "f"];

function group(previousValue, currentValue, index, arr)
{
	if (index > 0  && arr[index - 1] == currentValue)
		return previousValue.slice(0,-1).concat([previousValue.slice(-1)[0].concat(currentValue)]);
	return previousValue.concat([[currentValue]]);
}

function format(previousValue, currentValue, index, arr)
{
	return previousValue.concat(
		currentValue.length < 3 ? 
		currentValue.join(" ") :
		currentValue.slice(0,2).join(" ") + 
			" " + currentValue.slice(2).join(" ") + "");
}

print(arrVal.reduce(group, []).reduce(format, []).join(" "));