<?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 The next 10,000 hours</title>
	<atom:link href="http://www.trouble.net.au/blog/korny/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trouble.net.au/blog/korny</link>
	<description>Korny&#039;s tech blog</description>
	<lastBuildDate>Thu, 08 Apr 2010 00:34:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Simple ruby wrapper for Delcom build lights on Linux by korny</title>
		<link>http://www.trouble.net.au/blog/korny/2010/02/12/simple-ruby-wrapper-for-delcom-build-lights-on-linux/comment-page-1/#comment-35</link>
		<dc:creator>korny</dc:creator>
		<pubDate>Thu, 08 Apr 2010 00:34:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=138#comment-35</guid>
		<description>Just a note - if using a recent Delcom light, you should check out the ruby driver at http://github.com/ileitch/delcom_904008_driver - apparently the linux kernel doesn&#039;t support new lights (yet!)</description>
		<content:encoded><![CDATA[<p>Just a note &#8211; if using a recent Delcom light, you should check out the ruby driver at <a href="http://github.com/ileitch/delcom_904008_driver" rel="nofollow">http://github.com/ileitch/delcom_904008_driver</a> &#8211; apparently the linux kernel doesn&#8217;t support new lights (yet!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Playing with CoffeeScript by jashkenas</title>
		<link>http://www.trouble.net.au/blog/korny/2010/02/25/playing-with-coffeescript/comment-page-1/#comment-34</link>
		<dc:creator>jashkenas</dc:creator>
		<pubDate>Fri, 26 Feb 2010 20:04:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=148#comment-34</guid>
		<description>Right -- when you pass the &quot;app.init&quot; function into jQuery (binding it to document.ready), you&#039;re pulling the function off of the &quot;app&quot; object, and it loses its sense of &quot;this&quot;. So, another way to go is to keep your single init, and replace the final line with this:

$(-&gt; app.init())</description>
		<content:encoded><![CDATA[<p>Right &#8212; when you pass the &#8220;app.init&#8221; function into jQuery (binding it to document.ready), you&#8217;re pulling the function off of the &#8220;app&#8221; object, and it loses its sense of &#8220;this&#8221;. So, another way to go is to keep your single init, and replace the final line with this:</p>
<p>$(-&gt; app.init())</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Playing with CoffeeScript by korny</title>
		<link>http://www.trouble.net.au/blog/korny/2010/02/25/playing-with-coffeescript/comment-page-1/#comment-33</link>
		<dc:creator>korny</dc:creator>
		<pubDate>Fri, 26 Feb 2010 00:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=148#comment-33</guid>
		<description>In fact, I can clean everything up by putting in a second init, and then I can use &#039;@&#039; (which is an alias for &#039;this.&#039;
&lt;code&gt;
app: {
   init: -&gt; app.__init()
   __init:
     @paper: Raphael(&#039;playspace&#039;,320,200)
     @draw_circle()
     @draw_square()
&lt;/code&gt;
Nice!</description>
		<content:encoded><![CDATA[<p>In fact, I can clean everything up by putting in a second init, and then I can use &#8216;@&#8217; (which is an alias for &#8216;this.&#8217;<br />
<code><br />
app: {<br />
   init: -&gt; app.__init()<br />
   __init:<br />
     @paper: Raphael('playspace',320,200)<br />
     @draw_circle()<br />
     @draw_square()<br />
</code><br />
Nice!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Playing with CoffeeScript by korny</title>
		<link>http://www.trouble.net.au/blog/korny/2010/02/25/playing-with-coffeescript/comment-page-1/#comment-32</link>
		<dc:creator>korny</dc:creator>
		<pubDate>Fri, 26 Feb 2010 00:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=148#comment-32</guid>
		<description>Thanks - that works!
I&#039;m still confused around how &#039;this&#039; works - it&#039;s not really a Coffeescript thing, more of a Javascript thing.
For example, in my code above, I can change references in &#039;app.draw_circle&#039; to use &#039;this&#039; and they get &#039;app&#039;.  Which makes sense, as they are called as &#039;app.draw_circle()&#039;
But I can&#039;t change references in &#039;app.init&#039; to use &#039;this&#039;, for some reason the JQuery call &#039;$(app.init)&#039; doesn&#039;t set &#039;this&#039; to &#039;app&#039;...  I think that&#039;s where a lot of my confusion started, as I&#039;d change something in &#039;draw_circle&#039; and it would work, then I&#039;d change it in &#039;init&#039; and it wouldn&#039;t!</description>
		<content:encoded><![CDATA[<p>Thanks &#8211; that works!<br />
I&#8217;m still confused around how &#8216;this&#8217; works &#8211; it&#8217;s not really a Coffeescript thing, more of a Javascript thing.<br />
For example, in my code above, I can change references in &#8216;app.draw_circle&#8217; to use &#8216;this&#8217; and they get &#8216;app&#8217;.  Which makes sense, as they are called as &#8216;app.draw_circle()&#8217;<br />
But I can&#8217;t change references in &#8216;app.init&#8217; to use &#8216;this&#8217;, for some reason the JQuery call &#8216;$(app.init)&#8217; doesn&#8217;t set &#8216;this&#8217; to &#8216;app&#8217;&#8230;  I think that&#8217;s where a lot of my confusion started, as I&#8217;d change something in &#8216;draw_circle&#8217; and it would work, then I&#8217;d change it in &#8216;init&#8217; and it wouldn&#8217;t!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Playing with CoffeeScript by jashkenas</title>
		<link>http://www.trouble.net.au/blog/korny/2010/02/25/playing-with-coffeescript/comment-page-1/#comment-31</link>
		<dc:creator>jashkenas</dc:creator>
		<pubDate>Thu, 25 Feb 2010 12:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=148#comment-31</guid>
		<description>Nice writeup. It&#039;s very cool to see an example of using Raphael from CoffeeScript.

The problem that you had with &quot;this&quot; is one of my least favorite parts of JavaScript. Unlike everything else in JS (which has proper lexical scope), the value of &quot;this&quot; within a function is the object that the function has been attached to. 

The benefit is that you can pull a function off one object and attach it to another, and it&#039;ll work seamlessly. The downside is that if you pull a function off an object, say, to hand it to a click handler, it loses its notion of identity and it&#039;s former value for &quot;this&quot;.

The common way to address it is to set a local variable to &quot;this&quot; from the outside, and reference it through the closure, instead of &quot;this&quot;. So, your original:

    $(circle.node).click (e) -&gt; this.kick e

Becomes:

    me: this
    $(circle.node).click (e) -&gt; me.kick e

Which will work properly. However, CoffeeScript provides a convenience for defining functions that are bound to the current value of &quot;this&quot;, right on the spot where they&#039;re declared, for use in cases like these.

http://jashkenas.github.com/coffee-script/#fat_arrow

Using the fat arrow, the example becomes:

    $(circle.node).click (e) =&gt; this.kick e

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Nice writeup. It&#8217;s very cool to see an example of using Raphael from CoffeeScript.</p>
<p>The problem that you had with &#8220;this&#8221; is one of my least favorite parts of JavaScript. Unlike everything else in JS (which has proper lexical scope), the value of &#8220;this&#8221; within a function is the object that the function has been attached to. </p>
<p>The benefit is that you can pull a function off one object and attach it to another, and it&#8217;ll work seamlessly. The downside is that if you pull a function off an object, say, to hand it to a click handler, it loses its notion of identity and it&#8217;s former value for &#8220;this&#8221;.</p>
<p>The common way to address it is to set a local variable to &#8220;this&#8221; from the outside, and reference it through the closure, instead of &#8220;this&#8221;. So, your original:</p>
<p>    $(circle.node).click (e) -&gt; this.kick e</p>
<p>Becomes:</p>
<p>    me: this<br />
    $(circle.node).click (e) -&gt; me.kick e</p>
<p>Which will work properly. However, CoffeeScript provides a convenience for defining functions that are bound to the current value of &#8220;this&#8221;, right on the spot where they&#8217;re declared, for use in cases like these.</p>
<p><a href="http://jashkenas.github.com/coffee-script/#fat_arrow" rel="nofollow">http://jashkenas.github.com/coffee-script/#fat_arrow</a></p>
<p>Using the fat arrow, the example becomes:</p>
<p>    $(circle.node).click (e) =&gt; this.kick e</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Behaviour Driven Development with Cucumber and Selenium by mat kelcey</title>
		<link>http://www.trouble.net.au/blog/korny/2009/11/03/behaviour-driven-development-with-cucumber-and-selenium/comment-page-1/#comment-27</link>
		<dc:creator>mat kelcey</dc:creator>
		<pubDate>Tue, 03 Nov 2009 10:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/?p=102#comment-27</guid>
		<description>good stuff korny, i&#039;m definitely lacking in the cucumber knowledge</description>
		<content:encoded><![CDATA[<p>good stuff korny, i&#8217;m definitely lacking in the cucumber knowledge</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Refactoring my blogs by korny</title>
		<link>http://www.trouble.net.au/blog/korny/2009/10/04/refactoring-my-blogs/comment-page-1/#comment-19</link>
		<dc:creator>korny</dc:creator>
		<pubDate>Sun, 04 Oct 2009 11:46:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.trouble.net.au/blog/korny/2009/10/04/refactoring-my-blogs/#comment-19</guid>
		<description>hmm - this theme doesn&#039;t do bullet points very well.  Might have to fiddle with this further tomorrow...</description>
		<content:encoded><![CDATA[<p>hmm &#8211; this theme doesn&#8217;t do bullet points very well.  Might have to fiddle with this further tomorrow&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Faking DNS with Ruby and Sinatra by Korny</title>
		<link>http://www.trouble.net.au/blog/korny/2008/03/07/faking-dns-with-ruby-and-sinatra/comment-page-1/#comment-18</link>
		<dc:creator>Korny</dc:creator>
		<pubDate>Fri, 07 Mar 2008 05:41:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sietsma.com/2008/03/07/faking-dns-with-ruby-and-sinatra/#comment-18</guid>
		<description>oops, looks like wordpress didn&#039;t like my inline html in the code.  I might need to make these files into attachments...</description>
		<content:encoded><![CDATA[<p>oops, looks like wordpress didn&#8217;t like my inline html in the code.  I might need to make these files into attachments&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mobile blogging still needs work, also Pythons on a Phone! by Korny</title>
		<link>http://www.trouble.net.au/blog/korny/2007/06/14/mobile-blogging-still-needs-work-also-pythons-on-a-phone/comment-page-1/#comment-3</link>
		<dc:creator>Korny</dc:creator>
		<pubDate>Wed, 20 Jun 2007 01:34:24 +0000</pubDate>
		<guid isPermaLink="false">https://www.trouble.net.au/blog/korny/2007/06/14/mobile-blogging-still-needs-work-also-pythons-on-a-phone/#comment-3</guid>
		<description>Hmm - I&#039;m actually thinking of giving up on Trouble - the way the web is moving, it&#039;s less pain to have a blog on a big hosting service than on a friend&#039;s machine...  sorry Thorne!</description>
		<content:encoded><![CDATA[<p>Hmm &#8211; I&#8217;m actually thinking of giving up on Trouble &#8211; the way the web is moving, it&#8217;s less pain to have a blog on a big hosting service than on a friend&#8217;s machine&#8230;  sorry Thorne!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mobile blogging still needs work, also Pythons on a Phone! by Jennie</title>
		<link>http://www.trouble.net.au/blog/korny/2007/06/14/mobile-blogging-still-needs-work-also-pythons-on-a-phone/comment-page-1/#comment-2</link>
		<dc:creator>Jennie</dc:creator>
		<pubDate>Thu, 14 Jun 2007 12:19:06 +0000</pubDate>
		<guid isPermaLink="false">https://www.trouble.net.au/blog/korny/2007/06/14/mobile-blogging-still-needs-work-also-pythons-on-a-phone/#comment-2</guid>
		<description>you can email your post to a special email address to flickr and it will post it to your blog automatically. I think you set it up under accounts/blogging. you can even set default post settings, code and image handling. it&#039;s pretty kewl.</description>
		<content:encoded><![CDATA[<p>you can email your post to a special email address to flickr and it will post it to your blog automatically. I think you set it up under accounts/blogging. you can even set default post settings, code and image handling. it&#8217;s pretty kewl.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
