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

<channel>
	<title>David Lynch</title>
	<atom:link href="http://davidlynch.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidlynch.org/blog</link>
	<description>has a blog</description>
	<pubDate>Fri, 03 Jul 2009 22:58:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A jQuery 1.3 quirk that bit me</title>
		<link>http://davidlynch.org/blog/2009/07/a-jquery-13-quirk-that-bit-me/</link>
		<comments>http://davidlynch.org/blog/2009/07/a-jquery-13-quirk-that-bit-me/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 22:58:04 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=84</guid>
		<description><![CDATA[deviantART just upgraded to jQuery 1.3, and we found an undocumented jQuery change that broke some things.
The behavior of the :enabled selector changed. Before it selected all enabled form elements, now it selects all enabled and non-hidden form elements. This bit us, because we were using jQuery to assemble some form elements to submit over [...]]]></description>
			<content:encoded><![CDATA[<p>deviantART just upgraded to jQuery 1.3, and we found an undocumented jQuery change that broke some things.</p>
<p>The behavior of the <code>:enabled</code> selector changed. Before it selected all enabled form elements, now it selects all enabled <em>and non-hidden</em> form elements. This bit us, because we were using jQuery to assemble some form elements to submit over xmlhttprequest&#8230; and now some hidden fields weren&#8217;t getting included.</p>
<p>This means that if you were using <code>:enabled</code>, you now need to use <code>:not(:disabled)</code> to get the old behavior.</p>
<p>A bit of googling turned up that 
<a  href="http://www.nabble.com/Re%3A-Selector-%3Aenabled-no-longer-finds-hidden-elements-p21743026s27240.html">this is a deliberate change, to match the behavior of querySelectorAll</a> in browsers that have implemented it. I&#8217;d disagree with the phrasing John Resig used, &#8220;more standards compliant&#8221;, since &#8220;enabled&#8221; has a specific meaning in the standards.</p>
<p>This should really have been in 
<a  href="http://docs.jquery.com/Release:jQuery_1.3">the release notes</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/07/a-jquery-13-quirk-that-bit-me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NautilusSVN</title>
		<link>http://davidlynch.org/blog/2009/04/nautilussvn/</link>
		<comments>http://davidlynch.org/blog/2009/04/nautilussvn/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:58:47 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[svn linux gnome nautilus]]></category>

		<guid isPermaLink="false">http://davidlynch.org/blog/2009/04/nautilussvn/</guid>
		<description><![CDATA[
NautilusSVN is a TortoiseSVN clone for the GNOME file browser, Nautilus.
I am very happy to have found this. Now, I just need someone to write &#8220;NautilusGit&#8221;. (Or wait for the NautilusSVN project to do what they say they plan to, and extend it to cover multiple VCSs&#8230;)
]]></description>
			<content:encoded><![CDATA[<p>
<a  href="http://code.google.com/p/nautilussvn/">NautilusSVN</a> is a TortoiseSVN clone for the GNOME file browser, Nautilus.</p>
<p>I am very happy to have found this. Now, I just need someone to write &#8220;NautilusGit&#8221;. (Or wait for the NautilusSVN project to do what they say they plan to, and extend it to cover multiple VCSs&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/04/nautilussvn/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Smart Home in TextMate</title>
		<link>http://davidlynch.org/blog/2009/03/smart-home-in-textmate/</link>
		<comments>http://davidlynch.org/blog/2009/03/smart-home-in-textmate/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 09:59:41 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

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

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

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

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=74</guid>
		<description><![CDATA[I really like &#8220;smart home&#8221; behavior in text editors. That is, I like it when pressing the &#8220;home&#8221; key first moves the cursor to the start of the indented text on that line, and then to the very beginning of the line on a second press.
I go out of my way to enable this behavior, [...]]]></description>
			<content:encoded><![CDATA[<p>I really like &#8220;smart home&#8221; behavior in text editors. That is, I like it when pressing the &#8220;home&#8221; key first moves the cursor to the start of the indented text on that line, and then to the very beginning of the line on a second press.</p>
<p>I go out of my way to enable this behavior, where possible. For instance, I wrote a 
<a  href="http://github.com/kemayo/gedit-smarthome/tree/master">gedit plugin</a> to get it working properly in gedit, the Gnome text editor.</p>
<p>Unfortunately, TextMate is a harder nut to crack. I worked out the following as a TextMate command, and bound it to command-left:</p>
<pre class="prettyprint"><code>#!/usr/bin/ruby
current_line = ENV['TM_LINE_NUMBER']
current_column  = ENV['TM_LINE_INDEX'].to_i
whitespace_column = /^(\s*)/.match(ENV['TM_CURRENT_LINE'])[1].length + 1

column = if current_column == 0 or current_column &gt; whitespace_column
           whitespace_column
         else
           0
         end

`open "txmt://open?line=#{current_line}&amp;column=#{column}"`</code></pre>
<p>It works, but is far too slow to be usable for me. There&#8217;s a perceptible lag of probably around 100-200ms between hitting the shortcut and the cursor moving.</p>
<p>I think this is an unavoidable limitation of TextMate&#8217;s approach to letting commands navigate within the file. It has to spawn a process to run the command, and the command then spawns a process to run the OSX command <code>open</code> which handles a &#8220;txmt://&#8221; protocol that TextMate has registered with the OS. There&#8217;s some inherent inefficiency there.</p>
<p>(Writing a command with pure shell scripting doesn&#8217;t help, incidentally. It&#8217;s slightly faster, but still not enough to be worth it.)</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/03/smart-home-in-textmate/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TextMate bundle: Ack in Project (improved)</title>
		<link>http://davidlynch.org/blog/2009/02/textmate-bundle-ack-in-project-improved/</link>
		<comments>http://davidlynch.org/blog/2009/02/textmate-bundle-ack-in-project-improved/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 05:54:46 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

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

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

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

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=63</guid>
		<description><![CDATA[I use 
TextMate for work.  It&#8217;s a good editor, doesn&#8217;t get in my way, and I take advantage of relatively few of its nifty features.
One problem with TextMate is that its built-in search is very slow, especially across a large project.  Since I work with a full checkout of the deviantART source code, [...]]]></description>
			<content:encoded><![CDATA[<p>I use 
<a  href="http://macromates.com/">TextMate</a> for work.  It&#8217;s a good editor, doesn&#8217;t get in my way, and I take advantage of relatively few of its nifty features.</p>
<p>One <em>problem</em> with TextMate is that its built-in search is very slow, especially across a large project.  Since I work with a full checkout of the deviantART source code, searches can take a while.</p>
<p>So I started using 
<a  href="http://github.com/protocool/ack-tmbundle/tree/master">Ack in Project</a>, a TextMate bundle that uses 
<a  href="http://petdance.com/ack/">ack</a> to search your project.  (Ack is a nifty little tool that combines grep and find, along with a number of useful optimizations for searching checked-out source code.)</p>
<p>However, Ack in Project doesn&#8217;t expose a very useful part of ack&#8217;s functionality, which is the ability to search just particular filetypes.  This has occasionally been a pain &#8212; some words appear commonly in PHP and JS files, but I only care about them in the PHP.</p>
<p>So I spent a little while this evening adjusting Ack in Project to let you choose a file type to search.</p>
<p><img src="http://davidlynch.org/blog/wp-content/uploads/2009/02/picture-9.png" alt="My Ack in Project tweak" title="my-ack-in-project" width="561" height="268" class="size-full wp-image-67" /></p>
<p>My version is up on 
<a  href="http://github.com/kemayo/ack-tmbundle/tree/master">github</a>.</p>
<p>If you&#8217;d like to use it, do this:</p>
<pre><code class="prettyprint">cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/kemayo/ack-tmbundle.git Ack.tmbundle</code></pre>
<p>(It was my first time messing with tm_dialog, so I&#8217;m not necessarily confident about how I did it. But it works!)</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/02/textmate-bundle-ack-in-project-improved/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Detecting failure</title>
		<link>http://davidlynch.org/blog/2009/02/detecting-failure/</link>
		<comments>http://davidlynch.org/blog/2009/02/detecting-failure/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 09:11:01 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[cross-browser]]></category>

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

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=58</guid>
		<description><![CDATA[I warn you in advance that this post does not end with a resolution of my problems.
For reasons relating to dynamic loading of javascript dependencies, I wanted to find a way to tell:

When a script tag finishes loading a file
Whether that file was successfully loaded

For various reasons, I didn&#8217;t want to add cruft into the [...]]]></description>
			<content:encoded><![CDATA[<p>I warn you in advance that this post does not end with a resolution of my problems.</p>
<p>For reasons relating to dynamic loading of javascript dependencies, I wanted to find a way to tell:</p>
<ol>
<li>When a script tag finishes loading a file</li>
<li>Whether that file was successfully loaded</li>
</ol>
<p>For various reasons, I didn&#8217;t want to add cruft into the files being loaded &#8212; no appending a function call to the end of every file, or anything.</p>
<p>Now, the finishes-loading case turns out to be pretty easy, albeit with some quirky cross-browser ramifications:</p>
<pre class="prettyprint"><code>var eax, load;
eax = document.createElement('script');
eax.setAttribute('type', 'text/javascript');
eax.setAttribute('src', src);
load = function(e) {
    // FF/Safari get the `load` handler, IE gets the `readystatechange` handler.
    // IE doesn't fire 'load' for JS (but does for CSS...)
    if(!eax.readyState || eax.readyState == 'complete' || eax.readyState == 'loaded') {
        // IE6 stalls at 'loaded' sometimes
        alert('loaded!');
        // remove these listeners for everyone, because it's
        // easier than testing everything to find out whether it's needed.
        removeEventListener(eax, 'readystatechange', arguments.callee);
        removeEventListener(eax, 'load', arguments.callee);
    }
};
addEventListener(eax, 'load', load); // FF/Safari get this
addEventListener(eax, 'readystatechange', load); // IE gets this</code></pre>
<p>It&#8217;s a horrible mish-mash of events, obviously, but it works.  Insofar as it goes.</p>
<p>Working out whether the load was <em>successful</em> turns out to be the hard part.</p>
<p>In Firefox it&#8217;s very easy.  The <code>load</code> event doesn&#8217;t fire if there are problems loading the JS file, and a <code>error</code> event fires instead.  This is <em>lovely</em>.</p>
<p>In Safari the <code>load</code> event doesn&#8217;t fire if there are problems, but there&#8217;s no other sign given.  So I could probably fake this with a <code>setTimeout</code> set to a reasonable length &#8212; not perfect, but good enough for most cases.</p>
<p>In IE the <code>readystatechange</code> event fires away regardless.  It&#8217;s here that I&#8217;m stuck &#8212; I can&#8217;t see any way to tell, in the <code>readystatechange</code> handler whether the script tag was really loaded without problems.</p>
<p>Since IE represents an unfortunately large component of deviantART&#8217;s users, half-working failure detection isn&#8217;t going to cut it.  Especially since all the developers mainly use Firefox/Safari, and wouldn&#8217;t expect IE to behave differently.</p>
<p>So for now I&#8217;m going with verifying that the script tag loaded something, and says it&#8217;s complete.  I&#8217;ll keep my eyes out for a way to work around IE&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/02/detecting-failure/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Engagingly quirky</title>
		<link>http://davidlynch.org/blog/2009/02/engagingly-quirky/</link>
		<comments>http://davidlynch.org/blog/2009/02/engagingly-quirky/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 08:24:29 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[personal]]></category>

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

		<category><![CDATA[firefox 3.1]]></category>

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

		<guid isPermaLink="false">http://davidlynch.org/blog/2009/02/engagingly-quirky/</guid>
		<description><![CDATA[Wordpress 2.7.1 has a wonderful quirk of immediately redirecting the &#8220;new post&#8221; page to a page that appears to just be the row of buttons from above the editor.
It&#8217;s probably a Firefox 3.1 quirk.  But it&#8217;s still annoying.
]]></description>
			<content:encoded><![CDATA[<p>Wordpress 2.7.1 has a wonderful quirk of immediately redirecting the &#8220;new post&#8221; page to a page that appears to just be the row of buttons from above the editor.</p>
<p>It&#8217;s probably a Firefox 3.1 quirk.  But it&#8217;s still annoying.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2009/02/engagingly-quirky/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A few useful git links</title>
		<link>http://davidlynch.org/blog/2008/12/a-few-useful-git-links/</link>
		<comments>http://davidlynch.org/blog/2008/12/a-few-useful-git-links/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 19:46:30 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=48</guid>
		<description><![CDATA[I recently saw 
one approach to the &#8220;what git branch am I on?&#8221; issue, which (if you&#8217;re using the bash shell) puts your current branch into your prompt.
There&#8217;s also 
tortoisegit for Windows.  TortoiseSVN has always been one of the best things about SVN, so it&#8217;s good to see a clone pop up for git.
]]></description>
			<content:encoded><![CDATA[<p>I recently saw 
<a  href="http://log.damog.net/2008/12/two-git-tips/">one approach</a> to the &#8220;what git branch am I on?&#8221; issue, which (if you&#8217;re using the bash shell) puts your current branch into your prompt.</p>
<p>There&#8217;s also 
<a  href="http://code.google.com/p/tortoisegit/">tortoisegit</a> for Windows.  TortoiseSVN has always been one of the best things about SVN, so it&#8217;s good to see a clone pop up for git.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2008/12/a-few-useful-git-links/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Intrepidly lacking</title>
		<link>http://davidlynch.org/blog/2008/11/intrepidly-lacking/</link>
		<comments>http://davidlynch.org/blog/2008/11/intrepidly-lacking/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 00:15:29 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[personal]]></category>

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

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

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=46</guid>
		<description><![CDATA[I updated my desktop to the new Ubuntu release (Intrepid Ibix)
This is mostly good, but I discovered a problem as a side-effect of them improving their mouse support.  Now that my mouse is auto-detected with all its buttons, the side-button no longer defaults to being a middle-click.  I like having the side-button do [...]]]></description>
			<content:encoded><![CDATA[<p>I updated my desktop to the new Ubuntu release (Intrepid Ibix)</p>
<p>This is mostly good, but I discovered a problem as a side-effect of them improving their mouse support.  Now that my mouse is auto-detected with all its buttons, the side-button no longer defaults to being a middle-click.  I <em>like</em> having the side-button do middle clicks.</p>
<p>So, no problem, I thought.  I&#8217;ll just go rebind it.  There is doubtless something in the mouse settings that lets me adjust this &#8212; I mean, Windows generally handles this fine, so surely Ubuntu will be at least equivalent.</p>
<p>This turned out to not be true.</p>
<p>After a lot of searching, I found the community documentation for 
<a  href="https://help.ubuntu.com/community/Logitech_Marblemouse_USB">the Logitech Marblemouse USB</a>, which (sort of) discusses how to remap buttons.</p>
<p>So I ran:<br />
<code>$ xinput set-button-map "Logitech USB Gaming Mouse" 1 8 3 4 5 6 7 2 9</code></p>
<p>This didn&#8217;t remap it, per se.  It swapped clicking the mouse wheel and clicking the side-button.</p>
<p>(I&#8217;m not certain that this will persist through a reboot.  I might need to meddle with .Xmodmap.)</p>
<p>It&#8217;s a weird place to be lacking what I consider basic functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2008/11/intrepidly-lacking/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Deliciously rebranded</title>
		<link>http://davidlynch.org/blog/2008/08/deliciously-rebranded/</link>
		<comments>http://davidlynch.org/blog/2008/08/deliciously-rebranded/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 04:12:58 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[del.icio.us]]></category>

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

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=41</guid>
		<description><![CDATA[Del.icio.us rebranded to Delicious, along with a new URL.  This happened a week or two ago.
Incidentally, this new URL broke my delicious widget.  I just noticed that a half-hour ago.

So it&#8217;s fixed.
]]></description>
			<content:encoded><![CDATA[<p>Del.icio.us rebranded to Delicious, along with a new URL.  This happened a week or two ago.</p>
<p><em>Incidentally</em>, this new URL broke my delicious widget.  I just noticed that a half-hour ago.</p>
<p>
<a  href="http://wordpress.org/extend/plugins/delicious-plus/">So it&#8217;s fixed.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2008/08/deliciously-rebranded/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Distracted</title>
		<link>http://davidlynch.org/blog/2008/07/distracted/</link>
		<comments>http://davidlynch.org/blog/2008/07/distracted/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 17:57:41 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://davidlynch.org/blog/?p=40</guid>
		<description><![CDATA[I&#8217;ve been very distracted by a new job since the end of April.  Thus, quiet.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been very distracted by a new job since the end of April.  Thus, quiet.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlynch.org/blog/2008/07/distracted/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
