<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>High Altitude Hacking</title>
	<atom:link href="http://highaltitudehacking.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://highaltitudehacking.wordpress.com</link>
	<description>Rocky Mountain Rails</description>
	<lastBuildDate>Tue, 17 May 2011 21:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='highaltitudehacking.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>High Altitude Hacking</title>
		<link>http://highaltitudehacking.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://highaltitudehacking.wordpress.com/osd.xml" title="High Altitude Hacking" />
	<atom:link rel='hub' href='http://highaltitudehacking.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Not giving money to Microsoft</title>
		<link>http://highaltitudehacking.wordpress.com/2010/01/22/not-giving-money-to-microsoft/</link>
		<comments>http://highaltitudehacking.wordpress.com/2010/01/22/not-giving-money-to-microsoft/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 17:40:14 +0000</pubDate>
		<dc:creator>Jon Christensen</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browser testing]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[SDRuby]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=130</guid>
		<description><![CDATA[Last week I had a great email conversation with the San Diego Ruby Users Group (SDRuby).  I told them &#8220;I&#8217;m on a mac. I have parallels, but no windows license. I need to test stuff in IE and don&#8217;t want to buy Windows. I have absolutely no other reason to use Windows than occasionally testing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=130&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I had a great email conversation with the San Diego Ruby Users Group (SDRuby).  I told them &#8220;I&#8217;m on a mac. I have parallels, but no windows license. I need to test stuff in IE and don&#8217;t want to buy Windows. I have absolutely no other reason to use Windows than occasionally testing stuff on IE, thus the full cost of a windows 7 license just isn&#8217;t justifiable.&#8221;</p>
<p>The response from the group was incredible. It was obvious that this is a pain point for many of us who have turned our backs on Ballmer.</p>
<p>I got seven suggestions. Here&#8217;s a breakdown of each followed by my conclusions:<span id="more-130"></span></p>
<p>1) Thiago suggested installing wine and then installing standalone IE or IETester.</p>
<blockquote><p><strong>HAH Results:</strong> I wish I could trust IE running on Wine, but I can&#8217;t. I got IE 7 working on my machine, and it was super unstable, and it looked very different as an app than it does on PCs. There could be some value in using it for initial testing, but then I feel like you&#8217;d have to still find a real PC and test again.</p></blockquote>
<p>2) Nick mentioned, &#8220;Perhaps Litmus would suffice?&#8221;</p>
<blockquote><p><strong>HAH Results:</strong> Works great if things are mostly already working and you&#8217;re going for a huge set of browsers. It will show you screenshots of what pages look like on up to 24 different browsers. Unfortunately, it has no interactivity, so you can&#8217;t get to a dynamically created page, and you also can&#8217;t &#8216;play&#8217; by tweaking html/css/javascript on a particular browser until it works.</p></blockquote>
<p>3) Edward tossed out the idea of using some images Microsoft makes available with different versions of IE on each (<a href="http://www.russellheimlich.com/blog/walkthrough-setup-multiple-ie-virtual-machines-on-a-mac/" target="_blank">http://www.russellheimlich.com/blog/walkthrough-setup-multiple-ie-virtual-machines-on-a-mac/</a>)</p>
<blockquote><p><strong>HAH Results:</strong> If you read the last couple of comments on the referenced blog, you&#8217;ll see that these are now encumbered with license requirements if you try and convert them from VPC to something that a Mac can run.</p></blockquote>
<p>4) Guyren had a promising-looking suggestion called ie4osx (which appears now to be WineBottler) at <a href="http://kronenberg.org/" target="_blank">http://kronenberg.org/</a></p>
<blockquote><p><strong>HAH Results:</strong> This is the wine solution in a nice binary installaion package for osx. Same problems as mentioned in number 1.</p></blockquote>
<p>5) James came through with a fantastic option: Use an Amazon EC2 instance whenever you need it.</p>
<blockquote><p><strong>HAH Results:</strong> This is legit and it works. Great solution. Cost is about $0.12/hr. No problems there. It speaks directly to my complaint that it&#8217;s not worth a the full license cost of Windows for just one app every once in a while.</p></blockquote>
<p>6) Thibaut said that those Microsoft VPC images might be runnable via VirtualBox. (VirtualBox is a free competitor to Parallels from SUn Microsystems.</p>
<blockquote><p><strong>HAH Results:</strong> Looks like a great way to avoid paying for a Parallels license. However, we run into the same problem with the Microsoft VPC issues discussed in number 3.</p></blockquote>
<p>7) Finally Zach dug up a neat new product from Adobe called BrowserLab: <a href="https://browserlab.adobe.com/index.html" target="_blank">https://browserlab.adobe.com/index.html</a></p>
<blockquote><p><strong>HAH Results:</strong> This offers the same core functionality as Litmus with a few extra bells and whistles. You still run into the issue of not being able to look deep into ajaxy sites and not being able to do real time &#8216;poking around&#8217;.</p></blockquote>
<p>With all these great suggestions, I was surprised to find only three real options for my particular needs. Here are my conclusions:</p>
<ul>
<li>Borrow someone&#8217;s PC for a while</li>
<li>Use Amazon to remote into a pc (to be fair there are probably a bunch of other remoting services)</li>
<li>Find someone that has an old copy of one of those VPCs that came from microsoft before they became license encumbered.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=130&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2010/01/22/not-giving-money-to-microsoft/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06a274faf34f9e7557d54ff94793b0ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jon Christensen</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails Reservation Calendar plugin</title>
		<link>http://highaltitudehacking.wordpress.com/2010/01/11/reservation_calendar_rails_plugin/</link>
		<comments>http://highaltitudehacking.wordpress.com/2010/01/11/reservation_calendar_rails_plugin/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 21:29:41 +0000</pubDate>
		<dc:creator>Mike Gehard</dc:creator>
				<category><![CDATA[Rails plugin]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[dates]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[reservation]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=122</guid>
		<description><![CDATA[As Jon mentioned in the last blog posting, we&#8217;ve been hard at work on a couple of projects and I am happy to announce the unveiling of our reservation calendar plugin for Ruby on Rails.  It can be found here: http://github.com/broughten/reservation_calendar. An example of what it looks like in our other &#8220;secret&#8221; project: This plugin builds [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=122&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As Jon mentioned in the last blog posting, we&#8217;ve been hard at work on a couple of projects and I am happy to announce the unveiling of our reservation calendar plugin for Ruby on Rails.  It can be found here: <a href="http://github.com/broughten/reservation_calendar" target="_blank">http://github.com/broughten/reservation_calendar</a>.</p>
<p>An example of what it looks like in our other &#8220;secret&#8221; project:</p>
<p><a href="http://highaltitudehacking.files.wordpress.com/2010/01/slide1.jpg"><img class="alignnone size-medium wp-image-126" title="Calendar Plugin Example" src="http://highaltitudehacking.files.wordpress.com/2010/01/slide1.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a></p>
<p>This plugin builds on the ideas and HTML generation outlined in <a href="http://dev.elevationblog.com/2009/07/23/event-calendar-rails-plugin/" target="_blank">http://dev.elevationblog.com/2009/07/23/event-calendar-rails-plugin/</a> but differs in the underlying model(s) that drive the plugin.  The original plugin used one model that had a start and end date on the model in question.  This modeling did not allow for breaks between the start and end date.  Our new plugin revises this idea and uses two models to hold the data: a parent model that represents a reservation (instead of an event) and a child model that represents one of possibly many, non-contiguous dates for this reservation.</p>
<p>If you want to get up and running quickly, you can check out the test application that we&#8217;ve put together <a href="http://github.com/broughten/reservation_calendar_test_app" target="_blank">http://github.com/broughten/reservation_calendar_test_app</a> to see how all of the moving parts work together.</p>
<p>Mike</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=122&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2010/01/11/reservation_calendar_rails_plugin/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad7d31950ff470cae3a026a776f9a40c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2010/01/slide1.jpg?w=300" medium="image">
			<media:title type="html">Calendar Plugin Example</media:title>
		</media:content>
	</item>
		<item>
		<title>Hang tight! Things are coming soon&#8230;</title>
		<link>http://highaltitudehacking.wordpress.com/2010/01/09/hang-tight-things-are-coming-soon/</link>
		<comments>http://highaltitudehacking.wordpress.com/2010/01/09/hang-tight-things-are-coming-soon/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 19:06:51 +0000</pubDate>
		<dc:creator>Jon Christensen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=117</guid>
		<description><![CDATA[We haven&#8217;t written much in the past few weeks for two reasons: The holidays. So much eating so little time. Mike and I have been working our asses off on two things that will be announced very shortly. One is an open source project for the Rails community and the other is a for profit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=117&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We haven&#8217;t written much in the past few weeks for two reasons:</p>
<ol>
<li>The holidays. So much eating so little time.</li>
<li>Mike and I have been working our asses off on two things that will be announced very shortly. One is an open source project for the Rails community and the other is a for profit business for surf travel. Both will see the light of day before the end of January!</li>
</ol>
<p>Hang tight&#8230;.<br />
&#8211;Jon</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=117&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2010/01/09/hang-tight-things-are-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06a274faf34f9e7557d54ff94793b0ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jon Christensen</media:title>
		</media:content>
	</item>
		<item>
		<title>Chosing the Right Design Bandwagon</title>
		<link>http://highaltitudehacking.wordpress.com/2009/12/15/chosing-the-right-design-bandwagon/</link>
		<comments>http://highaltitudehacking.wordpress.com/2009/12/15/chosing-the-right-design-bandwagon/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 17:49:32 +0000</pubDate>
		<dc:creator>Jon Christensen</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[surfing]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=67</guid>
		<description><![CDATA[I nearly made a fatal web design mistake. It could have cost my company it&#8217;s future. Why? I almost hopped on the wrong design bandwagon and created a website that wouldn&#8217;t have resonated with my users. Design bandwagons, more politely called &#8216;design trends&#8217; are a very good thing. They make it so that you don&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=67&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I nearly made a fatal web design mistake. It could have cost my company it&#8217;s future. Why? I almost hopped on the wrong design bandwagon and created a website that wouldn&#8217;t have resonated with my users.</p>
<p><span id="more-67"></span>Design bandwagons, more politely called &#8216;design trends&#8217; are a very good thing. They make it so that you don&#8217;t have to reinvent the wheel for every new website you make. You can just look at some good examples of what you want and extrapolate.</p>
<p>But the moral of this story is be careful when you do this&#8230;</p>
<p>As I got ready to build my surf travel website, I thought about the websites I visit often that I like. I like the new design bandwagon that I&#8217;m not sure how to name. It&#8217;s the Ruby on Rails, big button, rounded box, san-serif, low intensity colors, and clean drawn images thing that has been going on in lots of new websites lately.  Some examples? Vimeo.com, Twitter.com, Shopify.com</p>
<table>
<tr>
<td>
<div id="attachment_69" class="wp-caption aligncenter" style="width: 246px"><a href="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-36-10-am.png"><img class="size-medium wp-image-69 " title="Vimeo" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-36-10-am.png?w=236&#038;h=300" alt="Vimeo" width="236" height="300" /></a><p class="wp-caption-text">The Vimeo WebsiteShopify</p></div>
    </td>
<td>
<div id="attachment_68" class="wp-caption aligncenter" style="width: 257px"><img class="size-medium wp-image-68 " title="Shopify" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-35-15-am.png?w=247&#038;h=300" alt="Shopify" width="247" height="300" /><p class="wp-caption-text">The Shopify Website</p></div>
    </td>
</tr>
</table>
<p>So when I set out to create a surf travel website, I went straight to a few of my favorite websites and started &#8216;paraphrasing&#8217; their designs. The result was something I thought looked pretty sweet. Then a friend saw it and said, &#8220;Well I like it but it doesn&#8217;t look very <em>Surfer</em>.&#8221;</p>
<p>WHAT!!!??? But it looks so web 2 point oh-y and nice and it&#8217;s easy to read, and it follows good design principles and it uses one of my favorite pictures, and &#8230;. &#8230; you know what? You&#8217;re right. It doesn&#8217;t look very surfer.</p>
<p>This is when it hit me. The neato big button rails-y 2.0ey design that I wanted might be fine for a market of tech savvy, possibly hipsterish, late-twenties to mid thirties, internet marketing loving, social media slinging Bay Area or Chicago types, but it&#8217;s <em>not</em> what <em>surfers</em> want.</p>
<p>The new fangled rails/web 2.0ey/big buttoney/low-color-intensity websites may be the culmination of years of industry progress and user research and plain old human intuition on what&#8217;s &#8216;good&#8217;, but they are not surfer!</p>
<p>So I took a look at some surf websites, and sure enough. Those sites have their own &#8216;bandwagon&#8217;.  I&#8217;ll call it electric blue meets black and white with heavy contrast and sharp corners with high exposure ocean and wave imagery thrown in. And every surfer website from magazines to stores to live streams of competitions is squarly within the bandwagon.  Take a look at Surfing Magazine, Transworld Surf Magazine, a contest Website from the Hawaiian Triple Crown, and Billabong:</p>
<table>
<tr>
<td>
<div id="attachment_71" class="wp-caption alignleft" style="width: 260px"><a href="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-39-57-am.png"><img class="size-medium wp-image-71" title="Surfing" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-39-57-am.png?w=250&#038;h=300" alt="Surfing" width="250" height="300" /></a><p class="wp-caption-text">The Surfing Mag Website</p></div>
</td>
<td>
<div id="attachment_73" class="wp-caption alignleft" style="width: 260px"><a href="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-42-44-am.png"><img class="size-medium wp-image-73" title="Reef Hawaiian Pro" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-42-44-am.png?w=250&#038;h=300" alt="Reef Hawaiian Pro" width="250" height="300" /></a><p class="wp-caption-text">The Reef Hawaiian Pro Website</p></div>
</td>
</tr>
<tr>
<td>
<div id="attachment_72" class="wp-caption alignleft" style="width: 260px"><a href="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-40-42-am.png"><img class="size-medium wp-image-72" title="Transworld Surf" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-40-42-am.png?w=250&#038;h=300" alt="Transword Surf" width="250" height="300" /></a><p class="wp-caption-text">The Transword Surf Website</p></div>
</td>
<td>
<div id="attachment_74" class="wp-caption alignleft" style="width: 260px"><a href="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-10-04-53-am.png"><img class="size-medium wp-image-74" title="Billabong" src="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-10-04-53-am.png?w=250&#038;h=300" alt="Billabong" width="250" height="300" /></a><p class="wp-caption-text">The Billabong Website</p></div>
</td>
</tr>
</table>
<p>The proof is overwhelming. These companies have no trouble attracting surfers, and surfers have no problem supporting these companies. If my website was to have any chance of success, I needed to switch design bandwagons.</p>
<p>I think the best piece of advice that my friend gave me regarding choosing the right web design (and therefore jumping on the right bandwagon) was this: Ask yourself whether the webdesign you chose is something that makes you happy or if it&#8217;s something that will make your customers happy. Too often the answer is the former, and it should always be the latter.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=67&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2009/12/15/chosing-the-right-design-bandwagon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06a274faf34f9e7557d54ff94793b0ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jon Christensen</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-36-10-am.png?w=236" medium="image">
			<media:title type="html">Vimeo</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-35-15-am.png?w=247" medium="image">
			<media:title type="html">Shopify</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-39-57-am.png?w=250" medium="image">
			<media:title type="html">Surfing</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-42-44-am.png?w=250" medium="image">
			<media:title type="html">Reef Hawaiian Pro</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-9-40-42-am.png?w=250" medium="image">
			<media:title type="html">Transworld Surf</media:title>
		</media:content>

		<media:content url="http://highaltitudehacking.files.wordpress.com/2009/12/screen-shot-2009-12-15-at-10-04-53-am.png?w=250" medium="image">
			<media:title type="html">Billabong</media:title>
		</media:content>
	</item>
		<item>
		<title>Why do I enjoy working for myself so much?</title>
		<link>http://highaltitudehacking.wordpress.com/2009/12/02/why-do-i-enjoy-working-for-myself-so-much/</link>
		<comments>http://highaltitudehacking.wordpress.com/2009/12/02/why-do-i-enjoy-working-for-myself-so-much/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 21:42:13 +0000</pubDate>
		<dc:creator>Mike Gehard</dc:creator>
				<category><![CDATA[philosophy]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=62</guid>
		<description><![CDATA[While sitting on my meditation cushion this morning this very question crossed my mind.  Like a &#8220;good&#8221; meditator, I  let it roll thought my consciousness and not get too attached to it.  A little while longer here it comes again.  I took this as a sign that it might be time to chew this over [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=62&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While sitting on my meditation cushion this morning this very question crossed my mind.  Like a &#8220;good&#8221; meditator, I  let it roll thought my consciousness and not get too attached to it.  A little while longer here it comes again.  I took this as a sign that it might be time to chew this over so I did.  This blog posting is the result of that analysis.<span id="more-62"></span></p>
<p>A little background is in order here for those new to my world.  I&#8217;ve been doing software/web development for 10+ years now and have worked with many companies, big, small, startup, established and everywhere in between.  One company I even worked at twice, returning after a small stint working remotely for another company that was full of folks from a previous employer.  Everyone that I have worked with at these companies has been a good person; some I got along well with personally and others not so well but that&#8217;s the way it is.  Along this path I have learned many different technologies and methodologies for developing software.</p>
<p>Another part of my life is a study, practice and teaching of the ancient tradition of Yoga.  Yoga has been part of my life for almost as long as technology has been a part of my life.  The yogic path has been just as exciting and event filled as my technology path, filled with many good people, many good schools of yoga and many teachings that have help shape the person I am today.</p>
<p>In September 2008, I decided that it was time for me to strike out on my own as a independent developer and started Samyama Technology Solutions, LLC (<a href="http://www.samyamatech.com" target="_blank">www.samyamatech.com</a>).  My purpose was to allow me work to merge the two parts of my life, to practice applying the teaching of Yoga to the technology world to serve my clients and myself.  I just didn&#8217;t feel like I was able to do that while working within another company because it always seemed like the culture of my employer trumped my desire for that merger, almost like I was swimming upstream in the corporate river.</p>
<p>Here we are just over a year later and I have to say that the answer to the question of &#8220;Why do I enjoy working for myself so much?&#8221; is because the fundamental direction (or dharma for you yogis out there) of my employer and myself are in line.  You might be saying to yourself &#8220;Duh silly since you are your employer and the only way for them to be different would be for you to have a split personality&#8221;.</p>
<p>A couple of months ago I would have thought that working for myself was the only way both my direction and my employers direction would be in line.  In the past couple of months I have been exposed to the Ruby on Rails world (coming from a PHP/.Net world previously) and have found some people/organizations/beliefs that now make me rethink the idea that working for myself is the only way for this alignment to happen.  I now feel that there are companies/people/systems out there that I could work with/for as an employee and still be able to continue my goal of combining the two parts of my world.</p>
<p>No it&#8217;s not those previous companies/people were doing anything wrong.  It&#8217;s just that their way of doing business didn&#8217;t align with the direction that my life was going.  I was spending too much energy trying to &#8220;fit in&#8221; and that was taking a toll on me.  I wish them all the luck in their endeavors and I am sure that many of them will be successful.</p>
<p>Thank you to all of those companies/people who have given me the opportunity to get to where I am today and thank you to all of those &#8220;new&#8221; people who have shown me that some day in the future I may be once again part of a team of people moving in the same direction in a corporate culture.</p>
<p>A big shout out to the folks at 37Signals (<a href="http://www.37signals.com" target="_blank">www.37signals.com</a>) for being so open with their philosophies on business and development/design.  Another big shout out to the whole Ruby on Rails community for being an inspiration and mentor as I begin my journey down the Rails track.  I&#8217;m hooked and look forward to a long, fruitful career doing Rails development.  They have really taken the mantra of &#8220;developer happiness&#8221; from Ruby and made it evident in Rails, both from a code perspective as well as a culture.</p>
<p>I am sure that there are many other folks out are just as inspirational so I ask you to define your direction/dharma as a developer and a person and seek out those that help you become better at both.</p>
<p>Mike (@mikegehard on Twitter)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=62&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2009/12/02/why-do-i-enjoy-working-for-myself-so-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad7d31950ff470cae3a026a776f9a40c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting the right HTML for Rails Nested Model Forms</title>
		<link>http://highaltitudehacking.wordpress.com/2009/11/10/getting-the-right-html-for-rails-nested-model-forms/</link>
		<comments>http://highaltitudehacking.wordpress.com/2009/11/10/getting-the-right-html-for-rails-nested-model-forms/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 04:38:07 +0000</pubDate>
		<dc:creator>Jon Christensen</dc:creator>
				<category><![CDATA[Rails problem solving]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[hidden input]]></category>
		<category><![CDATA[nested model forms]]></category>
		<category><![CDATA[nested models]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=46</guid>
		<description><![CDATA[It turns out that in Rails 2.3.4 it is necessary to provide pairs of hidden input tags for each child you want to delete from your model.  This works because Rails figures out that it must group the two inputs together; one to define the id and the other to signify the delete.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=46&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I had trouble getting Rails&#8217;s Nested Model Forms feature to work for me in exactly the way I wanted.  Two things were working against me: 1) No documentation that shows the complete process for nested models from ERB to HTML, to HTTP parameters, to controller code. and 2) Blogs and suggestions I came up with were close, but didn&#8217;t work.</p>
<p>Since I was using javascript rather than ERB to create the hidden input tags in the HTML, I needed to know exactly how to construct my tags to tell rails what to do with my nested models.<span id="more-46"></span></p>
<p>First a quick definition of Nested Model forms: These are forms where you manage an object and associated child objects within the same form.  For example, you might create a room (such as a hotel room) and it&#8217;s associated bookings in one form.  Another example closer to what I was trying to do is to update a room by adding and removing bookings within a single form.  The official Rails blog discusses it in some detail <a href="http://weblog.rubyonrails.org/2009/1/26/nested-model-forms" target="_blank">here</a>.</p>
<p>So, rather than boring you with everything that didn&#8217;t work, allow me to get right to what works.</p>
<p>When using nested model forms, you can add new child objects to your model by ensuring your html form has properly named input tags.  Each input tag with a rather convoluted name (full of brackets like this: project[task_attributes][]) results in a new child object getting created with the name set to whatever is in the &#8216;value&#8217; attribute of the html tag.</p>
<p>What I found odd is that delete didn&#8217;t seem to work the same way.  It turns out that in Rails 2.3.4 it is necessary to provide pairs of hidden input tags for each child you want to delete from your model.  This works because Rails figures out that it must group the two inputs together; one to define the id and the other to signify the delete.</p>
<p>Like this:</p>
<pre class="brush: xml;">
&lt;input type=&quot;hidden&quot; value=&quot;56&quot; name=&quot;room[bookings_attributes][][id]&quot;/&gt;
&lt;input type=&quot;hidden&quot; value=&quot;1&quot;  name=&quot;room[bookings_attributes][][_delete]&quot;/&gt;
</pre>
<p>This method raises an important concern, though.  Would this start failing if I had multiple children to delete in one server request?  Also what would happen if there was a mix of inserts and deletes?  Further testing showed odd behavior.  The only way I have been able to get this to work is with pairs of hidden inputs as follows:</p>
<pre class="brush: xml;">
&lt;!-- Add a booking --&gt;
&lt;input type=&quot;hidden&quot; name=&quot;room[bookings_attributes][][id]&quot;/&gt;
&lt;input type=&quot;hidden&quot; value=&quot;11/18/2009&quot; name=&quot;room[bookings_attributes][][date]&quot;/&gt;

&lt;!-- Delete a booking --&gt;
&lt;input type=&quot;hidden&quot; value=&quot;15&quot; name=&quot;room[bookings_attributes][][id]&quot;/&gt;
&lt;input type=&quot;hidden&quot; value=&quot;1&quot; name=&quot;room[bookings_attributes][][_delete]&quot;/&gt;

&lt;!-- Delete a booking --&gt;
&lt;input type=&quot;hidden&quot; value=&quot;16&quot; name=&quot;room[bookings_attributes][][id]&quot;/&gt;
&lt;input type=&quot;hidden&quot; value=&quot;1&quot; name=&quot;room[bookings_attributes][][_delete]&quot;/&gt;

&lt;!-- Add a booking --&gt;
&lt;input type=&quot;hidden&quot; name=&quot;room[bookings_attributes][][id]&quot;/&gt;
&lt;input type=&quot;hidden&quot; value=&quot;01/22/2010&quot; name=&quot;room[bookings_attributes][][date]&quot;/&gt;
</pre>
<p>These get translated to parameters as follows:</p>
<div>Parameters:</div>
<div>
<pre class="brush: ruby;">
{&quot;commit&quot;=&gt;&quot;Update Reservation!&quot;,&quot;authenticity_token&quot;=&gt;&quot;blah&quot;,
    &quot;id&quot;=&gt;&quot;1&quot;,
    &quot;room&quot;=&gt; {&quot;bookings_attributes&quot;=&gt;[{&quot;id&quot;=&gt;&quot;&quot;, &quot;date&quot;=&gt;&quot;11/18/2009&quot;},
                                      {&quot;_delete&quot;=&gt;&quot;1&quot;, &quot;id&quot;=&gt;&quot;15&quot;},
                                      {&quot;_delete&quot;=&gt;&quot;1&quot;, &quot;id&quot;=&gt;&quot;16&quot;},
                                      {&quot;id&quot;=&gt;&quot;&quot;, &quot;date&quot;=&gt;&quot;01/22/2010&quot;}
                                     ]
             }
}
</pre>
<p>I think that herein lies the key to why this works this way.  I wish I understood it a little better, but what I&#8217;m able to deduce is that the current implementation of nested attributes needs the child objects to be presented in an array where each element of the array is a hash containing child object attributes and optionally the delete flag.</p>
<p>Given that requirement, there seems to be a limitation on how the input tags are parsed.  The only way to get something on the right side of a &#8216;=&gt;&#8217; in the hashes is to put it in the &#8216;value&#8217;attribute of the html input tag.  For example:</p>
<pre class="brush: xml;">
&lt;input type=&quot;hidden&quot; value=&quot;1&quot; name=&quot;room[bookings_attributes][16][_delete]&quot;/&gt;
</pre>
<p>gets parsed to</p>
<pre class="brush: ruby;">
{&quot;booking_attributes&quot; =&gt; {&quot;16&quot; =&gt; {&quot;_delete&quot; =&gt; &quot;1&quot;}}}
</pre>
<p>The documentation says that should be ok, but Rails doesn&#8217;t actually do the deletion &#8230; nor does it complain.</p>
<p>So that&#8217;s a long and specific story, but it&#8217;s such an odd case and it doesn&#8217;t seem to be deeply explored in blogs and writeups, so I thought I&#8217;d share it with everyone.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=46&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2009/11/10/getting-the-right-html-for-rails-nested-model-forms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06a274faf34f9e7557d54ff94793b0ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jon Christensen</media:title>
		</media:content>
	</item>
		<item>
		<title>What do test first development and dental floss have in common?</title>
		<link>http://highaltitudehacking.wordpress.com/2009/11/03/test-first-development-flossing/</link>
		<comments>http://highaltitudehacking.wordpress.com/2009/11/03/test-first-development-flossing/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 18:54:05 +0000</pubDate>
		<dc:creator>Mike Gehard</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=36</guid>
		<description><![CDATA[Yes I am going to write another blog posting singing the praises of test first development (be it TDD, BDD or whatever DD is cool now).  What will be new is that I&#8217;m going to compare it to something that I avoided doing for almost 36 years on this planet, flossing my teeth regularly. Six [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=36&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yes I am going to write another blog posting singing the praises of test first development (be it TDD, BDD or whatever DD is cool now).  What will be new is that I&#8217;m going to compare it to something that I avoided doing for almost 36 years on this planet, flossing my teeth regularly.</p>
<p><span id="more-36"></span></p>
<p>Six months ago I was told by my dental hygienist that my gums were not doing so well in terms of health.  This made for a somewhat uncomfortable (ok it was downright painful) dental cleaning.  She said that flossing was really the key to keeping my gums healthy, keeping my teeth in my mouth and making visits to the dentist more &#8220;enjoyable&#8221;.  I took it upon myself to help myself by flossing more regularly.  Yes I missed a couple of days but for the most part I flossed every day.  It really only takes 5 minutes at most to do a good job in there&#8230;which you can easily make up by reading 5 less minutes of the Internet (or at least this is how I found the time).  Today&#8217;s cleaning was a breeze compared to last time.  Yes it was still a little uncomfortable but nothing compared to the last time.</p>
<p>So what does this have to do with test first development?  We&#8217;ll just this morning (before the dentist&#8217;s visit) I was in the process of refactoring a bunch of Rails code to add a new object hierarchy for some new requirements.  To make a long story short, my refactoring broke a bunch of code (as one would expect).  Thanks to our suite of existing spec code, I now had a laundry list of tasks that were needed to properly integrate the new code.  After addressing all of them and tweaking some views (we don&#8217;t have view specs but hey nobody is prefect), I fired up the app and it all just worked.  Until I started working on Rails sites, all of that spec code would not have existed.</p>
<p>I couldn&#8217;t imagine what might have happened had we not taken the TFD (test first development) route with this project.  Yes it takes a little more time up front to write the tests (just like flossing) but the next time you have to do some major work in your application (which is regular just like visiting the dentist&#8217;s office)  the experience won&#8217;t be as painful as it could be.</p>
<p>Today&#8217;s experiences with TFD as well as the dentist office have made me a firm believer that both regular TFD and regular flossing makes my life a little easier.  I vow to no longer look at writing tests as wasted time but an investment in pain saved down the road.  I hope that anyone that reads this either starts doing test first development, or maybe even flosses a little more regularly and uses this analogy when preaching the wonders of TFD.</p>
<p>&#8211; Mike Gehard</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=36&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2009/11/03/test-first-development-flossing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ad7d31950ff470cae3a026a776f9a40c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>dynamic has_many association (for lack of a better name)</title>
		<link>http://highaltitudehacking.wordpress.com/2009/10/30/dynamic-has_many-association/</link>
		<comments>http://highaltitudehacking.wordpress.com/2009/10/30/dynamic-has_many-association/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 05:25:58 +0000</pubDate>
		<dc:creator>Jon Christensen</dc:creator>
				<category><![CDATA[Rails problem solving]]></category>
		<category><![CDATA[:has_many]]></category>
		<category><![CDATA[associations]]></category>
		<category><![CDATA[conditions]]></category>
		<category><![CDATA[lazy load]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://highaltitudehacking.wordpress.com/?p=6</guid>
		<description><![CDATA[Technically speaking, I wanted to create collections of child objects on a parent object where the membership of each collection depended on whether the parent and the child shared an attribute in common.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=6&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I had one of those moments in Rails where I knew there must be a really good way to do something, there had to be.  But all I could think of was the brute force way.</p>
<p><strong>Technically speaking</strong>, I wanted to create collections of child objects on a parent object where the membership of each collection depended on whether the parent and the child shared an attribute in common.</p>
<p><strong>In simpler terms</strong>, imagine you have a group blog.  Each post in the blog is written by one of several authors.  A Post belongs to an Author.<span id="more-6"></span></p>
<p>Then imagine that each Post can have many Comments.  Once again a comment belongs to an Author.</p>
<p>Each Post could have many Comments.  Some of the comments will be owned(written) by the same Author as the Post and other Comments will be owned by other Authors.  In your application, you may find it valuable to know the difference, and, moreover, to be able to access each group of comments for each Post as a collection.</p>
<p>I&#8217;m sure there are many working ways to do tis, but here&#8217;s the way I stumbled upon last night and I think it&#8217;s sahweeeet.</p>
<p>First, let&#8217;s look at our Post model before adding these collections:</p>
<pre class="brush: ruby;">&lt;br /&gt;
class Post &amp;lt; ActiveRecord::Base&lt;br /&gt;
  belongs_to :author&lt;br /&gt;
  has_many :comments&lt;br /&gt;
end&lt;br /&gt;
</pre>
<p>And the Comment model:</p>
<pre class="brush: ruby;">&lt;br /&gt;
class Comment &amp;lt; ActiveRecord::Base&lt;br /&gt;
  belongs_to :post&lt;br /&gt;
  belongs_to :author&lt;br /&gt;
end&lt;br /&gt;
</pre>
<p>I won&#8217;t show the Author model.  All that is important about it is that it has an id and that it can own Posts or Comments or both.  Now say I want to actually differentiate between comments created by the Author of the Post and comments created by other Authors, but I don&#8217;t want a separate model for each type of comment.  I just want the one Comment model.  Here&#8217;s what I mean:</p>
<p>For a given Post, I want to access all the Comments that are owned by the same Author that owns the Post.  Let&#8217;s call these AuthorComments,</p>
<p>and</p>
<p>for a given Post, I want to access all the Comments that are owned by someone other than the Author of the Post.  Let&#8217;s call these ReaderComments.</p>
<p>As I mentioned, there are probably several valid ways to do this.  A few that come to mind are 1) Actually having two seperate model classes to do it. 2) Using find by methods on the post. 3) Using named scopes on Comments and retrieving the lists via <strong>@post.comments.byauthor</strong> or <strong>@post.comments.byreader</strong></p>
<p>I chose a road less traveled.  In the name of less code means less to maintain (as long as it&#8217;s readable), I searched high and low for a way to use &#8216;has_many&#8217; to accomplish this job.  I ended up finding it in this other blog posting: <a href="http://www.dweebd.com/ruby/has_many-with-arguments/" target="_blank">http://www.dweebd.com/ruby/has_many-with-arguments/</a> by a guy who&#8217;s name might be Duncan Beever.  He was trying to do something a little different, but the nugget I needed was in there.</p>
<p>Below is the updated Post model with the magic.  These are litterally the only two lines I had to add to achieve the functionality I&#8217;ve been describing:</p>
<pre class="brush: ruby;">&lt;/p&gt;
&lt;p&gt;class Post &amp;lt; ActiveRecord::Base&lt;br /&gt;
belongs_to :author&lt;br /&gt;
has_many :comments&lt;br /&gt;
#note: learned out to create associations below&lt;br /&gt;
#from http://www.dweebd.com/ruby/has_many-with-arguments/&lt;br /&gt;
has_many :author_comments,&lt;br /&gt;
         :class_name=&amp;gt;'Comment',&lt;br /&gt;
         :conditions=&amp;gt; 'author_id != #{author.id}'&lt;/p&gt;
&lt;p&gt;has_many :reader_comments,&lt;br /&gt;
         :class_name=&amp;gt;'Comment',&lt;br /&gt;
         :conditions=&amp;gt;'author_id = #{author.id}'&lt;br /&gt;
end&lt;br /&gt;
</pre>
<p>As Duncan says in his blog, &#8220;But all is not lost!  A poorly-documented feature of the association methods is the lazy evaluation of conditions.&#8221;  The single quotes on the condition clause tell the interpreter to wait to evaluate the contents until it needs to. When the conditions clause is evaluated, the author method will be called on the comment.</p>
<p>When this worked the first time I tested it, I couldn&#8217;t believe it.  So I double checked the SQL generated when accessing the list of AuthorComments for a Post, and this is what I saw:</p>
<pre class="brush: sql;">&lt;/p&gt;
&lt;p&gt;SELECT * FROM &amp;quot;comments&amp;quot; WHERE (&amp;quot;comments&amp;quot;.post_id = 15 AND (author_id = 44))&lt;/p&gt;
&lt;p&gt;</pre>
<p>It&#8217;s getting all the comments that belong to a particular post that shares the same author_id as the comments it&#8217;s getting!  My advice to anyone out there that is looking to try this is to only use this technique if there is no internal difference in behavior between the objects in the two collections.  If the objects within the two lists need to be different in any way other than their name, then they should really have their own model classes.</p>
<p>Thanks for reading.</p>
<p>&#8211;Jon Christensen</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/highaltitudehacking.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/highaltitudehacking.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/highaltitudehacking.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=highaltitudehacking.wordpress.com&amp;blog=10180186&amp;post=6&amp;subd=highaltitudehacking&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://highaltitudehacking.wordpress.com/2009/10/30/dynamic-has_many-association/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06a274faf34f9e7557d54ff94793b0ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jon Christensen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
