<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>The Mechanical Turk - Home</title>
  <id>tag:blog.ardes.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://blog.ardes.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.ardes.com/" rel="alternate" type="text/html"/>
  <updated>2008-05-07T15:32:57Z</updated>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2008-05-07:2094</id>
    <published>2008-05-07T15:29:00Z</published>
    <updated>2008-05-07T15:32:57Z</updated>
    <category term="Ian"/>
    <category term="Ray"/>
    <category term="birth"/>
    <category term="ian"/>
    <category term="personal"/>
    <link href="http://blog.ardes.com/2008/5/7/iancongrats" rel="alternate" type="text/html"/>
    <title>Congratulations to Ian!</title>
<content type="html">
            &lt;p&gt;As of last night, Ian became a father! At around 11pm, his son was born. Let me be the first in a public forum to congratulate him :)&lt;/p&gt;

&lt;p&gt;Hopefully, he&#8217;ll soon post pictures&#8212;and a name!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-04-30:2020</id>
    <published>2008-04-30T16:12:00Z</published>
    <updated>2008-04-30T16:22:11Z</updated>
    <category term="ArDes Plugins"/>
    <category term="Ian"/>
    <category term="resources_controller"/>
    <category term="response_for"/>
    <category term="ardes"/>
    <category term="github"/>
    <category term="lighthouse"/>
    <category term="plugins response_for"/>
    <category term="resources_controller"/>
    <link href="http://blog.ardes.com/2008/4/30/ardes-plugins-available-github-and-lighthouse" rel="alternate" type="text/html"/>
    <title>ardes plugins available github and lighthouse</title>
<content type="html">
            &lt;p&gt;Many of our plugins are now available on &lt;strong&gt;github:&lt;/strong&gt; &lt;a href=&quot;http://github.com/ianwhite&quot;&gt;github.com/ianwhite&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And OSS projects such as these can now be hosted free on &lt;strong&gt;lighthouse: &lt;a href=&quot;http://ianwhite.lighthouseapp.com/&quot;&gt;ianwhite.lighthouseapp.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ones that you see on lighthouse have all had a good dusting off to make sure they're compliant with the very latest edge, and BC to 2.0.2.  &lt;a href=&quot;http://blog.ardes.com/response_for&quot;&gt;response_for&lt;/a&gt; is now branched to support edge and 2.0.2, but the other plugins haven't yet required this.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you don't see one you use there, it means that I haven't deemed it being used by many people - so leave a comment to say otherwise&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-04-27:1991</id>
    <published>2008-04-27T19:35:00Z</published>
    <updated>2008-04-27T19:57:44Z</updated>
    <category term="Code"/>
    <category term="Ian"/>
    <category term="Rails"/>
    <category term="resources_controller"/>
    <category term="rails"/>
    <category term="resources_controller"/>
    <category term="REST"/>
    <link href="http://blog.ardes.com/2008/4/27/resources_controller-things" rel="alternate" type="text/html"/>
    <title>resources_controller: things</title>
<content type="html">
            &lt;p&gt;RC's got a &lt;a href=&quot;http://github.com/ianwhite/resources_controller&quot;&gt;github home&lt;/a&gt; now&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://svn.ardes.com/rails_plugins/resources_controller&quot;&gt;subversion repo&lt;/a&gt; will still continue to be maintained for the foreseeable future.&lt;/a&gt;

&lt;p&gt;RC's also reported as being one of the things under the hood at &lt;a href=&quot;http://getnaked.com&quot;&gt;naked&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Lastly, I've been cooking my CI with &lt;a href=&quot;http://github.com/ianwhite/garlic&quot;&gt;garlic&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2008-04-25:1973</id>
    <published>2008-04-25T15:31:00Z</published>
    <updated>2008-04-25T18:56:02Z</updated>
    <category term="Code"/>
    <category term="Design"/>
    <category term="Ray"/>
    <category term="css"/>
    <link href="http://blog.ardes.com/2008/4/25/css-debugging" rel="alternate" type="text/html"/>
    <title>Two CSS Debugging Tips</title>
<content type="html">
            &lt;p&gt;Ian may &lt;strong&gt;claim&lt;/strong&gt; to be doing nothing but git-work (and what an unfortunate name that is), but the fact of the matter is that we&#8217;re both eyebrow-deep in client work. This business has been running since April 1999 &amp;amp; we&#8217;ve never been so busy.&lt;/p&gt;

&lt;p&gt;When you&#8217;re so busy, the last thing you want is a series of bugs that won&#8217;t seem to go away. Since most of my work is in the HTML/CSS/Rails templates realm, I&#8217;m speaking mostly of visual bugs, things that seemingly won&#8217;t budge no matter how much time you put into them. I thought I&#8217;d share two tips which have helped me squash a considerable number of visual bugs, one created by someone else &amp;amp; the other merely a process that I follow.&lt;/p&gt;

&lt;h3&gt;CSS Debugging Tip 1: Burn it all to the ground&lt;/h3&gt;

&lt;p&gt;First, the work supplied by someone else: Eric Meyer&#8217;s &lt;a href=&quot;http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/&quot;&gt;CSS Reset&lt;/a&gt;. If you&#8217;re unfamiliar with it, go &amp;amp; read up on it ASAP. For those unfamiliar with why you&#8217;d need to reset something your CSS, the answer is simple: different browsers have different default sizes for fonts, lists, buttons &amp;amp; a hell of a lot else. By resetting all these items via CSS, you help ensure that all your browsers&#8212;Safari, Firefox, Opera &amp;amp; the thorniest of them all, Internet Explorer&#8212;start from a common vantage point.&lt;/p&gt;

