<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Barklund.org</title>
	<link>http://www.barklund.org/blog</link>
	<description>My life with ActionScript and relations</description>
	<pubDate>Wed, 01 Oct 2008 22:32:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>QR codes and Flash on the Beach</title>
		<link>http://www.barklund.org/blog/2008/10/02/qr-codes-and-flash-on-the-beach/</link>
		<comments>http://www.barklund.org/blog/2008/10/02/qr-codes-and-flash-on-the-beach/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 22:32:52 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>AS3</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2008/10/02/qr-codes-and-flash-on-the-beach/</guid>
		<description><![CDATA[Flash on the Beach is just over and the final day had the most impressive (and the single most useful) presentations. The inspirational level this year has been great. The wonderfully beautiful creations by Eric Natzke or Robert Hodgin can take anyones breath away and the generally inspiring nature of Jonathan Harris&#8217; works makes everyone [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashonthebeach.com" "Official website" onclick="javascript:urchinTracker ('/outbound/article/www.flashonthebeach.com');">Flash on the Beach</a> is just over and the final day had the most impressive (and the single most useful) presentations. The inspirational level this year has been great. The wonderfully beautiful creations by <a href="http://jot.eriknatzke.com/" title="Eric's blog" onclick="javascript:urchinTracker ('/outbound/article/jot.eriknatzke.com');">Eric Natzke</a> or <a href="http://www.flight404.com/blog/" "Robert's blog" onclick="javascript:urchinTracker ('/outbound/article/www.flight404.com');">Robert Hodgin</a> can take anyones breath away and the generally inspiring nature of <a href="http://www.number27.org/" title="Jonathan's website" onclick="javascript:urchinTracker ('/outbound/article/www.number27.org');">Jonathan Harris&#8217;</a> works makes everyone want to do the same (if only we could get similar great ideas).</p>
<p>But <a href="http://www.quasimondo.com/" title="Mario's blog" onclick="javascript:urchinTracker ('/outbound/article/www.quasimondo.com');">Mario Klingemann&#8217;s</a> presentation about reading <a href="http://en.wikipedia.org/wiki/QR_Code" title="QR Code explained on the English Wikipedia" onclick="javascript:urchinTracker ('/outbound/article/en.wikipedia.org');">QR codes</a> in Flash was the most (technically) inspiring presentation in my opinion and I could immediately see a bunch of ways in which, I could use this for all different sorts of purposes - in real life advertising and not just for the fun of it. I really feel that I could join this project and make it into a complete library and so far I&#8217;ve written him a mail offering my help (and a minor possibility for optimization).</p>
<p>But credits also go to <a href="http://www.gskinner.com" title="Grant's website" onclick="javascript:urchinTracker ('/outbound/article/www.gskinner.com');">Grant Skinner</a>, as his talk on important things to learn as a new web developer (in Flash in particular) gave me some good inspiration for my own job as head of development with developers of my own needing help and guidelines.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2008/10/02/qr-codes-and-flash-on-the-beach/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Self-&#8221;partially applying&#8221; JavaScript functions</title>
		<link>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/</link>
		<comments>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 20:54:51 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>AS3</category>
	<category>JavaScript</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/</guid>
		<description><![CDATA[Was: self-currying JavaScript functions
I read this nice post on self-currying JavaScript functions, and even though the code to me is not optimal (dispite the low line count), it is improperly named, and it depends on the Prototype JavaScript library (which I really don&#8217;t like), it is a very nice script and a very nice idea. [...]]]></description>
			<content:encoded><![CDATA[<p style="font-style:italic;margin-left:20px">Was: <a href="http://blog.jcoglan.com/2007/12/12/self-currying-javascript-functions/" title="Self-currying JavaScript functions from The If Works blog" onclick="javascript:urchinTracker ('/outbound/article/blog.jcoglan.com');">self-currying JavaScript functions</a></p>
<p>I read <a href="http://blog.jcoglan.com/2007/12/12/self-currying-javascript-functions/" title="Self-currying JavaScript functions from The If Works blog" onclick="javascript:urchinTracker ('/outbound/article/blog.jcoglan.com');">this nice post on self-currying JavaScript functions</a>, and even though the code to me is not optimal (dispite the low line count), it is improperly named, and it depends on the Prototype JavaScript library (which I really don&#8217;t like), it is a very nice script and a very nice idea. The trick in this script is using <code>Function.prototype.length</code>. I didn&#8217;t know that this property existed, but after digging a bit I&#8217;ve realized, that it has been in <a href="http://www.ecma-international.org/cgi-bin/counters/unicounter.pl?name=Ecma-262&#038;deliver=http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" title="PDF: see section 15.3.5.1 on page 87 (PDF real page number 99)" onclick="javascript:urchinTracker ('/outbound/article/www.ecma-international.org');">ECMAScript at least since 3rd edition</a> (which is the latest edition published in 1999), in <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:length" title="Core JavaScript 1.5 Reference:Global Objects:Function:length from mozilla developer center" onclick="javascript:urchinTracker ('/outbound/article/developer.mozilla.org');">JavaScript since v1.1</a>, but only made it into ActionScript by <a href=" http://livedocs.adobe.com/specs/actionscript/3/as3_specification203.html" onclick="javascript:urchinTracker ('/outbound/article/livedocs.adobe.com');">ActionScript 3</a> (which I haven&#8217;t study in as much detail as I have with ActionScript 1 and 2 in relation to <a href="/blog/authorship/" title="My authorship">my book on basic programming</a> in these versions).</p>
<p>In this post <a href="http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#toc-background" >I discuss this property and functionality a bit further</a>, and I implement this function for creating self-&#8221;partially applying&#8221; functions using both <a href="http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#toc-nativejs" >no framework</a>, the <a href="http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#toc-mochikit" >MochiKit framework</a> and the <a href="http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/#toc-prototype" >Prototype framework</a>.</p>
<p><a id="more-46"></a></p>
<h2 id="toc-background">Background</h2>
<p>So, what is this property? I have not seen anyone use it before, not in production nor in any of the major JavaScript libraries. It might have been in use by a lot of people several times, but I just haven&#8217;t come across it. It has the simple function of returning the number of named arguments, that a given function is originally created with. The function will be called and might work just fine given less or more parameters, but Function.prototype.length is the number of named arguments in the definition. The ECMAScript language specification is kind of vague on the functionality, as it uses the term &#8220;usually&#8221;:</p>
<blockquote><p>The value of the <code>length</code> property is <strong>usually</strong> an integer that indicates the “typical” number of arguments expected by the function. However, the language permits the function to be invoked with some other number of arguments. The behaviour of a function when invoked on a number of arguments other than the number specified by its <code>length</code> property depends on the function. [&#8230;]</p></blockquote>
<p>In his post James Coglan uses this property to create what he originally denotes as <em>self-currying functions</em>, but agrees with a <a href="http://www.herrmann.eti.br/" title="Ricardo Hermann" onclick="javascript:urchinTracker ('/outbound/article/www.herrmann.eti.br');">commenter</a>, that it is in fact <em>self-&#8221;partially applied&#8221; functions</em> using the proper terms. I would though go to the extend to say, that the functions are neither curried nor partially applied &ndash; their application/evaluation/invocation is just postponed until the correct amount of parameters have been accumulated. If the function was partially applied, the partially applied function would run faster (in theory), as it has been specialized with respect to the already supplied parameters, but this is not the case. The parameters are simply stored until the number of parameters given (potentially across several calls) matches the number of arguments <em>&#8220;typically&#8221;</em> accepted by the original function.</p>
<p>One of the issues about the implementation by James Coglan that caught my eye, is the use of the prototype chain. Many have an opinion about whether to contaminate the prototype chain or not, but I am of the latter school and really dislike this. Contaminating the global namespace (i.e. <code>window</code>) is thus the only other alternative, but for this a single global object containing all library functions can be created. This is the approach that my preferred library, <a href="http://www.mochikit.com" title="MochiKit makes JavaScript suck less - and it's true" onclick="javascript:urchinTracker ('/outbound/article/www.mochikit.com');">MochiKit</a>, uses but <a href="http://www.prototypejs.org" title="Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications" onclick="javascript:urchinTracker ('/outbound/article/www.prototypejs.org');">Prototype</a> (which is way more popular than MochiKit) extends built-in JavaScript objects using the prototype chain. I have thus decided to implement this functionality both in native JavaScript and using MochiKit or Prototype methodologies. Another minor issue with the implementation by Coglan is the use of the activation object to read variables from the inner function. This tends to leak memory (as collected by <a href="http://www.quirksmode.org/" title="quirksmode.org" onclick="javascript:urchinTracker ('/outbound/article/www.quirksmode.org');">Quirksmode</a> <a href="http://www.quirksmode.org/blog/archives/coding_techniques/memory_leaks/index.html" title="QuirksBlog - Memory leaks" onclick="javascript:urchinTracker ('/outbound/article/www.quirksmode.org');">here</a>), so the general rule of thumb here is to store such values on the function instance and retrieve them from <code>arguments.callee</code>.</p>
<h2 id="toc-nativejs">In native JavaScript</h2>
<p>First the implementation in native JavaScript. Note the two helper functions, of which the first is needed, as <code>arguments</code> isn&#8217;t a real array, and the latter is the general &#8220;curry&#8221; or &#8220;partial&#8221; method found in most libraries:</p>
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="kw2">function</span> makeArray<span class="br0">&#40;</span>a<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> b = <span class="br0">&#91;</span><span class="br0">&#93;</span>, i = <span class="nu0">0</span>; i &lt; a.<span class="me1">length</span>; i++<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; b.<span class="me1">push</span><span class="br0">&#40;</span>a<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> b;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="kw2">function</span> bind<span class="br0">&#40;</span>f, a<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw2">var</span> g = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw2">var</span> c = arguments.<span class="me1">callee</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> c._func.<span class="me1">apply</span><span class="br0">&#40;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; <span class="kw2">null</span>,</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; c._args.<span class="me1">concat</span><span class="br0">&#40;</span>makeArray<span class="br0">&#40;</span>arguments<span class="br0">&#41;</span><span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; g._func = f;</div></li>
<li class="li1"><div class="de1">&nbsp; g._args = a ? makeArray<span class="br0">&#40;</span>a<span class="br0">&#41;</span> : <span class="br0">&#91;</span><span class="br0">&#93;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> g;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="kw2">function</span> partialize<span class="br0">&#40;</span>f, n<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw2">var</span> g = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw2">var</span> c = arguments.<span class="me1">callee</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>c._len &lt;= arguments.<span class="me1">length</span><span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> c._func.<span class="me1">apply</span><span class="br0">&#40;</span><span class="kw2">null</span>, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> bind<span class="br0">&#40;</span>c, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; g._len = n || f.<span class="me1">length</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; g._func = f;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw1">return</span> g;</div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span> </div></li></ol></div>
<p style="font-style:italic;margin-left:20px">The above bind-function is not optimal, as re-binding creates an extra layer of function calls which could easily be avoided by reusing the values stored on the function instance, but for this use, the above suffices.</p>
<p>This function can the be utilized exactly like the one by Coglan &ndash; except that this <code>partialize</code> function is actually a function, where the <code>toSelfCurrying</code> function by Coglan is a method (available through any function instance):</p>
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="kw2">var</span> adder = <span class="kw2">function</span><span class="br0">&#40;</span>a,b,c<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> a + b + c;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span>;</div></li>
<li class="li2"><div class="de2"><span class="kw2">var</span> add = partialize<span class="br0">&#40;</span>adder<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">add<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span>&nbsp; <span class="co1">// --&gt; 6</span></div></li>
<li class="li2"><div class="de2">add<span class="br0">&#40;</span><span class="nu0">7</span>,<span class="nu0">8</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="nu0">23</span><span class="br0">&#41;</span>&nbsp; <span class="co1">// --&gt; 38 </span></div></li></ol></div>
<h2 id="toc-mochikit">In MochiKit</h2>
<p>Implementing this in MochiKit and using the power of the built-in functions (especially <code>bind</code>), this becomes only the last function:</p>
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="kw2">function</span> partialize<span class="br0">&#40;</span>f, n<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw2">var</span> g = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> c = arguments.<span class="me1">callee</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>c._len &lt;= arguments.<span class="me1">length</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> c._func.<span class="me1">apply</span><span class="br0">&#40;</span><span class="kw2">null</span>, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> MochiKit.<span class="me1">Base</span>.<span class="me1">bind</span><span class="br0">&#40;</span>c, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; g._len = n || f.<span class="me1">length</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; g._func = f;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> g;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span> </div></li></ol></div>
<p>If keeping with the MochiKit spirit, one would save this function in the <code>MochiKit.Base</code> library and globally if export is active:<br />
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2"><span class="co1">// closure to avoid cluttering window</span></div></li>
<li class="li1"><div class="de1"><span class="kw2">function</span> partialize<span class="br0">&#40;</span>f, n<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw2">var</span> g = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> c = arguments.<span class="me1">callee</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>c._len &lt;= arguments.<span class="me1">length</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> c._func.<span class="me1">apply</span><span class="br0">&#40;</span><span class="kw2">null</span>, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> MochiKit.<span class="me1">Base</span>.<span class="me1">bind</span><span class="br0">&#40;</span>c, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; g._len = n || f.<span class="me1">length</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; g._func = f;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> g;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="co1">// save in MochiKit.Base:</span></div></li>
<li class="li1"><div class="de1">MochiKit.<span class="me1">Base</span>.<span class="me1">partialize</span> = partialize;</div></li>
<li class="li2"><div class="de2"><span class="co1">// if export is active, save on window:</span></div></li>
<li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>MochiKit.__export__<span class="br0">&#41;</span> window.<span class="me1">partialize</span> = partialize;</div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; </div></li></ol></div>
<h2 id="toc-prototype">In prototype</h2>
<p>If you are using Prototype, you probably do not dislike the use of extending built-in classes using the prototype chain, thus the implementation is a slight change of the implementation by Coglan:</p>
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="kw2">Function</span>.<span class="me1">prototype</span>.<span class="me1">toSelfCurrying</span> = <span class="kw2">function</span><span class="br0">&#40;</span>n<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw2">var</span> g = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> c = arguments.<span class="me1">callee</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>arguments.<span class="me1">length</span> &gt;= c._len<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> c._func.<span class="me1">apply</span><span class="br0">&#40;</span><span class="kw1">this</span>, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> c.<span class="me1">curry</span>.<span class="me1">apply</span><span class="br0">&#40;</span>c, arguments<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; g._len = n || <span class="kw1">this</span>.<span class="me1">length</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; g._func = <span class="kw1">this</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; <span class="kw1">return</span> g;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span>; </div></li></ol></div>
<p style="font-style:italic;margin-left:20px">UPDATE: Fixing typo pointed out by <a href="http://blog.jcoglan.com" title="The If Works" onclick="javascript:urchinTracker ('/outbound/article/blog.jcoglan.com');">James Coglan</a>.</p>
<p>This is almost as compact and just as readable.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2008/02/06/self-partially-applying-javascript-functions/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Data Structures for Game Development in AS3</title>
		<link>http://www.barklund.org/blog/2007/11/08/data-structures-for-game-development-in-as3/</link>
		<comments>http://www.barklund.org/blog/2007/11/08/data-structures-for-game-development-in-as3/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 15:41:03 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>AS3</category>
	<category>Games</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/11/08/data-structures-for-game-development-in-as3/</guid>
		<description><![CDATA[This library by polygonal.de looks really nice. I would most definitely be using this for future development.

]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.polygonal.de/2007/05/10/data-structures-released/" title="Data Structures Released" onclick="javascript:urchinTracker ('/outbound/article/lab.polygonal.de');">This library</a> by <a href="http://polygonal.de" onclick="javascript:urchinTracker ('/outbound/article/polygonal.de');">polygonal.de</a> looks really nice. I would most definitely be using this for future development.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/11/08/data-structures-for-game-development-in-as3/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Filterable tables – MochiKit-style</title>
		<link>http://www.barklund.org/blog/2007/09/27/filterable-tables-mochikit-style/</link>
		<comments>http://www.barklund.org/blog/2007/09/27/filterable-tables-mochikit-style/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 23:08:17 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>JavaScript</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/09/27/filterable-tables-mochikit-style/</guid>
		<description><![CDATA[A recent post on the MochiKit mailing list inspired me to have a little more fun with MochiKit, which I use a lot professionally and privately. The task was to see how simply a filtering for tables could be done using MochiKit.
The first task was to identify all the problems of the original script. Then [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://groups.google.com/group/mochikit/browse_thread/thread/5c55d5bfef5bd3bf" title="Topic: examples of filterable tables using mochikit?" onclick="javascript:urchinTracker ('/outbound/article/groups.google.com');">recent post</a> on the <a href="http://groups.google.com/group/mochikit" title="Using Google Groups" onclick="javascript:urchinTracker ('/outbound/article/groups.google.com');">MochiKit mailing list</a> inspired me to have a little more fun with <a href="http://mochikit.org" title="It really does make JavaScript suck less" onclick="javascript:urchinTracker ('/outbound/article/mochikit.org');">MochiKit</a>, which I use a lot professionally and privately. The task was to see how simply a filtering for tables could be done using MochiKit.</p>
<p>The first task was to identify all the problems of <a href="http://leparlement.org/filterTable" title="JavaScript filter/search in table (parlement)" onclick="javascript:urchinTracker ('/outbound/article/leparlement.org');">the original script</a>. Then comes setting up the basics, and finally implementing the necessary functionality. And as always MochiKit supplies so many convenient functions, that only the fun part is left. Furthermore this article suggest some simple extensions to the concept of filtering.<br />
<a id="more-43"></a><br />
Current problems with the existing script include, that the de-highlighter ignores sibling (non-text) nodes of the text node that contained the highlighted term (and removes their markup). That is, if there is a cell like:</p>
<pre><span style="color:green">&lt;td&gt;</span>here is a <span style="color:green">&lt;strong&gt;</span>bold<span style="color:green">&lt;/strong&gt;</span> text<span style="color:green">&lt;/td&gt;</span></pre>
<p>Then if we search for <code>is</code>, the script will correctly highlight this word in the text, and the result looks like:</p>
<pre><span style="color:green">&lt;td&gt;</span>here <span style="color:green">&lt;span </span><span style="color:blue">class=&#8221;highlight&#8221;</span><span style="color:green">&gt;</span>is<span style="color:green">&lt;/span&gt;</span> a <span style="color:green">&lt;strong&gt;</span>bold<span style="color:green">&lt;/strong&gt;</span> text<span style="color:green">&lt;/td&gt;</span></pre>
<p>But if we then de-highlight this highlighted word, all markup from the entire cell (the cell is the direct parent of the text node containing the searched word) will be removed. Thus the resulting cell will look like:</p>
<pre><span style="color:green">&lt;td&gt;</span>here is a bold text<span style="color:green">&lt;/td&gt;</span></pre>
<p>And this does matter. Because it does not only remove presentational markup like <code>&lt;strong&gt;</code> but (of course) also structural or functional markup like headers or links.</p>
<p>I needed an example table for this, and I used the one html table on the entire net, that I frequent the most &ndash; the <a href="http://imdb.com/chart/top" title="What is &quot;Ratatouille&quot; doing there by the way?" onclick="javascript:urchinTracker ('/outbound/article/imdb.com');">IMDB top 250</a>. Though I expected the script to be quite heavy, so I only used the top 10 actually for the base example. But later I will show other examples using longer tables for doing different searches.</p>
<p>The script is built around a basic onload-hook putting everything in closure (good for later inclusion in <em>foreign</em> pages) and this function sets up a few utility functions as well as the main hook for all filterable tables (tables including the class <code>filterable</code>). All these filterable tables are prefixed with a form containing a single input field. This input field&#8217;s onkeyup-event is then connected to the filtering function. When a key is released in the input field, the search term is extracted, the current highlights are removed, the lines not containing the word are hidden, and the remaining lines are sent through the highlighter. If the search term is empty, all lines are shown without highlights.</p>
<p>The script has many nice displays of how MochiKit really makes programming in JavaScript easier, and less <em>sucky</em> &ndash; I especially enjoy this simple function extracting all text nodes beneath a given node (depth-first, children before siblings):</p>
<div class="javascript" style="font-family: monospace;"><div class="head">JAVASCRIPT:</div><ol><li class="li1"><div class="de1"><span class="co1">// get all text nodes below current</span></div></li>
<li class="li2"><div class="de2"><span class="kw2">function</span> getTextNodes<span class="br0">&#40;</span>node<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>node.<span class="me1">nodeType</span> == <span class="nu0">3</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="br0">&#91;</span>node<span class="br0">&#93;</span>;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> reduce<span class="br0">&#40;</span>extend, map<span class="br0">&#40;</span>arguments.<span class="me1">callee</span>, node.<span class="me1">childNodes</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span> </div></li></ol></div>
<p>This simple version of the script can be viewed <a href="/examples/filterable/index.html">here</a>.</p>
<p>As mentioned, this isn&#8217;t a complete solution. For larger tables, it is very slow. It can be optimized a bit though. First thing is to do the <code>scrapeText(row).toLowerCase()</code> only once per row and store it as an attribute on the node. But for large tables, this isn&#8217;t enough. This could be fixed by adding more classes and creating special handling of these. Here I suggest the following two extra classes:</p>
<ul>
<li><code>filterable-onsubmit</code></li>
<li><code>filterable-nohighlight</code></li>
</ul>
<p>If the first class is given, the filtering will only be applied, when the form is submitted (instead of the input changed, user has to press enter to search) and if the second class is given, the filter will not highlight the search term &ndash; only show or hide rows with the given term. These can of course be combined. This can be seen in effect <a href="/examples/filterable/extended.html">here</a>.</p>
<p>Have fun and feel free to use under the given <a href="/blog/license">license</a>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/09/27/filterable-tables-mochikit-style/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Now introducing: Dexgames</title>
		<link>http://www.barklund.org/blog/2007/09/11/now-introducing-dexgames/</link>
		<comments>http://www.barklund.org/blog/2007/09/11/now-introducing-dexgames/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 20:44:44 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>AS3</category>
	<category>Games</category>
	<category>Dexgames</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/09/11/now-introducing-dexgames/</guid>
		<description><![CDATA[With a colleague of mine, Morten Reinholdt, I have started to work on a new flash gaming website called Dexgames. Actually we started on the idea several months ago, but now we both have the time to do some more actual work on it.
The concept is very much inspired by many other gaming sites. The [...]]]></description>
			<content:encoded><![CDATA[<p>With a colleague of mine, <a href="http://flashorbit.com" onclick="javascript:urchinTracker ('/outbound/article/flashorbit.com');">Morten Reinholdt</a>, I have started to work on a new flash gaming website called <em>Dexgames</em>. Actually we started on the idea several months ago, but now we both have the time to do some more actual work on it.</p>
<p>The concept is very much inspired by many other gaming sites. The ones that I personally have frequented some times are:</p>
<ul>
<li><a href="http://www.orisinal.com/" onclick="javascript:urchinTracker ('/outbound/article/www.orisinal.com');">Orisinal</a></li>
<li><a href="http://www.donutgames.com/" onclick="javascript:urchinTracker ('/outbound/article/www.donutgames.com');">Donutgames</a></li>
<li><a href="http://www.miniclip.com/" onclick="javascript:urchinTracker ('/outbound/article/www.miniclip.com');">Miniclip</a></li>
</ul>
<p>Just to name a few.<br />
<a id="more-41"></a><br />
The site should be completely free, but we might add some google adsense here and there to get the hosting paid this way.</p>
<p>The current titles, that we are thinking about are mostly classical puzzle games like break-out. tetris and the like with different modern twists. But the big plan for the site is the big game, Dex Empire.</p>
<p>What this game is really about, no-one knows yet. But it is to be a combination of a series of games, that the both of us really enjoy:</p>
<ul>
<li><a href="http://supremecommander.com" onclick="javascript:urchinTracker ('/outbound/article/supremecommander.com');">Supreme Commander</a></li>
<li><a href="http://www.handdrawngames.com/DesktopTD/game.asp" onclick="javascript:urchinTracker ('/outbound/article/www.handdrawngames.com');">Desktop Tower Defense</a></li>
<li><a href="http://travian.com" onclick="javascript:urchinTracker ('/outbound/article/travian.com');">Travian</a></li>
<li>Civilization, Colonization and such simulation classics</li>
</ul>
<p>With this as the basis, this game cannot fail. But it can and will take a very long time to develop &ndash; I just hope, that we will actually complete it.</p>
<p>It will end up as some kind of <acronym title="Massive Multiplayer Online Real-Time Strategy Role-Playing Game">MMORTSRPG</acronym> &ndash; whatever that means.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/09/11/now-introducing-dexgames/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Bibliotekr – a new Danish social book-sharing site</title>
		<link>http://www.barklund.org/blog/2007/09/04/bibliotekr-%e2%80%93-a-new-danish-social-book-sharing-site/</link>
		<comments>http://www.barklund.org/blog/2007/09/04/bibliotekr-%e2%80%93-a-new-danish-social-book-sharing-site/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 20:55:24 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>JavaScript</category>
	<category>Mashup</category>
	<category>Bibliotekr</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/09/04/bibliotekr-%e2%80%93-a-new-danish-social-book-sharing-site/</guid>
		<description><![CDATA[Bibliotekr (a badly hidden pun on Flickr) is an idea crafted by a group of persons trying to create a book-sharing site &#8220;competing&#8221; with the Danish libraries. And one of the organizers had thrown together a small Hackathon, which I just had to attend.

The Hackathon turned out to be more of a Conceptuathon or Possibilithon, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bibliotekr.dk" title="(in Danish) The current developer blog" onclick="javascript:urchinTracker ('/outbound/article/www.bibliotekr.dk');">Bibliotekr</a> (a badly hidden pun on <a href="http://www.flickr.com" title="You know it" onclick="javascript:urchinTracker ('/outbound/article/www.flickr.com');">Flickr</a>) is an idea crafted by a group of persons trying to create a book-sharing site &#8220;competing&#8221; with the Danish libraries. And one of the organizers had thrown together a small <a href="http://www.webmercial.dk/bibliotekr-hackathon-tirsdag-den-4-september-kl-1800.htm" title="(in Danish) Call for attendants to the Hackathon" onclick="javascript:urchinTracker ('/outbound/article/www.webmercial.dk');">Hackathon</a>, which I just had to attend.<br />
<a id="more-40"></a><br />
The <em>Hackathon</em> turned out to be more of a <em>Conceptuathon</em> or <em>Possibilithon</em>, because the concept wasn&#8217;t really ready for implementation yet. But <a href="http://www.bibliotekr.dk/2007/09/05/udvikling/" title="(in Danish) The minutes of the meeting" onclick="javascript:urchinTracker ('/outbound/article/www.bibliotekr.dk');">we met up 8 persons</a> and discussed our views on the project. Some were developers like me, some were librarians and some just interested parties.</p>
<p>The key points remaining to make the concept ready for alpha-release to the public was how to conceptually identify the lending of a book in a Wordpress post. How does the post change to visualize, that the book has been lent out. This has to be done via some extension to Wordpress. I looked into creating Wordpress plugins &ndash; <a href="http://codex.wordpress.org/Creating_Tables_with_Plugins" title="From Wordpress Codex: Creating Tables with Plugins" onclick="javascript:urchinTracker ('/outbound/article/codex.wordpress.org');">and that seems to be very easy</a>. So when that time comes, I will probably create that.</p>
<p>The second challenge is to display books for lending on a Google Map. This is however quite easy &ndash; even applying filters on the sections to show (only sci-fi, only paperback, etc.). The funny thing comes when zooming on the map. Of course the map cannot handle thousands of displayed icons in the same view &ndash; the javascript is simply too slow. Thus on different zoom levels, different levels of detail must be applied. The easiest is to switch to zipcode view at a certain zoom-level, and then just count the number of available books in the zipcode and display a single icon for this.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/09/04/bibliotekr-%e2%80%93-a-new-danish-social-book-sharing-site/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Doing a large corporate website the interesting way</title>
		<link>http://www.barklund.org/blog/2007/08/14/doing-a-large-corporate-website-the-interesting-way/</link>
		<comments>http://www.barklund.org/blog/2007/08/14/doing-a-large-corporate-website-the-interesting-way/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 10:32:41 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>Play</category>
	<category>JavaScript</category>
	<category>HTML</category>
	<category>Mashup</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/08/14/doing-a-large-corporate-website-the-interesting-way/</guid>
		<description><![CDATA[Today we launched a new website for one of the major Danish mortgage provider, Totalkredit. They are known by all Danes due to their tv-ads (produced by TBWA\Copenhagen), that everyone either hates or loves. This is a very big client, and thus they require a very big website. But as they are for the people [...]]]></description>
			<content:encoded><![CDATA[<p>Today <a href="http://tbwa-play.com" onclick="javascript:urchinTracker ('/outbound/article/tbwa-play.com');">we</a> launched a new website for one of the major Danish mortgage provider, Totalkredit. They are known by all Danes due to their tv-ads (produced by <a href="http://www.tbwa.dk" onclick="javascript:urchinTracker ('/outbound/article/www.tbwa.dk');">TBWA\Copenhagen</a>), that everyone either hates or loves. This is a very big client, and thus they require a very big website. But as they are <em>for the people</em> and tries to communicate directly with the <em>common man</em>, the website need not be corporate, but must be rich with content, easy to use and with many features that will create returning visitors.</p>
<p>Well, all this I did not have much to do with, that concerns the concept department. But concretising, technically verifying and realizing this concept is very much my job. The project has taken many months but it is now finally complete. Or well, such is never complete, but the first version has been launched at least. And this site is (technically) amazing if I should describe it. The amount of JavaScript used is huge and much of it uses <a href="http://mochikit.com" onclick="javascript:urchinTracker ('/outbound/article/mochikit.com');">MochiKit</a> heavily. The JavaScript is used to enliven the page in a very interesting way.</p>
<p>The whole page works without JavaScript in the classical fashion (clicking links, reloading the whole page with the new page), but with JavaScript enabled, all links are caught and handle via Ajax instead. This technique was introduced to me by <a href="http://adactio.com/" onclick="javascript:urchinTracker ('/outbound/article/adactio.com');">Jeremy Keith</a> and his somewhat cute term <em>Hijax</em>. In order to do this, but not combine markup with content, large portions of the HTML (very large in fact) are built in JavaScript. For this need <a href="http://mochikit.com/doc/html/MochiKit/DOM.html" onclick="javascript:urchinTracker ('/outbound/article/mochikit.com');">MochiKit.DOM</a> is really handy.</p>
<p>Other features of the site, that makes this a very satisfying job to have completed:</p>
<ul>
<li>It is of course search engine optimized (Hijax preserves this)</li>
<li>It uses a very concise, readable markup and works as mentioned without JavaScript (the properties of <em><a href="http://en.wikipedia.org/wiki/Progressive_enhancement" onclick="javascript:urchinTracker ('/outbound/article/en.wikipedia.org');">Progressive Enhancement</a></em>)</li>
<li>The URL is modified on every major page change using fragments in order to allow deep-linking and bookmarking (this is partly self-developed, partly borrowed from <a href="http://www.asual.com/swfaddress/" onclick="javascript:urchinTracker ('/outbound/article/www.asual.com');">SWFAddress</a>)</li>
<li>And given the above, that &#8220;back&#8221; and &#8220;forward&#8221; buttons of the browser works (unlike many other full-Ajax websites)</li>
<li>The site includes <a href="http://maps.google.com" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">Google Maps</a> (you can&#8217;t go wrong with that!)</li>
<li>The site is tested and optimized for Internet Explorer 6 and 7 as well as Firefox 2 (and friends).</li>
</ul>
<p>Enough talking, here is the site: <a href="http://www.totalkredit.dk" onclick="javascript:urchinTracker ('/outbound/article/www.totalkredit.dk');">http://www.totalkredit.dk</a> &ndash; &#8220;unfortunately&#8221; most of the site is in Danish except for a small investor-part.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/08/14/doing-a-large-corporate-website-the-interesting-way/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Adobe AIR Developer Derby!</title>
		<link>http://www.barklund.org/blog/2007/06/12/adobe-air-developer-derby/</link>
		<comments>http://www.barklund.org/blog/2007/06/12/adobe-air-developer-derby/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 16:04:11 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>AS3</category>
	<category>Mashup</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/06/12/adobe-air-developer-derby/</guid>
		<description><![CDATA[Adobe has released a new version of Apollo AIR (yup, that is the new name along with quite a boring logo) and to promote it, they have also announced Adobe AIR Developer Derby &#8211; a competition to see who&#8217;s best at their new runtime.
The prizes are quite amazing and given the long duration of the [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has released a new version of <s>Apollo</s> AIR (yup, that is the new name along with <a href="http://labs.adobe.com/technologies/air/images/air_156x136.jpg" onclick="javascript:urchinTracker ('/outbound/article/labs.adobe.com');">quite a boring logo</a>) and to promote it, they have also announced <a href="http://labs.adobe.com/showcase/special/airderby/" title="The name sounds quite alright actually" onclick="javascript:urchinTracker ('/outbound/article/labs.adobe.com');">Adobe AIR Developer Derby</a> &ndash; a competition to see who&#8217;s best at their new runtime.</p>
<p>The prizes are quite amazing and given the long duration of the development time (deadline is in September), anyone can create some pretty amazing applications. But one things puzzles me about the license, that they require applications to be released under: is attribution-requiring licenses accepted? And what about copyleft-licenses? The <a href="http://labs.adobe.com/showcase/special/airderby/airderby_officialrules.pdf" title="PDF document" onclick="javascript:urchinTracker ('/outbound/article/labs.adobe.com');">official rules</a> are pretty clear on what the license must permit Adobe to use the content for (display, commercial use and derivative use), but does that mean, that if my application is released under say CC-BY-SA-2.5, is that accepted? And what if I include <a href="/blog/wikipedia">Wikipedia</a>-texts in it (GFDL&#8217;ed) and some Flickr-images (under <a href="http://flickr.com/creativecommons" title="Flickr are good at promoting free licenses" onclick="javascript:urchinTracker ('/outbound/article/flickr.com');">free licenses</a>) will Adobe then be willing to credit me, the main 5 authors of every article from Wikipedia (<a href="http://www.gnu.org/licenses/fdl.txt" title="Section 4, Item B" onclick="javascript:urchinTracker ('/outbound/article/www.gnu.org');">which is what GFDL requires</a>) as well as the creators of all the Flickr-images that require attribution?</p>
<p>I&#8217;ve sent a mail and hope for a positive response. I will keep this entry updated on the matter.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/06/12/adobe-air-developer-derby/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Clients can never be trusted</title>
		<link>http://www.barklund.org/blog/2007/06/03/clients-can-never-be-trusted/</link>
		<comments>http://www.barklund.org/blog/2007/06/03/clients-can-never-be-trusted/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 13:05:34 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>Games</category>
	<category>Flash Platform</category>
	<category>Security</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/06/03/clients-can-never-be-trusted/</guid>
		<description><![CDATA[And for once, I am not talking bad about our company clients, but the clients in a client-server architecture.
Flash memory cheats have always been known to any good flash game hackers and ditto developer, but some still don&#8217;t know about them. Thus, as shoemoney recently posted a competition to get the best score in Desktop [...]]]></description>
			<content:encoded><![CDATA[<p>And for once, I am not talking bad about our company clients, but the clients in a client-server architecture.</p>
<p>Flash memory cheats have always been known to any good flash game hackers and ditto developer, but some still don&#8217;t know about them. Thus, as <a href="http://www.shoemoney.com" title="Guess he just likes the game" onclick="javascript:urchinTracker ('/outbound/article/www.shoemoney.com');">shoemoney</a> recently <a href="http://www.shoemoney.com/2007/05/25/can-you-beat-me-at-desktop-tower-defense/" title="A bit naive of him" onclick="javascript:urchinTracker ('/outbound/article/www.shoemoney.com');">posted a competition to get the best score</a> in <a href="http://www.handdrawngames.com/DesktopTD/" title="It IS a cool game" onclick="javascript:urchinTracker ('/outbound/article/www.handdrawngames.com');">Desktop Tower Defence</a>, &#8220;some guy&#8221; of course fired up <a href="http://www.timsvault.com/cheattools/tsearch.htm" title="Simple and rude, but very efficient" onclick="javascript:urchinTracker ('/outbound/article/www.timsvault.com');">Tsearch</a> and throw a lot of points his way. <a href="http://www.shoemoney.com/2007/05/31/congrats-tylerc-on-the-dtd-challenge/" title="At least shoemoney was true to his word" onclick="javascript:urchinTracker ('/outbound/article/www.shoemoney.com');">The result was of course, that he won</a> (even though he cheated), and afterwards <a href="http://www.rotinpieces.com/2007/06/02/how-to-hack-desktop-tower-defence" title="Tsearch this and that" onclick="javascript:urchinTracker ('/outbound/article/www.rotinpieces.com');">he posted a simple guide to do it</a>.</p>
<p>That is why should should always have a server telling you what to do when. More on this topic in the months to come - as I and a friend is developing a brand new game site including high-level security.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/06/03/clients-can-never-be-trusted/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>I was just like biking down Park Drive N</title>
		<link>http://www.barklund.org/blog/2007/05/30/i-was-just-like-biking-down-park-drive-n/</link>
		<comments>http://www.barklund.org/blog/2007/05/30/i-was-just-like-biking-down-park-drive-n/#comments</comments>
		<pubDate>Wed, 30 May 2007 09:32:37 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
		
	<category>General</category>
	<category>JavaScript</category>
	<category>Mashup</category>
		<guid isPermaLink="false">http://www.barklund.org/blog/2007/05/30/i-was-just-like-biking-down-park-drive-n/</guid>
		<description><![CDATA[Google Maps Street View is pretty amazing. The detail, the 360 view, the small increments between images. Just see these poor guys driving down Park Drive N. Google is quite amazing. This new street view has mapped 5 cities in the US.


Next, I would expect them to sell these cameras with GPS and have ordinary [...]]]></description>
			<content:encoded><![CDATA[<p>Google Maps Street View is pretty amazing. The detail, the 360 view, the small increments between images. Just see <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=Biking+down+Park+Drive+North&#038;ie=UTF8&#038;om=1&#038;layer=c&#038;cbll=40.797708,-73.954352&#038;cbp=1,168.531760450161,0.697274919614148,1&#038;ll=40.850696,-73.946571&#038;spn=0.112058,0.191746&#038;z=13" title="It was such a nice weather" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">these poor guys driving down Park Drive N</a>. Google is quite amazing. This new street view has mapped <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=&#038;ie=UTF8&#038;ll=35.38905,-94.921875&#038;spn=60.196156,98.173828&#038;z=4&#038;om=1&#038;layer=c" title="San Fransisco, Denver, Las Vegas, New York and Miami" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">5 cities in the US</a>.
<p>
<a id="more-31"></a></p>
<p>Next, I would expect them to sell these cameras with GPS and have ordinary people drive around with these on their roof. And then once a week, you would sync the camera with Google Maps making sure to only upload good, new, interesting, appropriate photos.</p>
<p>Future advances to this would be local sounds, videos and custom photos - thus competing with sites like <a href="http://locr.com" title="locate your photos" onclick="javascript:urchinTracker ('/outbound/article/locr.com');">Locr</a>.</p>
<p><strong>Update 2007-06-01</strong>: The <a href="http://maps.google.com/?ie=UTF8&#038;om=0&#038;layer=c&#038;cbll=37.420894,-122.084098&#038;cbp=1,356.927512057877,0.501172314593583,0&#038;ll=37.424826,-122.084391&#038;spn=0.007685,0.020084&#038;t=h&#038;z=16" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">Google Map Street View Team can be seen here, as the truck passes by</a>, <a href="http://slashdot.org/" onclick="javascript:urchinTracker ('/outbound/article/slashdot.org');">Slashdot</a> has an <a href="http://yro.slashdot.org/yro/07/06/01/1219256.shtml" onclick="javascript:urchinTracker ('/outbound/article/yro.slashdot.org');">article about privacy issues with street map</a>, and the latter also links to a <a href="http://blog.wired.com/27bstroke6/2007/05/request_for_urb.html" onclick="javascript:urchinTracker ('/outbound/article/blog.wired.com');">contest for finding interesting things</a> - of which I especially like <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=&#038;sll=37.783672,-122.429066&#038;sspn=0.002451,0.004624&#038;ie=UTF8&#038;om=0&#038;layer=c&#038;cbll=37.764903,-122.47729&#038;cbp=2,152.541684791813,0.436210807165745,3&#038;ll=37.779263,-122.475371&#038;spn=0.028492,0.053773&#038;z=15" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">the speed limit violation</a> or <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=&#038;sll=37.783672,-122.429066&#038;sspn=0.002451,0.004624&#038;ie=UTF8&#038;om=0&#038;layer=c&#038;cbll=37.779957,-122.432021&#038;cbp=1,360,0.520287515577836,0&#038;ll=37.787098,-122.429066&#038;spn=0.020112,0.061111&#038;z=15" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">stopping at the drive-thru</a>. And some images have been removed, like <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=2967+geary+ave,+san+francisco&#038;sll=37.783638,-122.452519&#038;sspn=0.007479,0.014591&#038;ie=UTF8&#038;om=0&#038;layer=c&#038;cbll=37.781965,-122.450769&#038;ll=37.785792,-122.450545&#038;spn=0.007479,0.014591&#038;z=16&#038;cbp=1,134.527972027972,0.59341113538" onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">this one once picturing an ongoing police investigation</a>.<a href="http://mashable.com/2007/05/31/top-15-google-street-view-sightings/" onclick="javascript:urchinTracker ('/outbound/article/mashable.com');"> Here is a top 15 of some of these and other sightings</a>.</p>
<p><strong>Update 2007-06-09</strong>: <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;q=San+Francisco&#038;ie=UTF8&#038;om=1&#038;layer=c&#038;cbll=37.872006,-122.463774&#038;cbp=1,469.109233288536,0.151762581092268,2&#038;t=h&#038;ll=37.872429,-122.46383&#038;spn=0.001751,0.004227&#038;z=19"title="I could have been a galaxy!"  onclick="javascript:urchinTracker ('/outbound/article/maps.google.com');">I have found a galaxy visible in bright daylight</a>.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.barklund.org/blog/2007/05/30/i-was-just-like-biking-down-park-drive-n/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
