<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>The CrunchyFrog Blog - Home</title>
  <id>tag:blog.crunchyfrog.net,2010:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://blog.crunchyfrog.net/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.crunchyfrog.net/" rel="alternate" type="text/html"/>
  <updated>2010-11-01T19:23:33Z</updated>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2010-11-01:23</id>
    <published>2010-11-01T17:56:00Z</published>
    <updated>2010-11-01T19:23:33Z</updated>
    <category term="postgis"/>
    <category term="postgresql"/>
    <link href="http://blog.crunchyfrog.net/2010/11/1/updating-postgis-databases" rel="alternate" type="text/html"/>
    <title>Updating PostGIS Databases</title>
<content type="html">
            &lt;p&gt;I recently tried upgrading a &lt;a href=&quot;http://postgis.refractions.net/&quot;&gt;PostGIS&lt;/a&gt; database to a newer version, going from 1.4.0 to 1.5.2. Unfortunately the upgrade scripts failed with the error&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;ERROR:  type &quot;box3d_extent&quot; is only a shell&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;The only thing that worked was to follow the advice given by Paul Ramsey, in his blog post &lt;a href=&quot;http://blog.cleverelephant.ca/2010/09/postgis-back-up-restore.html&quot;&gt;PostGIS Back-up / Restore&lt;/a&gt;, and Steve Woodbridge, in a &lt;a href=&quot;http://www.mail-archive.com/postgis-users@postgis.refractions.net/msg08724.html&quot;&gt;thread on the postgis-users list&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The only gotcha I see here is that &lt;code&gt;pg_dump&lt;/code&gt; doesn&#8217;t include the database&#8217;s search path setting. So, I&#8217;ll have to remember to set the search path for the database when it&#8217;s restored. That doesn&#8217;t happen very often &#8212; usually only with major version upgrades of &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; &#8212; but it&#8217;s infrequent enough that it&#8217;s something that has the potential to get overlooked if it&#8217;s not documented.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2010-10-28:22</id>
    <published>2010-10-28T06:07:00Z</published>
    <updated>2010-10-28T06:08:28Z</updated>
    <category term="rails"/>
    <link href="http://blog.crunchyfrog.net/2010/10/28/rails-controller-action-response-ordering" rel="alternate" type="text/html"/>
    <title>Response Order in Rails Controller Actions</title>
<content type="html">
            &lt;p&gt;When checking test coverage on a Rails application, there was one code path that was missing, even though a test existed for it.&lt;/p&gt;