&lt;p&gt;The idea is not new. For years I&#8217;ve employed a very basic,  simple reset:&lt;/p&gt;

&lt;pre&gt;
  html * { margin: 0; padding: 0; }
&lt;/pre&gt;

&lt;p&gt;The problem is that this didn&#8217;t reset nearly enough things&#8212;and it often didn&#8217;t even reset everything it was supposed to! Eric&#8217;s reset is a total razing to the ground of all browser-specific sizing quirks &amp;amp; as such should be adopted by every designer. In my experience, it&#8217;s particularly useful for a project that you&#8217;re just starting up: my IE-specific stylesheets are a fraction of their former size. For pre-existing sites, however, it&#8217;s not going to be a magic bullet. You still assembled your CSS based on different assumptions &amp;amp; short of starting from scratch, it will be of more limited use (although still recommended in my book).&lt;/p&gt;

&lt;h3&gt;CSS Debugging Tip 2: Build it back up brick by brick&lt;/h3&gt;

&lt;p&gt;The second tip is merely a process that I&#8217;ve been following. I&#8217;m surely not the first person to do this, but since it doesn&#8217;t appear to be widely discussed I thought I&#8217;d write it up here.&lt;/p&gt;

&lt;p&gt;I&#8217;m going to take a real-world example from a site we&#8217;re building. In this site, we&#8217;re using some &lt;a href=&quot;http://script.aculo.us/&quot; title=&quot;Awesome effects&quot;&gt;Scriptaculous&lt;/a&gt; effects to aid in the creation of a visually compact secondary navigation for a database of imagery. The markup is simple:&lt;/p&gt;

&lt;pre&gt;
    &amp;lt;h4&amp;gt;Section Heading&amp;lt;/h4&amp;gt;
    &amp;lt;a href=&quot;subsection/1&quot;&amp;gt;Subsection 1&amp;lt;/a&amp;gt;
    &amp;lt;a href=&quot;subsection/2&quot;&amp;gt;Subsection 2&amp;lt;/a&amp;gt;
    ...
&lt;/pre&gt;

&lt;p&gt;Clicking on the &lt;code&gt;H4&lt;/code&gt; tag will cause the subnavigation links to reveal themselves, or hide themselves if they&#8217;re already revealed.&lt;/p&gt;

&lt;p&gt;Unless you&#8217;re viewing in Internet Explorer 7, that is&#8212;no, the problem for once isn&#8217;t IE6! In IE7, the links were invisible&#8212;they were clickable, but you couldn&#8217;t see them.&lt;/p&gt;

&lt;p&gt;I tore out what little hair I had left, for weeks, trying to figure out this bug. I even thought it might have been Scriptaculous&#8217; fault. It wasn&#8217;t, however &amp;amp; eventually I realised I was compounding the problem by &lt;strong&gt;adding&lt;/strong&gt; CSS declarations instead of &lt;strong&gt;removing&lt;/strong&gt; them&#8212;instead of trying to figure out what was triggering the bug, I was trying to pave over the bug. If you&#8217;re adding more declarations in order to fix a bug, you may very well be creating a shifting target, which is definitely not what you want to be doing. Particularly when you have a lot of other work to do.&lt;/p&gt;

&lt;p&gt;The answer is just a process &amp;amp; a very simple one at that: take your CSS declarations &amp;amp; strip them out. Add them incrementally, viewing in the target browser every time, until you trigger the bug. &lt;/p&gt;

&lt;p&gt;In the example above, removing a declaration of &lt;code&gt;a:link { display: block; }&lt;/code&gt; rendered the links visible again in IE7. I don&#8217;t know why&#8212;I&#8217;ve used this declaration countless times with no problems&#8212;but nevertheless the declaration wasn&#8217;t necessary &amp;amp; it was causing a big problem.&lt;/p&gt;

&lt;p&gt;Again, though, it&#8217;s the &lt;strong&gt;process&lt;/strong&gt; of stripping away your CSS &amp;amp; then re-implementing your declarations which is the key. It&#8217;s all too easy to add more &amp;amp; more to your declarations, but remember: you may only be making the job of fixing your problems worse.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-04-24:1965</id>
    <published>2008-04-24T20:49:00Z</published>
    <updated>2008-04-25T12:30:50Z</updated>
    <category term="Code"/>
    <category term="Ian"/>
    <category term="Rails"/>
    <category term="continuous-integration"/>
    <category term="git"/>
    <category term="rails"/>
    <link href="http://blog.ardes.com/2008/4/24/continuous-integration-with-garlic" rel="alternate" type="text/html"/>
    <title>Continuous Integration with Garlic</title>
<content type="html">
            &lt;p&gt;So I've been curled up in a ball, riding the git avalanche, trying to sort out my rails plugins - making sure they're getting tested against the latest and greatest.&lt;/p&gt;

&lt;p&gt;Inspired by &lt;a href=&quot;http://rspec.lighthouseapp.com/projects/5645/tickets/387-use-git-instead-of-svn-for-install_dependencies-and-update_dependencies#ticket-387-6&quot;&gt;this ticket for rspec&lt;/a&gt;, git's coolness, some menthol snuff, and a lot of coffee, I came up with &lt;a href=&quot;http://github.com/ianwhite/garlic&quot;&gt;garlic&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It's an extremely lightweight set of rake tasks that let you test your plugins or app against various version of rails, and other dependencies.&lt;/p&gt;

