<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for gunnarsteinn.com</title>
	<atom:link href="http://www.gunnarsteinn.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gunnarsteinn.com</link>
	<description></description>
	<lastBuildDate>Wed, 23 Sep 2009 22:48:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Easily cache results from Javascript functions by Gunnar Steinn</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7501</link>
		<dc:creator>Gunnar Steinn</dc:creator>
		<pubDate>Wed, 23 Sep 2009 22:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7501</guid>
		<description>&lt;a href=&quot;#comment-7500&quot; rel=&quot;nofollow&quot;&gt;@jetm &lt;/a&gt; 
Thanks, fixed the link</description>
		<content:encoded><![CDATA[<p><a href="#comment-7500" rel="nofollow">@jetm </a><br />
Thanks, fixed the link</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easily cache results from Javascript functions by jetm</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7500</link>
		<dc:creator>jetm</dc:creator>
		<pubDate>Wed, 23 Sep 2009 17:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7500</guid>
		<description>URL: 
http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/wp-content/cache.html

Is don&#039;t working</description>
		<content:encoded><![CDATA[<p>URL:<br />
<a href="http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/wp-content/cache.html" rel="nofollow">http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/wp-content/cache.html</a></p>
<p>Is don&#8217;t working</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easily cache results from Javascript functions by Gunnar Steinn</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7497</link>
		<dc:creator>Gunnar Steinn</dc:creator>
		<pubDate>Mon, 21 Sep 2009 17:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7497</guid>
		<description>Adrians approach works well except that arguments isn&#039;t a proper Array in Javascript so you will have to use the &quot;Array.slice.call(arguments).join(&#039;&#124;&#039;)&quot; line from my code.</description>
		<content:encoded><![CDATA[<p>Adrians approach works well except that arguments isn&#8217;t a proper Array in Javascript so you will have to use the &#8220;Array.slice.call(arguments).join(&#8217;|')&#8221; line from my code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easily cache results from Javascript functions by Bob</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7496</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Mon, 21 Sep 2009 16:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7496</guid>
		<description>I came up with an alternative version as well, looks like Adrian beat me to it.

My commentary is here:

http://www.reddit.com/r/programming/comments/9mm5o/easily_cache_results_from_javascript_functions/c0deuu8

I put Adrian&#039;s thing in there, to get the formatting back. Woo!</description>
		<content:encoded><![CDATA[<p>I came up with an alternative version as well, looks like Adrian beat me to it.</p>
<p>My commentary is here:</p>
<p><a href="http://www.reddit.com/r/programming/comments/9mm5o/easily_cache_results_from_javascript_functions/c0deuu8" rel="nofollow">http://www.reddit.com/r/programming/comments/9mm5o/easily_cache_results_from_javascript_functions/c0deuu8</a></p>
<p>I put Adrian&#8217;s thing in there, to get the formatting back. Woo!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easily cache results from Javascript functions by Adrian Quark</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7495</link>
		<dc:creator>Adrian Quark</dc:creator>
		<pubDate>Mon, 21 Sep 2009 15:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7495</guid>
		<description>Sorry about the formatting, the blog software seems to lose indentation even though I used a &lt;code/&gt; block.

&lt;em&gt;[EDIT: Fixed :) Gunnar Steinn]&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Sorry about the formatting, the blog software seems to lose indentation even though I used a &lt;code/&gt; block.</p>
<p><em>[EDIT: Fixed <img src='http://www.gunnarsteinn.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Gunnar Steinn]</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easily cache results from Javascript functions by Adrian Quark</title>
		<link>http://www.gunnarsteinn.com/2009/09/easily-cache-results-from-javascript-functions/comment-page-1/#comment-7494</link>
		<dc:creator>Adrian Quark</dc:creator>
		<pubDate>Mon, 21 Sep 2009 15:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1147#comment-7494</guid>
		<description>A few problems with this:
1. the .name property is a much easier way to get the name of a function.
2. this won&#039;t work with anonymous functions.
3. because it uses a global cache the cached values won&#039;t be garbage collected even if the function goes away (e.g. it&#039;s an event handler).
4. if your function takes a variable number of arguments and one contains a &quot;&#124;&quot; the cache won&#039;t work correctly.
5. if the function returns null this won&#039;t be cached
6. the cache key won&#039;t work with Object values since they don&#039;t have a unique string representation. You need to use something like http://www.timdown.co.uk/jshashtable/ to get around that.

You can fix 1-5 with some minor modifications:

[js  entities=&#039;1&#039;]
function memoise(f) {
  var cache = {};
  return function () {
    var key = arguments.length+&quot;&#124;&quot;+arguments.join(&quot;&#124;&quot;);
    if (cache[key] === undefined) {
      cache[key] = f.apply(this, arguments);
    }
    return cache[key];
  }
}

isPrime = memoise(isPrime);
[/js]</description>
		<content:encoded><![CDATA[<p>A few problems with this:<br />
1. the .name property is a much easier way to get the name of a function.<br />
2. this won&#8217;t work with anonymous functions.<br />
3. because it uses a global cache the cached values won&#8217;t be garbage collected even if the function goes away (e.g. it&#8217;s an event handler).<br />
4. if your function takes a variable number of arguments and one contains a &#8220;|&#8221; the cache won&#8217;t work correctly.<br />
5. if the function returns null this won&#8217;t be cached<br />
6. the cache key won&#8217;t work with Object values since they don&#8217;t have a unique string representation. You need to use something like <a href="http://www.timdown.co.uk/jshashtable/" rel="nofollow">http://www.timdown.co.uk/jshashtable/</a> to get around that.</p>
<p>You can fix 1-5 with some minor modifications:</p>
<pre class="brush: jscript;">
function memoise(f) {
  var cache = {};
  return function () {
    var key = arguments.length+&quot;|&quot;+arguments.join(&quot;|&quot;);
    if (cache[key] === undefined) {
      cache[key] = f.apply(this, arguments);
    }
    return cache[key];
  }
}

isPrime = memoise(isPrime);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blogg by Gunnar Steinn</title>
		<link>http://www.gunnarsteinn.com/2009/09/blogg-4/comment-page-1/#comment-7493</link>
		<dc:creator>Gunnar Steinn</dc:creator>
		<pubDate>Wed, 16 Sep 2009 10:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1094#comment-7493</guid>
		<description>Ef þú skoðar RSS-feedið sérðu meira segja gömlu færslurnar, Wordpress ekki alveg að kunna að fela færslur...

Glæsilegt með armböndin, ég er svo flínkur að prjóna!</description>
		<content:encoded><![CDATA[<p>Ef þú skoðar RSS-feedið sérðu meira segja gömlu færslurnar, Wordpress ekki alveg að kunna að fela færslur&#8230;</p>
<p>Glæsilegt með armböndin, ég er svo flínkur að prjóna!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blogg by katrín</title>
		<link>http://www.gunnarsteinn.com/2009/09/blogg-4/comment-page-1/#comment-7492</link>
		<dc:creator>katrín</dc:creator>
		<pubDate>Tue, 15 Sep 2009 22:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1094#comment-7492</guid>
		<description>sjitt ég hélt það væru einhverjar private færslur og ég ekki með aðgang! sá svo að það var ég sem kommentaði á þetta þannig þetta getur ekki hafa verið læst:)

ég er núna að tölvastm eð fínu armböndin mín.. eða úlnliðaskjólin.. eða hvað sem þetta kallst, ó svo fínt:)</description>
		<content:encoded><![CDATA[<p>sjitt ég hélt það væru einhverjar private færslur og ég ekki með aðgang! sá svo að það var ég sem kommentaði á þetta þannig þetta getur ekki hafa verið læst:)</p>
<p>ég er núna að tölvastm eð fínu armböndin mín.. eða úlnliðaskjólin.. eða hvað sem þetta kallst, ó svo fínt:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blogg by Gunnar Steinn</title>
		<link>http://www.gunnarsteinn.com/2009/09/blogg-4/comment-page-1/#comment-7491</link>
		<dc:creator>Gunnar Steinn</dc:creator>
		<pubDate>Tue, 15 Sep 2009 13:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1094#comment-7491</guid>
		<description>&lt;a href=&quot;#comment-7490&quot; rel=&quot;nofollow&quot;&gt;@gunnare&lt;/a&gt; 

Já ég kann ekki að slökkva á þeim. Ég faldi bara gömlu færslurnar og bjóst við að kommentin færu með but computer says no.
Þú verður bara að kommenta 3x í viðbót og vandamálið er leyst!</description>
		<content:encoded><![CDATA[<p><a href="#comment-7490" rel="nofollow">@gunnare</a> </p>
<p>Já ég kann ekki að slökkva á þeim. Ég faldi bara gömlu færslurnar og bjóst við að kommentin færu með but computer says no.<br />
Þú verður bara að kommenta 3x í viðbót og vandamálið er leyst!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blogg by gunnare</title>
		<link>http://www.gunnarsteinn.com/2009/09/blogg-4/comment-page-1/#comment-7490</link>
		<dc:creator>gunnare</dc:creator>
		<pubDate>Tue, 15 Sep 2009 12:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.gunnarsteinn.com/?p=1094#comment-7490</guid>
		<description>Kannast við þetta vandamál.

En hey! Maður sér comment á private færslur í recent comments hjá þér.</description>
		<content:encoded><![CDATA[<p>Kannast við þetta vandamál.</p>
<p>En hey! Maður sér comment á private færslur í recent comments hjá þér.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
