<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kera.name Articles</title>
	<atom:link href="http://kera.name/articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://kera.name/articles</link>
	<description>tomalak's occasional commentary on Internet, PHP, TV and Life</description>
	<lastBuildDate>Fri, 13 Jan 2012 14:17:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Here&#039;s Another One</title>
		<link>http://kera.name/articles/2012/01/heres-another-one/</link>
		<comments>http://kera.name/articles/2012/01/heres-another-one/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 14:17:56 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stack Overflow]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=887</guid>
		<description><![CDATA[<a href="http://kera.name/articles/wp-content/uploads/2012/01/anothershitone.png"><img src="http://kera.name/articles/wp-content/uploads/2012/01/anothershitone-300x298.png" alt="" title="anothershitone" width="300" height="298" class="alignnone size-medium wp-image-888" /></a>

And <a href="http://stackoverflow.com/questions/8851863/change-c-to-php">another bollocks post</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://kera.name/articles/wp-content/uploads/2012/01/anothershitone.png"><img src="http://kera.name/articles/wp-content/uploads/2012/01/anothershitone-300x298.png" alt="" title="anothershitone" width="300" height="298" class="alignnone size-medium wp-image-888" /></a></p>
<p>And <a href="http://stackoverflow.com/questions/8851863/change-c-to-php">another bollocks post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2012/01/heres-another-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Worst Stack Overflow &quot;Question&quot; Ever</title>
		<link>http://kera.name/articles/2012/01/the-worst-stack-overflow-question-ever/</link>
		<comments>http://kera.name/articles/2012/01/the-worst-stack-overflow-question-ever/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 12:20:25 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stack Overflow]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=879</guid>
		<description><![CDATA[<a href="http://kera.name/articles/wp-content/uploads/2012/01/worstquestionever.png"><img src="http://kera.name/articles/wp-content/uploads/2012/01/worstquestionever-300x250.png" alt="the worst Stack Overflow question ever" /></a>

I don&#039;t think I&#039;ll be answering <a href="http://stackoverflow.com/questions/8850434/hello-i-have-a-big-thing-to-deal-with-on-my-website">this one</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://kera.name/articles/wp-content/uploads/2012/01/worstquestionever.png"><img src="http://kera.name/articles/wp-content/uploads/2012/01/worstquestionever-300x250.png" alt="the worst Stack Overflow question ever" /></a></p>
<p>I don&#039;t think I&#039;ll be answering <a href="http://stackoverflow.com/questions/8850434/hello-i-have-a-big-thing-to-deal-with-on-my-website">this one</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2012/01/the-worst-stack-overflow-question-ever/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby Does Equality Right, And C++ Does Not</title>
		<link>http://kera.name/articles/2011/11/ruby-does-equality-right-and-c-does-not/</link>
		<comments>http://kera.name/articles/2011/11/ruby-does-equality-right-and-c-does-not/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 11:40:52 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=863</guid>
		<description><![CDATA[I was posed a question recently as to why the C++ expression <code>true == true == true</code> compiled successfully. The person asking was sure that equality comparison held no associativity and that the expression was thus too ambiguous to be well-formed.]]></description>
			<content:encoded><![CDATA[<p>I was posed a question recently as to why the C++ expression <code>true == true == true</code> compiled successfully. The person asking was sure that equality comparison held no associativity and that the expression was thus too ambiguous to be well-formed.</p>
<p>Well, in Ruby, <a href="http://romhack.wikia.com/wiki/Ruby_operators#Operator_associativity">this <em>is</em> the case</a>:</p>
<ul>
<li>
<p>Subtraction is left associative;<br />
so <code>a - b - 3</code> acts like <code>(a - b) - 3</code>.</p>
</li>
<li>
<p>Assignment is right associative;<br />
so <code>a = b = 3</code> acts like <code>a = (b = 3)</code>.</p>
</li>
<li>
<p>Equality is not associative;<br />
so <code>a == b == 3</code> raises <code>SyntaxError</code>.</p>
</li>
</ul>
<p>In fact, C++&#039;s equality operator is left associative, and my immediate thought was that Ruby&#039;s behaviour was a little odd.</p>
<p>However, on further thought, I realised that it makes quite a bit of sense.</p>
<p>For example, it essentially prevents the following mistake:</p>
<pre><code>int x = 0, y = 0, z = 0;
std::cout &lt;&lt; (x == y == z); // false
</code></pre>
<p>Naively, especially when coming directly from a mathematics background, one might expect the output of this program to be <code>true</code> because all three operands are equal.</p>
<p>But in fact, C++&#039;s comparison takes only two operands, and when implicit associativity is applied explicitly with parentheses, the program&#039;s true behaviour becomes more obvious:</p>
<pre><code>int x = 0, y = 0, z = 0;
std::cout &lt;&lt; ((x == y) == z);
//              true   == 0
//                 false
</code></pre>
<p>Ruby&#039;s position of completely disallowing such a form in its arithmetic expressions will prevent any such &#034;bugs&#034;. Perhaps it would have been better had C++ adopted this position as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/11/ruby-does-equality-right-and-c-does-not/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doctor Who: The Wedding Of River Song</title>
		<link>http://kera.name/articles/2011/10/doctor-who-the-wedding-of-river-song/</link>
		<comments>http://kera.name/articles/2011/10/doctor-who-the-wedding-of-river-song/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 12:51:00 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Doctor Who]]></category>
		<category><![CDATA[TV]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=849</guid>
		<description><![CDATA[I'm the biggest fan of the Eleventh Doctor and of Moffat as <em>Doctor Who</em> showrunner. The change from RTD's constant contrived flamboyance has been welcomed, and the show <em>looks</em> amazing. But if there's any way in which series six actually makes any internally consistent logical sense at all please let me know.]]></description>
			<content:encoded><![CDATA[<p>I&#039;m the biggest fan of the Eleventh Doctor and of Moffat as <em>Doctor Who</em> showrunner. The change from RTD&#039;s constant contrived flamboyance has been welcomed, and the show <em>looks</em> amazing.</p>
<p>But if there&#039;s any way in which series six actually makes any internally consistent logical sense at all please let me know.</p>
<p><a href="http://kera.name/articles/wp-content/uploads/2011/10/Doctor-Who-The-Wedding-of-007.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/10/Doctor-Who-The-Wedding-of-007-300x180.jpg" alt="" title="Doctor-Who-The-Wedding-of-007" width="300" height="180" class="aligncenter size-medium wp-image-856" /></a></p>
<p>A few thoughts:</p>
<h3>The Doctor&#039;s death averted</h3>
<ul>
<li>The Doctor beside Lake Silencio was clearly not the Teselecta. The mannerisms, the fluid movements&#8230; And how do you make a Teselecta look like it&#039;s regenerating?</li>
<li>If the Doctor was never going to die on that beach after all, then why would River <em>not</em> killing him violate a fixed point in time? Or why would the audience finding out that he was never going to die suddenly make that sit right with time?
<ul>
<li><em>I suppose we found out that the fixed point was actually the Teselecta getting shot, not the Doctor. Hardly seems like something that Time would care all that much about, though.</em></li>
</ul>
</li>
<li>How <em>did</em> River overcome the suit&#039;s programming? She was destined to be forced to make that shot and the entire series&#039;s build up has relied on it. That she can just decide not to bother makes me wonder why I was ever supposed to care in the first place.</li>
<li>River told Amy that she had to lie about recognising the space suit. That sort of implies that she remembers being inside it (contrary to the Doctor telling her that she won&#039;t remember it), and consequently possibly that the Doctor won&#039;t die after all. If nothing else, her entire shocked reaction in <em>The Impossible Astronaut</em> was supposed to be completely faked? Guh?</li>
<li>If River is powerful enough to do this, that just begs the question: why would the Silence and whoever else deliberately create a powerful timelady to do the job? If the suit&#039;s supposed to do all the work, why not just stick any old arbitrary human inside it? They were asking for trouble, really.</li>
<li>I still want to know why it had to be a United States spacesuit.</li>
<li>The Doctor had his last picnic with only his closest friends. He honestly seemed to want them there so he didn&#039;t die alone. But then, actually, he was faking his death&#8230; so why wouldn&#039;t he instead invite some people who <em>wouldn&#039;t</em> blatantly find out about it? Maybe some intergalactic news agency? In fact, why would he bother inviting Amy, Rory and River at all? It&#039;s not as if he knew that they were there &#034;the last time&#034;.
<ul>
<li>Post-Time War, Time Lords used to be a myth, a historical echo of a civilisation erased from history. Jabe of The Tree People from the Forest of Cheem was stunned to see a living Time Lord. But, &#034;now&#034;, the Doctor is so ubiquitous that there are entire species out to kill him (and to make a pretty big deal out of doing it). But how can there be a concept of &#034;now&#034; compared to &#034;then&#034; when everybody&#039;s zipping through time? How can the Doctor have a different standing in the Universe in Series Six than he did in Series One? Sure, it&#039;s a different Universe (<em>The Big Bang</em>), but it <em>is</em> supposed to be atomically identical&#8230;</li>
</ul>
</li>
<li>If the next Big Bad is an event known as &#034;The Fall Of The Eleventh&#034;, and there are all these things that the Doctor is still known to have coming up for him, why isn&#039;t it obvious to everyone else that he can&#039;t be dead yet? &#034;Doctor Who&#034; indeed.</li>
</ul>
<h3>&#034;That&#034; alternate timeline</h3>
<ul>
<li>Even if the Doctor was inside the Teselecta in the real timeline, how did he end up being inside it in the bubble timeline?</li>
<li>Why was he captured by Churchill-Caesar?</li>
<li>Where did he get a felt-tip pen from?</li>
<li>How come Amy and friends mustered up an army against and captured the Silence, when nobody seemed able to do that in the real timeline?</li>
<li>How do the Silence know that Rory keeps dying? That keeps happening in alternate realities, alternate universes, alternate timelines&#8230; only we&#039;re supposed to know about that.</li>
<li>The Doctor managed to get from the Teselecta bridge to the eye in pretty sharpish time whilst he was &#034;marrying&#034; River. And it&#039;s a shame that there was utterly no emotional connection in that kiss, since River was snogging a shapeshifting robot.</li>
</ul>
<h3>Unanswered Questions</h3>
<p>Some inconsistencies that I was hoping to see resolved this week&#8230; well, they weren&#039;t.</p>
<ul>
<li>At start of the series we see 1100-year old Doctor reunite with Amy and Rory. But why had they been at home? Why weren&#039;t they, at that time, running around with 900-year old Doctor? Had that, in their personal timelines, been after the events of <em>The God Complex</em>? No? Why not? Rory talked during that episode about his time in the TARDIS in the past tense; the Doctor noticed this, Rory couldn&#039;t explain why he said it, and I started wondering whether this might end up leading to explanation of the messy personal timelines. Guess not.</li>
<li>And the Silence is the name of the race, again, now? Where did they come from? Why were they on Earth in the 60s? Why were they trying to get to the moon? What&#039;s the significance of the space suit? Why do they want the Doctor dead if the rest of the Universe suddenly loves him so much?</li>
<li>Why would the Silence want to blow up the TARDIS? Don&#039;t they realise it&#039;ll blow up the Universe? Are they aware that they tried it before and ultimately (sort of) failed? Will they try it again? Are they still <em>capable</em> of taking complete control of the TARDIS? Nobody seems too fussed about that.</li>
<li>What does Madame Kovarian have against the Doctor, anyway?</li>
<li>When was Amy replaced by a Ganger? And, frankly, <em>why</em>?</li>
<li>When did Amy spend time with infant Melody? There&#039;s a photo of Amy with infant Melody in infant Melody&#039;s Silence hotel in <em>Day of the Moon</em>.</li>
<li>The Silence believe that the Doctor must never be allowed to answer &#034;the question&#034;, because otherwise &#034;silence will fall&#034;. But they named themselves &#034;The Silence&#034; and last series everybody seemed to be goading the Doctor about the silence, as if <em>they</em> wanted it to happen. The Silence seemed to be his death (cf. &#034;Lake Silencio&#034;). But, now, the phrase &#034;the Silence&#034; seems to refer to something else entirely&#8230;?</li>
</ul>
<p>And now the Doctor&#039;s had two hundred years of adventures without us, for what turns out to be no reason at all.</p>
<p>It&#039;s evident that we&#039;re two parts through a three- or four-part story arc long game, so the above may work itself out over the ensuing series. But Moffat&#039;s series resolutions so far haven&#039;t given me much confidence in that so, for now&#8230;</p>
<p>Contrived, silly and utterly illogical. What a shame.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/10/doctor-who-the-wedding-of-river-song/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Brief Introduction to Javascript Objects &amp; Arrays</title>
		<link>http://kera.name/articles/2011/09/a-brief-introduction-to-javascript-objects-arrays/</link>
		<comments>http://kera.name/articles/2011/09/a-brief-introduction-to-javascript-objects-arrays/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 17:52:03 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=817</guid>
		<description><![CDATA[Having come up against disbelievers too often now, I've decided to take matters into my own hands and definitively conclude this argument once and for all.]]></description>
			<content:encoded><![CDATA[<p><sub>(<strong>tl;dr:</strong> <code>Object</code>s are <code>{}</code> and <code>Array</code>s are <code>[]</code>; use string keys and <code>for .. in</code> only with <code>Object</code>s.)</sub></p>
<hr />
<p>Having come up against disbelievers too often now, I&#039;ve decided to take matters into my own hands and definitively conclude this argument once and for all.</p>
<p><em>Arrays may <strong>not</strong> have string keys.</em></p>
<p>Take the following oft-seen pattern:</p>
<pre><code>var myArray    = new Array();
myArray['foo'] = 'lol';
// an array with one element?
</code></pre>
<p>This is <strong>wrong</strong>. Broken. Bad, wrong, invalid. Naughty. And constantly misunderstood.</p>
<hr />
<h2>Objects</h2>
<p>The issue stems from both terminology and misleading language design. Pretty much everything in Javascript is an <em>object</em>, and those that are not objects &mdash; the primitive types like integers, booleans and strings &mdash; all have object-type counterparts. This is even true for functions!</p>
<p>At its most basic, a Javascript object is a collection of key/value pairs. We can create our own typeless object instance using <code>{}</code> notation (syntax from which the JSON data format is derived, incidentally):</p>
<pre><code>var myObj = {
   'foo': 1,
   'bar': 2
};
</code></pre>
<p>We could also build up the properties individually, using <code>obj[x]</code> notation:</p>
<pre><code>var myObj    = {}; // `new Object()` would do, too
myObj['foo'] = 1;
myObj['bar'] = 2;
</code></pre>
<p>This notation looks like &#034;array&#034; access notation due to the influence of other major programming languages and, in fact, this basic key/value functionality is more generally known as a &#034;map&#034; or&#8230; an &#034;associative array&#034;. This is only a <em>general</em> term, though, because in Javascript they are just &#034;objects&#034;.</p>
<p>Why does this terminology matter? It matters because Javascript has confused matters by providing functionality for a stricter subset of the &#034;array&#034; concept: the numerically-indexed <code>Array</code> type.</p>
<hr />
<h2>Arrays</h2>
<h3>Introduction</h3>
<p>The <code>Array</code> type is a specialisation of objects that provides an element access API (<code>.push</code> and <code>.length</code>) and maintains numeric, sequential keys for you:</p>
<pre><code>var myArray = []; // `new Array()` would do, too
myArray.push('house');
myArray.push('bird');
</code></pre>
<p>Or, again, we can do this in one push:</p>
<pre><code>var myArray = ['house', 'bird'];

for (var i = 0; i &lt; myArray.length; i++) {
   console.log(myArray[i]);
}
// Output: "house" "bird"
</code></pre>
<p>Notice how you still access the array&#039;s elements using the <code>obj[x]</code> notation. That&#039;s because the <code>Array</code> stores its elements as properties in itself, alongside the various other properties that it needs in order to function (like <code>length</code> and <code>push</code>, plus any other implementation-defined internal properties).</p>
<h3>Looping over <em>properties</em> not <em>elements</em></h3>
<p>However, this is also why looping through an <code>Array</code> with <code>for .. in</code> syntax is <em>wrong</em> &#8212; <code>for .. in</code> loops through low-level <em>object keys</em>, not the &#034;elements&#034; of this higher-level &#034;array&#034; abstraction:</p>
<pre><code>var myArray = ['house', 'bird'];
for (var key in myArray) {
   console.log(myArray[key]);
}
// Possible output: "bird" "concat" "every" "filter" "forEach"
//                  "house" "indexOf" "join" "lastIndexOf"
//                  "length" "map" "pop" "push" "reduce"
//                  "reduceRight" "reverse" "shift" "slice"
//                  "some" "sort" "splice" "unshift"
</code></pre>
<p>In fact, recent implementations of Javascript handle this more intelligently and will still output just <code>'house' 'bird'</code> for the above loop (*), but you cannot and should not rely on this behaviour.</p>
<h3>Array holes</h3>
<p>Another issue is that, due to some magic, setting <code>myArray[5]</code> will automatically increase <code>length</code> along with it. However, this can cause &#034;holes&#034; to &#034;appear&#034; if you use object loop syntax:</p>
<pre><code>var myArray = ["hello"];
arr[100]    = "goodbye";
</code></pre>
<p>Now <code>myArray</code> has a <code>length</code> of 100, but we only set two user-defined properties in the underlying object representation. Using <code>for .. in</code> will yield two indexes, while the <code>for</code> loop will yield 101 indexes, where the 99 new numeric ones have an <code>undefined</code> value. Which one did you intend?</p>
<hr />
<h2>The Misunderstanding</h2>
<p>Unfortunately, browser vendors aren&#039;t helping to stem the spread of the myth that objects and arrays can or should be used in the same way.</p>
<p>In addition to the <code>for .. in</code> trickery mentioned above (*), the order of enumeration even on <code>Array</code> objects is the order in which the properties were created:</p>
<pre><code>var array = [];
array[2] = 'c';
array[1] = 'b';
array[0] = 'a';

for (var p in array) {
   // p will be 2, 1 then 0 on IE &lt;= 8
}
</code></pre>
<p>This behaviour makes it quite obvious that the usage isn&#039;t quite right, but since Internet Explorer 9 the browser will enumerate the keys in ascending order, only serving to help propagate the myth that this is the right way to do things.</p>
<h3>Non-integer keys</h3>
<p>Another oft-seen chunk of code looks like this:</p>
<pre><code>var myArray    = [];
myArray["foo"] = 42;
myArray["bar"] = 84;

console.log(myArray["foo"]);
// Output: "42"
</code></pre>
<p>Argh! Now the programmer has created an <code>Array</code>, but is using functionality of its <em>underlying existence as an <code>Object</code></em> instead of the proper API tools. In particular, he or she is setting <em>object properties</em>, bypassing the <code>Array</code> functionality completely.</p>
<p>It appears to work, because we can still use <code>myArray[x]</code> to access object properties: this hasn&#039;t changed. But we&#039;re completely bypassing the fact that this object is, more specifically, of type <code>Array</code>.</p>
<p>Now, because the above-described &#034;intelligent&#034; behaviour of some browsers works by explicitly ignoring only those object properties that it knows to be properties of the <code>Array</code> prototype, when we loop over object properties we still only see those that we think we set:</p>
<pre><code>var myArray    = [];
myArray["foo"] = 42;
myArray["bar"] = 84;

for (var key in myArray) {
   console.log(myArray[key]);
}
// Output: "42" "84"
</code></pre>
<p>But <a href="http://stackoverflow.com/questions/242841/javascript-foreach-vs-for">it&#039;s still not correct</a>, which we only actually notice when we use a proper <code>Array</code> loop and notice that <code>.length</code> has no idea what&#039;s going on. And how could it? It&#039;s a number.</p>
<pre><code>var myArray    = [];
myArray["foo"] = 42;
myArray["bar"] = 84;

for (var i = 0; i &lt; myArray.length; i++) {
   console.log(myArray[i]);
}
// Output: (nothing)
</code></pre>
<p>So, **we shouldn&#039;t be looping over <code>Array</code>s with <code>for .. in</code>.</p>
<p>It also doesn&#039;t help that many reference materials (<a href="http://i-programmer.info/programming/javascript/1441-javascript-data-structures-the-associative-array.html">example</a>) continue to insist upon using the terms &#034;array&#034; and &#034;object&#034; interchangeably, and the difference between <code>Array</code> and &#034;associative array&#034; (i.e. <code>Object</code>) is not at all clear from the terminology.</p>
<p>At least <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array">the Mozilla documentation makes this clear</a>:</p>
<blockquote>
<p>An array is a JavaScript object. Note that you shouldn&#039;t use it as an associative array, use Object instead.</p>
</blockquote>
<hr />
<h2>How to do it properly</h2>
<p>It&#039;s tempting to rely on the above magical browser behaviours anyway. &#034;<code>for .. in</code> lets us use string keys where <code>for i &lt; .length</code> does not, so let&#039;s just use <code>for .. in</code>, right?&#034; Wrong.</p>
<p><strong>We shouldn&#039;t be using string keys in the first place.</strong></p>
<p>So, in conclusion:</p>
<ul>
<li>
<p>The correct way to <a href="http://stackoverflow.com/questions/500504/javascript-for-in-with-arrays">loop through an <code>Array</code></a> is to use the API that it provides, so that:</p>
<ul>
<li>You are not mixing up semantics;</li>
<li>You are not relying on implementation details;</li>
<li>You are not prone to unexpected and surprising behaviours;</li>
<li>Your code &#034;works&#034; properly on more browsers and in the future;</li>
</ul>
<p>So:</p>
<pre><code>var myArray = ['house', 'bird'];
for (var i = 0; i &lt; myArray.length; i++) {
    console.log(i + ": " + myArray[i]);
}
// Output: "0: house" "1: bird"
</code></pre>
</li>
<li>
<p>The correct way to use an <code>Array</code> is with <em>numeric</em> keys.<br />
If you need an &#034;array&#034; with string keys, you may use an &#034;associative array&#034;: a bog-standard <code>Object</code>.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/09/a-brief-introduction-to-javascript-objects-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One Less Bug To Worry About</title>
		<link>http://kera.name/articles/2011/08/one-less-bug-to-worry-about/</link>
		<comments>http://kera.name/articles/2011/08/one-less-bug-to-worry-about/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 23:36:13 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=808</guid>
		<description><![CDATA[From the MySQL documentation on <code>LAST_INSERT_ID()</code> and <code>AUTO_INCREMENT</code> columns...]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id">the MySQL documentation on <code>LAST_INSERT_ID()</code> and <code>AUTO_INCREMENT</code> columns</a>:</p>
<blockquote>
<p>The ID that was generated is maintained in the server on a per-connection basis. This means that the value returned by the function to a given client is the first <code>AUTO_INCREMENT</code> value generated for most recent statement affecting an <code>AUTO_INCREMENT</code> column by that client. This value cannot be affected by other clients, even if they generate <code>AUTO_INCREMENT</code> values of their own. This behavior ensures that each client can retrieve its own ID without concern for the activity of other clients, and without the need for locks or transactions.</p>
</blockquote>
<p>So, I&#039;ve spent years panicking about race conditions in code like that below that apparently won&#039;t exist (at least in my cases):</p>
<pre><code>`tbl`
------------------------
`id`  INT AUTO_INCREMENT
`col` TEXT

INSERT INTO `tbl` (`col`) VALUES("lol");
SELECT LAST_INSERT_ID(); -- get `id` for inserted row
</code></pre>
<p>Perhaps you have, too?</p>
<hr />
<p><strong>Update</strong></p>
<p>This is <em>not</em> explicitly the case for <code>SQL_CALC_FOUND_ROWS</code> and <code>FOUND_ROWS()</code>, though the following paragraph loosely implies that <code>FOUND_ROWS()</code> is guaranteed to be ok after <code>SQL_CALC_FOUND_ROWS</code>, at least within the same connection context:</p>
<blockquote>
<p>The row count available through <code>FOUND_ROWS()</code> is transient and not intended to be available past the statement following the <code>SELECT SQL_CALC_FOUND_ROWS</code> statement</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/08/one-less-bug-to-worry-about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debunking Leitner</title>
		<link>http://kera.name/articles/2011/08/debunking-leitner/</link>
		<comments>http://kera.name/articles/2011/08/debunking-leitner/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 19:01:31 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=794</guid>
		<description><![CDATA[I was linked earlier on to a presentation entitled "The Dark Side Of C++", written in August 2007 by C expert Felix von Leitner. He attempts to explain C++'s pitfalls and demonstrate why a programmer should choose another language. Though the intention is sound and some good points are made, unfortunately it also contains untruths. Therefore, I shall go through parts of the presentation, debunking its lies.]]></description>
			<content:encoded><![CDATA[<p>C++ is complex. Very complex. Some say that it is far <em>too</em> complex, and I&#039;m going to neither agree nor disagree with that here. That&#039;s not what this post is about.</p>
<p>I was linked earlier on to a presentation entitled <a href="http://www.docme.ru/doc/20742/the-dark-side-of-c%2b%2b#.ThXRw5ezc7Q.facebook">&#034;The Dark Side Of C++&#034;</a>, written in August 2007 by C expert Felix von Leitner. He attempts to explain C++&#039;s pitfalls and demonstrate why a programmer should choose another language. Though the intention is sound and some good points are made, unfortunately it also contains untruths. Therefore, I shall go through parts of the presentation, debunking its lies.</p>
<p>Again, I&#039;m not doing this to defend C++. I&#039;m actually doing it to defend any language newcomers who may stumble across this dangerous misinformation and believe it to be true, because it is not.</p>
<p>I am not going to go out of my way to point out areas that I agree with. (In particular, the implementation of library features <em>does</em> lead to some utterly horrendous diagnostic output.)</p>
<hr />
<h3>Slide 7</h3>
<p>This slide is entitled &#034;ever-changing standard&#034;, then lists the following ways in which the standard allegedly changed:</p>
<blockquote>
<ul>
<li>Wrote commercial C++ app in 1997</li>
<li>Then C++ changed (life time of i in &#034;for (int i=0; &#8230;)&#034;)</li>
<li>Then C++ changed again (use iostream instead of iostream.h)</li>
<li>Then C++ changed AGAIN (namespaces)</li>
</ul>
<p>Useless maintenance work. Would have been less trouble in C.</p>
</blockquote>
<p>In fact, C++ was standardised in 1998, and all of these elements were fixed in place at that time. To this day, none of them have ever changed in the standard. The &#034;useless maintenance work&#034; would have been less trouble had Leitner actually written standard C++.</p>
<h3>Slide 8</h3>
<blockquote>
<p>Old and busted:<br />
  <code>for (int i = 0; i &lt; n; i++)</code><br />
  New hotness:<br />
  <code>for (int i(0); i != n; ++i)</code></p>
</blockquote>
<p>Convention and idioms are important. If we all agree basically how to code, then cross-maintenance becomes easier.</p>
<p>However, this difference in construction syntax never really took off. Both are valid, and there is no consensus at all that the second approach is the &#034;new hotness&#034;; in fact, I don&#039;t think that I&#039;ve ever seen it in production code.</p>
<h3>Slide 12: &#034;C++ is hard to parse&#034;</h3>
<blockquote>
<pre><code>struct a{typedef int foo;};struct a1:a{};struct a2:a{};
#define X(b,a) struct a##1:b##1,b##2{};struct a##2:b##1,b##2{};
X(a,b)X(b,c)X(c,d)X(d,e)X(e,f)X(f,g)X(g,h)X(h,i)X(i,j)X(j,k)X(k,l)
X(l,m)X(m,n) n1::foo main(){}`
</code></pre>
</blockquote>
<p>I&#039;m not convinced that you can just throw up a ridiculously retarded piece of code like this, and use it as proof of a language flaw. When would you write this? Well-written C++ code is reasonably easy to parse (sometimes).</p>
<h3>Slide 15: &#034;C++ is hard to write&#034;</h3>
<blockquote>
<ul>
<li>Can&#039;t throw exceptions in destructors, shouldn&#039;t in constructors</li>
</ul>
</blockquote>
<p>You <em>can</em> throw exceptions in destructors (though you shouldn&#039;t).<br />
Throwing in constructors is fine; the default allocator throws <code>bad_alloc</code>, for goodness&#039;s sake.</p>
<blockquote>
<ul>
<li>Initializers done in order of declaration of fields in class, not written order</li>
</ul>
</blockquote>
<p>Good. I can&#039;t imagine having to figure out where the implicitly-constructed ones would go in an incomplete member-initialiser were the order not concretely defined.</p>
<blockquote>
<ul>
<li><code>auto_ptr</code> is useless</li>
</ul>
</blockquote>
<p>I can&#039;t disagree with that, and in fact <code>auto_ptr</code> has been deprecated in C++0x.</p>
<blockquote>
<ul>
<li>Iterators don&#039;t know anything about the container, can&#039;t detect errors</li>
<li>For a vector, <code>at()</code> does bounds checking, but <code>operator[]</code> doesn&#039;t</li>
<li>Can&#039;t call virtual member functions from constructor or destructor</li>
</ul>
</blockquote>
<p>Again, these are all <em>good</em> things.</p>
<h3>Slide 16: &#034;Throwing exceptions from con/destructors&#034;</h3>
<p>My personal favourite, this slide is full of utter nonsense.</p>
<blockquote>
<ul>
<li>Exceptions in constructor don’t unwind the constructor itself</li>
<li>Does not even clean up local variables!</li>
<li>Must do own cleanup</li>
</ul>
</blockquote>
<p>This is a flat-out lie. When throwing from a function, even a &#034;special function&#034; like constructors, any local objects are destroyed just as they would when going out of scope anywhere else.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;stdexcept&gt;

using std::cout;
using std::logic_error;

struct Tracked {
   Tracked() { cout &lt;&lt; "*"; }
  ~Tracked() { cout &lt;&lt; "~"; }
};

struct Test {
   Test() {
      Tracked t;
      throw logic_error("Yes, it *is* unwound. Things go out of scope as usual.");
   }
};

int main() {
   try {
      Test t;
   }
   catch (...) {}
}

// *~
</code></pre>
<p><a href="http://codepad.org/7pzljoNX">Live demo.</a></p>
<blockquote>
<ul>
<li>OTOH: no other way to return failure, constructors are <code>void</code></li>
</ul>
</blockquote>
<p>Constructors are not <code>void</code>. They are constructors.</p>
<h3>Slide 20: &#034;Bounds Checking&#034;</h3>
<blockquote>
<ul>
<li>For a vector, at() does bounds checking</li>
<li>operator[] can, but does not have to</li>
<li>The one from gcc doesn’t</li>
</ul>
</blockquote>
<p>Good. Then I have an option when I don&#039;t need the overhead of bounds checking. C arrays don&#039;t have bounds checking.</p>
<h3>Slide 21: &#034;Virtual functions in con/destructor&#034;</h3>
<blockquote>
<ul>
<li>In the constructor, the vtable is not properly initialized</li>
</ul>
</blockquote>
<p>That would be the <code>virtual pointer</code>. The <code>vtable</code> exists since compile-time. This is an implementation detail though: C++ as a language has no knowledge of either.</p>
<blockquote>
<ul>
<li>Usually, function pointers in vtable still point to virtual member of base class</li>
<li>&#8230; which can be pure virtual</li>
</ul>
</blockquote>
<p>This is a lot more useful than the automatic <code>this</code> pointer referring to an object that does not yet exist. Remember, when the Base part is being constructed, the Derived part hasn&#039;t started being constructed yet.</p>
<blockquote>
<ul>
<li>In the destructor of the base class, vtable points to base class</li>
</ul>
</blockquote>
<p>Similarly, it would be incredibly awkward to work around a virtual dispatch mechanism that tried to use the already-destroyed part of an object as you&#039;re cleaning it up.</p>
<h3>Slide 37: &#034;Other Nitpicks&#034;</h3>
<blockquote>
<ul>
<li>Can&#039;t tell what exceptions a library can throw</li>
</ul>
</blockquote>
<p>You can, by looking at the documentation. This is no different from the manner in which you find out anything else about library functions.</p>
<h3>Slide 39: &#034;Exception Safety&#034;</h3>
<blockquote>
<p>If <code>new[]</code> throws an exception, this leaks a file handle and deadlocks the next caller.</p>
</blockquote>
<p>That&#039;s only because Leitner is writing C-style code. He has not used the principle of RAII and insists on using antiquated C library functions rather than file streams, and this is the cause of his problem. Using C++ conventions and idioms completely nullifies this issue.</p>
<h3>Slide 47: &#034;Pointer arithmetic with base classes&#034;</h3>
<p>This slides presents an example of attempting to use non-polymorphic classes polymorphically. Just don&#039;t do that then.</p>
<h3>Slide 48: &#034;Gratuitous Bjarne Quote at the end&#034;</h3>
<blockquote>
<blockquote>
<p>Whole program analysis (WPA) can be used to eliminate unused virtual function tables and RTTI data. Such analysis is particularly suitable for relatively small programs that do not use dynamic linking.</p>
</blockquote>
<p>No shit, Sherlock.<br />
  It will be ready right after Duke Nukem Forever runs on the Hurd.</p>
</blockquote>
<p>Microsoft Visual Studio <a href="http://msdn.microsoft.com/en-us/library/0zza0de8%28v=vs.80%29.aspx">has supported this</a> since <em>at least</em> two years before the publication of this presentation and, as far as I&#039;m aware, the recently released Duke Nukem Forever is not yet available on the GNU Hurd platform.</p>
<hr />
<p>Now, don&#039;t get me wrong. As I said before, Leitner makes some valid points, and the overarching message that C++ is overly complex and <em>confusing</em> in certain places is certainly not without merit.</p>
<p>So go ahead and read his presentation&#8230; just keep a copy of this article with you throughout.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/08/debunking-leitner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Canning Circus Police Station</title>
		<link>http://kera.name/articles/2011/08/canning-circus-police-station/</link>
		<comments>http://kera.name/articles/2011/08/canning-circus-police-station/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 22:53:31 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[UK.gov]]></category>
		<category><![CDATA[ukriots2011]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=781</guid>
		<description><![CDATA[I went out for the evening and came back to find BBC News reporting that Canning Circus police station &#8212; which is 30m across the road from my flat &#8212; had been "firebombed".]]></description>
			<content:encoded><![CDATA[<p>I went out for the evening and came back to find reports that Canning Circus police station &mdash; which is 30m across the road from my flat &mdash; <a href="http://www.thisisnottingham.co.uk/Firebomb-attack-Nottingham-police-station/story-13098357-detail/story.html">had been &#034;firebombed&#034;</a>.</p>
<p>On personal inspection I found a mildly shattered window, a thin stretch of cordon and two police officers standing guard at the entrance. No sign of fire damage, though it is dark and I <i>have</i> been drinking slightly.</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/IMG_1830.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/IMG_1830-300x225.jpg" alt="" title="IMG_1830" width="300" height="225" class="aligncenter size-medium wp-image-782" /></a></center></p>
<p>I did notice that a Toyota dealership half a mile away had moved its entire stock of vehicles to a secure compound, but otherwise I can&#039;t see anything particularly interesting going on here. Frankly, for all the rap the Nottingham gets for crime, when it comes to mass organised unrest like we&#039;ve seen over the past couple of days, I can&#039;t envisage anything particularly damaging going on here.</p>
<p>Nottingham is still very much a city where major crime is restricted to a specific few outlying areas. The media usually like to ignore this for reasons of sensationalism, but given what&#039;s going on elsewhere this week, these usually overblown activities are completely outdone by events elsewhere, and I don&#039;t see that changing tonight.</p>
<hr />
<p><b>Update (midnight)</b> Captions like this make me wonder how hyped-up the mainstream news is being. Honestly, there&#039;s not that much going on here.</p>
<p>(Though the live video report is from Manchester, the caption <i>does</i> relate to Nottingham.)</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/caption.png"><img src="http://kera.name/articles/wp-content/uploads/2011/08/caption-300x183.png" alt="" title="caption" width="300" height="183" class="aligncenter size-medium wp-image-789" /></a></center></p>
<hr />
<p><b>Update (00:23):</b> There <i>is</i> quite a lot of siren action going on outside, but from what I can tell <a href="http://pastebin.info/2168">there&#039;s still not much going on here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/08/canning-circus-police-station/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On The Riots; What Else?</title>
		<link>http://kera.name/articles/2011/08/on-the-riots-what-else/</link>
		<comments>http://kera.name/articles/2011/08/on-the-riots-what-else/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 00:25:21 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[UK.gov]]></category>
		<category><![CDATA[ukriots2011]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=771</guid>
		<description><![CDATA[As the assorted peoples of the internet gather around Facebook, Twitter and the rest of them watching violence unfold in several major English cities, a couple of things cross my mind.]]></description>
			<content:encoded><![CDATA[<p>As the assorted peoples of the internet gather around Facebook, Twitter and the rest of them watching violence unfold in several major English cities, a couple of things cross my mind. And let&#039;s be honest about them.</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/54493763_jex_1130843_de27-1.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/54493763_jex_1130843_de27-1-300x168.jpg" alt="" title="_54493763_jex_1130843_de27-1" width="300" height="168" class="aligncenter size-medium wp-image-773" /></a></center></p>
<p><b>Population Quantity</b></p>
<p>The first is that the situation is utterly out of control, and that this is not really the police&#039;s fault. Not only have their numbers been drastically cut in recent years, but ultimately there are <i>too many people</i> in the country to control effectively when the shit hits the fan like this.</p>
<p>On a non-violent but wholly more spectacular scale, trying to keep up with the sheer volume of status updates, photos and amateur editorials (yes, yes, I know) is utterly impossible. Facebook groups demanding that the government listen to them are pointless, as it is not humanly possible to track &mdash; let alone respond to &mdash; the thousands of updates posted every 30 seconds or so.</p>
<p>Ultimately this is an argument for devolving power to local communities, something that the coalition government has always been in favour of. Personally, I think that more drastic steps are necessary: are we starting to see the fallout of encouraging globalisation alongside a decades-long population boom? Will democracy and &#034;equal representation&#034; now finally be crushed under its own weight? How can you represent, let alone control, sixty million people from a room that seats just thirty-three?</p>
<p><b>Population Quality</b></p>
<p>The second issue that comes to mind is that of <i>who</i> is out there committing this violence. Who are the gangs of &#034;hooded youths&#034; swaggering up and down the streets of the capital, trousers at their ankles, showing us that England&#039;s equivalent of Egypt&#039;s fighting for freedom is fighting for a free telly?</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/54460918_rioters_gallery.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/54460918_rioters_gallery-300x168.jpg" alt="" title="_54460918_rioters_gallery" width="300" height="168" class="aligncenter size-medium wp-image-777" /></a></center></p>
<p>The truth is that they are simply the underlying current of society, the tax-reliant chavs and bored malcontents that scream by you on their bikes day after day, blaring trash out of their Blackberries. Usually their widely-reported criminal activities are limited to shootings in gangland areas and the occasional bout of bravery in a more &#034;civilised&#034; part of town, but it only takes a few to spread courage. And that entire subculture has now spontaneously erupted into a mob with sufficient courage to run around and do exactly what they were always capable of. It&#039;s not that the coalition Government in particular has failed them (why should these kids give a flying frak who the Prime Minister is?) or that Twitter/BBM is destroying our children: it&#039;s just that far too many parents from the 90s didn&#039;t raise their children properly, and now there are too many to control.</p>
<p>How about this: shoot them. Just&#8230; shoot them.</p>
<p>The really scary thing is that, though an article like this might have been mildly controversial ten years ago, I reckon that people are kind of starting to get the point now. (Even if I am being tongue-in-cheek&#8230; slightly. Maybe.)</p>
<p><b>Bootnote</b></p>
<p>In the words of James Corden&#039;s Craig, <i>I never saw the point in London</i>. I generally avoid trips there, probably for no good reason.</p>
<p>But frankly, tonight, part of me wants to go down there and help out the thousands of law-abiding citizens who seem to be properly banding together to defend their homes and businesses, and who are preparing to clean the damned place up in the morning. Odd though it is, the whole situation is actually creating something hugely positive on the other side of the coin: a &#034;community spirit&#034; that&#039;s pretty rare nowadays.</p>
<p>Realistically, I have work in the morning. What would be really cool, though, is if those law-abiding citizens could do me a favour, find the little chaps who burned down somebody&#039;s dearly loved 100-year old family-run furniture shop, and stab them repeatedly in the genitals with a flaming dagger made of coarse diamonds. That&#039;d be great. Cheers.</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/fi_1967308b.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/fi_1967308b-300x187.jpg" alt="" title="fi_1967308b" width="300" height="187" class="aligncenter size-medium wp-image-772" /></a></center></p>
<hr />
<p>Oh, and whilst I&#039;m at it (and I do realise that I&#039;m being a complete hypocrite here in a sense), whilst I&#039;m grateful for the fantastic live coverage from the BBC and from Sky News, what we really need is a media blackout. Twerps aren&#039;t quite so loud when nobody&#039;s listening, surely.</p>
<p>And I have no comment about the <a href="http://www.youtube.com/watch?v=sXcI-NL3Tro" title="Clapham Junction looting - YouTube">&#034;we&#039;re getting our taxes back, innet&#034;</a> lady, except&#8230; no. No, you&#039;re not.</p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/08/on-the-riots-what-else/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Festivals And Music</title>
		<link>http://kera.name/articles/2011/08/on-festivals-and-music/</link>
		<comments>http://kera.name/articles/2011/08/on-festivals-and-music/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 01:55:25 +0000</pubDate>
		<dc:creator>Tomalak Geret'kal</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://kera.name/articles/?p=751</guid>
		<description><![CDATA[I went to Nottingham's Riverside Festival today, and it was astounding. Not just from the number of individuals present &#8212; from <i>all</i> walks of life &#8212; but from the talent that it demonstrated.]]></description>
			<content:encoded><![CDATA[<p>I went to Nottingham&#039;s Riverside Festival today, and it was astounding. Not just from the number of individuals present &mdash; from <i>all</i> walks of life &mdash; but from the talent that it demonstrated.</p>
<p>To put things into context, the Riverside Festival is a free, city council-run event that shows up every year along the riverbank at the start of August, featuring the standard funfair pieces, introducing slick, well-run and reasonably-priced licensed waterside bars (and <i>that</i>&#039;s hard to find at big events) and, above all, entertaining with some pretty quality music.</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/maniere_des_bohemiens-1.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/maniere_des_bohemiens-1-300x199.jpg" alt="" title="Maniere des Bohemiens" width="300" height="199" class="aligncenter size-medium wp-image-752" /></a></center></p>
<p>It&#039;s a multi-day event but, for the first time since setting foot in town six years ago, I decided to show my face on Saturday afternoon. My main target was the Monument Stage for an hour-long set by <i><a href="http://www.myspace.com/manieredesbohemiens">Maniere Des Bohemiens</a></i>, a hauntingly talented group who will prance around on stage and fill your soul with Gypsy Jazz by means of several guitars, a clarinet, a violin and some brilliant percussion. This evening they also brought on stage a rather sensual Russian vocalist who served to complement the line-up and make the entire experience even more special.</p>
<p>I&#039;ve wanted to see them live for years.</p>
<p>Then, having failed to find anything else to do with my Saturday evening (woah betide me, <i>et cetera</i>), I decided to stick around and give a chance to the next group to grace the Memorial Stage. That was <i><a href="http://www.myspace.com/fatdigester">Fat Digester</a></i> who, for the ensuing hour or so, transformed my week completely with just the most amazing wall of sound I&#039;ve ever heard. Blending soul and rock, this group had several hundred people swaying from side to side by the River Trent as a <i>triple</i> rainbow hung ominously overhead.</p>
<p><a href="http://kera.name/articles/wp-content/uploads/2011/08/Fat-Digester-315x200.jpg"><img src="http://kera.name/articles/wp-content/uploads/2011/08/Fat-Digester-315x200-150x150.jpg" alt="" title="Fat-Digester-315x200" width="150" height="150" class="alignright size-thumbnail wp-image-753" style="float:right" /></a> And it got me thinking. Why do we, as a culture, instead celebrate the most amazingly formulaic rubbish that we&#039;ve ever heard?</p>
<p>Do I mean Fat Digester? Do I frak. I&#039;m talking about the tracks that we hear in the official Top 40 charts every single week. Popular rubbish like Cher Lloyd&#039;s &#034;Swagger Jagger&#034; &mdash; near-universally loathed &mdash; and Rebecca Black&#039;s &#034;Friday&#034; &mdash; globally considered &#034;the worst song ever&#034; &mdash; take millions of pounds in sales every single week in the UK.</p>
<p>Now, Black&#039;s success is purely a function of fame, and of humanity&#039;s natural predisposition to following the crowd (see: Justin Bieber). And, in Cher&#039;s defence, she did not write <i>that</i> song.</p>
<p>But isn&#039;t that the problem? The vast majority of &#034;popular&#034; music today is a product of the Simon Cowells and the Jay-Zs, millionaire producers throwing re-used trash at money-hungry, semi-talented youngsters, eager for a piece of the limelight.</p>
<p><center><a href="http://kera.name/articles/wp-content/uploads/2011/08/fd.png"><img src="http://kera.name/articles/wp-content/uploads/2011/08/fd-300x168.png" alt="" title="fd" width="300" height="168" class="aligncenter size-medium wp-image-754"></a></center></p>
<p>And what happens to the Maniere Des Bohemiens and the Fat Digesters of the world? Those groups who create their own brilliant sound and who are, regardless of your personal tastes, <i>100% talent</i>? They are relegated to &#8212; amazing though the event is &#8212; a local festival of .. <i>maybe</i> .. a hundred thousand.</p>
<p>As I sit here, now back home, listening to the fantastic Ladytron at 1am on a Saturday night, it almost makes me physically ill to imagine how many genuinely talented groups and individuals are out there, struggling to be heard and to make a living, fighting against an established commercial industry whose primary motive is to put people on TV and bribe the lowest common denominator into buying their &#034;music&#034; week after week. It&#039;s hard to imagine that even a quarter of the population of the UK is even aware that there is more out there than Lady Gaga and Katy Perry.</p>
<p>And this is deeply, deeply distressing&#8230; made better only by the knowledge that real music <i>does</i> still exist. If you want to hear some, attend your local festivals. It&#039;ll be worth it; I promise.</p>
<hr />
<p><a href="http://www.nottinghamcity.gov.uk/index.aspx?articleid=14480">Nottingham&#039;s Riverside Festival</a> continues Sunday until 6.30pm.</p>
<p><small>Images reproduced without permission. Sorry. Please grant me it anyway!</small></p>
]]></content:encoded>
			<wfw:commentRss>http://kera.name/articles/2011/08/on-festivals-and-music/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