&lt;p&gt;If you want to see it in action (on one of my plugins), do this:&lt;/p&gt;

&lt;pre&gt;
  git clone git://github.com/ianwhite/inherit_views
  cd inherit_views
  rake cruise
&lt;/pre&gt;

&lt;p&gt;Sit back, watch it download all the dependencies, then create rails apps for each set, and run the rcov task for the plugin in each one... (the download only happens the first time you do it).&lt;/p&gt;

&lt;p&gt;You configure it using a little dsl, like this:&lt;/p&gt;

&lt;pre&gt;
garlic do
  # default paths are 'garlic/work', and 'garlic/repos'
  work_path &quot;tmp/work&quot;
  repo_path &quot;tmp/repos&quot;
  
  # repo, give a url, specify :local to use a local repo (faster
  # and will still update from the origin url)
  repo 'rails', :url =&gt; 'git://github.com/rails/rails' #, :local =&gt; &quot;~/dev/vendor/rails&quot;
  repo 'rspec', :url =&gt; 'git://github.com/dchelimsky/rspec'
  repo 'rspec-rails', :url =&gt; 'git://github.com/ianwhite/rspec-rails'
  repo 'inherit_views', :url =&gt; '.'
  
  # for target, default repo is 'rails', default branch is 'master'
  target 'edge'
  target '2.0-stable', :branch =&gt; 'origin/2-0-stable'
  target '2.0.2', :tag =&gt; 'v2.0.2'
  
  all_targets do
    prepare do
      plugin 'rspec'
      plugin 'rspec-rails', :branch =&gt; 'origin/aliased-render-partial' do
        sh &quot;script/generate rspec -f&quot;
      end
      plugin 'inherit_views'
    end
    
    run do
      cd &quot;vendor/plugins/inherit_views&quot; do
        sh &quot;rake spec:rcov:verify&quot;
      end
    end
  end
end
&lt;/pre&gt;

&lt;p&gt;Notice that I'm using my fork of rpsec-rails, and the plugin specifies that it should use a particular branch 'aliased-render-partial'.  The reason for this is that I have some outstanding tickets on rspec, which haven't been resolved.  In the meantime, I can just use my patched version.  If the patch gets accepted, I can just change the url, and garlic will inform me that I need to remove and run rake garlic:install_repos to get the new one.  This is just making use of the awesomely cool coolness of git.&lt;/p&gt;

&lt;p&gt;Also notice the block passed to the 'rspec-rails' plugin.  This will be executed inside the rails target after the plugin has been installed.  Finally the run block says what should happen for the actual CI.  In this case cding into the plugin and running an rcov task.&lt;/p&gt;

&lt;h3&gt;It's new stuff&lt;/h3&gt;
&lt;p&gt;So it probably has bugs and stuff.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2008-03-18:1611</id>
    <published>2008-03-18T13:30:00Z</published>
    <updated>2008-03-18T14:05:43Z</updated>
    <category term="Frivolity"/>
    <category term="Separated at Birth"/>
    <category term="frivolity"/>
    <category term="neocon-hell"/>
    <link href="http://blog.ardes.com/2008/3/18/neocon-clones" rel="alternate" type="text/html"/>
    <title>Neocon Clone Math!</title>
<content type="html">
            &lt;p&gt;Special &lt;strong&gt;Neoconservative Incompetence Cloning&lt;/strong&gt; edition!&lt;/p&gt;

&lt;div&gt;
  &lt;img src=&quot;http://blog.ardes.com/assets/2008/3/18/08_03_cheney.jpg&quot; height=&quot;292&quot; alt=&quot;Dick Cheney&quot; width=&quot;203&quot; /&gt;
  &lt;p&gt;Soulless, chillingly evil US Veep &lt;em&gt;Dick Cheney&lt;/em&gt; +&lt;/p&gt;
  
  &lt;img src=&quot;http://blog.ardes.com/assets/2008/3/18/08_03_rumsfeld.jpg&quot; height=&quot;170&quot; alt=&quot;Donald Rumsfeld&quot; width=&quot;203&quot; /&gt;
  &lt;p&gt;Formerly (and mysteriously) popular war criminal US Sec&#8217;y of Defense &lt;em&gt;Donald Rumsfeld&lt;/em&gt;,&lt;/p&gt;
  
  &lt;p&gt;-( (hair/2) + (war criminality) ) * ( (avg. human sympathy)/10 ) =&lt;/p&gt;
  
  &lt;img src=&quot;http://blog.ardes.com/assets/2008/3/18/08_03_hank_paulson.jpg&quot; height=&quot;152&quot; alt=&quot;Hank Paulson&quot; width=&quot;203&quot; /&gt;
  &lt;p&gt;Totally on-the-ball Sec&#8217;y of the Treasury &lt;em&gt;Hank Paulson&lt;/em&gt;?&lt;/p&gt;
  
&lt;/div&gt;

&lt;p&gt;Fucking hell, where do they &lt;strong&gt;get&lt;/strong&gt; these people? Aside from a petri dish, that is.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2008-02-28:1453</id>
    <published>2008-02-28T23:33:00Z</published>
    <updated>2008-02-28T23:46:53Z</updated>
    <category term="Frivolity"/>
    <category term="Ray"/>
    <category term="revolting-ads"/>
    <link href="http://blog.ardes.com/2008/2/28/hp-total-goatsecare" rel="alternate" type="text/html"/>
    <title>HP Total GoatseCare</title>
