<?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"
	>

<channel>
	<title>emotionalmarkup</title>
	<atom:link href="http://www.emotionalmarkup.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emotionalmarkup.com</link>
	<description>Feel the code</description>
	<pubDate>Mon, 30 Jun 2008 21:53:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Glastonbury 2008</title>
		<link>http://www.emotionalmarkup.com/2008/06/30/glastonbury-2008/</link>
		<comments>http://www.emotionalmarkup.com/2008/06/30/glastonbury-2008/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 21:37:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/?p=58</guid>
		<description><![CDATA[
I was fortunate enough to work backstage at this year&#8217;s Glastonbury which meant that I avoided the mud, the high prices and the discomfort of camping with thousands of punters. Some might argue that I wouldn&#8217;t have had the true Glastonbury experience, however when you&#8217;re in the press pit watching Crowded House, Leonard Cohen, the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.emotionalmarkup.com/wp-content/uploads/2008/06/wellies.jpg"><img class="alignnone size-full wp-image-59" title="wellies" src="http://www.emotionalmarkup.com/wp-content/uploads/2008/06/wellies.jpg" alt="Essential Glasto gear" width="426" height="326" /></a></p>
<p>I was fortunate enough to work backstage at this year&#8217;s Glastonbury which meant that I avoided the mud, the high prices and the discomfort of camping with thousands of punters. Some might argue that I wouldn&#8217;t have had the true Glastonbury experience, however when you&#8217;re in the press pit watching Crowded House, Leonard Cohen, the Verve and Amy Winehouse, these criticisms seem trivial.</p>
<p>Not that I especially liked any of the artists above. The fact was that as 120,000 people crammed themselves towards the Pyramid stage to glimpse a coloured dot bounce around on a very large screen, I sipped chilled beers behind the cattle fences. Largely oblvious to the struggle of the masses, I adjusted my complimentary earplugs with relative nonchelance.</p>
<p>I don&#8217;t feel the need to ramble on about the excitement and diversity of Glastonbury - the people, the food, the art and the various &#8216;villages&#8217; - where you can do anything from learn to make wooden cutlery to meditate with modern day druids. My only reaction to the time I spent there, even counting the hours I was working, was that it wouldn&#8217;t displease me in the slightest if everyday of my life was like a day at Glastonbury. It would exhausting yes, but holy crap it would be fun.</p>
<p>Check out the <a href="http://flickr.com/photos/glastonburyonthebbc/">BBC&#8217;s photostream</a>: many photos of which I took and, to nearly all of them, added comments to.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/06/30/glastonbury-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Short bite of the apple</title>
		<link>http://www.emotionalmarkup.com/2008/06/20/short-bite-of-the-apple/</link>
		<comments>http://www.emotionalmarkup.com/2008/06/20/short-bite-of-the-apple/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 14:47:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<category><![CDATA[new york]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/?p=57</guid>
		<description><![CDATA[At my left, a 40-inch television with 600 cable channels. To my right, the cold remains of a deli sandwich. Outside in the heat, traffic snakes and shoots through walls of sunlight; horns in a constant state of beeping almost as if to shout out to the world: &#8220;I&#8217;m alive! I&#8217;m alive in New York!&#8221;
If [...]]]></description>
			<content:encoded><![CDATA[<p>At my left, a 40-inch television with 600 cable channels. To my right, the cold remains of a deli sandwich. Outside in the heat, traffic snakes and shoots through walls of sunlight; horns in a constant state of beeping almost as if to shout out to the world: &#8220;I&#8217;m alive! I&#8217;m alive in New York!&#8221;</p>
<p>If Paris is a city for walking, then the Big Apple is one for skipping: mainly because you get around faster and at the same time, you can display an air of optimism (while hiding deep-seeded depression) that only the US can pull off.</p>
<p>Fortunately you don&#8217;t have to skip everywhere. Thanks to the subway and grid system of Manhattan streets, getting around New York <span style="text-decoration: line-through;">is piece of</span> a generous serving of your favourite cake (which, by the way, you probably get on every corner along with a bucket of watery coffee). The only hassle is trying to not get sidetracked by the mayhem. Smiling traffic conductors screaming at cars to move along; diners brandishing &#8220;All day burritos and jugs of beer&#8221;; flocks of garbage trucks; and of course, the thousands of people from everywhere and, judging by the mixture of fashion, every<em>when</em>.</p>
<p>New York could be described as London pushed into a tube and stood upright, sprayed with essence of extrovert. But it&#8217;s best not to make comparisons. This city is exciting in its own skin and I&#8217;m just about to walk out the door of my west mid-town apartment into the thick of it. More later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/06/20/short-bite-of-the-apple/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where the Eurostar goes</title>
		<link>http://www.emotionalmarkup.com/2008/06/10/where-the-eurostar-goes/</link>
		<comments>http://www.emotionalmarkup.com/2008/06/10/where-the-eurostar-goes/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 10:16:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<category><![CDATA[paris]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/06/10/where-the-eurostar-goes/</guid>
		<description><![CDATA[The smell of roasting rubber from the metro is a mere tickle compared to the hammering of fresh bread, seafood and cheese. Looking up to the grey sky, you don&#8217;t feel so bad as you would on a similar day across the Channel.
You&#8217;re in Paris.
What can be whittled from this majestic stick of French gold [...]]]></description>
			<content:encoded><![CDATA[<p>The smell of roasting rubber from the metro is a mere tickle compared to the hammering of fresh bread, seafood and cheese. Looking up to the grey sky, you don&#8217;t feel so bad as you would on a similar day across the Channel.</p>
<p>You&#8217;re in Paris.</p>
<p>What can be whittled from this majestic stick of French gold that hasn&#8217;t been said before? The streets are wide, the food is delicious and the people are French. Walking the streets, you feel as if you were in one colossal museum - there are monuments, ancient buildings, lively artist corners and French people everywhere. Like England, the hangover of lost colonial power is apparent in France, but it&#8217;s done with so much style; you can forgive them their pride and lose yourself in a empirical reverie of wine and fragrant butter sauces.</p>
<p>Far from being snobbish and rude, the people are warm and only happy to help you if you give their language a go. Every day I witnessed a tourist bark orders in English to a stunned service worker. In a bakery one afternoon I saw a man demand a badine in English and, with his arms stretched out, indicate the width of the loaf he had in mind. The teenager behind the counter, probably with a good level of English, was either too offended or too amused to react. The man looked and, probably to her, sounded like a zombie with a brand new Nikon strapped to his drooling head. Just before things hit melting point, a woman standing in line translated, the zombie got his bread and retreated. Imagine if a French person did that in Australia: they would be immediately sent to a detention facility and deported the following decade.</p>
<p>So determined to play by the rules, I stammered out what remained of my French language skills and surprisingly, I got by relatively well. Some were flattered that I&#8217;d taken the time as an anglophone to even open a French grammar book, which is a bit of a polite exaggeration but it was a nice compliment nonetheless. The folk selling trinkets beneath the Eiffel Tower and those trying to scam money weren&#8217;t so appreciative when I told them to fuck off.</p>
<p>In the areas where tourists tend to congregate you are guaranteed to be approached by someone asking you for money, directly or indirectly, at least once every 15 minutes. I learnt to ignore pleas of &#8220;Do you speak English?&#8221;, but there was one trick I&#8217;d never seen before - someone would pretend to pick up something from the ground in front of you, a ring or a coin, and then present it to you as if you&#8217;d dropped it. Insisting that you take the trinket, they congratulate you and then proceed to ask you for money to compensate them for having brought such good fortune upon your package holiday.</p>
<p>Va te faire!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/06/10/where-the-eurostar-goes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starting out on my Flash journey (again)</title>
		<link>http://www.emotionalmarkup.com/2008/05/24/starting-out-on-my-flash-journey-again/</link>
		<comments>http://www.emotionalmarkup.com/2008/05/24/starting-out-on-my-flash-journey-again/#comments</comments>
		<pubDate>Sat, 24 May 2008 13:29:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Development rants]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[gallery]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/?p=55</guid>
		<description><![CDATA[Now that the sun has come out and my employer&#8217;s training budget is large, I&#8217;ve decided to revist Flash and get my Actionscript skills up to scratch.
The last time I used Flash, as a naïve gen Xer looking to embrace the web, it was in version 2. Which sucked. But it was fun to fool [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the sun has come out and my employer&#8217;s training budget is large, I&#8217;ve decided to revist Flash and get my Actionscript skills up to scratch.</p>
<p>The last time I used Flash, as a naïve gen Xer looking to embrace the web, it was in version 2. Which sucked. But it was fun to fool around with things which, back then, were thought of as impossible to do with JavaScript and CSS alone such as smooth animation, timelines and pretty colours.</p>
<p>These days you can manipulate sound, images and video to such an extent that it&#8217;s made Flash the most ubiquitous piece of web software out there.</p>
<p>Not to mention that Flash skills are becoming more and more sought after from a Frontender.</p>
<p>So my quest starts with a <strong>very </strong><a href="/stuff/flash-gallery/">simple image gallery </a>written nearly entirely in Actionscript (2.0 because we only have Flash 8 available to us at the moment) that reads the contents of an xml file.</p>
<p>The next step will be to write a class that builds thumbnails on the fly to an interactive thumbnail scroller for better browsing. At the moment you can only navigate left and right by hovering over the image itself.</p>
<p>It&#8217;s basic, but it&#8217;s a start for me back into the cool world of rich media.</p>
<p>Check out the <a href="/stuff/flash-gallery/">simple image gallery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/05/24/starting-out-on-my-flash-journey-again/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Declaring functions in JavaScript</title>
		<link>http://www.emotionalmarkup.com/2008/05/08/declaring-functions-in-javascript/</link>
		<comments>http://www.emotionalmarkup.com/2008/05/08/declaring-functions-in-javascript/#comments</comments>
		<pubDate>Thu, 08 May 2008 09:43:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Development rants]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/05/08/declaring-functions-in-javascript/</guid>
		<description><![CDATA[Well, here&#8217;s a little tip for you if you didn&#8217;t know already. Some people say that there are a couple of ways of declaring functions in JavaScript and you can go to town doing one or the other (depending on your tastes) because they do precisely the same thing.
Well they do and they don&#8217;t.
Tell me [...]]]></description>
			<content:encoded><![CDATA[<p>Well, here&#8217;s a little tip for you if you didn&#8217;t know already. Some people say that there are a couple of ways of declaring functions in JavaScript and you can go to town doing one or the other (depending on your tastes) because they do precisely the same thing.</p>
<p>Well they do and they don&#8217;t.</p>
<p>Tell me why this will work:</p>
<pre><code>&lt;html&gt;
&lt;head&gt;
   &lt;script type="text/javascript"&gt;
    noodles();
    function noodles() {
      alert("Do you like noodles?");
   }
&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;

</code>
</pre>
<p>And not this:</p>
<pre><code>&lt;html&gt;
&lt;head&gt;
   &lt;script type="text/javascript"&gt;
    noodles();
   var noodles = function() {
      alert("Do you like noodles?");
   }
&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;

</code>
</pre>
<p>The second example will return our favourite word: <strong>undefined</strong>.</p>
<p>Maybe obvious to you, but not to me when I first got on the bandwagon. You see the browser will look at all function declarations (that is, the function in the first example) first and think, &#8220;Hey, these might be useful!&#8221; and then proceed to store them in a little hidey hole for use later. Then it will go on and do everything else. So when the browser encounters a call to a function it already knows what to do.</p>
<p>In the second example, we&#8217;re just assigning a function to a variable, which is great, but the browser has to know about it before we execute. In other words the execution must come <em>after</em> the variable declaration. It&#8217;s like trying to do this:</p>
<pre><code>   alert(noodles);
   var noodles = "I love noodles!";

</code></pre>
<p>It&#8217;s just something to keep in mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/05/08/declaring-functions-in-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On WWWriting</title>
		<link>http://www.emotionalmarkup.com/2008/04/28/on-wwwriting/</link>
		<comments>http://www.emotionalmarkup.com/2008/04/28/on-wwwriting/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:06:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[General musings]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/04/28/on-wwwriting/</guid>
		<description><![CDATA[Here&#8217;s an exercise we were taught in writing school to help free our minds from the conciseness and blandness used by politically-correct trogologytes with nothing better to do than to force us all to use non-figurative, monosyllabic grunts expressly devised to be comprehensible to a sock puppet.
What you do is think of someone you know [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an exercise we were taught in writing school to help free our minds from the conciseness and blandness used by politically-correct trogologytes with nothing better to do than to force us all to use non-figurative, monosyllabic grunts expressly devised to be comprehensible to a sock puppet.</p>
<p>What you do is think of someone you know well and write ten metaphorical sentences about them. It starts by thinking:</p>
<p><em>&#8220;If my friend were a vehicle, what type of vehicle would he/she be?&#8221;</em></p>
<p>The answer might be something like:</p>
<p><em>&#8220;She is a wheat harvester on its back wheels.&#8221;</em></p>
<p>The idea is taken from a poet, whose named I cannot remember, who used this device to describe English poet laureate, Ted Hughes.</p>
<p>For example, here&#8217;s one I made up about a person I know:</p>
<blockquote><p>His shoulders are two oversized furcoats, draped over a telegraph pole.<br />
His voice, a shotgun ringing through a bowling alley on a Saturday night.<br />
His eyes blink over an early evening at the equator.<br />
He uses his nose like a vacuum cleaner sucks up marbles.</p></blockquote>
<p>As you can see, you can create a fairly vivid image of a person through the association of ideas. My example is rubbish, but give it a go, it&#8217;s not only simple but fun - like throwing a hair dryer in the fish tank.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/04/28/on-wwwriting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Party on with the Youtube JavaScript API</title>
		<link>http://www.emotionalmarkup.com/2008/04/16/party-on-with-the-youtube-javascript-api/</link>
		<comments>http://www.emotionalmarkup.com/2008/04/16/party-on-with-the-youtube-javascript-api/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 23:05:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Development rants]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/04/16/party-on-with-the-youtube-javascript-api/</guid>
		<description><![CDATA[Spewing out Youtube videos on to your page has just become easier. Now you can load, control and search Youtube videos using nothing but JavaScript and a bit of patience. I know, I know. Your excitement is palpable through my DSL exchange.
So what can you do? You can embed two players onto your page:

The chrome [...]]]></description>
			<content:encoded><![CDATA[<p>Spewing out Youtube videos on to your page has just become easier. Now you can load, control and search Youtube videos <a href="http://code.google.com/apis/youtube/js_api_reference.html">using nothing but JavaScript</a> and a bit of patience. I know, I know. Your excitement is palpable through my DSL exchange.</p>
<p>So what can you do? You can embed two players onto your page:</p>
<ol>
<li>The chrome player - with all of Youtube&#8217;s standard controls</li>
<li>The chromeless player -  you guessed it, with no controls</li>
</ol>
<p>For some, probably sane reason (although I&#8217;m yet to ascertain why), when using the chrome interface you cannot load new videos into the same player using the loadVideoById function, which is available to the chromeless player. Therefore if you would like to employ this highly useful method <strong>and </strong>be able to control playback, you have to build your own controls. Fortunately, the API methods make it rather easy.</p>
<p>Having nothing to do one rainy day, I decided to give it a go. My motivation was related to the fact that we go to a lot of parties but neither I nor my lazy friends are bothered to bring music and whine incessantly if we have to change a CD. Given the wealth of music videos on Youtube these days I thought that I could make a rudimentary jukebox so that you can play and cue music at will, even when plastered on tins of lager.</p>
<p>Naturally, it will play whatever video you feed it, but I don&#8217;t really want to watch some inane mashup of the Star Wars movies dubbed to a Linkin Park sountrack or other shit. One application that I thought might be rather splendid would be to create a playlist to join all the parts of a movie or TV episode. I am grateful to all the folk who take the time to splice and upload these treats but, by no fault of theirs, it&#8217;s  a chore to click to the next part every nine minutes and twenty four seconds.</p>
<p><a href="http://www.emotionalmarkup.com/stuff/jukebox/">Here&#8217;s my first attempt.</a> Of course I will excuse myself with the following:</p>
<ul>
<li>it&#8217;s alpha</li>
<li>code review to come</li>
<li>design change inevitable (maybe in the shape of a jukebox, that would be original)</li>
<li>predictably, I couldn&#8217;t give a wet sock if it worked in IE6</li>
<li>ideas for the future: saveable playlists, editable playlist order using sortable behaviour, auto-download of next video for smoother playback, fullscreen (or bigger at least), save /cache searches, tally favourites, plug into last.fm for recommendations, get artist data from musicbrainz, blah blah</li>
</ul>
<p>At the very least, it&#8217;s great for listening to music at work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/04/16/party-on-with-the-youtube-javascript-api/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Peeing on flies</title>
		<link>http://www.emotionalmarkup.com/2008/04/10/peeing-on-flies/</link>
		<comments>http://www.emotionalmarkup.com/2008/04/10/peeing-on-flies/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 11:30:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/04/10/peeing-on-flies/</guid>
		<description><![CDATA[Ahh, Amsterdam - the watery princess of the North looking up into the oceans. Exuding chaos and beauty through its sinewy canals. Home to a thousand bicycles and iron hooks from which you can dangle furniture from your storage lofts. Magnet for people of all persuasions - particularly young continentals looking to get stoned.
The novelty [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh, Amsterdam - the watery princess of the North looking up into the oceans. Exuding chaos and beauty through its sinewy canals. Home to a thousand bicycles and iron hooks from which you can dangle furniture from your storage lofts. Magnet for people of all persuasions - particularly young continentals looking to get stoned.</p>
<p>The novelty of Amsterdam takes a few visits to wear down because you&#8217;re hardly on the plane on the way back from wherever you came from and you&#8217;re planning your next weekend to the city. This of course is due to your still altered state of consciousness whereby you hold the unwavering belief that you could subsist on joints, hot chips and cake for the rest of your terrestrial existence. Reality often kicks in when you are asked to communicate with someone born of the prevailing system and all you can manage is a string of warbling nonsense surrounded by pauses long enough in which to pour a pint of Guinness.</p>
<p>However Amsterdam is more than this: you will notice, if you are a male, or care to frequent the male toilets, that they paint tiny flies on the urinals. The idea is that you will instinctively aim at the fly when you piss and not on the floor, nor presumably on the person standing next to you. This can only mean that people in the Netherlands either take great delight in urinating on insects or on the floor, but not both at the same time.</p>
<p>You can also see the world&#8217;s largest collection of working bikes near the Central Station, crammed into a split-level parking lot on the canal. It is a marvel to witness how this modern city functions without reliance on the car, unlike so many other western metropolises. The prevalence of the bike has led to some astonishingly innovative two-wheeled contraptions such as the bike/trailer combination; the &#8220;bike for the whole family&#8221; bike, with a seat for mum and dad and two kids; and the reclining bike, which is the only personal displacement vehicle in which you can rest, smoke a doobie and exercise at the same time. The unicycle is notably absent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/04/10/peeing-on-flies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Diplomatic immunity through JavaScript</title>
		<link>http://www.emotionalmarkup.com/2008/04/05/diplomatic-immunity-through-javascript/</link>
		<comments>http://www.emotionalmarkup.com/2008/04/05/diplomatic-immunity-through-javascript/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 14:23:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Development rants]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/04/05/diplomatic-immunity-through-javascript/</guid>
		<description><![CDATA[Would you love to be able to waltz in to a place, piss all over the floor, without anybody saying or doing anything to you? Even if they wanted to punish you, they would have to follow a process that you yourself defined. Haw haw!
Anonymous, self-executing functions can allow you to do this. They&#8217;re kind [...]]]></description>
			<content:encoded><![CDATA[<p>Would you love to be able to waltz in to a place, piss all over the floor, without anybody saying or doing anything to you? Even if they wanted to punish you, they would have to follow a process that you yourself defined. Haw haw!</p>
<p>Anonymous, self-executing functions can allow you to do this. They&#8217;re kind of like diplomatic immunity for your browser and can be very powerful.</p>
<pre><code>(function(){</code>/*
    Oooh it&#8217;s so cozy in here. I have access to all
    global variables but I can do what
    I like and no-one will know!
    Now I&#8217;m going to do some private things.
*/

var privateVar = &#8220;I&#8217;m so lonely in here&#8221;;
var privateFunction = function(s){ alert(s) };

/*

Okay, maybe I want to share something with the
    outside world but let&#8217;s namespace it just in case:

*/

return namespace = {
           publicFunction : function(q){
               return function(a) {
                privateFunction(q + privateVar + a)
               }
            }
};

})();</pre>
<p>We can&#8217;t access any of the private variables or functions from outside our anonymous function, thus avoiding collisions and overwriting, but we can return public functions that do! namespace.publicFunction is able to see, use and modify our private variables, but only in the way in which we want it.</p>
<p>It&#8217;s even possible to throw a bit of curry in there to spice it up. Calling namespace.publicFunction and passing it an argument (in this case a question) returns another anonymous function that expects an argument (an answer) and will then use our private variables to construct a little dialogue.</p>
<p>We would call it like this:</p>
<p><code>namespace.publicFunction("How are you?\n")("\nThat's too bad");</code></p>
<p>The example is basic and doesn&#8217;t make much practical sense but it demonstrates the way scope works in JavaScript and it can be a simple but handy tool to have in your arsenal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/04/05/diplomatic-immunity-through-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A flying f*%kup</title>
		<link>http://www.emotionalmarkup.com/2008/03/28/a-flying-fkup/</link>
		<comments>http://www.emotionalmarkup.com/2008/03/28/a-flying-fkup/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 18:35:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.emotionalmarkup.com/2008/03/28/a-flying-fkup/</guid>
		<description><![CDATA[You&#8217;ve spent years and swathes of cash planning a major upgrade. Importing the best engineers, business consultants, designers and researchers, you&#8217;ve planned your project down to the finest detail, assessing risks, inviting all the right stakeholders to contribute and undertaking stringent testing procedures before launch.
There are no cutting corners and no getting it wrong - [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve spent years and swathes of cash planning a major upgrade. Importing the best engineers, business consultants, designers and researchers, you&#8217;ve planned your project down to the finest detail, assessing risks, inviting all the right stakeholders to contribute and undertaking stringent testing procedures before launch.</p>
<p>There are no cutting corners and no getting it wrong - you&#8217;re upgrading once of the most important and most highly trafficked sites in the world and any downtime would have a severe effect on a large number of people.</p>
<p>Going live - the moment you&#8217;ve been waiting for for what seems like years has come. Are we ready? Have we checked all the systems? Is everyone trained on how to deal with the infrastructure and networks? Is our backup plan prepared?</p>
<p>&#8220;Ok! Flick the switch!&#8221;</p>
<p>Nothing.</p>
<p>&#8220;Flick it again!&#8221;</p>
<p>Still nothing.</p>
<p>The pressure is mounting. Complaints start to trickle in. Your visitors are wondering what is going on as there is no service. Total chaos ensues.</p>
<p>No, I&#8217;m not talking about a website now, but Heathrow Terminal 5. My trip to Amsterdam to see Mark Knopfler in concert, planned months ago, has been thwarted by &#8220;<a href="http://news.bbc.co.uk/1/hi/uk/7317909.stm">a catalogue of errors</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.emotionalmarkup.com/2008/03/28/a-flying-fkup/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