&lt;p&gt;Here&#8217;s a stripped-down version of the controller spec:&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;describe &lt;span class=&quot;co&quot;&gt;BooksController&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  it &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;should get a book via an AJAX request&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    xhr &lt;span class=&quot;sy&quot;&gt;:get&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:show&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;9&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    response.should be_success&lt;tt&gt;
&lt;/tt&gt;    response.should have_text(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\b&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Book 9&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  it &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;should get a book via a non-AJAX request&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    get &lt;span class=&quot;sy&quot;&gt;:show&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;9&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    response.should be_success&lt;tt&gt;
&lt;/tt&gt;    response.should have_text(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\b&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Book 9&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;And here&#8217;s the relevant parts of the controller:&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;BooksController&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ApplicationController&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;show&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    respond_to &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |format|&lt;tt&gt;
&lt;/tt&gt;      format.js &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;# Do stuff for AJAX requests&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      format.html &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;# Do stuff for non-AJAX requests&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;But in both cases, only the first response block was being run. Of course, if the expected response text had taken into account the differences between the two responses, and not just one piece of text, the non-&lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt; spec would have failed and the problem would have been found sooner. But it wasn&#8217;t.&lt;/p&gt;
&lt;p&gt;The problem was with the &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Accept header or, in this case, the lack of one. The &lt;code&gt;get&lt;/code&gt; call did not generate an Accept header so the first response block handled the request. The &lt;code&gt;xhr&lt;/code&gt; call, on the other hand, generated an Accept header containing &lt;code&gt;text/javascript, text/html, application/xml, text/xml, */*&lt;/code&gt; so the correct response block would handle the request regardless of the order.&lt;/p&gt;
&lt;p&gt;The problem never showed up in browsers because an &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Accept header is always being passed; Firefox, for example, sends a &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Accept header with a value of &lt;code&gt;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;/code&gt;. Only command-line tools like curl and wget don&#8217;t include &lt;code&gt;text/html&lt;/code&gt; as part of the Accept header unless told to do so (for example, by using the &lt;code&gt;--header&lt;/code&gt; option). I don&#8217;t know what search engines and other robots specify for an Accept header, but it might be safe to assume that they act more like curl and wget than Firefox.&lt;/p&gt;
&lt;p&gt;So the easy fix in this case was to reverse the order of the response blocks, and remember to make sure that response blocks are always ordered so that the default response is first.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2010-10-26:21</id>
    <published>2010-10-26T06:00:00Z</published>
    <updated>2010-12-18T07:15:07Z</updated>
    <category term="gis"/>
    <link href="http://blog.crunchyfrog.net/2010/10/26/gis-experiments" rel="alternate" type="text/html"/>
    <title>GIS Experiments</title>
<content type="html">
            &lt;p&gt;Despite the painful problem I encountered in my &lt;a href=&quot;/2010/10/26/system-overload&quot;&gt;previous post&lt;/a&gt;, I did manage to recover and get some maps made and thought I&#8217;d share one of them. Over on the right side of the page, you&#8217;ll find a link to a little &lt;a href=&quot;http://brewerymaps.crunchyfrog.net/&quot;&gt;project&lt;/a&gt; I put together as a basis for learning the &lt;a href=&quot;http://code.google.com/apis/maps/&quot;&gt;Google Maps &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The database currently lists about 4,200 breweries. While still incomplete, especially in Asia, Africa, Central and South America, and parts of Europe, I was still curious about how the worldwide distribution looked. Unfortunately, trying to plot them on a map with the Google Maps &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; is not feasible because of the large number of markers; supposedlly more than a couple hundred markers are a problem, but I&#8217;ve not had any serious problem showing up to about 1,000 markers, but 4,000+ definitely won&#8217;t work.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href=&quot;http://www.qgis.org/&quot;&gt;Quantum &lt;span class=&quot;caps&quot;&gt;GIS&lt;/span&gt;&lt;/a&gt;. Since the data is stored in a &lt;a href=&quot;http://postgis.refractions.net/&quot;&gt;PostGIS&lt;/a&gt; database, it was relatively easy to generate a world map showing all of the brewery locations that have been entered in the database. Admitedly, the map could use some refinement, but I&#8217;ve only recently started working with Quantum &lt;span class=&quot;caps&quot;&gt;GIS&lt;/span&gt; and have limited experience with its capabilities at the moment.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/assets/2010/10/26/world_breweries.jpg&quot; title=&quot;Click to see a full-size map&quot;&gt;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2010-10-26:20</id>
    <published>2010-10-26T05:20:00Z</published>
    <updated>2010-11-01T18:21:03Z</updated>
    <category term="linux"/>
    <link href="http://blog.crunchyfrog.net/2010/10/26/system-overload" rel="alternate" type="text/html"/>
    <title>System Overload</title>
<content type="html">
            &lt;p&gt;This is probably not what you want to see on a typical &lt;span class=&quot;caps&quot;&gt;UNIX&lt;/span&gt; system:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;$ uptime
 15:07:27 up 500 days,  4:06,  3 users,  load average: 163.05, 170.70, 156.37&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;There might well be some powerful systems that can handle that type of load, but the one I was working on sure wasn&#8217;t coping very well. I can&#8217;t recall ever seeing such a high load average before on &lt;em&gt;any&lt;/em&gt; &lt;span class=&quot;caps&quot;&gt;UNIX&lt;/span&gt; system, and I almost didn&#8217;t get to see that because I was very close to power cycling the system to regain control before I was able to recover.&lt;/p&gt;
&lt;p&gt;The problem started with an out-of-control process that began sucking up memory. The system began to get slower and slower, and I had a good idea which process was at fault. The Linux &lt;span class=&quot;caps&quot;&gt;OOM&lt;/span&gt; (out-of-memory) killer didn&#8217;t kick in so I had to, but it was becoming harder and harder to get any response from a terminal, but I did manage to get a &lt;code&gt;ps&lt;/code&gt; command entered to identify the likely culprit, watching the characters echo back at about the speed of a 110 baud modem connection on a noisy phone line, and eventually got results:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;$ ps -C qgis u
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dcato    20596 15.1 76.0 6185492 3088452 pts/27 D   13:42  10:54 qgis&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This on a system with 4GB &lt;span class=&quot;caps&quot;&gt;RAM&lt;/span&gt; and 6GB swap, and a few other running processes that weren&#8217;t shy about using memory either. Thankfully I caught the system at just the right time and was able to enter &lt;code&gt;kill -9 20596&lt;/code&gt; and kill the process without any of the same painful delay that the &lt;code&gt;ps&lt;/code&gt; command took. I immediately typed &lt;code&gt;uptime&lt;/code&gt; and got the results shown above.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2010-05-19:19</id>
    <published>2010-05-19T03:30:00Z</published>
    <updated>2010-05-19T03:29:28Z</updated>
    <category term="firefox"/>
    <category term="html5"/>
    <category term="offline web app"/>
    <link href="http://blog.crunchyfrog.net/2010/5/19/offline-application-gotcha-in-firefox" rel="alternate" type="text/html"/>
    <title>Offline application gotcha in Firefox</title>
<summary type="html">&lt;p&gt;I&#8217;ve been working on an &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html&quot;&gt;HTML5-based offline web application&lt;/a&gt; but ran into trouble when updating files listed in the cache manifest.&lt;/p&gt;
&lt;p&gt;Even though the files were downloaded and cached when the page was initially loaded, if a change was made to one (or more) of the files listed on the server, the browser detected the updated manifest file and began pulling down the updated file(s). However, the update would halt with an error part way through the process, but only in Firefox; the update process worked fine in Safari and Chrome.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I&#8217;ve been working on an &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html&quot;&gt;HTML5-based offline web application&lt;/a&gt; but ran into trouble when updating files listed in the cache manifest.&lt;/p&gt;
&lt;p&gt;Even though the files were downloaded and cached when the page was initially loaded, if a change was made to one (or more) of the files listed on the server, the browser detected the updated manifest file and began pulling down the updated file(s). However, the update would halt with an error part way through the process, but only in Firefox; the update process worked fine in Safari and Chrome.&lt;/p&gt;
&lt;p&gt;I&#8217;ve been working on an &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html&quot;&gt;HTML5-based offline web application&lt;/a&gt; but ran into trouble when updating files listed in the cache manifest.&lt;/p&gt;
&lt;p&gt;Even though the files were downloaded and cached when the page was initially loaded, if a change was made to one (or more) of the files listed on the server, the browser detected the updated manifest file and began pulling down the updated file(s). However, the update would halt with an error part way through the process, but only in Firefox; the update process worked fine in Safari and Chrome.&lt;/p&gt;
&lt;p&gt;There does not appear to be any way to determine which file was being downloaded when the error event is fired and the server logs only showed status codes of 200 and 304 (as expected) but no 4xx or 5xx status codes. As it turned out, the server never received a request for the file that caused the error anyway.&lt;/p&gt;
&lt;p&gt;After a lot of frustration and futile debugging steps, I began hacking entries out of the manifest file and eventually narrowed the problem down to a single file. Although the file existed it was empty and, evidently, Firefox 3.6.3 does not like having empty files included in the cache manifest. The behavior was the same on both Mac OS X and Linux. (My guess is that the problem exists on other platforms too, but I have not verified that it does.) As I mentioned above, the problem did not occur with the current versions of Safari or Chrome; nor does the problem exist with the most recent Firefox 3.7 nightly build.&lt;/p&gt;
&lt;p&gt;The obvious fix is to avoid including any empty files in the cache manifest. And for good measure, don&#8217;t reference any empty files anywhere else in the web app to avoid accessing files that are not included in the offline cache when the user is working offline.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-06-29:18</id>
    <published>2009-06-29T17:36:00Z</published>
    <updated>2010-12-18T07:17:13Z</updated>
    <category term="activescaffold"/>
    <category term="rails"/>
    <link href="http://blog.crunchyfrog.net/2009/6/29/activescaffold-problems-when-using-acts-as-audited" rel="alternate" type="text/html"/>
    <title>ActiveScaffold problems when using acts_as_audited</title>
<summary type="html">&lt;p&gt;While beefing up the admin backend of a Rails app that uses &lt;a href=&quot;http://activescaffold.com&quot;&gt;ActiveScaffold&lt;/a&gt; for its admin UI, I encountered an error that only happened in production and the stack trace wasn&#8217;t much help in identifying the cause.&lt;/p&gt;
&lt;p&gt;After failing to recreate the problem with a (relatively) small test case, I took the opposite approach and began ripping code out of the original application until the failure went away.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;While beefing up the admin backend of a Rails app that uses &lt;a href=&quot;http://activescaffold.com&quot;&gt;ActiveScaffold&lt;/a&gt; for its admin UI, I encountered an error that only happened in production and the stack trace wasn&#8217;t much help in identifying the cause.&lt;/p&gt;
&lt;p&gt;After failing to recreate the problem with a (relatively) small test case, I took the opposite approach and began ripping code out of the original application until the failure went away.&lt;/p&gt;
&lt;p&gt;While beefing up the admin backend of a Rails app that uses &lt;a href=&quot;http://activescaffold.com&quot;&gt;ActiveScaffold&lt;/a&gt; for its admin UI, I encountered an error that only happened in production and the stack trace wasn&#8217;t much help in identifying the cause.&lt;/p&gt;
&lt;p&gt;After failing to recreate the problem with a (relatively) small test case, I took the opposite approach and began ripping code out of the original application until the failure went away.&lt;/p&gt;
&lt;h4&gt;Background&lt;/h4&gt;
&lt;p&gt;The problem began when I tried to access a &lt;a href=&quot;http://wiki.github.com/activescaffold/active_scaffold/api-nested&quot;&gt;nested scaffold&lt;/a&gt; from its parent scaffold. The relevant models are as follows:&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Country&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  has_many &lt;span class=&quot;sy&quot;&gt;:regions&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Region&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  belongs_to &lt;span class=&quot;sy&quot;&gt;:country&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h4&gt;The Problem&lt;/h4&gt;
&lt;p&gt;When viewing the list of countries, I should have been able to click the regions column and get a nested list of regions in the country like so.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Except, this is what I got.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And the log file had the following stack trace.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;NoMethodError (undefined method `controller_name' for nil:NilClass):
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sweeping.rb:83:in `callback'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sweeping.rb:65:in `after'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:208:in `around_proc'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:184:in `call'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:635:in `run_before_filters'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:615:in `call_filters'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib64/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_without_caching'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `send'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process_without_filters'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request' 
    ...&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;So the stack trace is pointing to a caching problem, which explains why the problem did not occur in development mode. But that&#8217;s about all the stack trace revealed to me.&lt;/p&gt;
&lt;p&gt;Another issue is that this same code worked fine in a couple other Rails applications. However, none of the applications used identical sets of gems and plugins so there was likely a problem introduced by some combination of external dependencies.&lt;/p&gt;
&lt;h4&gt;The Fix&lt;/h4&gt;
&lt;p&gt;After having failed to recreate the problem in a small test case, it was time to start ripping the code apart.&lt;/p&gt;
&lt;p&gt;As I pulled more and more functionality out of the application, I finally got it working when I ripped out the &lt;a href=&quot;http://github.com/collectiveidea/acts_as_audited&quot;&gt;&lt;code&gt;acts_as_audited&lt;/code&gt;&lt;/a&gt; plugin. A quick google took me to &lt;a href=&quot;http://opensoul.org/2007/12/13/acts_as_audited-and-activescaffold&quot;&gt;this post&lt;/a&gt; that offered the solution. After applying that fix, the nested scaffolds worked as expected, and after reverting all the other changes no other problems were raised.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-06-15:17</id>
    <published>2009-06-15T00:08:00Z</published>
    <updated>2009-06-15T00:12:14Z</updated>
    <category term="radiant"/>
    <category term="releases"/>
    <link href="http://blog.crunchyfrog.net/2009/6/15/rotating-ad-banners-for-radiant" rel="alternate" type="text/html"/>
    <title>Rotating Ad Banners for Radiant</title>
<content type="html">
            &lt;p&gt;As part of on ongoing project with &lt;a href=&quot;http://radiantcms.org/&quot;&gt;Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt;, I needed to display random ad banners on a page. The &lt;a href=&quot;http://ext.radiantcms.org/extensions/46-banner-rotator&quot;&gt;banner_rotator extension&lt;/a&gt; didn&#8217;t quite fit my needs so I rolled my own. It&#8217;s available at &lt;a href=&quot;http://github.com/davec/radiant-ad_banners-extension&quot;&gt;http://github.com/davec/radiant-ad_banners-extension&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What&#8217;s different from the banner_rotator extension?&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Simplified usage&lt;/dt&gt;&lt;dd&gt;Just include &lt;code&gt;&amp;lt;r:ad_banner/&amp;gt;&lt;/code&gt; to generate the appropriate &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; on the page. If you want a specific banner, use &lt;code&gt;&amp;lt;r:ad_banner name=&quot;Banner Name&quot;/&amp;gt;&lt;/code&gt;. Include as many banners on the page as you want, though if you include more banners than you have defined, the excess ad_banner tags will be ignored. A banner will only be displayed once on a page unless you specifically force it by specifying the name attribute.&lt;/li&gt;
	&lt;li&gt;Uses the &lt;a href=&quot;http://ext.radiantcms.org/extensions/20-paperclipped&quot;&gt;paperclipped extension&lt;/a&gt; for asset management. Drag-and-drop an image into the form when creating or editing a banner definition.&lt;/li&gt;
	&lt;li&gt;Banners are global, not tied to a specific page or set of pages. Depending on your use case, this could be considered a strike against the ad_banners extension.&lt;/li&gt;
&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-06-06:15</id>
    <published>2009-06-06T02:38:00Z</published>
    <updated>2010-12-18T07:21:40Z</updated>
    <category term="radiant"/>
    <category term="releases"/>
    <link href="http://blog.crunchyfrog.net/2009/6/6/events-calendar-extension-for-radiant" rel="alternate" type="text/html"/>
    <title>Events Calendar Extension for Radiant</title>
<summary type="html">&lt;p&gt;I&#8217;ve recently been working with &lt;a href=&quot;http://radiantcms.org&quot;&gt;Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt; for a project and needed a calendar of events. None of the existing calendar-related extensions fit the bill so I created one that did.&lt;/p&gt;
&lt;p&gt;Find it at &lt;a href=&quot;http://github.com/davec/radiant-events-calendar-extension&quot;&gt;http://github.com/davec/radiant-events-calendar-extension&lt;/a&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I&#8217;ve recently been working with &lt;a href=&quot;http://radiantcms.org&quot;&gt;Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt; for a project and needed a calendar of events. None of the existing calendar-related extensions fit the bill so I created one that did.&lt;/p&gt;
&lt;p&gt;Find it at &lt;a href=&quot;http://github.com/davec/radiant-events-calendar-extension&quot;&gt;http://github.com/davec/radiant-events-calendar-extension&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&#8217;ve recently been working with &lt;a href=&quot;http://radiantcms.org&quot;&gt;Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt; for a project and needed a calendar of events. None of the existing calendar-related extensions fit the bill so I created one that did.&lt;/p&gt;
&lt;p&gt;Find it at &lt;a href=&quot;http://github.com/davec/radiant-events-calendar-extension&quot;&gt;http://github.com/davec/radiant-events-calendar-extension&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;The Public Calendar&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The public face of the website gets a small monthly calendar that can be navigated month-by-month using the previous and next month links at the top of the calendar (the calendar is updated via an &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt; request). To display a calendar, simply add the radius tag &lt;code&gt;&amp;lt;r:calendar/&amp;gt;&lt;/code&gt; to the page (you might want to add a section header of some sort &#8212; the &lt;em&gt;Calendar&lt;/em&gt; title shown here is not included in the output of the &lt;code&gt;&amp;lt;r:calendar/&amp;gt;&lt;/code&gt; tag).&lt;/p&gt;
&lt;p&gt;The calendar cell of the current day, as known by the server, is highlighted; days that have events associated with them are shown in a bold red font. (Tweak the &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; to your own preferences if the defaults are not to your liking.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When the mouse pointer is within a calendar cell that has events, a tooltip is displayed with some basic information about the events for the day. To see the details on the day&#8217;s events, do as the tooltip says and click on the date. Doing so will render a separate page that contains the details of the day&#8217;s events.&lt;/p&gt;
&lt;p class=&quot;clear&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The tooltip is normally aligned a few pixels above and to the left of the lower left corner of the calendar cell it&#8217;s associated with. However, if the calendar is too close to the top of the browser&#8217;s viewport, the JavaScript code that displays the tooltip is intelligent enough to adjust the location of the tooltip to keep it within the viewport.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&#8220;Ah, ha!&#8221; you say. &#8220;What if I place my calendar on the left side of the page? Surely there isn&#8217;t room to display the tooltip.&#8221;&lt;/p&gt;
&lt;p&gt;Fear not, just as with the tooltip positioning adjustments made when the calendar it too close to the top of the page, if the tooltip cannot be fully displayed to the left of its associated calendar cell, it gets displayed to the right.&lt;/p&gt;
&lt;p&gt;There&#8217;s a potential for trouble if the browser window it too narrow. The JavaScript code does not currently consider the situation where there is insufficient room to display the tooltip on the left and the right sides. If there&#8217;s insufficient room on the left, the tooltip is displayed on the right with the potential of having the right side of the tooltip clipped.&lt;/p&gt;
&lt;h4&gt;The Admin Side&lt;/h4&gt;
&lt;p&gt;The public calendar, and associated events page, is pulling data from a simple table of events. The admin UI gets an Events tab that displays the list of current and future events.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Events that have already happened are not accessible &#8212; you&#8217;ll have to dive into the database directly if you want to rewrite history.&lt;/p&gt;
&lt;p&gt;The UI for creating new events and editing existing events is straight forward.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Events must have a name and a date, but everything else is optional.&lt;/p&gt;
&lt;h4&gt;Caveats&lt;/h4&gt;
&lt;p&gt;This extension works for my purposes, but still has some rough edges. I&#8217;m currently using it with Radiant 0.8RC1 but I&#8217;ve also done some testing with 0.7.1. I haven&#8217;t tried it with any earlier versions of Radiant. If you do, let me know if it works.&lt;/p&gt;
&lt;p&gt;Use the master branch for 0.8 and the radiant-0.7.1 branch for 0.7.1.&lt;/p&gt;
&lt;p&gt;The calendar display has been tested with Firefox 3.0.10, Safari 3.2.3, IE6, IE7, IE8, and Opera 9.64.&lt;/p&gt;
&lt;h4&gt;Acknowledgements&lt;/h4&gt;
&lt;p&gt;This extension makes use of Tim Harper&#8217;s &lt;a href=&quot;http://github.com/timcharper/calendar_date_select&quot;&gt;calendar_date_select plugin&lt;/a&gt;, Geoffrey Grosenbach&#8217;s &lt;a href=&quot;http://github.com/topfunky/calendar_helper&quot;&gt;calendar_helper plugin&lt;/a&gt;, and Tony Amoyal&#8217;s &lt;a href=&quot;http://github.com/tamoyal/simple_time_select&quot;&gt;simple_time_select plugin&lt;/a&gt;. &lt;sup class=&quot;footnote&quot;&gt;&lt;a href=&quot;#fn1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;All of these plugins are included with the events calendar extension.&lt;/p&gt;
&lt;p class=&quot;footnote&quot;&gt;&lt;a href=&quot;#fnr1&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; The simple_time_select plugin uses a 12 hour clock. If your users expect a 24 hour clock then you&#8217;ll need to do some hacking.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-06-01:14</id>
    <published>2009-06-01T04:13:00Z</published>
    <updated>2009-06-01T00:35:28Z</updated>
    <category term="spam"/>
    <link href="http://blog.crunchyfrog.net/2009/6/1/spam-on-the-rebound" rel="alternate" type="text/html"/>
    <title>Spam on the rebound</title>
<summary type="html">&lt;p&gt;Well, it looks like the spam levels this week have not only returned to their pre-&lt;a href=&quot;http://arstechnica.com/security/news/2008/11/spam-sees-big-nosedive-as-rogue-isp-mccolo-knocked-offline.ars&quot;&gt;McColo shutdown&lt;/a&gt; levels, but they&#8217;re beginning to surpass them.&lt;/p&gt;
&lt;p&gt;Just before the McColo shutdown, my mail server was receiving roughly 75K emails per day during the week, somewhat less on the weekends. Afterwards, the level dropped to less than 20K per day, which is where it stayed through the end of the year. Since the beginning of the year the amount of mail hitting my mail server has been rising, hitting about 60K messages per day two weeks ago.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Well, it looks like the spam levels this week have not only returned to their pre-&lt;a href=&quot;http://arstechnica.com/security/news/2008/11/spam-sees-big-nosedive-as-rogue-isp-mccolo-knocked-offline.ars&quot;&gt;McColo shutdown&lt;/a&gt; levels, but they&#8217;re beginning to surpass them.&lt;/p&gt;
&lt;p&gt;Just before the McColo shutdown, my mail server was receiving roughly 75K emails per day during the week, somewhat less on the weekends. Afterwards, the level dropped to less than 20K per day, which is where it stayed through the end of the year. Since the beginning of the year the amount of mail hitting my mail server has been rising, hitting about 60K messages per day two weeks ago.&lt;/p&gt;
&lt;p&gt;Well, it looks like the spam levels this week have not only returned to their pre-&lt;a href=&quot;http://arstechnica.com/security/news/2008/11/spam-sees-big-nosedive-as-rogue-isp-mccolo-knocked-offline.ars&quot;&gt;McColo shutdown&lt;/a&gt; levels, but they&#8217;re beginning to surpass them.&lt;/p&gt;
&lt;p&gt;Just before the McColo shutdown, my mail server was receiving roughly 75K emails per day during the week, somewhat less on the weekends. Afterwards, the level dropped to less than 20K per day, which is where it stayed through the end of the year. Since the beginning of the year the amount of mail hitting my mail server has been rising, hitting about 60K messages per day two weeks ago.&lt;/p&gt;
&lt;p&gt;This past Monday, May 25, 74,372 messages hit the mail server. The next day, 80,312 &#8212; a new record for me (not that I&#8217;m trying for any records). Activity slacked off slightly after that with only 79,909 messages on Wednesday and 79,040 on Thursday before taking a dive on Friday when only 70,739 messages came knocking.&lt;/p&gt;
&lt;p&gt;Not surprisingly, the amount of legitimate mail coming through has remained relatively stable, so all this increase is nothing but spam, most of which gets blocked outright at the server or shuffled off to the spam graveyard by the various spam filters I have in place.&lt;/p&gt;
&lt;h4&gt;You might be a spammer if &#8230;&lt;/h4&gt;
&lt;p&gt;A look at why the spam gets binned shows just how stupid the spammers are.&lt;/p&gt;
&lt;p&gt;By far the biggest reason spam gets caught is because the spammer forges the email address to appear as if the sender is from the domain to which the spam is being sent. How many mail servers actually accept such email these days without requiring authentication first? The only way a local user of my systems is sending mail is by going through the &lt;strong&gt;internal&lt;/strong&gt; mail server, not by connecting from a foreign IP address. This type of spam accounts for between 30% and 50% of all mail hitting my mail server.&lt;/p&gt;
&lt;p&gt;A specialized variation of the above is impersonating the user being spammed. I get several of these a day via an email address I have forwarded from another domain, so blocking them at the &lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; server doesn&#8217;t do any good but &lt;a href=&quot;http://bogofilter.sourceforge.net/&quot;&gt;bogofilter&lt;/a&gt; catches them just fine. Really, who would send a message to themselves with a subject of &#8220;Open or your a &lt;em&gt;racial epithet&lt;/em&gt;&#8221; or &#8220;FW: Hi &lt;em&gt;user@example.com&lt;/em&gt; visit me&#8221;? (Of course, I have to wonder about the intelligence of people who would actually bother to open such a message in the first place unless they&#8217;re analyzing their spam.)&lt;/p&gt;
&lt;p&gt;Coming in at number two on the spam block meter is connections from IP addresses in the Spamhaus &lt;a href=&quot;http://www.spamhaus.org/sbl/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SBL&lt;/span&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.spamhaus.org/xbl/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;XBL&lt;/span&gt;&lt;/a&gt; lists. These addresses account for about 25% of all inbound &lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; connections.&lt;/p&gt;
&lt;p&gt;Close behind in third place are bogus &lt;span class=&quot;caps&quot;&gt;HELO&lt;/span&gt; hostnames, mainly &lt;code&gt;localhost&lt;/code&gt; (sometimes fully-qualified as &lt;code&gt;localhost.localdomain&lt;/code&gt;) and &lt;code&gt;wireless_broadband_router&lt;/code&gt;. Less often the spammer uses the domain name, host name, or IP address of the host they&#8217;re connecting to. Bzzt, &lt;a href=&quot;http://www.isi.edu/in-notes/rfc1123.txt&quot;&gt;wrong&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The sender-&lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;MUST&lt;/span&gt; ensure that the &amp;lt;domain&amp;gt; parameter in a &lt;span class=&quot;caps&quot;&gt;HELO&lt;/span&gt; command is a valid principal host domain name for the client host.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If anyone knows of a legitimate &lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; server that doesn&#8217;t provide the correct hostname in the &lt;span class=&quot;caps&quot;&gt;HELO&lt;/span&gt; (or &lt;span class=&quot;caps&quot;&gt;EHLO&lt;/span&gt;) command, I&#8217;d like to hear about it.&lt;/p&gt;
&lt;p&gt;Though not too common, there is the occasional mangling of the &lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; protocol or perhaps attempts to break the server. Why else would email be sent to &lt;code&gt;+.-_|@example.com&lt;/code&gt; or &lt;code&gt;{%TO%}&lt;/code&gt;. Similarly, mail purporting to be from &lt;code&gt;{$FROM}&lt;/code&gt; or &lt;code&gt;{%FNAME%RND_NUM@%RND_DOM}&lt;/code&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-05-31:13</id>
    <published>2009-05-31T03:29:00Z</published>
    <updated>2010-12-18T07:19:45Z</updated>
    <category term="cats"/>
    <link href="http://blog.crunchyfrog.net/2009/5/31/weekend-cat-blogging" rel="alternate" type="text/html"/>
    <title>Weekend cat blogging</title>
<content type="html">
            &lt;p&gt;It&#8217;s the mystery cat. Yes, there is a cat under there.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This blog has been a bit like the cat under those bed covers, and like the cat this blog eventually emerges from the darkness.&lt;/p&gt;
&lt;p&gt;Curiously, she just recently began burrowing under the bed covers this week as the weather has been warming up. Nothing like a 88°F (31°C) day to seek out more warmth. OK, so it was a bit cooler inside, getting up to almost 80°F (27°C) early this evening before beginning to cool down.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-03-30:12</id>
    <published>2009-03-30T22:54:00Z</published>
    <updated>2009-03-30T22:59:51Z</updated>
    <category term="firefox"/>
    <category term="fonts"/>
    <category term="linux"/>
    <link href="http://blog.crunchyfrog.net/2009/3/30/firefox-display-problems-on-linux" rel="alternate" type="text/html"/>
    <title>Firefox display problems on Linux</title>
<summary type="html">&lt;p&gt;A week or so after upgrading Firefox to 3.0.7 on my Linux system, I began running across an occasional web page that wouldn&#8217;t render correctly. At first I attributed it to poor page coding — perhaps one of those old-timers that still hasn&#8217;t learned that there&#8217;s more to web browsers than IE, or someone who mucked up their &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; and wound up with white text on a white background — but since I wasn&#8217;t necessarily in need of the information at the site, considering the Google search that took me to the site provided many more possible links, I just moved on to the next site without bothering to figure out why the page didn&#8217;t render.&lt;/p&gt;


	&lt;p&gt;Unfortunately, the frequency of pages not rendering properly began to increase to the point that I began experiencing the problem with web sites that I did need to access. Opera could render them fine, and Firefox on my Mac &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; system had no problem, but Firefox on Linux was a basket case. Even worse, Galeon and Seamonkey crashed when I tried to visit those same sites.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;A week or so after upgrading Firefox to 3.0.7 on my Linux system, I began running across an occasional web page that wouldn&#8217;t render correctly. At first I attributed it to poor page coding — perhaps one of those old-timers that still hasn&#8217;t learned that there&#8217;s more to web browsers than IE, or someone who mucked up their &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; and wound up with white text on a white background — but since I wasn&#8217;t necessarily in need of the information at the site, considering the Google search that took me to the site provided many more possible links, I just moved on to the next site without bothering to figure out why the page didn&#8217;t render.&lt;/p&gt;


	&lt;p&gt;Unfortunately, the frequency of pages not rendering properly began to increase to the point that I began experiencing the problem with web sites that I did need to access. Opera could render them fine, and Firefox on my Mac &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; system had no problem, but Firefox on Linux was a basket case. Even worse, Galeon and Seamonkey crashed when I tried to visit those same sites.&lt;/p&gt;
&lt;p&gt;A week or so after upgrading Firefox to 3.0.7 on my Linux system, I began running across an occasional web page that wouldn&#8217;t render correctly. At first I attributed it to poor page coding — perhaps one of those old-timers that still hasn&#8217;t learned that there&#8217;s more to web browsers than IE, or someone who mucked up their &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; and wound up with white text on a white background — but since I wasn&#8217;t necessarily in need of the information at the site, considering the Google search that took me to the site provided many more possible links, I just moved on to the next site without bothering to figure out why the page didn&#8217;t render.&lt;/p&gt;


	&lt;p&gt;Unfortunately, the frequency of pages not rendering properly began to increase to the point that I began experiencing the problem with web sites that I did need to access. Opera could render them fine, and Firefox on my Mac &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; system had no problem, but Firefox on Linux was a basket case. Even worse, Galeon and Seamonkey crashed when I tried to visit those same sites.&lt;/p&gt;


	&lt;p&gt;OK, let&#8217;s start Firefox from the command line and visit one of the problematic sites.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt; (firefox-bin:25838): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'Helvetica 8.19921875'&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt; (firefox-bin:25838): Pango-WARNING **: font_font status is: out of memory&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt; (firefox-bin:25838): Pango-WARNING **: scaled_font status is: out of memory&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;The Great Gazoogle wasn&#8217;t being too helpful, leading me to several sites where a similar problem had been reported, usually with an early beta build of Firefox 3, but no obvious solution. I eventually came across an &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+bug/232417&quot;&gt;Ubuntu bug report&lt;/a&gt; that lead to the apparent solution. I&#8217;m not running Ubuntu, so the &lt;code&gt;dpkg-reconfigure&lt;/code&gt; and &lt;code&gt;update-pangox-aliases&lt;/code&gt; commands were not helpful, but the &lt;code&gt;fc-cache&lt;/code&gt; was.&lt;/p&gt;


	&lt;p&gt;So, I ran&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt; sudo fc-cache -fs&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;and waited for it to plow through all the installed fonts on the system. For good measure I did the same on my user-installed fonts too.&lt;/p&gt;


&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt; fc-cache -f&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;


	&lt;p&gt;Restart Firefox and visit a failing site, and &#8230; no errors, no rendering problems, everything seems to be back to normal.&lt;/p&gt;


	&lt;p&gt;Just for completeness, I visited the same site in Galeon and Seamonkey and, instead of crashing, they now render the sites correctly too.&lt;/p&gt;


	&lt;p&gt;I have no idea how the font cache got hosed — I haven&#8217;t installed any fonts recently — and I haven&#8217;t (knowingly) done anything that would have modified the font cache directories. Nevertheless, something got screwed up and a regeneration of the font cache fixed it.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-03-22:11</id>
    <published>2009-03-22T22:27:00Z</published>
    <updated>2010-12-18T07:19:12Z</updated>
    <category term="mephisto"/>
    <category term="passenger"/>
    <link href="http://blog.crunchyfrog.net/2009/3/22/problems-with-mephisto-and-passenger" rel="alternate" type="text/html"/>
    <title>Problems with Mephisto and Passenger</title>
<content type="html">
            &lt;p&gt;My &lt;a href=&quot;/2009/3/22/rails-functional-tests-and-406-errors&quot;&gt;previous post&lt;/a&gt; contained multiple code fragments contained in &lt;code&gt;macro:code&lt;/code&gt; blocks, but they were not formatted correctly. There was an excessive amount of space at the beginning of each code block and a smaller amount of excess space at the end, as well as extra lines between each line of code.&lt;/p&gt;
&lt;p&gt;Looking at the source code revealed that every line of the code block was terminated with a BR tag. The &lt;span class=&quot;caps&quot;&gt;XHTML&lt;/span&gt; code for the line number columns looked like this:&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;pre&amp;gt;&lt;/span&gt;1&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;2&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;3&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;4&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;5&lt;span class=&quot;ta&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;6&lt;span class=&quot;ta&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;ta&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Clearly, not what is expected.&lt;/p&gt;
&lt;p&gt;I tried the same post in a &lt;a href=&quot;http://mephistoblog.com/&quot;&gt;mephisto&lt;/a&gt; development environment but could not replicate the problem. After ruling out browser and OS differences, it was clear that the problem was confined to the production server.&lt;/p&gt;
&lt;p&gt;Another curiosity was that the problem only happened when there were multiple code snippets or text followed a code snippet. If only one code snippet appeared in a post and nothing followed it, the BR tags were not inserted.&lt;/p&gt;
&lt;p&gt;The differences between the development and production systems are the web server (&lt;a href=&quot;http://mongrel.rubyforge.org/&quot;&gt;mongrel&lt;/a&gt; in development and &lt;a href=&quot;http://httpd.apache.org/&quot;&gt;Apache&lt;/a&gt; + &lt;a href=&quot;http://www.modrails.com/&quot;&gt;Phusion Passenger&lt;/a&gt; in production) and the Ruby interpreter (plain ruby in development and &lt;a href=&quot;http://www.rubyenterpriseedition.com/&quot;&gt;Ruby Enterprise Edition&lt;/a&gt; in production).&lt;/p&gt;
&lt;p&gt;I quickly narrowed the problem down to Passenger. &lt;a href=&quot;http://blog.phusion.nl/2009/03/13/phusion-passenger-212-final-released/&quot;&gt;Passenger 2.1.2 was recently released&lt;/a&gt; but the production server was still running version 2.0.6. A quick &lt;code&gt;sudo gem update passenger&lt;/code&gt;, an edit of the Apache config, and a restart of Apache, and the extra BR tags have been eliminated.&lt;/p&gt;
&lt;p&gt;I can&#8217;t tell from the Passenger release notes what might have caused the problem in the first place but, whatever it was, it affected the CodeRay parsing and is no longer an issue.&lt;/p&gt;
&lt;p&gt;Now if I can only sort out the &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; issues that are causing some minor formatting glitches with the code snippets in Opera and Firefox 2.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-03-22:2</id>
    <published>2009-03-22T05:57:00Z</published>
    <updated>2010-12-18T07:18:34Z</updated>
    <category term="rails"/>
    <category term="testing"/>
    <link href="http://blog.crunchyfrog.net/2009/3/22/rails-functional-tests-and-406-errors" rel="alternate" type="text/html"/>
    <title>Rails functional tests and 406 errors</title>
<content type="html">
            &lt;p&gt;So I have an controller method that responds to multiple formats, like so.&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;index&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  respond_to &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |format|&lt;tt&gt;
&lt;/tt&gt;    format.html&lt;tt&gt;
&lt;/tt&gt;    format.pdf&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Simple enough. So what do the tests look like?&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;test_default_index&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  get &lt;span class=&quot;sy&quot;&gt;:index&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  assert_response &lt;span class=&quot;sy&quot;&gt;:success&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;test_pdf_index&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  get &lt;span class=&quot;sy&quot;&gt;:index&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:format&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:pdf&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  assert_response &lt;span class=&quot;sy&quot;&gt;:success&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Again, nothing fancy. Let&#8217;s run the test and &#8230;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  1) Failure:
test_pdf_index(FoosControllerTest)

    [stacktrace omitted for brevity]

Expected response to be a &amp;lt;:success&amp;gt;, but was &amp;lt;406&amp;gt;

2 tests, 2 assertions, 1 failures, 0 errors
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ruh-roh. How could such a simple test fail, and what&#8217;s a 406 response? Well, it&#8217;s the numeric code for a &lt;code&gt;Not Acceptable&lt;/code&gt; &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; response, so it looks like the &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; request is borked. Perhaps the log file will reveal something, and indeed it does.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Processing FoosController#index to pdf (for 0.0.0.0 at 2009-03-21 22:57:10) [GET]
  Parameters: {&quot;format&quot;=&amp;gt;:pdf, &quot;action&quot;=&amp;gt;&quot;index&quot;, &quot;controller&quot;=&amp;gt;&quot;foos&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Looks like we can&#8217;t use a symbol for the format in the test. Sure enough, a quick change to the failing test,&lt;/p&gt;
&lt;div class=&quot;CodeMacro&quot;&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;test_pdf_index&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  get &lt;span class=&quot;sy&quot;&gt;:index&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:format&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  assert_response &lt;span class=&quot;sy&quot;&gt;:success&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;and the results are as expected.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
2 tests, 2 assertions, 0 failures, 0 errors
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Looks like the code formatting is fubar.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update II:&lt;/strong&gt; The code formatting is now fixed. See &lt;a href=&quot;/2009/3/22/problems-with-mephisto-and-passenger&quot;&gt;the explanation&lt;/a&gt; if you&#8217;re interested in the details.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.crunchyfrog.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:blog.crunchyfrog.net,2009-03-21:1</id>
    <published>2009-03-21T00:36:00Z</published>
    <updated>2009-03-21T07:59:01Z</updated>
    <category term="rails"/>
    <link href="http://blog.crunchyfrog.net/2009/3/21/two-milestones-two-years-apart" rel="alternate" type="text/html"/>
    <title>Two milestones, two years apart</title>
<content type="html">
            &lt;p&gt;Today finds me celebrating (in a rather low-key manner) two milestones. The first milestone is finally getting this blog off the ground, and the second is the second anniversary of the first commit of my first serious Rails project. The initial site went live two weeks later, replacing a crufty old &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;-based codebase that I had grown weary of maintaining. Naturally, several new features have been added since the original launch and both Ruby and Rails have made developing the site more enjoyable than any of the languages that had been used previously.&lt;/p&gt;
&lt;p&gt;For much of the year the site doesn&#8217;t look like anything that anyone would bother using Rails, or any other application framework, to create. Why not just throw up a bunch of static &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; pages?&lt;/p&gt;
&lt;p&gt;Well, the site exists to support &lt;a href=&quot;http://www.crunchyfrog.net/dixiecup/&quot;&gt;the Dixie Cup homebrew competition&lt;/a&gt; that&#8217;s held every year in October. The public side of the site handles the online registration process while an administrative backend  handles the running of the competition. For about 10 months of the year the site sits quietly with infrequent updates and then springs to life for a couple of months of serious activity.&lt;/p&gt;
&lt;p&gt;Since I&#8217;ve had several inquiries about the code from other clubs who want to use it for their own competitions, I&#8217;ve begun working to extract the guts into a separate project. I found myself needing to look at the revision history of some files and, at one point, decided to look all the way back to the beginning of the revision history for the entire project and noticed the date of the first commit was March 20, 2007.&lt;/p&gt;
          </content>  </entry>
</feed>