<content type="html">
            &lt;p&gt;So I was reading an article this afternoon &amp;amp; noticed the HP advertisement that appeared right next to it:&lt;/p&gt;

&lt;img src=&quot;http://blog.ardes.com/assets/2008/2/28/totalgoatsecare.png&quot; height=&quot;245&quot; alt=&quot;OMG it's HP Total GoatseCare!&quot; width=&quot;296&quot; /&gt;

&lt;p&gt;And I kept thinking, that&#8217;s &lt;a href=&quot;http://www.google.com/search?ie=UTF-8&amp;amp;amp;oe=UTF-8&amp;amp;amp;domains=boingboing.net&amp;amp;amp;sitesearch=boingboing.net&amp;amp;amp;q=goatse&amp;amp;amp;btnG=Search&quot;&gt;so familiar&#8230;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-02-27:1445</id>
    <published>2008-02-27T10:35:00Z</published>
    <updated>2008-03-06T10:13:00Z</updated>
    <category term="Code"/>
    <category term="Design"/>
    <category term="Ian"/>
    <category term="css"/>
    <category term="dynamic css"/>
    <category term="dynamic resolution"/>
    <category term="javascript"/>
    <category term="particletree"/>
    <category term="prototype"/>
    <link href="http://blog.ardes.com/2008/2/27/dynamic-css-prototype" rel="alternate" type="text/html"/>
    <title>dynamic resolution + prototype</title>
<content type="html">
            &lt;p&gt;You may have heard of the &lt;a href=&quot;http://particletree.com/features/dynamic-resolution-dependent-layouts/&quot;&gt;Dynamic CSS resolution switcher from Particletree&lt;/a&gt;, it's a neat bit of js that allows you to specify different css files depending on the browser resolution.&lt;/p&gt;

&lt;p&gt;We love this script, but we had problems running it with Safari, and we are using &lt;a href=&quot;http://www.prototypejs.org/&quot;&gt;prototype&lt;/a&gt;, so we wanted to make use of its goodness for the browser independent stuff.&lt;/p&gt;

&lt;p&gt;So, if you're already using prototype, the following script achieves the same effect as the original particletree script.  It also uses the &lt;code&gt;dom:ready&lt;/code&gt; event, which fires after the dom is loaded, but before the screen is drawn, so you shouldn't see any 'twitch'.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;In the following example, we have three stylesheets that correspond to browser widths as follows:&lt;/p&gt;

&lt;pre&gt;
  thin      up to 1020
  wide     1021...1400
  widest    above 1400
&lt;/pre&gt;

&lt;p&gt;
  For non js users we want to default to 'wide' (the middle one).  In order for this to work properly, we disable all of the non-default stylesheet links.
&lt;/p&gt;

&lt;h4&gt;In your html&lt;/h4&gt;
&lt;p&gt;In your html you need to link to the three stylesheets, give them each a title attribute, and disable the ones you don't want non-js users to see.&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;link title=&quot;wide&quot; href=&quot;/stylesheets/wide.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;
  &amp;lt;link title=&quot;thin&quot; disabled=&quot;true&quot; href=&quot;/stylesheets/thin.css&quot; rel=&quot;stylesheet&quot;  type=&quot;text/css&quot; /&amp;gt;
  &amp;lt;link title=&quot;widest&quot; disabled=&quot;true&quot; href=&quot;/stylesheets/widest.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;
&lt;/pre&gt;

&lt;p&gt;And link to the script, we'll call it dynamic_css.js&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;script src=&quot;/javascripts/dynamic_css.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;

&lt;h4&gt;The script&lt;/h4&gt;
&lt;p&gt;This is the script, it uses the title attribute of the stylesheets to disable or enable them.  It is run when the dom is ready, and when the browser width changes.&lt;/p&gt;

&lt;pre&gt;
// DYNAMIC RESOLUTION SWITCHER
// Originally from ParticleTree
// Simplified with Prototype by Ian White of Argument from Design 2008
// include prototype.js (&gt;=1.6) before this file

// you need to edit this function as per your situation
function applyDynamicLayout() {
  var width = document.viewport.getWidth();
  if (width &amp;lt;= 1020 )                 { applyStylesheet(&quot;thin&quot;) }
  if (width &gt; 1020 &amp;&amp; width &amp;lt;= 1400)  { applyStylesheet(&quot;wide&quot;) }
  if (width &gt; 1400)                   { applyStylesheet(&quot;widest&quot;) }
}

// you shouldn't need to edit past here
function applyStylesheet(title) {
  var i, stylesheet;
  for(i=0; (stylesheet = document.getElementsByTagName(&quot;link&quot;)[i]); i++) {
    // is it a stylesheet with a title attribute?
    if(stylesheet.getAttribute(&quot;rel&quot;).indexOf(&quot;style&quot;) != -1 &amp;&amp; stylesheet.getAttribute(&quot;title&quot;)) {
      stylesheet.disabled = true;
      if (stylesheet.getAttribute(&quot;title&quot;) == title) {
        stylesheet.disabled = false;
      }
    }
  }
}

