<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bill Lee</title>
	<atom:link href="http://nonexistentknight.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://nonexistentknight.com</link>
	<description></description>
	<lastBuildDate>Tue, 10 Aug 2010 18:52:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Confused by broken local gem</title>
		<link>http://nonexistentknight.com/?p=121</link>
		<comments>http://nonexistentknight.com/?p=121#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:52:29 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nonexistentknight.com/?p=121</guid>
		<description><![CDATA[I&#8217;m writing a script that uses the mysql gem, and was stumped by the fact that I could instantiate a Mysql object, but could not execute certain methods on it (no such method errors). After outputting the $LOAD_PATH, I saw that the script was loading a broken gem from my local .gem directory. If I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing a script that uses the mysql gem, and was stumped by the fact that I could instantiate a Mysql object, but could not execute certain methods on it (no such method errors).  After outputting the $LOAD_PATH, I saw that the script was loading a broken gem from my local .gem directory.  If I recall, the first time I did a &#8220;gem install mysql&#8221;, but did not have the ruby-dev package install, so it failed to compile.  I realized at the same time I should have &#8220;sudo gem install mysql&#8221;, which installs at /var/lib/gems (on Ubuntu).  I should have cleaned things up the first time around, but now I have a ~/.gem file to prevent installation of local gems.</p>
]]></content:encoded>
			<wfw:commentRss>http://nonexistentknight.com/?feed=rss2&amp;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing diacritics in Ruby</title>
		<link>http://nonexistentknight.com/?p=109</link>
		<comments>http://nonexistentknight.com/?p=109#comments</comments>
		<pubDate>Fri, 06 Aug 2010 00:16:46 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nonexistentknight.com/?p=109</guid>
		<description><![CDATA[I have a multi-language text file that has some characters like á, é, í, ó, ú. I need to parse it well enough to load into a database and got some results I didn&#8217;t expect: irb(main):001:0&#62; 'perdú'.match /\b.*\b/ =&#62; #&#60;MatchData &#34;perd&#34;&#62; Hmm. I was really hoping for: =&#62; #&#60;MatchData &#34;perdú&#34;&#62; Some quick research finds that [...]]]></description>
			<content:encoded><![CDATA[<p>I have a multi-language text file that has some characters like á, é, í, ó, ú.  I need to parse it well enough to load into a database and got some results I didn&#8217;t expect:</p>
<pre class="brush: plain;">
irb(main):001:0&gt; 'perdú'.match /\b.*\b/
=&gt; #&lt;MatchData &quot;perd&quot;&gt;
</pre>
<p>Hmm.  I was really hoping for:</p>
<pre class="brush: plain;">
=&gt; #&lt;MatchData &quot;perdú&quot;&gt;
</pre>
<p>Some quick research finds that characters with diacritics are stored in two bytes rather than one, hence this behavior.  This is only a problem with Ruby 1.8.7, as Ruby 1.9 handles Unicode natively.  You may or may not have to set the encoding explicitly:</p>
<pre class="brush: ruby;"># encoding: utf-8</pre>
<p>&#8230; and specify your regex explicitly:</p>
<pre class="brush: ruby;">/pattern/u</pre>
]]></content:encoded>
			<wfw:commentRss>http://nonexistentknight.com/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL, nginx, passenger</title>
		<link>http://nonexistentknight.com/?p=82</link>
		<comments>http://nonexistentknight.com/?p=82#comments</comments>
		<pubDate>Wed, 23 Jun 2010 21:26:31 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nonexistentknight.com/?p=82</guid>
		<description><![CDATA[I added some personalization features to a Ruby-on-Rails site and needed SSL for logging in and changing passwords. The steps I took were: Install the ssl_requirement gem. Update the controllers to use SSL where appropriate (documented with the gem). Update the passenger gem. Run passenger&#8217;s installer. Use the advanced mode in order to compile nginx [...]]]></description>
			<content:encoded><![CDATA[<p>I added some personalization features to a Ruby-on-Rails site and needed SSL for logging in and changing passwords.  The steps I took were:</p>
<ul>
<li>Install the <a href="http://github.com/rails/ssl_requirement">ssl_requirement</a> gem.</li>
<li>Update the controllers to use SSL where appropriate (documented with the gem).</li>
<li>Update the passenger gem.</li>
<li>Run passenger&#8217;s <a href="http://www.modrails.com/install.html">installer</a>.</li>
<li>Use the advanced mode in order to compile nginx with the <a href="http://wiki.nginx.org/NginxModules#SSL">SSL module</a>.</li>
<li>Update nginx <a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-nginx-ssl-and-vhosts">configuration</a> to serve SSL on port 443.</li>
<li>Purchase and <a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx">install</a> SSL certificate.</li>
</ul>
<p>It was fairly painless.  Only one minor bugaboo:  You must run the passenger installer after updating the passenger gem, always.  The HelperServer in the passenger gem folder is compiled by the installer as well.  I got a bit stuck when nginx wouldn&#8217;t start right after I updated the passenger gem, but the nginx error log had a descriptive message.</p>
]]></content:encoded>
			<wfw:commentRss>http://nonexistentknight.com/?feed=rss2&amp;p=82</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git submodules in Capistrano</title>
		<link>http://nonexistentknight.com/?p=77</link>
		<comments>http://nonexistentknight.com/?p=77#comments</comments>
		<pubDate>Sun, 06 Jun 2010 17:59:57 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nonexistentknight.com/?p=77</guid>
		<description><![CDATA[So, I&#8217;d added a module to my project by cloning it from github, and when I pushed it, the folder (on my Github&#8217;s&#8217; project page) had a green arrow indicator. This means the folder contains a submodule. Instead of pushing the cloned files, we&#8217;re going to create a pointer to the plugin so other copies [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;d added a module to my project by cloning it from github, and when I pushed it, the folder (on my Github&#8217;s&#8217; project page) had a green arrow indicator.  This means the folder contains a submodule.</p>
<p><a href="http://ohama.biz/nonexist/wp-content/uploads/2010/06/git-sub.png"><img src="http://ohama.biz/nonexist/wp-content/uploads/2010/06/git-sub.png" alt="" title="git-sub" width="134" height="49" class="alignnone size-full wp-image-52" /></a></p>
<p>Instead of pushing the cloned files, we&#8217;re going to create a pointer to the plugin so other copies of the repo will checkout the module from its own repo.  If you deploy using Capistrano, you&#8217;ll have to make a small adjustment to make sure that happens.  In your Capistrano config/deploy.rb file, put:</p>
<pre class="brush: ruby;">set :git_enable_submodules, true</pre>
<p>And in RAILS_ROOT, put this in your .gitmodules file:</p>
<pre class="brush: plain;">
[submodule &quot;vendor/plugins/awesome_nested_set&quot;]
	path = vendor/plugins/awesome_nested_set
	url = git://github.com/collectiveidea/awesome_nested_set.git
</pre>
<p>When you run &#8220;cap deploy&#8221;, in addition to performing a &#8220;git pull&#8221;, Capistrano will also run a &#8220;git submodule init &#038;&#038; git submodule update &#038;&#038; git submodule sync.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://nonexistentknight.com/?feed=rss2&amp;p=77</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQueryUI Autocomplete versus auto_complete</title>
		<link>http://nonexistentknight.com/?p=73</link>
		<comments>http://nonexistentknight.com/?p=73#comments</comments>
		<pubDate>Tue, 01 Jun 2010 18:00:18 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nonexistentknight.com/?p=73</guid>
		<description><![CDATA[I recently decided to upgrade the aging auto_complete plugin with jQueryUI&#8217;s Autocomplete widget. It was mostly smooth sailing, but I had a bit of trouble getting the styling to look correct. jQueryUI was appending the Autocomplete results to the end of the html body, instead of after the text input where the user types his [...]]]></description>
			<content:encoded><![CDATA[<p>I recently decided to upgrade the aging <a href="http://github.com/rails/auto_complete">auto_complete plugin</a> with <a href="http://jqueryui.com/demos/autocomplete/">jQueryUI&#8217;s Autocomplete widget</a>.</p>
<p>It was mostly smooth sailing, but I had a bit of trouble getting the styling to look correct.  jQueryUI was appending the Autocomplete results to the end of the html body, instead of after the text input where the user types his search query.  This behavior seemed to contradict the documentation, so I submitted a bug report.  It turns out this is intended behavior to account for the fact that IE does not recognize z-index, but the search results must obviously appear on top of all other page elements.</p>
<p>Fortunately, you can easily modify the default behavior of the search event and append it where you want it.  I probably broke IE6 support, but if <a href="http://arstechnica.com/microsoft/news/2010/01/google-to-send-internet-explorer-6-users-packing-come-march.ars">Google can drop it</a>, why not?</p>
]]></content:encoded>
			<wfw:commentRss>http://nonexistentknight.com/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