//Run applyDynamicLayout function when window is ready and when it resizes.
Event.observe(document, 'dom:ready', applyDynamicLayout);
Event.observe(window, 'resize', applyDynamicLayout);
&lt;/pre&gt;

&lt;h4&gt;That's it!&lt;/h4&gt;
&lt;p&gt;That's it, it works for us in Safari, Opera, FF and IE 6 or greater.&lt;/p&gt;

&lt;p&gt;Also, you can have as many stylesheet links as you like with the same title.  For example, let's say you have some IE6 specific kludges for the 'thin' layout.  You would do this:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;
  &amp;lt;link title=&quot;thin&quot; disabled=&quot;true&quot; href=&quot;/stylesheets/thinie6.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;
&amp;lt;![endif]--&amp;gt;
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-02-26:1440</id>
    <published>2008-02-26T18:43:00Z</published>
    <updated>2008-02-27T10:36:52Z</updated>
    <category term="ArDes Plugins"/>
    <category term="Ian"/>
    <category term="Rails"/>
    <category term="resources_controller"/>
    <link href="http://blog.ardes.com/2008/2/26/resources_controller-new-trunk" rel="alternate" type="text/html"/>
    <title>resources_controller new trunk</title>
<content type="html">
            &lt;p&gt;There's going to be some new features coming in resources_controller.  Stay tuned...&lt;/p&gt;

&lt;p&gt;Meanwhile, rc has got a new repository location (the old one will still work for a while, but will remain at the current version):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;trunk:&lt;/strong&gt;
&lt;a href=&quot;http://svn.ardes.com/resources_controller/trunk/resources_controller&quot;&gt;
http://svn.ardes.com/resources_controller/trunk/resources_controller
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tag 0.5:&lt;/strong&gt;
&lt;a href=&quot;http://svn.ardes.com/resources_controller/tags/0.5/resources_controller&quot;&gt;
http://svn.ardes.com/resources_controller/tags/0.5/resources_controller
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those interested in providing patches, you should checkout &lt;a href=&quot;http://svn.ardes.com/resources_controller/trunk&quot;&gt;http://svn.ardes.com/resources_controller/trunk&lt;/a&gt; and run &lt;code&gt;rake pre_commit&lt;/code&gt; in that directory to check your changes.  Then send a diff along, or post it on the &lt;a href=&quot;http://groups.google.com/group/resources_controller&quot;&gt;google group&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ian White</name>
    </author>
    <id>tag:blog.ardes.com,2008-02-12:1374</id>
    <published>2008-02-12T15:03:00Z</published>
    <updated>2008-02-27T10:50:58Z</updated>
    <category term="Code"/>
    <category term="Ian"/>
    <category term="code"/>
    <category term="golf"/>
    <category term="ruby"/>
    <link href="http://blog.ardes.com/2008/2/12/ruby-muckin" rel="alternate" type="text/html"/>
    <title>Ruby muckin</title>
<content type="html">
            &lt;p&gt;So I was writing a Rakefile and found myself doing stuff like this:&lt;/p&gt;

&lt;pre&gt;
  cmd = &quot;svn co #{src} #{dest}&quot;
  puts cmd
  system cmd
&lt;/pre&gt;

&lt;p&gt;Everytime I wrote lines like this, a little corner of my heart died.&lt;/p&gt;

&lt;p&gt;I dreamt of something like this:&lt;/p&gt;

&lt;pre&gt;
  &quot;svn co #{src} #{dest}&quot;.to :puts, :system
&lt;/pre&gt;

&lt;p&gt;But it's &lt;strong&gt;hard&lt;/strong&gt; to do this properly, because you need to get hold of the receiver (in the above case main, or some Rake task) or binding, so that the methods can be sent where they ought.  With crippled Kernel#caller, the &lt;a href=&quot;http://eigenclass.org/hiki/breakpoint+breaking+in+1.8.5&quot;&gt;the demise of Binding.of_caller&lt;/a&gt; (&lt;a href=&quot;http://www.datanoise.com/articles/2006/8/26/breakpoint-extension-breakage&quot;&gt;Ruby-debug solved the problem&lt;/a&gt; but there's significant overhead) it was looking like I should just wait for the next ruby release.&lt;/p&gt;

&lt;p&gt;But I frowned like Hiro and came up with this:&lt;/p&gt;

&lt;pre&gt;
  pass(&quot;svn co #{src} #{dest}&quot;).to :puts, :system
&lt;/pre&gt;

&lt;p&gt;Briefly, Object gets #pass which creates a PassProxy (basic object).  It keeps hold of the receiver, but acts like the object (in this case the string).  When you send #to(:method) to this PassProxy, it calls the original receiver with the object.&lt;/p&gt;

&lt;p&gt;This is just sugar, but its nice sugar in some cases.  Compare:&lt;/p&gt;

&lt;pre&gt;
   # plain ruby
   msg = &quot;oooh!&quot;
   MyObj.foo msg
   MyObj.far msg
   MyObj.faz msg
   msg
   # =&amp;gt; 'oooh!'
   

   # returning (ActiveSupport)
   returning &quot;oooh!&quot; do |s|
     MyObj.foo s
     MyObj.far s
     MyObj.faz s
   end
   # =&amp;gt; 'oooh!'

   # (pass) (this code)
   MyObj.pass(&quot;oooh!&quot;).to :foo, :far, :faz
   # =&amp;gt; 'oooh!'
&lt;/pre&gt;

&lt;p&gt;But eat too much sugar and your teeth will fall out: I realised that this probably has limited usefulness (how often do you need to send the same object to a bunch of different methods?).  But at least I learned some things in that last couple of hours of coding.&lt;/p&gt;

&lt;p&gt;Go get the code from &lt;a href=&quot;http://pastie.caboo.se/150866&quot;&gt;pastie&lt;/a&gt; if you're interested.&lt;/p&gt;

&lt;p&gt;Thanks for reading&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2007-12-01:1149</id>
    <published>2007-12-01T10:39:00Z</published>
    <updated>2007-12-01T10:52:13Z</updated>
    <category term="Code"/>
    <category term="Design"/>
    <category term="Ray"/>
    <category term="24ways07"/>
    <category term="alpha transparency"/>
    <category term="drewmclellan"/>
    <category term="ie6"/>
    <category term="png"/>
    <link href="http://blog.ardes.com/2007/12/1/a-great-start-to-24-ways-2007" rel="alternate" type="text/html"/>
    <title>A great start to 24 Ways 2007</title>
<content type="html">
            &lt;p&gt;Since 2005, &lt;a href=&quot;http://24ways.org/&quot;&gt;24 Ways&lt;/a&gt; has been a great collection of web design tips &amp;amp; tricks in an &#8220;advent&#8221; format (i.e., one article per day in December before Christmas). This year already looks like it&#8217;s going to be a great one. Drew McLellan has a great opening article on dealing with &lt;a href=&quot;http://24ways.org/2007/supersleight-transparent-png-in-ie6&quot;&gt;transparent PNGs in Internet Explorer 6 &amp;amp; 5.5&lt;/a&gt; (yes, many of us do have to factor in those old browsers in our designs).&lt;/p&gt;

&lt;p&gt;This comes at a great time: currently we&#8217;re working on a site that uses 24-bit PNGs with alpha transparency, and as Drew says, the common solutions to the issue don&#8217;t help you when you want to use that type of PNG as a background image. He also mentions that it&#8217;s a big problem to use such PNGs behind a form&#8212;because of the way IE6 &amp;amp; earlier deals with the PNGs. IE effectively puts another layer on top of the area you&#8217;re looking at&#8212;meaning that &lt;code&gt;form&lt;/code&gt; inputs are completely inaccessible. This is a problem not simply for forms, but indeed potentially for &lt;strong&gt;any&lt;/strong&gt; design where you&#8217;re playing with positioning. For example, we&#8217;ve got an organisation&#8217;s logo dipping slightly below a masthead, spilling onto the crumbs bar below. Any links that happen to be in that PNG&#8217;s area were completely inaccessible, too. Our solution was to set &lt;code&gt;z-index&lt;/code&gt; for both the &lt;code&gt;#masthead img&lt;/code&gt; &amp;amp; &lt;code&gt;#crumbs&lt;/code&gt;. Drew&#8217;s solution is better, however&#8212;it&#8217;s far more set &amp;amp; forget.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2007-11-30:1148</id>
    <published>2007-11-30T11:37:00Z</published>
    <updated>2007-11-30T11:43:41Z</updated>
    <category term="Frivolity"/>
    <category term="Ray"/>
    <category term="nativity"/>
    <link href="http://blog.ardes.com/2007/11/30/the-12-days-of-kitschmas" rel="alternate" type="text/html"/>
    <title>The 12 Days of Kitschmas</title>
<content type="html">
            &lt;p&gt;'Tis the season&#8212;to get ready for fabulous gift-giving, of course. From the &lt;a href=&quot;http://www.shipoffools.com/kitschmas/&quot;&gt;Ship of Fools&lt;/a&gt;, here&#8217;s the Walled Nativity Set:&lt;/p&gt;

&lt;img src=&quot;/assets/2007/11/30/kitschmas_nativity_set.jpg&quot; height=&quot;300&quot; alt=&quot;Walled Nativity Set&quot; width=&quot;400&quot; /&gt;

&lt;p&gt;Thank you, Dan Sack, for the &lt;em&gt;best Christmas ever&lt;/em&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2007-11-24:1142</id>
    <published>2007-11-24T20:18:00Z</published>
    <updated>2007-11-24T20:22:41Z</updated>
    <category term="Frivolity"/>
    <category term="Ray"/>
    <category term="music"/>
    <category term="satire"/>
    <link href="http://blog.ardes.com/2007/11/24/wedding-band" rel="alternate" type="text/html"/>
    <title>It's so hard to find a wedding band that really speaks to our love, darling</title>
<content type="html">
            &lt;div&gt;
  &amp;lt;object height=&quot;355&quot; width=&quot;425&quot;&gt;&amp;lt;param&gt;&amp;lt;/param&gt;&amp;lt;param&gt;&amp;lt;/param&gt;&amp;lt;embed src=&quot;http://www.youtube.com/v/r7oCDbDebDA&amp;amp;amp;rel=1&quot; height=&quot;355&quot; width=&quot;425&quot;&gt;&amp;lt;/embed&gt;&amp;lt;/object&gt;
&lt;/div&gt;

&lt;p&gt;This video seems to illustrate something that was mentioned briefly in the last episode of BBC Three&#8217;s &lt;a href=&quot;http://www.bbc.co.uk/bbcthree/programmes/singing/episode6.shtml&quot; title=&quot;Fallen Angels vs. Amputated&quot;&gt;Singing with the Enemy&lt;/a&gt;, where the lead singer of death metal group Amputated (and didn&#8217;t he look &lt;strong&gt;exactly&lt;/strong&gt; like a young Murray from &lt;a href=&quot;http://www.hbo.com/conchords/&quot; title=&quot;Awesome show&quot;&gt;Flight of the Conchords&lt;/a&gt;?) mentions that sometimes he makes &#8220;oinking&#8221; sounds while singing. Very metal.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2007-11-23:1139</id>
    <published>2007-11-23T15:06:00Z</published>
    <updated>2007-11-23T15:38:17Z</updated>
    <category term="Design"/>
    <category term="Rails"/>
    <category term="Ray"/>
    <category term="form"/>
    <category term="html"/>
    <category term="rails"/>
    <category term="tidy"/>
    <category term="validity"/>
    <link href="http://blog.ardes.com/2007/11/23/why-i-love-safari-tidy" rel="alternate" type="text/html"/>
    <title>Why I love Safari Tidy</title>
<content type="html">
            &lt;p&gt;Recently I mentioned that I use &lt;a href=&quot;http://zappatic.net/safaritidy/&quot; title=&quot;A lifesaver&quot;&gt;Safari Tidy&lt;/a&gt;&#8212;a plugin for Apple&#8217;s Safari browser. I thought I&#8217;d shed a little light on &lt;strong&gt;why&lt;/strong&gt; I think it&#8217;s so great.&lt;/p&gt;

&lt;p&gt;For years now individuals&#8212;&lt;a href=&quot;http://www.happycog.com/publish/dwws/&quot; title=&quot;A seminal &amp;amp;amp; readable book&quot;&gt;Jeffrey Zeldman&lt;/a&gt; most prominent among them&#8212;have been evangelising the use of standards-based (X)HTML. There are vague reasons for supporting standards, like getting the warm &amp;amp; fuzzies for doing so; there are abstract reasons, such as preparing work properly to be handed over to a successor; but a very real &amp;amp; immediate reason is that you have a very firm basis upon which to work. It&#8217;s all too easy to make mistakes in the semantic properties of HTML, which can yield disastrous rendering results in browsers. And it&#8217;s all too easy to not see the problem until late in your design process.&lt;/p&gt;

&lt;p&gt;Safari Tidy is unobtrusive &amp;amp; always on: you&#8217;ll see that an error has arisen immediately, so you can go fix it. Other implementations of Tidy aren&#8217;t so automatic&#8212;you have to physically check your markup&#8217;s validity, which often means that you &lt;strong&gt;don&#8217;t&lt;/strong&gt; check&#8212;this is what makes Safari Tidy so fantastic.&lt;/p&gt;

&lt;p&gt;I&#8217;ll illustrate with a real-world example (one upon which I&#8217;m currently working, in fact):&lt;/p&gt;

&lt;p&gt;Many out there will be aware of the generating capabilities of Ruby on Rails. A good explanation of this is beyond the scope of this article, but suffice to say you can build the general building-blocks of a web application very quickly, such as setting up a new user in a system. Here&#8217;s a rudimentary example of a ready-built &lt;code&gt;form&lt;/code&gt; (linked to the &lt;code&gt;users&lt;/code&gt; controller). It&#8217;s to be rendered in XHTML:&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;% form_for(@user) do |f| %&amp;gt;

    &amp;lt;p&amp;gt;
      Login:&amp;lt;br /&amp;gt;
      &amp;lt;%= f.text_field :login %&amp;gt;
    &amp;lt;/p&amp;gt;

    &amp;lt;p&amp;gt;
      Email:&amp;lt;br /&amp;gt;
      &amp;lt;%= f.text_field :email %&amp;gt;
    &amp;lt;/p&amp;gt;

    &amp;lt;p&amp;gt;
      Password:&amp;lt;br /&amp;gt;
      &amp;lt;%= f.text_field :password %&amp;gt;
    &amp;lt;/p&amp;gt;

    &amp;lt;p&amp;gt;
      &amp;lt;%= submit_tag %&amp;gt;
    &amp;lt;/p&amp;gt;

  &amp;lt;% end %&amp;gt;
  
&lt;/pre&gt;

&lt;p&gt;The result of all that &lt;code&gt;&amp;lt;%= f.text_field :foo %&amp;gt;&lt;/code&gt; is to create form tags, such as &lt;code&gt;input&lt;/code&gt;. Here&#8217;s what the above gets with the Login example:&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;p&amp;gt;
    Login:&amp;lt;br /&amp;gt;
    &amp;lt;input id=&quot;user_login&quot; name=&quot;user[login]&quot; size=&quot;30&quot; /&amp;gt;
  &amp;lt;/p&amp;gt;
&lt;/pre&gt;

&lt;p&gt;So far, so good. But what if the user hasn&#8217;t filled out a field &amp;amp; you have to display associated errors? Simple in Ruby on Rails. Assuming validation has been set up in your &lt;code&gt;users&lt;/code&gt; controller, just add the following bit in front of your &lt;code&gt;form&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;%= error_messages_for :users %&amp;gt;
&lt;/pre&gt;

&lt;p&gt;With this in place, if your user doesn&#8217;t enter a required field, or enters a required field incorrectly, then Rails will automatically inform the user of what was wrong (in the location of the &lt;code&gt;&amp;lt;%= error_messages_for :users %&amp;gt;&lt;/code&gt;). Moreover, it&#8217;ll wrap the offending field to highlight the user&#8217;s attention to it. It will look like this:&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;p&amp;gt;
    Login:&amp;lt;br /&amp;gt;
    &amp;lt;div class=&quot;fieldWithErrors&quot;&amp;gt;
      &amp;lt;input id=&quot;user_login&quot; name=&quot;user[login]&quot; size=&quot;30&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/p&amp;gt;
&lt;/pre&gt;

&lt;p&gt;And now we have a problem. A &lt;code&gt;div&lt;/code&gt; &lt;strong&gt;can contain&lt;/strong&gt; a &lt;code&gt;p&lt;/code&gt;, but &lt;strong&gt;cannot&lt;/strong&gt; be contained within it. This is where Safari Tidy comes in &lt;strong&gt;really&lt;/strong&gt; handy. When you test your error message (as above) by viewing it in Safari, Safari Tidy will inform you of an error in your markup. The error it makes is somewhat cryptic:&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;p&amp;gt;
    Login:&amp;lt;br /&amp;gt; 
    &amp;lt;div class=&quot;fieldWithErrors&quot;&amp;gt;
      &amp;lt;input id=&quot;user_login&quot; name=&quot;user[login]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/p&amp;gt;
  -----
  Line 85  Warning: inserting implicit &amp;lt;p&amp;gt;
  Line 89  Warning: trimming empty  &amp;lt;p&amp;gt;
&lt;/pre&gt;

&lt;p&gt;What&#8217;s going on here? Since a &lt;code&gt;p&lt;/code&gt; can&#8217;t contain a &lt;code&gt;div&lt;/code&gt;, Tidy thinks you&#8217;ve not closed your &lt;code&gt;p&lt;/code&gt; tag before you started your &lt;code&gt;div&lt;/code&gt;. In addition, it thinks you haven&#8217;t &lt;strong&gt;opened&lt;/strong&gt; your &lt;code&gt;p&lt;/code&gt; &lt;strong&gt;after&lt;/strong&gt; you&#8217;ve closed your &lt;code&gt;div&lt;/code&gt; tag. Certainly, knowing your XHTML helps in this situation, since the error it throws is otherwise cryptic; but Tidy gives the clue where to find the error. On a form with a lots of fields, this is really helpful.&lt;/p&gt;

&lt;p&gt;Safari Tidy helped me note there was a problem before I even realised that there &lt;strong&gt;was&lt;/strong&gt; a problem&#8212;and there really was, the error screwed up my pretty design horribly.&lt;/p&gt; 

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; What a wally&#8212;I got so wrapped up in Safari Tidy that I didn&#8217;t explain how to &lt;strong&gt;fix&lt;/strong&gt; the error! There&#8217;s a simple solution: convert your &lt;code&gt;p&lt;/code&gt; tags to &lt;code&gt;div&lt;/code&gt;s throughout. I don&#8217;t know why Rails screws this up in the first place&#8212;Rails seems to have been designed pretty well &amp;amp; this is a glaring oversight. It&#8217;s really bothersome to have to fix every automatically-generated form.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.ardes.com/">
    <author>
      <name>Ray Drainville</name>
    </author>
    <id>tag:blog.ardes.com,2007-11-21:1136</id>
    <published>2007-11-21T17:57:00Z</published>
    <updated>2007-12-20T15:43:56Z</updated>
    <category term="Ray"/>
    <category term="personal"/>
    <link href="http://blog.ardes.com/2007/11/21/craig-allen" rel="alternate" type="text/html"/>
    <title>Craig Allen, R.I.P.</title>
<content type="html">
            &lt;p&gt;A business blog may not be the best forum for this, but I don&#8217;t have another outlet.&lt;/p&gt;

&lt;p&gt;A dear friend from my days at &lt;a href=&quot;http://www.ncf.edu/&quot;&gt;New College&lt;/a&gt;, Craig Allen, died on Saturday, 17 November 2007. There will not be a funeral, at the behest of his family.&lt;/p&gt;

&lt;p&gt;Craig was an extraordinarily gifted individual, painfully intelligent with an incredibly caustic wit&#8212;best when turned on someone else. He greatly enjoyed music &amp;amp; movies, but his dearest loves were his two children, whom he idolised.&lt;/p&gt;

&lt;p&gt;He worked as a lawyer for the National Science Foundation investigating fraud &amp;amp; criminal activity. While working there he developed two rare illnesses, neurosarcoidosis &amp;amp; pulmonary sarcoidosis. The struggle against these put an intolerable strain on him &amp;amp; his marriage, more so because he was inaccurately diagnosed for a considerable period of time. While fighting the pain of these illnesses, he became addicted to a cocktail of drugs.&lt;/p&gt;

&lt;p&gt;He was fighting his addiction &amp;amp; was trying to pick up the pieces of his life in Florida when he lost his battle. My last message from him was written the day before he died. He was upbeat, more so than I have heard in a long time.&lt;/p&gt;

&lt;p&gt;He leaves behind his two children, Gabriel &amp;amp; Jackson. He was 37 years old. He was a dear friend.&lt;/p&gt;

&lt;div&gt;
  &lt;img src=&quot;http://www.ardes.com/images/blog/allen_craig.jpg&quot; height=&quot;248&quot; alt=&quot;Craig Allen&quot; width=&quot;350&quot; /&gt;
  &lt;p&gt;Craig Allen (right), in happier days&lt;/p&gt;
&lt;/div&gt;
          </content>  </entry>
</feed>
