<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Joe Stelmach</title>
 <link href="http://joestelmach.com/atom.xml" rel="self"/>
 <link href="http://joestelmach.com/"/>
 <updated>2010-07-22T23:16:20-04:00</updated>
 <id>http://joestelmach.com/</id>
 <author>
   <name>Joe Stelmach</name>
   <email>joestelmach@gmail.com</email>
 </author>

 
   <entry>
     <title>Zenbe Lists + Gizmodo</title>
     <link href="http://joestelmach.com/2010/07/22/Zenbe-Lists-and-Gizmodo.html"/>
     <updated>2010-07-22T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2010/07/22/Zenbe-Lists-and-Gizmodo</id>
     <content type="html">&lt;p&gt;
I've had the pleasure over the last few weeks of rewriting the already awesome &lt;a href=&quot;http://itunes.apple.com/us/app/zenbe-lists/id284448147?mt=8&quot;&gt;Zenbe Lists&lt;/a&gt; iPhone app, and porting it over to the iPad.  
&lt;/p&gt;

&lt;p&gt;
Two days have passed since the inital release, and I'm happy to say that we've received a beyond flattering mention on &lt;a href=&quot;http://gizmodo.com/5594211/our-favorite-todolist-app-zenbe-lists-comes-to-ipad&quot;&gt;Gizmodo&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Thank you Gizmodo!
&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Natty Date Parser</title>
     <link href="http://joestelmach.com/2010/05/28/Natty-Date-Parser.html"/>
     <updated>2010-05-28T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2010/05/28/Natty-Date-Parser</id>
     <content type="html">&lt;p&gt;
It was bound to happen sooner or later &amp;mdash; a new blog post! (only took me 1,207 days.)
&lt;/p&gt;

&lt;p&gt;
Anyways, I'd like to talk a bit about a project I've been working on to extract dates from their natural language representation.  The project is called &lt;a href=&quot;http://natty.joestelmach.com&quot;&gt;natty&lt;/a&gt;, and Ive decided to open source it under an MIT license.
&lt;/p&gt;

&lt;p&gt;
What natty does is attempt to define a formal grammar describing all the crazy ways people refer to dates that are relative (or not) to the current date.  Some typical examples are: &lt;em&gt;monday of next week&lt;/em&gt;, &lt;em&gt;next tuesday&lt;/em&gt;, or &lt;em&gt;the 28th of february at 6pm&lt;/em&gt;.  The casual observer may suggest a series of regular expressions to do the job, but will soon find that the grammar describing such things is far from regular, and tends to be quite ambiguous.
&lt;/p&gt;

&lt;p&gt;
ANTLR fits the bill nicely as we can use syntactic predicates to deal with ambiguities (by enabling infinite lookahead,) and semantic predicates to deal with the parts of our grammar that inch towards context sensitivity.
&lt;/p&gt;

&lt;p&gt;
Defining the grammar is one thing, but actually extracting meaningful information is another.  To solve this, I'm using ANTLR's abstract syntax tree (AST) rewrite rules to build an intermediate representation that defines the date as a generic, tree-like structure.  Once built, this structure can be walked, invoking common date manipulation methods along the way to arrive at the correct date.
&lt;/p&gt;

&lt;p&gt;
This approach has several advantages over a more naive, non-grammar based approach.  The most significant of which is the ability to offload the generation of messy parsing code to a code generator instead of a human.  We still have to deal with a complex grammar specification, but the grammar is infinitely less complex than the generated code, and will prove to be far less brittle when making future changes.
&lt;/p&gt;

&lt;p&gt;
Another significant advantage is the theoretical ease at which the parser can be ported to a new language &amp;mdash; choose a new ANTLR target, implement a few generic date manipulation methods, and call it a day.
&lt;/p&gt;

&lt;p&gt;
More information about the project is available on the &lt;a href=&quot;http://natty.joestelmach.com/&quot;&gt;natty website&lt;/a&gt;, and the source can be found on &lt;a href=&quot;http://github.com/joestelmach/natty&quot;&gt;GitHub&lt;/a&gt;.  Enjoy.
&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Ajax Busy Indicators Part 2</title>
     <link href="http://joestelmach.com/2007/02/06/Ajax-Busy-Indicators-Part-2.html"/>
     <updated>2007-02-06T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2007/02/06/Ajax-Busy-Indicators-Part-2</id>
     <content type="html">&lt;p&gt;
		Just a follow-up to my last &lt;a href=&quot;/2007/01/25/Ajax-Busy-Indicators.html&quot;&gt;post on Ajax busy indicators&lt;/a&gt;, where I described how to implement a single image/callback to indicate the status of all the Ajax requests on your site.  The limitation was that the image had to always be placed in a pre-defined spot on the page, which is less than desirable.  This can be overcome by dynamically changing the position of your image based on which link/button was pressed.  Consider the following javascript:
	&lt;/p&gt;
	&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;function setBusyNextTo(link) {
  linkPosition = Position.cumulativeOffset(link);
  linkDimensions = Element.getDimensions(link);
  imageHeight = Element.getDimensions('busy_img').height;
  x = linkPosition[0] + linkDimensions.width;
  y = linkPosition[1] + (linkDimensions.height / 2) - (imageHeight / 2);
  $('busy_img').style.top = y + &quot;px&quot;;
  $('busy_img').style.left = x + &quot;px&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
You can hook this up to your ajax links (or buttons) using the &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; callback:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;&amp;lt;%= link_to_remote(&quot;Action&quot;, {
  :url   =&amp;gt; {:action =&amp;gt; &quot;ajax_action&quot;},
  :after =&amp;gt; &quot;setBusyNextTo(this)&quot;})%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	This will place the activity indicator directly to the right of the link that was clicked.  The code in my previous post will take care of actually displaying the indicator (via a generic callback.)  Note that this code makes no assumptions as to the physical size of the indicator image - The image will be vertically centered next to the link.  This makes it possible to try out a bunch of different indicators by simply changing the &lt;code class=&quot;noindent&quot;&gt;src&lt;/code&gt; attribute of your indicator's image tag. The vertical positioning will be taken care of, but the horizontal positioning may be a bit trickier.  You will have to make sure that your link or button has enough empty space to the right of it to avoid placing your indicator on top of something.
&lt;/p&gt;
&lt;p&gt;
	This idea can be taken a step further by adding the positioning functionality to our links and buttons unobtrusively (say, in the body's &lt;code class=&quot;noindent&quot;&gt;onload&lt;/code&gt; handler.)  This can be accomplished with the following &lt;em&gt;beautiful&lt;/em&gt; piece of javascript:
&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;$$(&quot;a&quot;).each(function(anchor) {
  anchor.onclick= function() {setBusyNextTo(this)};
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt; 
	Be careful with this method though, as this will only affect those dom elements that were originally created at the last &lt;em&gt;browser&lt;/em&gt; page load (as opposed to the last javascript dom manipulation.)
&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Ajax Busy Indicators</title>
     <link href="http://joestelmach.com/2007/01/25/Ajax-Busy-Indicators.html"/>
     <updated>2007-01-25T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2007/01/25/Ajax-Busy-Indicators</id>
     <content type="html">&lt;p&gt;
If someone told me back in 2002 that animated gifs would one day be popular again, I wouldn't have believed them.  The image of a construction worker shoveling next to a road-block to indicate a site is 'Under Construction' still brings on a feeling of nausea.  However, animated gifs are now proving to be useful and sometimes even &lt;em&gt;necessary&lt;/em&gt; in modern day web apps.  The difference is that now they have some usability characterstics instead of just looking cute. Since Ajax requests are made behind the scenes, the browser itself doesn't offer any form of visual feedback to indicate that a request has been made and a response is pending.  Therefore, we're on our own with letting the user know something is happening and that the application isn't just sitting there being stupid.
&lt;/p&gt;

&lt;p&gt;
So how do we do this?  The easiest way is to place an image on the page and set it's display property to none.  Then when an ajax request occurs, we simply show the image by setting it's display property to 'inline' or 'block', and hide it again once the request has finished. We can actually forget about the css completely by using the prototype Element methods instead.
&lt;/p&gt;

Somewhere in your rhtml:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;&amp;lt;img src=&quot;images/spinner.gif&quot; id=&quot;busy_indicator&quot;
  alt=&quot;busy&quot; style=&quot;display:none&quot; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;%= link_to_remote(&quot;Click Me&quot;, :url =&amp;gt; {:action =&amp;gt; &quot;action_name&quot;},
  :after =&amp;gt; &quot;Element.show('busy_indicator');&quot;,
  :complete =&amp;gt; &quot;Element.hide('busy_indicator');&quot;)%&amp;gt;	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
I'm using the &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; callback in this example, which might generate some confusion.  The &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; callback is invoked after the request has been made and the browser is awaiting a response.  This differs from the &lt;code class=&quot;noindent&quot;&gt;before&lt;/code&gt; callback which is invoked before the request is even attempted.  I guess the jury is still out on this one, but I feel that the &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; callback is more appropriate since it will display the image &lt;em&gt;only&lt;/em&gt; if the request was actually made.  If we use the &lt;code class=&quot;noindent&quot;&gt;before&lt;/code&gt; callback and the request fails for some reason, then the busy indicator will be sitting there spinning and the user will just sit there and wait.  Using the &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; callback will not display the busy indicator in this situation, and the user will most likely click the link again since they see nothing is happening.
&lt;/p&gt;
&lt;p&gt;
In this simple example, we might also have some style rules associated with the image to place it in a well defined position on the page:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#busy_indicator {
  position:absolute;
  top:300px;
  left:100px;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Now, what happens when I have lots of Ajax calls on my page and I'd like the busy indicator to be shown for each one?  Using the solution above would require the very un-DRY-like repetition of the &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;complete&lt;/code&gt; callback code for each &lt;code class=&quot;noindent&quot;&gt;link_to_remote&lt;/code&gt;, &lt;code class=&quot;noindent&quot;&gt;form_remote_tag&lt;/code&gt;, etc.  Luckily, there's an easy solution to extracting this code into a common place.
&lt;/p&gt;
&lt;p&gt;
	The prototype library allows you to register generic callbacks that work across all Ajax requests (those invoked through prototype, ofcourse.)  This makes it painless to show our busy indicator at the proper time.  Add the following to your application.js file:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ajax.Responders.register({
  onCreate: function() {
    if($('busy_indicator') &amp;amp;&amp;amp; Ajax.activeRequestCount&amp;gt;0)
      Element.show('busy_indicator');
  },
  onComplete: function() {
    if($('busy_indicator') &amp;amp;&amp;amp; Ajax.activeRequestCount==0)
      Element.hide('busy_indicator');
    }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Note that we are simply just moving our previously defined &lt;code class=&quot;noindent&quot;&gt;after&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;complete&lt;/code&gt; callback code.  Those callbacks no longer need to be defined in the previous link_to_remote call (or any other Ajaxified link for that matter.)  Also note that the &lt;code class=&quot;noindent&quot;&gt;before&lt;/code&gt; callback described previously is not possible at this level, since &lt;code class=&quot;noindent&quot;&gt;onCreate&lt;/code&gt; is invoked after the request is created, not before.  This code will display our busy indicator as long as there is at least 1 outstanding Ajax request awaiting a response.  This is accomplished by looking at the prototype's &lt;code class=&quot;noindent&quot;&gt;Ajax.activeRequestCount&lt;/code&gt;, which is updated each time an Ajax request is made through prototype (this is actually implemented in the prototype library by registering a callback, just like we're doing here!)
&lt;/p&gt;	
&lt;p&gt;
	So this is a pretty good solution, but the thing I hate about it is the inability to move the busy indicator around on the page.  Sometimes I'd like the indicator to display next to each link or button that I click.  However, I don't want to have an image tag sitting next to &lt;em&gt;every single&lt;/em&gt;  link.  That would suck.  So what can we do here?  One solution would be to still place only a single image tag on the page, but change it's position each time a link is clicked.  We may even be able to take this one step further by walking down our dom and generically inserting an onclick handler to position the indicaotor next to each link/button that we press so we don't have to define the onclick handler ourselves each time a link is added.  Also, I think it may be benificial to insert the image tag into the dom via Javascript, since the busy indicator is useless outside of an Ajax/Javascript context.
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>More on Object Graphs in Active Record</title>
     <link href="http://joestelmach.com/2006/12/30/More-On-Object-Graphs-In-Active-Record.html"/>
     <updated>2006-12-30T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/12/30/More-On-Object-Graphs-In-Active-Record</id>
     <content type="html">&lt;p&gt;As I said in my &lt;a href=&quot;2006/12/29/Persisting-Object-Graphs-With-Active-Record.html&quot;&gt;last post&lt;/a&gt;, I can't help but to think there is a better way to persist object graphs in Rails applications.  The solution I outlined last time seems to stray from the DRY principle (Don't Repeat Yourself,) and just seems to leave a bad taste in my mouth.  Don't you wish there was some way to leverage the meta-programming capabilities of Ruby and Rails to solve this problem in a generic way?  Me too.  Consider the following sketch of a solution:
			&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;def update_object_graph(root_entity, entities_seen = [])
  &lt;span class=&quot;codeComment&quot;&gt;# return if we've processed this entity already&lt;/span&gt;
  return if entities_seen.include?(root_entity)
  entities_seen &amp;lt;&amp;lt; root_entity
  errors = []

  parameter_name = root_entity.class.name.underscore
  # if paramaters are given for the root entity, then we update it
  if params[parameter_name]
    keys = params[parameter_name].keys
    index = keys.index(root_entity.id.to_s)
    root_entity.attributes = params[parameter_name].values[index]
    errors += root_entity.errors.full_messages unless root_entity.save
  end
    
  forward_associations =
    root_entity.class.reflect_on_all_associations -
    root_entity.class.reflect_on_all_associations(:belongs_to)

  forward_associations.each do |association|
    # ignore acts_as_versioned association tables
    next if(/::Version$/ =~ association.class_name)
    raise unless root_entity.respond_to?(association.name)
    # Deal with has_one associations
    if(association.macro == :has_one)
      assoc_entity = root_entity.send(association.name)
      new_errors = update_object_graph(assoc_entity, entities_seen)
      errors = errors + new_errors if new_errors
      # Deal with has_many and habtm associations
    else
      association_entities = root_entity.send(association.name)
      association_entities.each do |assoc_entity|
        new_errors = update_object_graph(assoc_entity, entities_seen)
        errors = errors + new_errors if new_errors
      end
    end
  end
  errors
end
&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
				The idea here is that we first update the current entity with any corresponding values in the parameters hash.  Then we attempt to 
save the entity and collect any errors.  Remember, since the &lt;code class=&quot;noindent&quot;&gt;save&lt;/code&gt; method is called on the actual instance of
the entity in question, it's erorrs collection will be populated and used when rendering the page.  Now things get interesting - we discover the 
associations of the entity, and then use reflection to obtain references to the actual objects that represent those associations.  Now we recursively call &lt;code class=&quot;noindent&quot;&gt;persist_object_graph&lt;/code&gt; on each of these objects.
			&lt;/p&gt;
&lt;p&gt;
	Makes perfect sense right?  Let me first say that this code doesn't actually work: it is just a sketch of a solution and has lots of oversights (no support for 
composed_of aggregations, it makes assumptions about the names of things, etc.)  However, I was hopeful that I could take this idea and run with it.
Unfortunately, this solution hits a brick wall when we back up and take a real close look at the Active Record design pattern.  Can anyone spot the subtle but major flaw here? 
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Persisting Object Graphs With Active Record</title>
     <link href="http://joestelmach.com/2006/12/29/Persisting-Object-Graphs-With-Active-Record.html"/>
     <updated>2006-12-29T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/12/29/Persisting-Object-Graphs-With-Active-Record</id>
     <content type="html">&lt;p&gt;
		If given a choice between simple and complex, Rails will always lean towards the simple (actually, it crashes into the simple side of things.)  Most of the time this is a nice, refreshing change from the J2EE world, whose committee seems to get off on adding complexity into every nook and cranny of the J2EE spec.  However, sometimes there are real complexities in the problems we are trying to solve.  Consider the following domain model:
	&lt;/p&gt;
	&lt;img style=&quot;float:none;&quot; src=&quot;/images/rosemaryDomainModelExample.png&quot; alt=&quot;example domain model&quot; /&gt;
&lt;br /&gt;
&lt;p&gt;
	Now, let's suppose you would like to display the rendered html version of this entire object graph to the user on a single page with only one form.  If you've done any rails development in the past, you're probably thinking &quot;It can't be that bad&quot;.  After all, Rails almost &lt;em&gt;enforces&lt;/em&gt; that you follow domain-driven design, so how hard can it be to satisfy this requirement? &lt;code class=&quot;noindent&quot;&gt;update_attributes&lt;/code&gt; to the rescue!  Take a look at the RDoc:  
&lt;/p&gt;
&lt;div class=&quot;command&quot;&gt;
	Updates all the attributes from the passed-in Hash and saves the record. If the object is invalid, the saving will fail and false will be returned.
&lt;/div&gt;
&lt;p&gt;
	Sounds great right?  But wait - what if the method fails?  Can we still access the error messages as if i called the &lt;code class=&quot;noindent&quot;&gt;save&lt;/code&gt; or &lt;code class=&quot;noindent&quot;&gt;valid?&lt;/code&gt; method directly on each object?  Will the framework know which properties have errors associated with them to insert the proper 'fieldWithError' class names while rendering the response?  Unfortunately, the answer is No.  The &lt;code class=&quot;noindent&quot;&gt;update_attributes&lt;/code&gt; method is therefore worthless to me, and exists as nothing more than an absolute tease.  However, I'm sure the Rails core developers will argue that they were just 'keeping it simple'.  I applaude that.  But I still have to satisfy this requirement that goes against the seemingly conventional Rails wisdom of a single object per page.
&lt;/p&gt;
&lt;p&gt;
	So what options are we left with here?  I could refactor my interface to break the object graph into multiple screens, but that would add lots of complexity to my user interface, which I believe should remain simple at all costs (even if it means adding complexity to the back-end.)  So refactoring the interface is out.  I suppose I could just walk the object graph and populate and save each object directly, collecting any error messages that arise as we make our way to the bottom of the graph.  Populate and save you say?  That's what &lt;code class=&quot;noindent&quot;&gt;update_attributes&lt;/code&gt; is for.  So maybe we can validate each object on our way down, and then use the update_attributes on each object.  Sounds good right?  Wrong again.  &lt;code class=&quot;noindent&quot;&gt;update_attributes&lt;/code&gt; maintains its own transaction, which means that once an object is updated, it cannot be rolled back if another object's validation or save fails.  The entire group of saves needs to be wrapped in a transaction.  It looks like the optimal solution in this case is to use the &lt;code class=&quot;noindent&quot;&gt;attributes=&lt;/code&gt; method to populate the attributes from the parameters hash and the &lt;code class=&quot;noindent&quot;&gt;save&lt;/code&gt; method to do the persisting, all within one transaction.
&lt;/p&gt;
&lt;p&gt;
	This solution will work (and does work for a couple apps I have written.)   However, the complexity of the save operation increases for each entity you add to your domain model (luckily, this seems to be only a linear increase.)  But seriously, I can't help but to think there's a better way to do this...
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Javascript Trivia</title>
     <link href="http://joestelmach.com/2006/12/18/Javascript-Trivia.html"/>
     <updated>2006-12-18T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/12/18/Javascript-Trivia</id>
     <content type="html">&lt;p&gt;
  I guess I should have learned this a long time ago - but when a tiny piece of code kicks my ass this bad, I like to share it with the world :)  How many times do you expect the following Javascript to alert 'hi'?
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function x() {
  for(i=0; i&amp;lt;8; i++) {
    y();
  }
}
function y() {
  for(i=0; i&amp;lt;2; i++) {
    alert('hi');
  }
}
x();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
  The answer - An infinite number of times!  Believe it or not, when the Javascript interpreter comes across a variable without the &lt;em&gt;var&lt;/em&gt; keyword in front of it, it automatically creates a global variable with the given variable name.  Fun stuff. 
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>New Jersey</title>
     <link href="http://joestelmach.com/2006/12/06/New-Jersey.html"/>
     <updated>2006-12-06T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/12/06/New-Jersey</id>
     <content type="html">&lt;p&gt;This has to be the funniest Jersey joke I've heard in a while (From the movie 'Just Friends')&lt;/p&gt;
&lt;blockquote&gt;
  Are you kidding? You're Chris Brander. You're Hollywood; you date models. He's Jersey; he skis in his jeans.
&lt;/blockquote&gt;

</content>
   </entry>
 
   <entry>
     <title>Comment Spam</title>
     <link href="http://joestelmach.com/2006/12/02/Comment-Spam.html"/>
     <updated>2006-12-02T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/12/02/Comment-Spam</id>
     <content type="html">&lt;p&gt;
I hate comment spam.  As if a mailbox full of solicitations to buy cialis soft tabs is not enough, now I have to deal with my blog posts being barraged with comment spam.  What's the solution?  I obviously can't go on accepting all of these spam posts, so what's a guy to do?  Here are some options:
&lt;/p&gt;
&lt;dl&gt;
	&lt;dt&gt;&lt;strong&gt;Captchas&lt;/strong&gt;&lt;/dt&gt;
	&lt;dd&gt;
	You know, the funny looking skewed letters that you have to try and decipher to buy tickets on Ticketmaster.  The idea here is that it will block most spam bots from guessing correctly, yielding a high percentage of human-only comments.  The downside: they are a pain in the ass.  Accessibility issues aside, I just don't like these things - half the time even my &lt;em&gt;human&lt;/em&gt; eyes can't decipher what they say.
	&lt;/dd&gt;

	&lt;dt&gt;&lt;strong&gt;Ajax-only comments&lt;/strong&gt;&lt;/dt&gt;
	&lt;dd&gt;
		The idea here is simple: only accept comment requests that ride in on the Ajax bus.  Apparently, most comment-spam bots are designed to blast your site with regular old-school requests.  For a rails-based web-site (which this is) the implementation would be simple given the availability of the xhr? method on the request object.  However, I have to ask: won't someone figure this out and start writing bot programs that makes Ajax requests?  What about the more obvious problem of eliminating the user's of non-Ajax browsers from posting comments on your site?  Not so much a fan of this solution either.
	&lt;/dd&gt;

	&lt;dt&gt;&lt;strong&gt;No anchors&lt;/strong&gt;&lt;/dt&gt;
	&lt;dd&gt;
		The simplest scheme yet: don't allow anchor tags in your comments.  Since the evil spammers are looking to place links on your page, you should be able to take care of the majority of the problem with this approach.  The problem, however; is that this goes against the founding principles of the web: The ability to link from one page to another.  I think it's great when someone leaves me a link to a site that's relevant to the conversation at hand.  It would be a shame to allow the pillars of the web to falter at the mercy of these evil people writing spam bots.
	&lt;/dd&gt;

	&lt;dt&gt;&lt;strong&gt;Dictionary&lt;/strong&gt;&lt;/dt&gt;
	&lt;dd&gt;
		How many times does a comment &lt;em&gt;truly&lt;/em&gt; need to contain the word 'viagra' (especially in the context of software development.)  Probably never.  The dictionary approach uses this concept to weed out human vs. bot comments by not allowing comments to contain certain words.  Generating this dictionary to get reasonable results would probably not be that hard, but the dictionary would be in constant need of change as new drugs, gambling games, and cures for baldness come about.
	&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;
	The solution I chose?  No anchors.  I know - that last bit about pillars and faltering is quite dramatic, but I just have to beleive that this is the best solution for me right now.  A regular expression based implementation was put into place and seems to be working well so far.  Leave me a comment if you disagree with my position here - just be sure not to leave me a link :)  
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Browser Back Button</title>
     <link href="http://joestelmach.com/2006/10/20/Browser-Back-Button.html"/>
     <updated>2006-10-20T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/10/20/Browser-Back-Button</id>
     <content type="html">&lt;p&gt;
  I have a question.  Why does the browser have to be so stupid about its back button? I realize that http is an overly simple protocol, but I just can't help but to think that we can implement a better back button.  With the advent of sending http requests via ajax, the back, forward, and refresh buttons have gotten to be just about pointless.  This is unfortunate since most people find the back button to be invaluable (try counting how many times you hit it in one day.)
&lt;/p&gt;
&lt;p&gt;
  The problem is that each state in the browser is represented by a complete page load.  So when we go through an entire ajax request/response cycle, the browser is not pushed into the next state.  My question is, why not?  I realize that the browser is properly implementing the http protocol, but I can't help but wonder how much nicer the web would be if we could change this behavior.  I also don't know that it would be that hard.
&lt;/p&gt;
&lt;p&gt;
  Consider the following sequence of events:
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Send an ajax request&lt;/li&gt;
	&lt;li&gt;Receive the response&lt;/li&gt;
	&lt;li&gt;Take a snapshot of the current DOM&lt;/li&gt;
	&lt;li&gt;Manipulate the DOM as intended by the programmer&lt;/li&gt;
	&lt;li&gt;Push the browser into the next state&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
In other words, imagine all of these steps completing, and then the user pressing the back button.  The browser sould reload the DOM exactly as it was represented in steps 1-3.  I realize I'm being an idealist here (I tend to be,) but I can't stop thinking about how cool this would be.  We could make the browser truly event-based instead of page load based by simply caching each snapshot of the DOM on each request/response cycle (ajax or traditional.)
&lt;/p&gt;

&lt;p&gt;
Ofcourse, this idea may not be perfect.  We still have a problem with the URL being the same across multiple events (or 'states'.)  One of the main complaints against using ajax (or even dhtml in general,) is that bookmarking becomes impossible.  But wouldn't it be great if you could bookmark a page after making several ajax requests?  Maybe the browser could actually remember how it got back to the state that was bookmarked by remembering the sequence of events that occured after the last complete page load (I'll admit, this would be hard to implement, especially when we start mixing get and post requests.)  But would it really be impossible.  Do we really need a new protocol to handle this?
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Value Object Aggregation in Rails</title>
     <link href="http://joestelmach.com/2006/09/27/Value-Object-Aggregation-in-Rails.html"/>
     <updated>2006-09-27T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/09/27/Value-Object-Aggregation-in-Rails</id>
     <content type="html">&lt;p&gt;
Aggregation is an important concept that should arguably be applied to any domain of reasonable complexity.  While this statement is certainly open for discussion, I feel that it's important to study what aggregation is and discover the benefits of making a distinction between true &lt;em&gt;Entities&lt;/em&gt; and things that are just &lt;em&gt;Value Objects&lt;/em&gt;.  An &lt;em&gt;Entity&lt;/em&gt; can be defined most simply as something that needs to maintain it's own state, whereas a &lt;em&gt;Value Object&lt;/em&gt; is just a certain value (or collection of values) that has no state.  Consider the following portion of a domain model:
&lt;/p&gt;

&lt;div style=&quot;text-align:center;&quot;&gt;
	&lt;img style=&quot;float:none;&quot; src=&quot;/images/exampleDomainModel.gif&quot; alt=&quot;example domain model&quot; /&gt;
	&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt;
In the example shown, both distributor and customer have an address.  I would consider the address to be a &lt;em&gt;Value Object&lt;/em&gt; since it has no state.  Please realize that there may be some application domains where an address should be modeled as an entity, I just don't feel that this domain is one of them.  Another way to think about this is that the address has no identity outside of the context of either a distributor or a customer.  Therefore, we refer to distributor and customer as &lt;em&gt;Root Entities&lt;/em&gt;.  A value object should not be accessible without first going through a root entity.  So, theoretically speaking, you should never be able to write the following code:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;address = Address.new
address.save
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The problem with the above code is that it refers to the address as it's own entity, which we said is probably  not a good idea.  We should only allow access to a value object through an owning entity like so:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;address = Address.new
customer = Customer.new(:address =&amp;gt; address)
customer.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
The difference here is that we are assigning the address to a customer and then saving the customer.  So again, the address only makes sense within the context of a customer (or distributor) object.  There is another subtle point going on here.  Since an address has no state of its own, we should never be allowed to modify the address object - the address should be &lt;em&gt;Immutable&lt;/em&gt;.  This means that if the customers address changes, we would need to create a new address object and associate it with the customer and re-save the customer.  Calling &lt;code&gt;customer.address.zip = 08080&lt;/code&gt; doesn't make sense (from a pedagogical point of view anyways.)
&lt;/p&gt;

&lt;p&gt;
OK, enough theory - lets talk about implementation.  Active Record has direct support for aggregation through the use of the &lt;code class=&quot;noindent&quot;&gt;composed_of&lt;/code&gt; keyword.  Lets assume the following migrations are used to create the Customer and Distributor tables:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class CreateCustomers &amp;lt; ActiveRecord::Migration
  def self.up
    create_table :customers do |t|
      t.column :customer_name, :string
      t.column :phone_number, :string
      t.column :email, :string
      t.column :address_1, :string
      t.column :address_2, :string
      t.column :city, :string
      t.column :state, :string, :limit =&amp;gt; 2
      t.column :zip, :string, :limit =&amp;gt; 10
    end
  end

  def self.down
    drop_table :customers
  end
end

class CreateDistributors &amp;lt; ActiveRecord::Migration
  def self.up
    create_table :distributors do |t|
      t.column :distributor_name, :string
      t.column :distributor_region, :string
      t.column :phone_number, :string
      t.column :email, :string
      t.column :address_1, :string
      t.column :address_2, :string
      t.column :city, :string
      t.column :state, :string, :limit =&amp;gt; 2
      t.column :zip, :string, :limit =&amp;gt; 10
    end
  end

  def self.down
    drop_table :distributors
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now, what we'd like to do is abstract the address columns into their own Address class.  This will allow us to say things like &lt;code class=&quot;noindent&quot;&gt; customer.address.address_1&lt;/code&gt; after Active Record has retrieved a collection of Customer objects for us.  To further clarify, the following code should not run once we're done: &lt;code class=&quot;noindent&quot;&gt;distributor.address_1&lt;/code&gt;.  The real benefit here is not just the syntactic sugar of adding 'address' to the reader method, rather we can now implement certain address related functionality (like &lt;code class=&quot;noindent&quot;&gt;calculate_distance&lt;/code&gt;,) and have that functionality be shared among multiple root entities of address objects.

&lt;/p&gt;
&lt;p&gt;
	First, we need to tell the Distributor and Customer classes that they should be composed of an Address:	
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;class Customer &amp;lt; ActiveRecord::Base
  composed_of :address,
    :class_name =&amp;gt; &quot;Address&quot;,
    :mapping =&amp;gt; [
      [:address_1, :address_1],
      [:address_2, :address_2],
      [:city, :city],
      [:state, :state],
      [:zip, :zip]]
end
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;class Distributor &amp;lt; ActiveRecord::Base
  composed_of :address,
    :class_name =&amp;gt; &quot;Address&quot;,
    :mapping =&amp;gt; [
      [:address_1, :address_1],
      [:address_2, :address_2],
      [:city, :city],
      [:state, :state],
      [:zip, :zip]]
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	In the above two class definitions, the mapping and class_name attributes are optional.  The class_name attribute isn't needed if the class name is the camel-cased version of the composed_of value.  Additionally, the mapping attribute is not needed if each value pair contains identical values (as they do in this case.)  
&lt;/p&gt;
	&lt;p&gt;Now we can go ahead and create our Address class:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Address
  attr_reader :address_1, :address_2, :city, :state, :zip
    
  def initialize(address_1, address_2, city, state, zip)
    @address_1 = address_1
    @address_2 = address_2
    @city = city
    @state = state
    @zip = zip
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Since Address objects will be immutable, we create only attribute reader methods.  The attributes can only be set at initialization time.  Rails further enforces immutability by freezing the value object once it has been associated with an entity.
&lt;/p&gt;

&lt;p&gt;
So now that I've shown you how to implement such a thing, let's talk about the abundant shortcomings of this.
&lt;/p&gt;
&lt;h4&gt;Duplication:&lt;/h4&gt;
&lt;p&gt;
As you can see, there is a fair amount of duplication going on here.  Not only are we re-defining all of the address attributes in each table that will be composed of an address, but we are also duplicating the mapping and class_name values in both the Customer and Distributor classes.
&lt;/p&gt;

&lt;h4&gt;Validation&lt;/h4&gt;
&lt;p&gt;
	This is the deal breaker.  Value objects in rails are completely dis-associated from ActiveRecord, which means they cannot use the wonderful validation framework provided.  To be quite honest, this pisses me off.  I believe this will make value objects in rails unusable in all cases where the value objects don't contain reference data.  Yes, I'm aware of workarounds for this problem, like tricking the value object into thinking it's being handled by ActiveRecord, but to be honest with you, its not quite worth the hassle.  I'd much sooner just make the value object an entity of it's own and lose the theoretical correctness of not maintaining the state of the object.  But wait, that would bring up another problem: How do I associate an entity with more than one kind of other entity?  The answer lies in one beautiful addition to Rails 1.1: Polymorphic Associations...
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Model Versioning in Rails</title>
     <link href="http://joestelmach.com/2006/09/12/Model-Versioning-in-Rails.html"/>
     <updated>2006-09-12T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/09/12/Model-Versioning-in-Rails</id>
     <content type="html">&lt;p&gt;
	Versioned data is common to many applications.  Consider the case of an online store selling products.  A simplified view of the product data might consist of the upc, description, volume, and price.  Let's suppose a customer purchases a product on September 12th for a certain amount, then we update the product info to reflect a price increase.  If we dont keep a snapshot of the product data before the price increase, the customer's order history will be generated from the new product data instead of the product data at the time of purchase.
&lt;/p&gt;
&lt;p&gt;
Ok, so we basically need a parallel product table to append a new entry to each time a product's data is updated.  The main product table will always hold the current data.  In Rails, this means that we need to somehow hijack the ActiveRecord call flow and intercept any updates to all product instances, append a new entry to the versioned table with a timestamp, and then somehow tell active record to resume its updating of the original product, making note of the version that was just appended.  That sucks.  I thought about using an observer, or maybe a callback...but there is definitely a better way - the &lt;a href=&quot;http://ar-versioned.rubyforge.org&quot;&gt;acts_as_versioned plugin&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
  Let's go through the basic setup to getting this working.
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		Install the plugin:&lt;br /&gt;
		&lt;pre&gt;&lt;code&gt;prompt$ gem install acts_as_versioned&lt;/code&gt;&lt;/pre&gt;
	&lt;/li&gt;
	&lt;li&gt;
	update the product model to use the plugin:&lt;br /&gt;
		&lt;pre&gt;&lt;code&gt;class Product &amp;lt; ActiveRecord::Base
  &amp;nbsp;&amp;nbsp;acts_as_versioned
  &amp;nbsp;&amp;nbsp;...
end&lt;/code&gt;&lt;/pre&gt;
	&lt;/li&gt;
	&lt;li&gt;
	Create your database tables.&lt;br /&gt;
		&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;Class CreateProducts &amp;lt; ActiveRecord::Migration
  def self.up
    create_table :products do |t|
      t.column :version, :integer
      t.column :upc, :integer
      t.column :description, :string, :null =&amp;gt; false
      t.column :volume, :float, :null =&amp;gt; false
      t.column :price, :decimal
    end

    Product.create_versioned_table
  end

  def self.down
    drop_table :products
    Product.drop_versioned_table
  end
end&lt;/code&gt;&lt;/pre&gt;
		&lt;p&gt;
		Note that we are required here to add a version column to the main product table that will automatically be updated with the current version on each update (sequential, starting at 1.)  You can use the &lt;code class=&quot;noindent&quot;&gt;version_column&lt;/code&gt; option to the &lt;code class=&quot;noindent&quot;&gt;acts_as_versioned&lt;/code&gt; declaration if you would like to rename the column.  Also note that we use the &lt;code class=&quot;noindent&quot;&gt;create_versioned_table&lt;/code&gt; class method that was added to the Product class with the &lt;code class=&quot;noindent&quot;&gt;acts_as_versioned&lt;/code&gt; declaration.  This method will automatically create a product_versions table with a product_id foreign key column, an updated_at datetime column, a version column, and a colum for each column in the products table.  The &lt;code class=&quot;noindent&quot;&gt;drop_versioned_table&lt;/code&gt; class method will drop the table generated by the corresponding call to &lt;code class=&quot;noindent&quot;&gt;create_versioned_table&lt;/code&gt;.
		&lt;/p&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Now you can start adding products and updating them, and you will see the versions magically appear in the product_versions table.  There are a couple of problems here though.  First of all, we are versioning &lt;em&gt;all&lt;/em&gt; of the columns from the original model.  In our example here, once a product is created, I know that the UPC cannot be changed, therefore there is no point in wasting a column for every version of every product.  It turns out that the plugin will refer to the &lt;code class=&quot;noindent&quot;&gt;non_versioned_fields&lt;/code&gt; class method to determine which columns to generate in the migration and which columns in the versioned table (and corresponding object methods) to populate on each update.  If we add our own columns to the array returned by &lt;code class=&quot;noindent&quot;&gt;non_versioned_fields&lt;/code&gt;, we can exclude certain columns from being versioned:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Product &amp;lt; ActiveRecord::Base
  acts_as_versioned
  non_versioned_fields.push &quot;upc&quot;
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Note here that you pushing symbols onto the array will not work, you must use strings.  I have to admit that I'm a bit skeptical of the correctness of my implementation here, so please let me know if something seems a bit funky with the column exclusions (or anything else for that matter.)
&lt;/p&gt;
&lt;p&gt;
	The other problem is that by default, a new version will be appended to the versions table on &lt;em&gt;every&lt;/em&gt; update.  This means that if you change nothing on your product object and call update, a new version will be added.  We can correct this using the :if_changed option to the original acts_as-versioned declaration.
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;class Product &amp;lt; ActiveRecord::Base
  acts_as_versioned :if_changed =&amp;gt; [:description, :volume, :price]
  ...
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
This means that a new version will not be appended unless the description, volume, or price column has changed.  The plugin also supports more complex version checks with &lt;code class=&quot;noindent&quot;&gt;:if&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;version_condition_met?&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt; I have to say that I'm pretty excited to start using this in some of my projects.  At first I was a bit worried about the fact that the most current realease starts with a 0, but hey - its probably a hell of a lot more solid than anything I could come up with :)
&lt;/p&gt;


</content>
   </entry>
 
   <entry>
     <title>Live Search Thinking</title>
     <link href="http://joestelmach.com/2006/08/16/Live-Search-Thinking.html"/>
     <updated>2006-08-16T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/08/16/Live-Search-Thinking</id>
     <content type="html">&lt;p&gt;
An old &lt;a href=&quot;http://www.joestelmach.com/blog/live_search_with_ruby_on_rails&quot;&gt;live search post&lt;/a&gt; of mine generated a comment the other day regarding the feasibility of searching all of your records on each keystroke made by the user.  This is one area of the post that I admittedly gave little (or no) attention to partly because it was out of the scope of the post (the usual excuse,) and partly because I didn't have any good answers to the problem (the real excuse.)
&lt;/p&gt;

&lt;p&gt;
The first thing that needs to be decided is if there really exists a problem.  I say this in both the performance sense (is your live search noticeably slow,) and the usability sense (does it make sense for your 'live' search to wait until your done typing to be submitted.)  I personally feel that there should be a very short delay between the time the user starts typing and the time they see some results.  Otherwise, we would just stick a submit button on there and be done with it.  However, there is a point to be made in that each keystroke could potentially fire off a rather expensive http request, which in turn will search through a potentially large number of records and return a potentially large response to the user.
&lt;/p&gt;

&lt;p&gt;
I think its safe to say that we have a problem here.  We want results, we don't want to wait for them, and we want to include a lot of records in the search.  I'm sorry to say, but something has to give.  On this puny little blog, its no problem for my live search to perform an sql 'like' search of all my blog posts and render the results on each keystroke with a very short delay.  For some people (and possibly for me in the future,) this will not be possible. 
&lt;/p&gt;

&lt;p&gt;
There is actually an interesting phenomenon going on here.  If the response is not finished being prepared until &lt;em&gt;after&lt;/em&gt; the next request comes in, then we are placing an extreme load on our server.  By increasing the delay, we could potentially see no performance improvement from the user's perspective, but considerably reduce the strain on the server.  It seems that there would be some kind of 'sweet spot' here for the value of this delay.  The calculation of this value may be harder to come up with than the realization of its existence, but I think the following would need to be considered:
&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Average number of simultaneous requests on your web server&lt;/li&gt;
	&lt;li&gt;The number of total records to be searched&lt;/li&gt;
	&lt;li&gt;The average length of each record&lt;/li&gt;
	&lt;li&gt;The performance of the search algorithm (which may be hard to quantify for our purposes here)&lt;/li&gt;
	&lt;li&gt;Network traffic on the internet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
	Any number that could be calculated would certainly be based on heuristics, since things like network traffic on the internet are extremely hard to model. 
&lt;/p&gt;

&lt;p&gt;
After all this babbling, I have to wonder if any of this is even worth the effort.  If your live search is too slow, you probably need to re-think what your search is doing.  Maybe you need to index your entries with search keywords.  Maybe you just have too many entries for a live search.  I guess I don't have a whole lot of motivation here since at the current time my blog consists of only 40 entries.  However, if the concept of 'live search' really catches on, then I believe research on this topic will be inevitable as clients like &lt;em&gt;The New York Times&lt;/em&gt; want to add a live search to their home page (available only to the registered users of their site ofcourse.)
&lt;/p&gt;


</content>
   </entry>
 
   <entry>
     <title>Superiority Complex</title>
     <link href="http://joestelmach.com/2006/08/04/Superiority-Complex.html"/>
     <updated>2006-08-04T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/08/04/Superiority-Complex</id>
     <content type="html">&lt;p&gt;
I came across &lt;a href=&quot;http://lukewelling.com/2006/08/03/java-programmers-are-the-erotic-furries-of-programming/&quot;&gt;this post&lt;/a&gt; this morning written by Luke Welling, author of 'PHP and MySQL Web Development'.  The post attempts to classify the superiority of programmers by their language of choice.  I beleive Luke meant this as a complete joke, but the comments section is full of incompetence.  I have always found this to be a nonsensical and meaningless topic, so I do realize that I am fueling the fire of bullshit here, but I feel the need to post my own classification of programmers:
&lt;/p&gt;
&lt;p style=&quot;text-align:center&quot;&gt;
  &lt;img src=&quot;/images/chart.png&quot; style=&quot;float:none&quot; alt=&quot;superiority chart&quot; /&gt;
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Fiona Apple at Central Park</title>
     <link href="http://joestelmach.com/2006/07/27/Fiona-Apple-at-Central-Park.html"/>
     <updated>2006-07-27T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/07/27/Fiona-Apple-at-Central-Park</id>
     <content type="html">&lt;p&gt;
I was lucky enough to see Fiona Apple and Damien Rice play at the central park summer stage last night.  Definitely not the clientele you'd find at a Pearl Jam concert on the Camden Waterfront.  Besides the fact that my sexual  preference was very much in the minority, these people were &lt;em&gt;reading&lt;/em&gt; between sets.  That's right, I spotted at least 5 people reading a book while waiting for Fiona to come on stage.  These books ranged in topics from Psychology to LSAT practice exams to Shakespeare.  Weird shit.
&lt;/p&gt;
&lt;p&gt;
My lasting impression after seeing Fiona for the first time is that I wouldn't mess with that chick.  She comes off really cute and sweet and then gets really pissed off and appears to be having a seizure on stage.  While I could do without the bouts of trembling and hitting herself, the emotions she has tied up in her music are quite evident and genuine.
&lt;/p&gt;
&lt;p&gt;
One thing I really enjoyed about watching Fiona perform is that her music's true sound is present and easily discerned from her studio recordings.  It's obvious that her record producers have a large effect on the way she's &lt;em&gt;allowed&lt;/em&gt; to sing in order to produce a &lt;em&gt;successful&lt;/em&gt; album (We all know that &lt;em&gt;Extraordinary Machine&lt;/em&gt; wasn't even supposed to be released due to poor sales projections.)  Music is too much of a wonderful thing to succumb to those dollar counters in suits.  
&lt;/p&gt;
&lt;p&gt;
Have you ever heard someone say 'you can tell this band is good since the concert sounds just like the CD.'? Nothing annoys me more than this statement.  If you want to hear the studio recording, then play it on your iPod and save yourself the 50 dollar ticket and over-priced beers in the process.  When you see an artist live, you really get to see what they are about, what makes them tick.  If they're a good artist, they might even bring it to the point of appearing to have seizures on stage.
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Dusk and Summer</title>
     <link href="http://joestelmach.com/2006/07/19/Dusk-and-Summer.html"/>
     <updated>2006-07-19T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/07/19/Dusk-and-Summer</id>
     <content type="html">&lt;p&gt;
			&lt;img src=&quot;/images/dusk_and_summer.jpg&quot; alt=&quot;Dusk and Summer&quot; style=&quot;float:left;margin-right:15px&quot; /&gt;
	It's obvious that Chris Carraba went through some life balancing experience while writing the songs for the &lt;em&gt;So Impossible EP&lt;/em&gt; (Which happens to be my favorite offering from Dashboard.)  This EP paved the way for &lt;em&gt;A Mark, A Mission, A Brand, A Scar&lt;/em&gt; with the 'Hands Down' single.  In my opinion, the addition of the full band tainted many of the songs, but we all know about the inescapable need of an artist to play around with their sound from time to time.
&lt;/p&gt;
&lt;p&gt;
That being said, the songs prior to &lt;em&gt;So Impossible&lt;/em&gt; are where I believe Chris picked up most of his fan base.  After a casual listen to &lt;em&gt;The Swiss Army Romance&lt;/em&gt;, you are left feeling like you just had your heart broken and the shit kicked out of you (why this is an enjoyable experience, I cannot describe.)  Even more impressive is that this state of 'enjoyable depression' (for lack of a better word,) is achieved with only acoustic instruments.
&lt;/p&gt;
&lt;p&gt;
When the band released 'Vindicated' for the Spider Man 2 soundtrack, I was very much impressed at how they took the sound of &lt;em&gt;A Mark, A Mission, A Brand, A Scar&lt;/em&gt; and went a little farther into a direction which I believe sounds much better.  &lt;em&gt;Dusk and Summer&lt;/em&gt;, in my opinion, is an entire album based on the sound of 'Vindicated'.
&lt;/p&gt;
&lt;p&gt;
I think the album is solid and have been listening to it constantly for the past two weeks.  The addition of Adam Duritz to 'So Long, So Long' certainly adds some luster.  Fans of &lt;em&gt;Swiss Army Romance&lt;/em&gt; and &lt;em&gt;The Places You Have Come to Fear the Most&lt;/em&gt; may be a bit disapointed, but I think most fans will agree that this album is still worth owning. 
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Active Record Object Identity Part 2</title>
     <link href="http://joestelmach.com/2006/06/26/Active-Record-Object-Identity-Part-2.html"/>
     <updated>2006-06-26T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/06/26/Active-Record-Object-Identity-Part-2</id>
     <content type="html">&lt;p&gt;
  Well, it turns out that &lt;a href=&quot;http://www.joestelmach.com/blog/active_record_object_identity&quot;&gt;my last post&lt;/a&gt; was in fact fueled by my own mis-information.  While browsing through David Black's &lt;em&gt;Ruby For Rails&lt;/em&gt; book this afternoon, I stumbled upon a discussion involving the somewhat colorful history involving object identification in Ruby.
&lt;/p&gt;
&lt;p&gt;
  It turns out that there are actually 3 methods on the &lt;code class=&quot;noindent&quot;&gt;Object&lt;/code&gt; class used for identification.
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;Object#id&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  A more careful look at the Rdoc specifies that this method is soon to be deprecated (why didn't i see that yesterday!?)  I believe that this was traditionally used for unique identification, but was found to be over-ridden too often to be reliable.  Object identification is far too ubiquitous to be left into the hands of such a popular method name as &lt;code class=&quot;noindent&quot;&gt;id&lt;/code&gt;, which leads us to...
&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;Object#__id__&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  This obscure looking call was added as an additional means to getting at the object id.  The idea was that since the name is so obscure, it is unlikely that anyone would ever want to over-ride it (does Ruby have no concept of &lt;code class=&quot;noindent&quot;&gt;final&lt;/code&gt;!)  I guess the name was too obscure to be usable though, since the next method was added later on down the road.
&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;Object#object_id&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  The (hopefully) last addition to this saga which is yet another means at getting to the object id.  I suppose this is the preferred method to use these days as it is left untouched by ActiveRecord.
&lt;/p&gt;

&lt;p&gt;
  My only question is, what happens if you over-ride all three of these?
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Active Record Object Identity</title>
     <link href="http://joestelmach.com/2006/06/25/Active-Record-Object-Identity.html"/>
     <updated>2006-06-25T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/06/25/Active-Record-Object-Identity</id>
     <content type="html">&lt;p&gt;
				When compared to Hibernate, ActiveRecord is the clear winner for ease of use, but the clear loser for configurability.  For most of the projects I work on, I'm happy to trade one for the other and go with ActiveRecord (not to mention all the other perks I get from using the rest of the Rails Framework.)  However, I'm a bit disappointed (or maybe simply misinformed,) when it comes to object identity in ActiveRecord.
			&lt;/p&gt;
			&lt;p&gt;
				The Hibernate framework has a clear and understandable separation between object identity and the primary key of an entity.  Object identification is the job of the JVM, and Hibernate guarantees that objects created within the same hibernate session will have a one-to-one correspondence to database records (meaning there won't exist two objects with different ids and the same primary key.)  There is a clear distinction between the concepts of primary key and object id, and I think hibernate does a good job at keeping them at a reasonable distance from each other. 
			&lt;/p&gt;
			&lt;p&gt;
				ActiveRecord, it appears, operates by enforcing the one-to-one correspondence between objects and database rows &lt;em&gt;all the time&lt;/em&gt;.  It does this by hijacking the &lt;code class=&quot;noindent&quot;&gt;id&lt;/code&gt; method of the &lt;code class=&quot;noindent&quot;&gt;Object&lt;/code&gt; class and returning the entity's primary key.  Coming from the java world, this is confusing.  I would think that pure &lt;em&gt;object&lt;/em&gt; identification should be the job of the ruby interpreter, and not involve ActiveRecord at all.  The problem with this approach is that disconnected new objects have no id - calling &lt;code class=&quot;noindent&quot;&gt;Object.id&lt;/code&gt; returns &lt;code class=&quot;noindent&quot;&gt;nil&lt;/code&gt;.  But the object must have &lt;em&gt;some&lt;/em&gt; identification within the interpreter, no?
			&lt;/p&gt;
			&lt;p&gt;
				I have to admit that the guarantee of never having two objects represent the same entity regardless of the 'session', (although the session concept doesn't really apply in ActiveRecord,) is appealing.  But the problem I have is that there is no way to compare disconnected new entities unless we provide an &lt;code class=&quot;noindent&quot;&gt;==&lt;/code&gt; method, which I guess isn't a bad idea, but we'd be comparing natural candidate keys which won't be effective 100% of the time.
			&lt;/p&gt;
			&lt;p&gt;
				I have to ask you the reader (if anyone is in fact reading this,) to take a look at the rdoc for the &lt;code class=&quot;noindent&quot;&gt;Object#id&lt;/code&gt; method:
			&lt;/p&gt;
			&lt;div class=&quot;command&quot;&gt;
				Returns an integer identifier for obj. The same number will be returned on all calls to id for a given object, and no two active objects will share an id.
			&lt;/div&gt;

			Well, I guess it depends on how you define 'active' objects, but I would think that &lt;code class=&quot;noindent&quot;&gt;nil&lt;/code&gt; would never be returned here given this description.  
&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Update - 6/26/2006&lt;/em&gt; - All of this babbling is cleared up in this &lt;a href=&quot;http://www.joestelmach.com/blog/active_record_object_identity_part_2&quot;&gt;follow-up post&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;

</content>
   </entry>
 
   <entry>
     <title>Live Search With Ruby On Rails Part 4 - request.xhr?</title>
     <link href="http://joestelmach.com/2006/05/09/Live-Search-With-Ruby-On-Rails-Part-4-xhr.html"/>
     <updated>2006-05-09T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/05/09/Live-Search-With-Ruby-On-Rails-Part-4-xhr</id>
     <content type="html">&lt;p&gt;
				After receiving &lt;a href=&quot;http://www.joestelmach.com/blog/live_search_2#comments&quot;&gt;some excellent advice&lt;/a&gt; from someone named Ivan, I've decided to revisit the topic of live search in Ruby on Rails yet another time.  In &lt;a href=&quot;http://www.joestelmach.com/blog/live_search_2&quot;&gt;this post&lt;/a&gt; written way back in February, I outlined the steps necessary to gracefully degrade the Ajax-style live search for browsers that have Javascript disabled.  This required two distinct methods in the search controller: one for Javascript enabled browsers that would render the search results directly within the target element, and one for non-Javascript enabled browsers which would return the users back to the page they invoked the search from.  To re-iterate, here's the search controller listing:
			&lt;/p&gt;
			&lt;pre&gt;&lt;code&gt;def search #Javascript-enabled search
  get_search_results #implementation not shown
  render :partial =&amp;gt; &quot;search&quot;
end

def search_no_Javascript #Javascript-disabled search
  get_search_results #implementation not shown
  redirect_to :back
end&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
				Admittedly, this design leaves a lot to be desired.  The biggest concern here is that the code does not directly address the scenario of the user's browser having Javascript enabled, but not being able to support the XmlHttpRequest object (I say &lt;em&gt;not directly&lt;/em&gt; since the code will still work if the user submits the form with the enter button, since no search button will be present.)  The other (more theoretical) issue is that we have written two methods to do exactly the same thing, where the second method exists solely for graceful degradation of the view.
			&lt;/p&gt;
			&lt;p&gt;
				Well, it turns out that we can actually fix the latter.  The framework provides us with &lt;code class=&quot;noindent&quot;&gt;request.xhr?&lt;/code&gt;, or the arguably nicer alias of &lt;code class=&quot;noindent&quot;&gt;request.xml_http_request?&lt;/code&gt;, which decides if the request has come from an Ajax-style call.  The &lt;a href=&quot;http://api.rubyonrails.com/classes/ActionController/AbstractRequest.html#M000174&quot;&gt;Rails API&lt;/a&gt; states that this decision is based on the 'X-Requested-With' header containing 'XMLHttpRequest', which is apparently done automatically by the framework whenever an Ajax request is made.  This seems useful at first glance, but just remember that since this relies only on header information, it is possible that this could be simulated by any request.  
			&lt;/p&gt;
			&lt;p&gt;
				OK, since I'm starting to look a bit too far into this now, let's see how this new discovery allows us to completely remove the un-needed second search method from our controller:  
			&lt;/p&gt;
			&lt;pre&gt;&lt;code class=&quot;noindent&quot;&gt;def search
  get_search_results
  if request.xhr?
    render :partial =&amp;gt; &quot;search&quot;
  else
    redirect_to :back
end&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
				Also, the implementation of &lt;code class=&quot;noindent&quot;&gt;get_search_results&lt;/code&gt; can be placed directly in the search method if you prefer, as the extraction of this code is no longer necessary. 
			&lt;/p&gt;
			&lt;p&gt;
				This still leaves us with the problem of Javascript support without XmlHttpRequest support.  Some would argue that this scenario will effect a negligible number of users, but I'd still like to figure out a way to get around this.   
			&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>What an Idiot</title>
     <link href="http://joestelmach.com/2006/05/08/What-an-Idiot.html"/>
     <updated>2006-05-08T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/05/08/What-an-Idiot</id>
     <content type="html">&lt;p style=&quot;height:310px&quot;&gt;
				&lt;img src=&quot;/images/blaine.jpg&quot; alt=&quot;David Blane Under Water&quot; style=&quot;float:right&quot; /&gt;
				I understand that some people are brighter than others, but this guy should definitely win some kind of award for being a moron.  I can't believe I actually got on the subway today with the sole purpose of witnessing this nonsense.  What an idiot.
			&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Live Search With Ruby On Rails Part 3</title>
     <link href="http://joestelmach.com/2006/05/01/Live-Search-With-Ruby-On-Rails-Part-3.html"/>
     <updated>2006-05-01T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/05/01/Live-Search-With-Ruby-On-Rails-Part-3</id>
     <content type="html">&lt;p&gt;
				In my previous posts on Rails Live Search (&lt;a href=&quot;http://www.joestelmach.com/blog/live_search_with_ruby_on_rails&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://www.joestelmach.com/blog/live_search_2&quot;&gt;2&lt;/a&gt;) I outlined some reservations I had regarding a typical live search implementation.  One outstanding issue was that the framework provides a &lt;code class=&quot;noindent&quot;&gt;text_field&lt;/code&gt; html helper that seems unusable due to the fact that all form elements must be backed by the model.  As tomtoday &lt;a href=&quot;http://www.joestelmach.com/blog/live_search_2#comments&quot;&gt;pointed out&lt;/a&gt; to me, this is simply not true.  The Rails framework does provide a facility to render form elements that are not backed by the model using the &lt;code class=&quot;noindent&quot;&gt;_tag&lt;/code&gt; helper elements (&lt;code class=&quot;noindent&quot;&gt;text_field_tag, select_tag, &lt;/code&gt;etc.)
			&lt;/p&gt;
			&lt;p&gt;
			Many thanks to tomtoday for pointing this out to me.  There's even a big fat section in the Agile Web Development With Rails book titled &lt;strong&gt;&lt;em&gt;Working With Nonmodel Fields&lt;/em&gt;&lt;/strong&gt; on page 366.  Exactly how did I miss that!?
			&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Error Styling in Struts</title>
     <link href="http://joestelmach.com/2006/04/19/Error-Sytling-in-Struts.html"/>
     <updated>2006-04-19T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/04/19/Error-Sytling-in-Struts</id>
     <content type="html">&lt;p&gt;
			In light of my last &lt;a href=&quot;http://www.joestelmach.com/blog/web_form_usability&quot;&gt;post&lt;/a&gt;, I'd like to discuss a new facility available in Struts to apply error styling to your form fields.  Since Struts 1.2.5, all form elements now have the optional errorStyle, errorStyleClass, and errorStyleId attributes.  These are meant as a means to define the styling of particular form elements that have failed validation (which I think is a pretty good idea.)  Imagine the following form definition: 
			&lt;/p&gt;
			&lt;pre&gt;&lt;code&gt;&amp;lt;html:form action=&quot;/processForm&quot;&amp;gt;
  User Name
  &amp;lt;html:text property=&quot;userName&quot;&amp;gt;
  Password
  &amp;lt;html:text property=&quot;password&quot;&amp;gt;
  &amp;lt;html:submit&amp;gt;
&amp;lt;html:form/&amp;gt;&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
			Now, lets suppose we wanted to place a 2 pixel red border around each text field that fails validation.  This can be accomplished by adding the desired error style attribute to the text fields, and defining the corresponding style.  In our example here, we'll use the &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; attribute, which means that the framework will apply a &lt;code class=&quot;noindent&quot;&gt;class=&quot;fieldError&quot;&lt;/code&gt; attribute to the rendered input field.  Alternatively, we could use the &lt;code class=&quot;noindent&quot;&gt;errorStyleId&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;errorStyle&lt;/code&gt; attributes, which will apply the &lt;code class=&quot;noindent&quot;&gt;id=&quot;fieldError&quot;&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;style=&quot;given style rules&quot;&lt;/code&gt; attributes respectively.
			&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html:form action=&quot;/processForm&quot;&amp;gt;
  User Name
  &amp;lt;html:text property=&quot;userName&quot; errorStyleClass=&quot;fieldError&quot;&amp;gt;
  Password
  &amp;lt;html:text property=&quot;password&quot; errorStyleClass=&quot;fieldError&quot;&amp;gt;
  &amp;lt;html:submit&amp;gt;
&amp;lt;html:form/&amp;gt;&lt;/code&gt;&lt;/pre&gt;
			And in your css file:
			&lt;pre&gt;&lt;code style=&quot;display:block; margin:10px 0 10px 30px&quot;&gt;.fieldError {
  border:2px solid red;	
}&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
				Now, lets suppose the password field has some crazy requirement that is has to be between 4 and 5 characters, the first two characters must be digits, the third character must be a 'special' character, and the remaining characters can't be digits. (I know, its a bit of an exaggerated example.)  The user has forgotten all of these rules and enters an invalid password.  The following html will be rendered:
			&lt;/p&gt;
			&lt;pre&gt;&lt;code&gt;&amp;lt;form action=&quot;/processForm.do&quot;&amp;gt;
  User Name
  &amp;lt;input type=&quot;text&quot; name=&quot;userName&quot;&amp;gt;
  Password
  &amp;lt;input type=&quot;text&quot; name=&quot;password&quot; class=&quot;fieldError&quot;&amp;gt;
  &amp;lt;input type=&quot;submit&quot;&amp;gt;
&amp;lt;form/&amp;gt;&lt;/code&gt;&lt;/pre&gt;
			&lt;p&gt;
			Thus applying the fieldError style rule to the password field and drawing a 2px border around it.  Simple right?  Yes its simple. It's &lt;em&gt;too&lt;/em&gt; freaking simple!  I'd like to vent a bit about the following frustrations I have with this: 
			&lt;/p&gt;
			&lt;dl&gt;
				&lt;dt&gt;- The error style attribute has to be applied to &lt;em&gt;all individual&lt;/em&gt; fields&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;
				At first, I thought this must be a mistake.  I'm sure the following question has crossed at least some of your minds upon reading this post: You mean I have to add &lt;code class=&quot;noindent&quot;&gt;errorStyleClass=&quot;fieldError&quot;&lt;/code&gt; to &lt;em&gt;ALL&lt;/em&gt; of my form elements?  Yes, you do.  And yes, ITS RIDICULOUS!  I just want all failed validations to include the &lt;code class=&quot;noindent&quot;&gt;class=&quot;fieldError&quot;&lt;/code&gt; attribute when rendered.  Is that so much to ask?  Why can't I apply &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; to the top level form element and have ALL the fields on the form inherit this attribute (like the &lt;code class=&quot;noindent&quot;&gt;disable&lt;/code&gt; attribute?)
				&lt;/p&gt;
				&lt;p&gt;
					A possible solution to this might be to add a custom implementation of the struts html tags that will apply this class for you.  I personally don't think that this is a good idea, but it would work.  
				&lt;/p&gt;
				&lt;/dd&gt;

				&lt;dt&gt;- The &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; and &lt;code class=&quot;noindent&quot;&gt;styleClass&lt;/code&gt; attributes are mutually exclusive&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;
				That's right boys and girls.  If you apply a style to your form element using the &lt;code class=&quot;noindent&quot;&gt;styleClass&lt;/code&gt; attribute, they will be &lt;em&gt;forgotten&lt;/em&gt; in favor of your &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; definition upon failed validation.  COME ON!  There is no reason why the struts developers couldn't have simply added the class definitions given in the &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; attribute to the list of classes given in the &lt;code class=&quot;noindent&quot;&gt;styleClass&lt;/code&gt; attribute.  This must be a product of 'design by committee'.  Because of this obscure behavior, we now have to use unique error style class names for each element that already defines a style class.  Not to mention duplicating the style rules across both class definitions.  
				&lt;/p&gt;
				&lt;p&gt;
				If you take the above approach to alleviate yourself from adding the &lt;code class=&quot;noindent&quot;&gt;errorStyleClass&lt;/code&gt; attribute to every form element, it may also help in this situation.  Your custom implementation could check if a style class or list of style classes was given, and simply add the error style class to the list.  Again, this is possible and will work, but I'd hate to be the one to maintain it and explain it to new developers.
				&lt;/p&gt;
				&lt;/dd&gt;
			&lt;/dl&gt;

</content>
   </entry>
 
   <entry>
     <title>Web Form Usability</title>
     <link href="http://joestelmach.com/2006/04/10/Web-Form-Usability.html"/>
     <updated>2006-04-10T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2006/04/10/Web-Form-Usability</id>
     <content type="html">&lt;style type=&quot;text/css&quot;&gt;
#web_form_usability form {
	margin:10px;
	padding:10px;
	border:1px solid #aaa;
}

#web_form_usability form dl {
	margin:0 0 10px 0;
}

#web_form_usability form dd {
	margin:0 0 0 15px;
}

#web_form_usability .errorList {
	border:1px solid #DCA2A9;
  margin-bottom:10px;
  padding-bottom:5px;
}
&lt;/style&gt;

&lt;div id=&quot;web_form_usability&quot;&gt;
&lt;p&gt;
				&lt;img src=&quot;/images/amdSupport.gif&quot; alt=&quot;AMD Tech Support&quot; style=&quot;float:left;margin-right:15px;margin-bottom:15px;&quot;/&gt;
				After about 20 minutes of &lt;em&gt;really trying&lt;/em&gt; to register at &lt;a href=&quot;http://support.amd.com/consumer&quot;&gt;AMD's support site&lt;/a&gt;, I've come to the conclusion that it's just not possible.  No matter what values I place into the form, I am always brought back to the same page with the &lt;span style=&quot;color:red;&quot;&gt;*=required field&lt;/span&gt; message.  I finally broke down and called them on the phone.  Of course, I wasn't able to talk to a real person until an automated message walked me through all of the great, easy, convenient, and time-saving features available at their newly re-designed web site.
			&lt;/p&gt;
			&lt;p&gt;
				I have a feeling that I'm not alone in my frustration.
			&lt;/p&gt;

			&lt;p&gt;
				Web forms should be easy.  There is no excuse for a web designer (or a developer given the task of designing the usability and look of a form, which too often is the case,) to design something like this.  This is not 1995.  We have tools, we have experience, heck - we're even getting paid more than ever (OK, not as much as 1999, but you know what I mean.)  Did these people not try their final product?  Did something else break that's causing the application to act stupid?  Maybe I'll never know the answer to these questions, but I now keep this experience in the back of my mind when I'm given the task of designing a web form.
			&lt;/p&gt;
			&lt;p&gt;
				Feeling the need to write something about the simple usability of web based forms seems a bit odd to me, as we have all been using them for the past 10 years.  But apparently, this type of writing is still warranted, as non-usable forms like those found at AMD are still being developed today.  And we all know that AMD of all people should have their shit together.
			&lt;/p&gt;

			&lt;h3&gt;What's missing from AMD's forms?&lt;/h3&gt;
			&lt;p&gt;
				Well, besides the fact that they don't work, the user isn't given any feedback.  Feedback is the most essential element when trying not to frustrate a user.  Keep in mind though, that too much feedback is almost as bad as no feedback at all.  So we need to find a happy median.  A simple combination of textual and, more importantly, visual feedback will have our users keeping their heads on straight.
			&lt;/p&gt;
			&lt;h3&gt;Textual feedback&lt;/h3&gt;
			&lt;p&gt;
				This one is easy.  Just give the user a list of things that's wrong with the form.  This requires that each field is given a label (a good idea anyway.)  Let's set up an example form that loosely follows a typical account creation form:
			&lt;/p&gt;
			&lt;form action=&quot;#&quot;&gt;
				&lt;dl&gt;&lt;dt&gt;
					Title
				&lt;/dt&gt;&lt;dd&gt;
					&lt;select&gt;
						&lt;option value=&quot;Mr&quot;&gt;Mr.&lt;/option&gt;
					&lt;/select&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					First Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Last Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					E-Mail address
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Password
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
			&lt;/form&gt;

			&lt;p&gt;
				Now, some would argue that some instruction is warranted at this point.  For example, letting the user know that the e-mail address must be in the xxx@xxx.com format, or that the telephone number must be in xxx-xxx-xxxx format.  Let's see how something like that would look:  
			&lt;/p&gt;

			&lt;form action=&quot;#&quot;&gt;
				&lt;dl&gt;&lt;dt&gt;
					Title
				&lt;/dt&gt;&lt;dd&gt;
					&lt;select&gt;
						&lt;option value=&quot;Mr&quot;&gt;Mr.&lt;/option&gt;
					&lt;/select&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					First Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt; (Can't be greater than 100 characters)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Last Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt; (Can't be greater than 100 characters)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					E-Mail address
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt; (Must be in xxx@xxx.com format)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Password
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; /&gt; (Must be 6 to 8 characters with at least 1 letter)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
			&lt;/form&gt;
			&lt;p&gt;
				Admittedly, some of these examples are a bit extreme (like the 100 character limit,) but the point is that this clutter is simply not necessary.  If they enter the e-mail address in the wrong format, we'll let them know at that point.  99% of the time, we won't get to that point.  The only place I feel this is warranted in our example here is the password field.  Since the higher-up, figure head, pointy haired people come up with the craziest requirements for what they see as an acceptable password, we should let the user know ahead of time what will fail validation.
			&lt;/p&gt;
			&lt;p&gt;
				Imagine the following situation:
			&lt;/p&gt;
			&lt;form action=&quot;#&quot;&gt;
				&lt;ul class=&quot;errorList&quot;&gt;
					&lt;li&gt;E-Mail address Must be in xxx@xxx.com format&lt;/li&gt;
					&lt;li&gt;Password must be 6 to 8 characters with at least 1 letter&lt;/li&gt;
				&lt;/ul&gt;
				&lt;dl&gt;&lt;dt&gt;
					Title
				&lt;/dt&gt;&lt;dd&gt;
					&lt;select&gt;
						&lt;option value=&quot;Mr&quot;&gt;Mr.&lt;/option&gt;
					&lt;/select&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					First Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;Joe&quot; /&gt; 
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Last Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;Stelmach&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					E-Mail address
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;joestelmachgmail.com&quot; /&gt; 
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Password
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;******&quot; /&gt; (Must be 6 to 8 characters with at least 1 letter)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
			&lt;/form&gt;
			&lt;p&gt;
				It's pretty obvious what's going on here.  The user is notified of the exact problem locations.  This is good.  A lot of sites fail to even get this far.
			&lt;/p&gt;

			&lt;h3&gt;Visual Feedback&lt;/h3&gt;
			&lt;p&gt;
				On our simple form, the textual description might be enough for the user to find and correct the problem in a short amount of time.  But what if the form was complex (think IRS 1040.)  How can we make the location of the problem incredibly obvious?  How about this:
			&lt;/p&gt;
			&lt;form action=&quot;#&quot;&gt;
				&lt;ul class=&quot;errorList&quot;&gt;
					&lt;li&gt;E-Mail address Must be in xxx@xxx.com format&lt;/li&gt;
					&lt;li&gt;Password must be 6 to 8 characters with at least 1 letter&lt;/li&gt;
				&lt;/ul&gt;
				&lt;dl&gt;&lt;dt&gt;
					Title
				&lt;/dt&gt;&lt;dd&gt;
					&lt;select&gt;
						&lt;option value=&quot;Mr&quot;&gt;Mr.&lt;/option&gt;
					&lt;/select&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					First Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;Joe&quot; /&gt; 
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Last Name
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;Stelmach&quot; /&gt;
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					E-Mail address
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;joestelmachgmail.com&quot; style=&quot;background-color:#dca2a9;&quot;/&gt; 
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;dl&gt;&lt;dt&gt;
					Password
				&lt;/dt&gt;&lt;dd&gt;
					&lt;input type=&quot;text&quot; value=&quot;******&quot; style=&quot;background-color:#dca2a9;&quot;/&gt; (Must be 6 to 8 characters with at least 1 letter)
				&lt;/dd&gt;&lt;/dl&gt;

				&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
			&lt;/form&gt;
			&lt;p&gt;
				If you can't figure out what the problem is now, then its hopeless.  This is where we want to be.  To the point where the user simply has no doubt how to proceed.  I'm sure there are many alternatives to what I've described above that will have the same effect.  Just make sure your form is dummy-proof.  It's easy.  It's cheap.  And it will make for a much more enjoyable on-line experience for your users.
			&lt;/p&gt;
			&lt;p&gt;
				&lt;em&gt;p.s.&lt;/em&gt;  I do realize that this post has a complete disregard for any and all accessibility issues (like color blindness.)  I have no experience in this area, and am not one to give advice regarding it.
			&lt;/p&gt;
&lt;/div&gt;
</content>
   </entry>
 
   <entry>
     <title>Live Search With Ruby On Rails Part 2</title>
     <link href="http://joestelmach.com/2006/02/28/Live-Search-With-Ruby-On-Rails-Part-2.html"/>
     <updated>2006-02-28T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/02/28/Live-Search-With-Ruby-On-Rails-Part-2</id>
     <content type="html">&lt;p&gt;
			In a previous post, I outlined the steps necessary to &lt;a href=&quot;/blog/live_search_with_ruby_on_rails&quot;&gt;implement live search functionality&lt;/a&gt; in a Ruby On Rails application.  That post brought forth some reservations I had regarding the semantics and accessibility nuances associated with the ajax-style search that I hope to (mostly) remedy in this post.  Let's review the major problems I had with the original implementation:
			&lt;/p&gt;
			&lt;ol&gt;
				&lt;li&gt;We use an &lt;code class=&quot;noindent&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag that isn't wrapped with a &lt;code class=&quot;noindent&quot;&gt;&amp;lt;form&amp;gt;&lt;/code&gt; tag.&lt;/li&gt;
				&lt;li&gt;Rails provides a &lt;code class=&quot;noindent&quot;&gt;text_field&lt;/code&gt; html helper that seems unusable.&lt;/li&gt;
				&lt;li&gt;The &lt;code class=&quot;noindent&quot;&gt;observe_field&lt;/code&gt; kind of just &lt;em&gt;hangs out&lt;/em&gt; on the page.&lt;/li&gt;
				&lt;li&gt;The search results are not persisted in the session.&lt;/li&gt;
				&lt;li&gt;A client's lack of Javascript or XMLHttpRequest support will cause serious confusion and a lack of &lt;em&gt;any&lt;/em&gt; search functionality.&lt;/li&gt;
			&lt;/ol&gt;
			&lt;p&gt;
				After reviewing these things for a couple of days, I was able to eliminate points 1, 4, and most of point 5.  I'm happy with this since I feel that these are the biggest showstoppers (especially point 5,) as I've come to realize that point 2 and 3 are debate able, subtle, and probably not that important in the grand scheme of things.  That being said, let's jump in and give our search functionality some enhanced accessibility.
			&lt;/p&gt;
			&lt;p&gt; 
			As I said previously, I'm not a big fan of web sites that limit the core functionality (especially those that just sit there and act stupid,) when the user has Javascript disabled.  There are lots of reasons why people would disable Javascript: corporate office policy, too many pop ups asking to buy porn, or maybe Grandma did it by accident when she was tinkering with the IE preferences trying to make the font size bigger.  Whatever the reason, I feel that we need to accommodate non-Javascript users with very basic site functionality such as a search feature.  I'm not advocating that we stop innovating and pushing the envelope of Javascript-only features like auto-spellcheck or auto-save, I'm just saying that being able to search never &lt;em&gt;required&lt;/em&gt; Javascript in the past, and it shouldn't &lt;em&gt;require&lt;/em&gt; it now or in the future. 
			&lt;/p&gt;
			&lt;p&gt;
				Let's go ahead and iterate through each point and see what we can do to correct things.
			&lt;/p&gt;
			&lt;dl&gt;
				&lt;dt&gt;
				- We use an &lt;code class=&quot;noindent&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag that isn't wrapped with a &lt;code class=&quot;noindent&quot;&gt;&amp;lt;form&amp;gt;&lt;/code&gt; tag.
				&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;
				This is easy enough to fix. Just wrap the thing in a form element.  No harm done, and this will also set us up for point number 5.  While we're at it, let's go ahead and add an action and a submit button to the form, as we'll need those for step 5 as well.
					&lt;br /&gt;
					&lt;pre&gt;&lt;code&gt;&amp;lt;%= start_form_tag :action =&amp;gt; 'search_no_javascript' %&amp;gt;
  &amp;lt;input type=&quot;text&quot; id=&quot;search&quot; name=&quot;criteria&quot; /&amp;gt;
  &amp;lt;%= submit_tag 'Go' %&amp;gt;
&amp;lt;%= end_form_tag %&amp;gt;&lt;/code&gt;&lt;/pre&gt;
					&lt;/p&gt;
				&lt;/dd&gt;

				&lt;dt&gt;- Rails provides a &lt;code class=&quot;noindent&quot;&gt;text_field&lt;/code&gt; html helper that seems unusable.&lt;/dt&gt;
				&lt;dd&gt;&lt;p&gt;
					I'm still at a loss on this one.  I suppose the Rails framework assumes that &lt;em&gt;all&lt;/em&gt; form elements will correspond to something in the data model.  In our example here, a search function should certainly not be a part of the data model.  I'm sure there are other exceptions, so either I'm missing something that the framework provides, or I'm being a bit too anal here and need to stop looking so deeply into these things.
					&lt;/p&gt;&lt;/dd&gt;

				&lt;dt&gt;- The &lt;code class=&quot;noindent&quot;&gt;observe_field&lt;/code&gt; kind of just &lt;em&gt;hangs out&lt;/em&gt; on the page.&lt;/dt&gt;
				&lt;dd&gt;&lt;p&gt;
					Once again, I'm probably looking a bit too deep into this, but I do feel that the observers for an ajax-heavy site should probably be declared in a central, easily maintainable place, rather than in the actual markup.  However, I admit that the jury is still out on this one, and we are dealing with only a single observer here, so let's forget about this for now.
					&lt;/p&gt;&lt;/dd&gt;

				&lt;dt&gt;- The search results are not persisted in the session.&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;
				This could be regarded as a matter of personal preference, but I believe that a persistent list of search results will make it easier for the person searching to find what they are looking for.  This is especially true in our case here, where we are showing the titles of blog entries that contain the search criteria in the blog's actual contents, but not in the title.
				&lt;/p&gt;
				&lt;p&gt;
				The fix for this is pretty obvious: use session variable instead of instance variables.  The only thing we need to be careful about here is handling the difference between no results, and not submitting any search criteria.  The subtlety is in the fact that submitting no search criteria will in fact return no results (admittedly, this is based on your search implementation,) but we probably don't want to show the user any information regarding the results if no criteria has been sent. 
				&lt;/p&gt;
				&lt;p&gt;
				To better coincide with our next topic, I've implemented the search results as a partial named _search.rhtml:&lt;br /&gt;
				&lt;pre&gt;&lt;code&gt;&amp;lt;%if session[:items] != nil &amp;amp;&amp;amp;
  (session[:mark_term] == nil||session[:mark_term].length&amp;gt; 0)%&amp;gt;
  &amp;lt;dl id=&quot;searchResultsDl&quot; class=&quot;linkList&quot;&amp;gt;
    &amp;lt;dt&amp;gt;
      &amp;lt;%= session[:items].length %&amp;gt;
      Result(s) for
      &amp;lt;% session[:mark_term] %&amp;gt;
    &amp;lt;/dt&amp;gt;
    &amp;lt;% for blog in session[:items] %&amp;gt;
      &amp;lt;dd&amp;gt;
        &amp;lt;% session[:mark_term] ? highlight(blog.title,
          session[:mark_term]) : h(blog.title) %&amp;gt;
      &amp;lt;dd&amp;gt;
    &amp;lt;% end %&amp;gt;
  &amp;lt;/dl&amp;gt;
&amp;lt;% else %&amp;gt;
  &amp;amp;nbsp; #this represents the subtlety mentioned above
&amp;lt;% end %&amp;gt;&lt;/code&gt;&lt;/pre&gt;
				&lt;/p&gt;
				&lt;/dd&gt;

				&lt;dt&gt;- A client's lack of Javascript or XMLHttpRequest support will cause serious confusion and a lack of any search functionality.&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;
				We now arrive at the heart of the matter.  How do we gracefully degrade this thing?  We started by wrapping our search criteria input field with a form element,	assigning it an action of search_no_javascript, and adding a submit button.  As you've probably guessed, we're going to implement an action in our controller to be used when the user has Javascript disabled.  The search functionality will be identical to the standard Javascript-enabled search, so you can go ahead and extract that implementation into a separate private method called something like 'get_search_results'.  What concerns us here is the final rendering decision of the action.  
				&lt;/p&gt;
				&lt;p&gt;
				Previously, we rendered our search results directly into the searchResults div element with no layout.  We're gonna change that a bit here so the Javascript and non-Javascript versions will play nice together.  As I stated before, the search results rhtml has been moved to a partial named '_search.rhtml', instead of being inside a 'search.rhtml' file to coincide with the 'search' function:&lt;br /&gt;
				&lt;pre&gt;&lt;code&gt;&amp;lt;div id=&quot;searchResults&quot;&amp;gt;
  &amp;lt;%= render :partial =&amp;gt; &quot;search&quot; %&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
				Note that this implementation is also a bit more semantically correct than our previous implementation, which displayed an empty div in the markup.
				&lt;/p&gt;
				&lt;p&gt;
				Now let's take a look at our two search actions in our controller:&lt;br /&gt;
				&lt;pre&gt;&lt;code&gt;def search #Javascript-enabled search
&amp;nbsp;&amp;nbsp;get_search_results
&amp;nbsp;&amp;nbsp;render :partial =&amp;gt; &quot;search&quot;
end

def search_no_javascript #Javascript-disabled search
  get_search_results
  redirect_to :back
end&lt;/code&gt;&lt;/pre&gt;
				When Javascript is enabled, the search method is invoked from the observer, and the results are rendered using the partial _search.rhtml within the searchResults div.  But wait, the _search.rhtml partial has already being rendered within the searchResults div, since we specifically placed it there.  However, this rendering happens only on the page load.  Once you give an observer a target element, the contents of that element will be replaced with the result of the action given to the observer.  So in our case here, its kind of like we are hitting the refresh button on just searchResults div (which I must admit, is quite bizarre when you step back and think about it.)  When we throw persistent search results into the mix, this method works beautifully, as hitting refresh will render the most current search results within the searchResults div.
				&lt;/p&gt;
				&lt;p&gt;
					Now, what happens when grandma turns off Javascript while trying to make her fonts bigger?  Well, since we added a form and a submit button, she can go ahead and submit her search criteria the old-fashioned way: by hitting the submit button (I can hear the 'When I was your age' stories now!)  This will invoke the search_no_javascript method in our action, which will gather the search results in the same way as before, but instead of rendering the results instantly within the searchResults div (which we realize is impossible without Javascript,) we simply re-direct her back to whatever page she was looking at when the search was submitted.  A re-direct will cause the browser to make a new request for the page, thereby re-rendering the search results we just stuck in the session. 
				&lt;/p&gt;
				&lt;p&gt;
				We're almost done here, but we have a couple more things to discuss.  We don't want our users to see a search button if they have Javascript enabled.  Similarly, we might want the label of the search field to say 'Live Search' when Javascript is present, and just plain 'Search' when it is not present.  This can easily be achieved by initially setting the label to 'Search' and adding a small script just after the form element:&lt;br /&gt;
				&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
  document.getElementById(&quot;searchSubmit&quot;).style.display = &quot;none&quot;;
  document.getElementById(&quot;searchLabel&quot;).innerHTML = &quot;Live Search&quot;;
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;
				This piece of script will run only when Javascript is enabled (obviously,) and will swap the label to 'Live Search' and hide the submit button.  Some would argue that this should be placed in the body's onload attribute, as it should run when the page is loaded.  However, the onload method requires the entire page to be loaded before the script is invoked, which causes a delay in its execution.  This means that the user can actually see the label change and the button disappear.
				&lt;/p&gt;
				&lt;p&gt;
				One last point and then I'll shut up.  We still haven't touched on the scenario of having Javascript enabled but no XMLHttpRequest functionality.  As we all know, most recent browsers do in fact have this support, so I don't view this as being a big deal.  However, since this is a post about accessibility, I should add that those users will still be able to use our search by entering their criteria and hitting enter, which will in turn submit the form.  The only thing we lose is the visibility of the submit button, and the generic 'Search' label.  I think I can live with that.
				&lt;/p&gt;
				&lt;/dd&gt;
			&lt;/dl&gt;
&lt;br/&gt;
&lt;em&gt;Update - 5/1/2006:&lt;/em&gt; I've added a followup to this post &lt;a href=&quot;/blog/live_search_3&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;

</content>
   </entry>
 
   <entry>
     <title>New York City Snow</title>
     <link href="http://joestelmach.com/2006/02/15/New-York-City-Snow.html"/>
     <updated>2006-02-15T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/02/15/New-York-City-Snow</id>
     <content type="html">&lt;p&gt;
			&lt;img src=&quot;/images/nycSnow.jpg&quot; alt=&quot;New York City Snow&quot; style=&quot;float:left;margin:0 15px 15px 0&quot; /&gt;
			Yes, snow can be beautiful.  Skyscrapers glisten through unique flakes of frozen crystals as they lay fresh white blankets across the urban landscape.  Then, those blankets are mixed with salt and dirt, causing them to melt into a never ending stream of substance that amounts to the dirt, grime, and waste of the millions of people, cars, dogs, even horses that pollute the streets and sidewalks each day.  I hate the city when it snows.
			&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Lava Lamp Builds</title>
     <link href="http://joestelmach.com/2006/02/13/Lava-Lamp-Builds.html"/>
     <updated>2006-02-13T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/02/13/Lava-Lamp-Builds</id>
     <content type="html">&lt;p&gt;
			&lt;img src=&quot;/images/lava.jpg&quot; alt=&quot;Lava Lamps&quot; style=&quot;float:left;margin:0 15px 15px 0;&quot;/&gt;
			The benefits of an automated build/test/package system are, in my opinion, quite obvious.  But sometimes it takes a little bit more than statistical evidence to get you motivated.  At my current project, we've been thinking about setting up such a system for some time now, but it wasn't until a colleague of mine stumbled upon the system described in Mike Clark's &lt;a href=&quot;http://www.pragmaticprogrammer.com/starter_kit/auto/index.html&quot;&gt;Pragmatic Project Automation&lt;/a&gt; that we realized we could include Lava Lamps and home automation devices to display the status of the current build.  Fun stuff!
			&lt;/p&gt;
			&lt;p&gt;
			I'm happy to report that the system has been functional for about a week now, and I don't know how we ever lived without it.  The Lava Lamps (or 'Extreme Feedback Devices' as Mike Clark calls them,) are very effective.  As soon as someone sees the red light come on, they immediately look to see who made the last change to the code base so they can begin their tormenting.  The system truly makes you want to keep your code base clean and your unit tests running without any errors. 
			&lt;/p&gt;
			&lt;p&gt;
				If you're thinking of implementing a similar system, here's a list of things you'll need to get things rolling:
			&lt;/p&gt;
				&lt;ul&gt;
					&lt;li&gt;&lt;a href=&quot;http://www.x10.com/automation/firecracker.htm&quot;&gt;X10 FireCracker&lt;/a&gt; home automation kit&lt;/li&gt;
					&lt;li&gt;&lt;a href=&quot;http://cruisecontrol.sourceforge.net/&quot;&gt;CruiseControl&lt;/a&gt; automated build system&lt;/li&gt;
					&lt;li&gt;An &lt;a href=&quot;http://ant.apache.org/&quot;&gt;Ant&lt;/a&gt; build script for CruiseControl to invoke&lt;/li&gt;
					&lt;li&gt;The &lt;a href=&quot;http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc&quot;&gt;X10 Publisher for CruiseControl&lt;/a&gt; written by Mike Clark&lt;/li&gt;
					&lt;li&gt;Two &lt;a href=&quot;http://coolstuffcheap.com/1724-yellow-lava---blue-liquid-accent-motion-mini-lava-lamp.html&quot;&gt;Lava Lamps&lt;/a&gt; to indicate the build status&lt;/li&gt;
				&lt;/ul&gt;
			&lt;p&gt;
				Extensive documentation is available in the book and on the &lt;a href=&quot;http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc&quot;&gt;book's website&lt;/a&gt; to fit these pieces together, but a few snags and surprises were discovered along the way that I feel should be documented.
				&lt;/p&gt;
			&lt;ul&gt;
				&lt;li&gt;The Java Communication Library (in its current version of 3,) is not available for Windows.  Therefore, if you're forced to work on a windows machine, its up to you to find a copy of the old version 2 Library.  I found a copy of it &lt;a href=&quot;https://jsecom16d.sun.com/ECom/EComActionServlet;jsessionid=E8B9573F5ED5E191E57A7AB4C89DA7DE&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
				&lt;li&gt;&lt;img src=&quot;/images/x10.jpg&quot; alt=&quot;X10 Modules&quot; style=&quot;float:left;margin:0 15px 15px 0&quot; /&gt;The X10 devices don't seem to work as advertised through our building's electrical system.  We found that the transceiver and the lamp module have to be plugged into the same power strip.  This presented a problem for us, as we wanted to have a single transceiver with multiple lamp modules scattered around the cubicle farm.  We were able to get around this by using a transceiver and a lamp module at each cubicle.  I don't know how far the transmitter will work, but we tested it up to about 12 cubicles away without any problems.&lt;/li&gt;
		&lt;li&gt;CruiseControl gives you the ability to automatically send e-mail to certain people whenever the build breaks.  We thought this was such a cool feature that we just couldn't wait to throw a bunch of e-mail addresses in there.  Be warned that as soon as your manager starts receiving these, he/she will get all kinds of crazy ideas (&quot;Let's integrate this thing with PeopleSoft and include it into our monthly report to the steering committee!&quot;)
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	If I run into some spare time in the near future, I'm gonna see how hard it would be to get this thing running within a Ruby On Rails development environment.  If that day ever comes, I'll be sure to post my findings.  In the meantime, be sure to hit me up with any suggestions!
	&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Live Search With Ruby On Rails</title>
     <link href="http://joestelmach.com/2006/02/01/Live-Search-With-Ruby-On-Rail.html"/>
     <updated>2006-02-01T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/02/01/Live-Search-With-Ruby-On-Rail</id>
     <content type="html">&lt;p&gt;
			Gone are the days of actually &lt;em&gt;submitting&lt;/em&gt; your search query and waiting for an entirely new page to be rendered.  The 'Live Search' era is upon us, and I'm here to welcome it with open arms.  My first encounter with a Live Search type of form was some time in 2005 when Google launched Google Suggest.  I was so blown away that I figured only a giant company full of PhD's could figure out how to implement this.  Boy, was I wrong.
			&lt;/p&gt;
			&lt;p&gt;
				I'm here to discuss a step-by-step procedure for adding a live search feature to your Ruby On Rails application, and some of the peculiarities you may encounter while walking through the steps.  The &lt;a href=&quot;http://wiki.rubyonrails.com/rails/pages/How+to+make+a+real-time+search+box+with+the+Ajax+helpers&quot;&gt;wiki&lt;/a&gt; on the Rails site is the only real resource I could find regarding live search, and it will be the basis of our discussion here. 
			&lt;/p&gt;
			&lt;h4&gt;Implementation Steps&lt;/h4&gt;
			&lt;p&gt;
				The steps to adding live search to your Ruby On Rails app are as follows:
			&lt;/p&gt;
			&lt;ol id=&quot;implementationList&quot;&gt;
				&lt;li&gt;
					Include the default Javascript files in your page&lt;br /&gt;
					&lt;code&gt;
						&amp;lt;%= javascript_include_tag  :defaults %&amp;gt;
					&lt;/code&gt;&lt;br /&gt;
					OR&lt;br /&gt;
					&lt;code&gt;
						&amp;lt;%= define_javascript_functions %&amp;gt; 
					&lt;/code&gt;&lt;br /&gt;
					Both of these will give you access to the ActionPack Javascript libraries.  The difference is that &lt;code class=&quot;noindent&quot;&gt;define_javascript_functions&lt;/code&gt; will place ALL of the ActionPack Javascript within a &lt;code class=&quot;noindent&quot;&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag on your page, where the &lt;code class=&quot;noindent&quot;&gt;javascript_include_tag&lt;/code&gt; will simply link the external ActionPack Javascript files to your page. (HINT: use &lt;code class=&quot;noindent&quot;&gt;javascript_include_tag&lt;/code&gt;)
				&lt;/li&gt;
				&lt;li&gt;
					Create a text field for your users to enter their search criteria.  We'll use 'search' as our id and name attributes, but feel free to use any value you want.&lt;br /&gt;
					&lt;code&gt;
						&amp;lt;input type=&quot;text&quot; id=&quot;search&quot; name=&quot;search&quot; /&amp;gt;
					&lt;/code&gt;
				&lt;/li&gt;
				&lt;li&gt;
				Create an image to be used as a status indicator while the search is being performed.  Be sure to set an id and add an inline style rule to force the image to not show initially.&lt;br /&gt;
				&lt;code&gt;
					&amp;lt;img id=&quot;busy&quot; src=&quot;/images/spinner.gif&quot; style=&quot;display:none&quot; /&amp;gt;
				&lt;/code&gt;&lt;br /&gt;
				If you're looking for some images to use on your site, some are available &lt;a href=&quot;http://mentalized.net/activity-indicators/&quot;&gt;here&lt;/a&gt;.  Also feel free to use the modified spinner indicator I'm using on this site.
				&lt;/li&gt;
				&lt;li&gt;
				Create an empty div where you would like the results of the search to be rendered.  Be sure to give the div an id.&lt;br /&gt;
					&lt;code&gt;
						&amp;lt;div id=&quot;searchResults&quot;&amp;gt;&amp;lt;/div&amp;gt;
					&lt;/code&gt;
				&lt;/li&gt;
				&lt;li&gt;
				Create an Ajax observer to observe the text field while the user is typing.  The value of the first parameter should be whatever you chose as an id in step 2.&lt;br /&gt;
					&lt;pre&gt;&lt;code&gt;&amp;lt;%= observe_field 'search',
  :frequency =&amp;gt; 0.5,
  :update =&amp;gt; 'searchResults',
  :url =&amp;gt; { :controller =&amp;gt; 'blog', :action=&amp;gt; 'search' },
  :with =&amp;gt; &quot;'criteria=' + escape(value)&quot;,
  :loading =&amp;gt; &quot;document.getElementById('busy').style.display='inline'&quot;,
  :loaded =&amp;gt; &quot;document.getElementById('busy').style.display='none'&quot; %&amp;gt;&lt;/code&gt;&lt;/pre&gt;
					This is where we get a first glimpse of the power inherent in the Ajax helpers.  To implement this directly through the XMLHttpRequest object would be much more difficult, error-prone, and messy.  Let's take a look at each of the expressions we're using here
					&lt;ul class=&quot;noPaddingList&quot;&gt;
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:frequency&lt;/code&gt; - The frequency, in seconds, that you would like the field to be observed&lt;/li&gt;
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:update&lt;/code&gt; - The id of the element where the search results should be rendered.  This is the id you chose in step 4&lt;/li&gt;
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:url&lt;/code&gt; - The controller/action that implements your search functionality (see step 6)&lt;/li&gt; 
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:with&lt;/code&gt; - Used to pass a parameter called 'criteria' which will be set to the value of the text field at the time of the observation.  The call to &lt;code class=&quot;noindent&quot;&gt;escape&lt;/code&gt; ensures that any special characters in the input are escaped. Note that we are breaking out of the traditional form-submission process where a request parameter is automatically created for a form element when the form is submitted.  We technically don't have a form in this case (more on this later.)&lt;/li&gt;
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:loading&lt;/code&gt; - used to display the busy indicator image you created in step 3.  The Javascript placed here will be executed when the search results element is being loaded with data&lt;/li&gt;
						&lt;li&gt;&lt;code class=&quot;noindent&quot;&gt;:loaded&lt;/code&gt; - used to hide the busy indicator once the search results element is done loading.&lt;/li&gt;
					&lt;/ul&gt;
					You should also be aware that any options available in &lt;a href=&quot;http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000433&quot;&gt;link_to_remote&lt;/a&gt; are also available to you here.
				&lt;/li&gt;
				&lt;li&gt;
				Create an action in the controller of your choice that will provide the search facility.  Let's assume we have a model called 'Blog' with the blog's contents being stored in the 'content' column.&lt;br /&gt; 
					&lt;pre&gt;&lt;code&gt;def search
  if 0 == @params['criteria'].length
    @items = nil
  else
    @items = Blog.find(:all, :order_by =&amp;gt; 'title',
      :conditions =&amp;gt; [ 'LOWER(content) LIKE ?',
      '%' + @params['criteria'].downcase + '%' ])
    @mark_term = @params['criteria']
  end
  render_without_layout
end&lt;/code&gt;&lt;/pre&gt;
					This search function will perform a simple sql like query on the blog's criteria column.  Depending on the size of your site and the volume of content you have, this may or may not be a sufficient way to search.  For our purposes here, this method works just fine.  Once the results have been gathered, we render the search results (using no layout) with the page you will create in the next step. Also note that we have set an instance variable, &lt;code class=&quot;noindent&quot;&gt;@mark_term&lt;/code&gt;, that we can use to highlight our search criteria within the rendered search results.
				&lt;/li&gt;
				&lt;li&gt;
				Create a search.rhtml view page to display the search results. &lt;br /&gt;
					&lt;pre&gt;&lt;code&gt;&amp;lt;% if @items &amp;amp;&amp;amp; @items.length &amp;gt; 0 %&amp;gt;
  &amp;lt;ul id=&quot;searchResults&quot;&amp;gt;
    &amp;lt;% for blog in @items %&amp;gt;
      &amp;lt;li&amp;gt;
        &amp;lt;%= link_to
          @mark_term ? highlight(blog.title, @mark_term) : h(blog.title),
          :controller =&amp;gt; &quot;blog&quot;,
          :action =&amp;gt; &quot;show&quot;, :id =&amp;gt; blog.id %&amp;gt;
      &amp;lt;/li&amp;gt;
    &amp;lt;% end %&amp;gt;
  &amp;lt;/ul&amp;gt;
  &amp;lt;% elsif @mark_term &amp;amp;&amp;amp; @mark_term.length &amp;gt; 0 %&amp;gt;
    No Results
  &amp;lt;% else %&amp;gt;
    &amp;amp;nbsp;
&amp;lt;% end %&amp;gt;&lt;/code&gt;&lt;/pre&gt;
					If &lt;code class=&quot;noindent&quot;&gt;@items&lt;/code&gt; is not nil or empty, then we display our search results as a list of links to each blog entry's 'show' action, highlighting the given search term within each link.  If you would like to change the appearance of the highlighting, simply add a style rule for the class 'highlight' in your style sheet.  If the &lt;code class=&quot;noindent&quot;&gt;@mark_term&lt;/code&gt; is not nil or 0 characters, then the search must not have returned any results, so we simply display 'No Results'.  Otherwise, we show nothing since this would indicate that the search field has been cleared.
				&lt;/li&gt;
			&lt;/ol&gt;
			
			In just 7 painless steps we were able to create a piece of functionality that I wouldn't have dreamed possible back in 1999.  I have to admit that my initial reaction to such a cool feature (given so little code) was nothing less than a giddy feeling of amazement.  However, there are some things I do feel uncomfortable with here, and this being my blog, I'm gonna go ahead and discuss them. &lt;br /&gt;&lt;br /&gt;
			&lt;dl id=&quot;complaintList&quot;&gt;
				&lt;dt&gt;We use an &lt;code class=&quot;noindent&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag that isn't wrapped with a &lt;code class=&quot;noindent&quot;&gt;&amp;lt;form&amp;gt;&lt;/code&gt; tag.&lt;/dt&gt;
				&lt;dd&gt;
				I'm not sure if I should be as bothered by this as I am, but it just doesn't feel right to have form elements without a form. Let's take a look at the W3C's definition of form elements:
				&lt;blockquote style=&quot;font-style:italic&quot;&gt;Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form.&lt;/blockquote&gt;  The last part is what gets me: &lt;em&gt;in a form&lt;/em&gt;.  Form elements allow you to capture data &lt;em&gt;in a form&lt;/em&gt;.  But we have no form here.  I suppose you could argue that wrapping the input tag with a form element will do no harm here and will make the page more semantically correct, however; the action attribute would be left empty (or useless, since we have no submit button,) and that would open up a whole new basket of worries.  &lt;br /&gt;
				&lt;br /&gt;	
				It is at this point I realized that Ajax functionality may come at a cost.
				&lt;/dd&gt;

				&lt;dt&gt;Rails provides a &lt;code class=&quot;noindent&quot;&gt;text_field&lt;/code&gt; html helper that seems unusable&lt;/dt&gt;
				&lt;dd&gt;
				There is built in support for generating html form elements, but I find them to be unusable in this case.  The html form helpers seem to work &lt;em&gt;only&lt;/em&gt; when the form is backed by an actual model object.  If I am missing something here, please let me know.
				&lt;/dd&gt;

				&lt;dt&gt;The &lt;code class=&quot;noindent&quot;&gt;observe_field&lt;/code&gt; kind of just &lt;em&gt;hangs out&lt;/em&gt; on the page&lt;/dt&gt;
				&lt;dd&gt;I find it to have no semantic meaning or proper place.  Perhaps all of the observers should be registered in a single place, but I'm not sure if that makes sense either.  I suppose you could argue that the  &lt;code class=&quot;noindent&quot;&gt;&amp;lt;script&amp;gt;&lt;/code&gt; or &lt;code class=&quot;noindent&quot;&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag is just as semantically incorrect.  In any event, it bothers me.&lt;/dd&gt;

				&lt;dt&gt;The search is not persisted in the session&lt;/dt&gt;
				&lt;dd&gt; I'm assuming this can be fixed.  Perhaps this will be the topic of a later post.&lt;/dd&gt;


				&lt;dt&gt;No JavaScript For You!&lt;/dt&gt;
				&lt;dd&gt;
				&lt;p&gt;I personally feel very strongly against limiting a site's core functionality when the user has Javascript disabled.  I can see this issue becoming less and less prominent as more mainstream sites are depending on Javascript for core functionality, however; I still see the need to support browsers sans Javascript (Certainly in the case of search functionality.)  
				&lt;/p&gt;
				&lt;p&gt;
				If Javascript is disabled in our example here, the user has no way of knowing how to search.  They'll enter some text, hit enter, wait, and then get frustrated and leave.  Therefore, a button should be displayed for the user when Javascript is disabled (or when the XMLHttpRequest object is not available on the user's browser.)  At first glance this problem does not seem to be trivial. There are many factors to consider here (one being the previously stated absence of a form tag and submit button.)  This will be the topic of a later post.  
				&lt;/p&gt;	
			&lt;/dd&gt;
			&lt;dt&gt;Browser Support&lt;/dt&gt;
			&lt;dd&gt;
				I tested this code on all of the browsers I had laying around.  I realize this is in no way an exhaustive list, but I found the following browsers to be supported:
				&lt;ul&gt;
						&lt;li&gt;Safari 2.0&lt;/li&gt;
						&lt;li&gt;Firefox 1.5 Mac&lt;/li&gt;
						&lt;li&gt;Firefox 1.0.4 Linux&lt;/li&gt;
						&lt;li&gt;Firefox 1.0.4 Windows&lt;/li&gt;
						&lt;li&gt;Mozilla 1.7.8 Linux&lt;/li&gt;
						&lt;li&gt;Konqueror 3.5&lt;/li&gt;
						&lt;li&gt;Epiphany 1.6.0&lt;/li&gt;
						&lt;li&gt;Opera 8.51 Mac&lt;/li&gt;
						&lt;li&gt;IE 5.5 Windows&lt;/li&gt;
						&lt;li&gt;IE 6 Windows&lt;/li&gt;
					&lt;/ul&gt;
and these browsers to be unsupported:
					&lt;ul&gt;
					
						&lt;li&gt;IE 5.2.3 Mac&lt;/li&gt;
						&lt;li&gt;Opera 7.5.4 Mac&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/dd&gt;
			&lt;/dl&gt;

&lt;em&gt;Update - 3/13/2006:&lt;/em&gt;  I've added a followup to this post &lt;a href=&quot;/blog/live_search_2&quot;&gt;here&lt;/a&gt;.&lt;br  /&gt;&lt;br /&gt;


&lt;em&gt;Update - 5/1/2006:&lt;/em&gt;  I've added another followup &lt;a href=&quot;/blog/live_search_3&quot;&gt;here&lt;/a&gt;.&lt;br  /&gt;&lt;br /&gt;

</content>
   </entry>
 
   <entry>
     <title>Bittersweet Nostalgia</title>
     <link href="http://joestelmach.com/2006/01/18/Bittersweet-Nostalgia.html"/>
     <updated>2006-01-18T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/01/18/Bittersweet-Nostalgia</id>
     <content type="html">&lt;img src=&quot;/images/ticket-5-22-1999.jpg&quot; alt=&quot;Dave Ticket&quot; style=&quot;float:right;margin:0 0 15px 15px;&quot;/&gt;
&lt;p&gt;
As a deterrent to my infinite boredom, I've decided to digitize my &lt;a href=&quot;http://www.joestelmach.com/concerts&quot;&gt;reminiscence of concert experiences&lt;/a&gt;.  In other words, I've taken the time to scan all the old concert tickets I have laying around.  The oldest ticket I found is from a 1999 Dave Matthew's Concert at Veterans Stadium in Philadelphia.  Since then, Dave and company have released 4 more studio albums, I went and saw them 11 more times, and Veterans Stadium has been imploded and is now a parking lot.  I feel old.
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Web 2.0 Whining</title>
     <link href="http://joestelmach.com/2006/01/17/Web-two-point-o-whining.html"/>
     <updated>2006-01-17T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/01/17/Web-two-point-o-whining</id>
     <content type="html">&lt;p&gt;
			I have nothing but the utmost respect for Mr. Jeffrey Zeldman.  If it wasn't for him and that beautiful orange book he wrote back in 2003, I wouldn't be half as motivated to create clean content for the web.  That being said, I'm a bit disappointed that he has &lt;a href=&quot;http://www.alistapart.com/articles/web3point0&quot;&gt;fallen victim to the nonsensical whining&lt;/a&gt; of anti-web-2.0 zealots.  I don't see the point and I wish it would all just go away.
			&lt;/p&gt;
			&lt;p&gt;
			As I've said before, I'm not a fan of buzzwords and there's nothing I hate more than a middle manager with a head full of technologies he knows nothing about.  But let's forget about all that and think about what it is we are trying to accomplish. I don't know about you, but I would like to make better web sites. Web sites with better usability.
			&lt;/p&gt;
			&lt;p&gt;
Let's face it, Tim Berners-Lee never fathomed the web would be used the way we use it today when he was sitting behind a NeXTcube.  The HTML protocol was just not made to support rich e-mail clients that check our spelling as we type, or maps that allow us to drag them around transparently fetching more information from the server in the background. I don't see how anybody could disagree with the fact that these features enhance a user's experience on the web, and they would simply not be possible without AJAX or some other still undiscovered technology.
		&lt;/p&gt;
		&lt;p&gt;
		I'm also sick of hearing that AJAX provides &lt;em&gt;nothing new&lt;/em&gt;.  That AJAX is the same old javascript with fancy API's written on top.  This is simply not true.  AJAX is a collection of technologies that, until recently, nobody thought to stick together.  Nobody is claiming the javascript to be interesting.  It's the way javascript is being used to invoke other available resources, namely the XmlHttpRequest object, that makes things interesting.  I will agree that these technologies were available in some capacity since Internet Explorer 5, but who cares!  Do we disdain AJAX as a technology just because it is a collection of existing technologies that nobody had the mental capacity and creativity to stick together before now?  I think not.
		&lt;/p&gt;
		&lt;p&gt;
		The sooner people stop complaining about the improper use of 'Web 2.0' buzzwords and start thinking about what this technology (or concept, or collection of technologies, or whatever &lt;em&gt;you&lt;/em&gt; wish to call it,)  gives us as web developers and how we can embrace it and enhance it, the better off we will be, and the better off the users of our sites will be.  I don't care if venture capitalists are backing a hundred Ruby-based AJAX-driven social networking sites.  I don't care about the money involved or the possibility of another dot-com bubble.  I just care about the technology.  I'm excited about what this technology offers us and I look forward to watching it shape the future of the web.
			&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Portable Time Zones In Rails Applications</title>
     <link href="http://joestelmach.com/2006/01/05/Portable-Time-Zones-In-Rails-Applications.html"/>
     <updated>2006-01-05T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/01/05/Portable-Time-Zones-In-Rails-Applications</id>
     <content type="html">&lt;p&gt;
					It seems like such a simple concept: I live in New Jersey; therefore I would like all of the dated material on my site to be displayed and managed in the Eastern Time zone.  I'm sure some of you are wondering why I'm wasting my time writing about such a simple concept.  Set the server time zone to US/Eastern and all should be well, right?  Not so fast.  Suppose your server is in California and you don't have the option of changing the time zone.  
&lt;/p&gt;
					&lt;p&gt;
					This is the situation I encountered recently while putting this site together to be hosted by Dreamhost.  After thinking way too long about how to solve this problem, I'd like to discuss my solution for maintaining flexible, time zone independent dates in Rails applications. 
					&lt;/p&gt;
					&lt;h4&gt;The Problem&lt;/h4&gt;
					&lt;p&gt;
						Let's take a look at what we're trying to accomplish:
					&lt;/p&gt;
					&lt;ul&gt;
						&lt;li&gt;&lt;code style=&quot;padding-left:0&quot;&gt;Time.now&lt;/code&gt; and &lt;code style=&quot;padding-left:0&quot;&gt;mysql&gt;sysdate()&lt;/code&gt; will produce times in the Pacific Time zone, but we would like to store and display these times in the Eastern Time zone.&lt;/li&gt;
						&lt;li&gt;We would like all of our dates to be managed in the Eastern Time zone.&lt;/li&gt; 
					&lt;/ul&gt;
					&lt;p&gt;
						That's it.  Seems simple enough right?  
					&lt;/p&gt;

					&lt;h4&gt;What most people will probably do at first&lt;/h4&gt;
					&lt;p&gt;
					OK, the server is on Pacific Time, so all dates generated on the system clock will be in Pacific Time.  The Pacific Time zone is exactly 3 hours behind the Eastern Time zone, so the problem can be fixed by simply adding 3 hours to all the dates being generated by the System clock.  Your SQL will change to: &lt;code&gt;mysql&amp;gt;date_add(sysdate(), interval 3 hour);&lt;/code&gt;&lt;br/&gt;
					
					and, more appropriately for a Rails application, Your Ruby code will change to:&lt;br/&gt;
					&lt;code&gt;time_in_eastern = Time.now() + (60 * 60 * 3)&lt;/code&gt;&lt;br/&gt;
&lt;/p&gt;
					&lt;p&gt;
					So we're close to coming up with a solution: our users will give us all times in the Eastern Time zone, and all system clock generated times will be converted to the Eastern Time zone by adding 3 hours.  In researching message boards and articles on the subject, it seems like this is probably the most popular solution (not necessarily only for Rails apps, but in general.)  However, we should consider the following drawbacks to this solution:
					&lt;/p&gt;
					&lt;ol&gt;
						&lt;li&gt;&lt;code style=&quot;padding-left:0&quot;&gt;strftime(&quot;%Z&quot;)&lt;/code&gt; will still display the Pacific Time zone by default for any dates retrieved with ActiveRecord.&lt;/li&gt;
						&lt;li&gt;Your application will be hard-coded with a 3 hour interval difference.  What if webspace becomes ridiculously cheap in Russia and you'd like to move your application? (Hey, music is, so why not web space?)&lt;/li&gt;
						&lt;li&gt;If you decide at a later time that you would like to work with your dates in some other time zone, say Central time, you will need to change the time interval in your code to 2 instead of 3, and subtract an hour from all the dates that have been stored already.  Not exactly portable. &lt;/li&gt; 
					&lt;/ol&gt;&lt;br/&gt;
					&lt;h4&gt;Where does this leave us?&lt;/h4&gt;
					&lt;p&gt;
						OK, so &lt;code style=&quot;padding-left:0&quot;&gt;strftime(&quot;%Z&quot;)&lt;/code&gt; is displaying Pacific Time, even though we are sure that all of our times are stored as Eastern Time.  Believe it or not, this can be fixed with a simple configuration of your application.  Whooaa! A configuration...In a Rails app?  But that's impossible! 
					&lt;/p&gt;
					&lt;p&gt;The Rails team prides itself on 'convention over configuration,' and for the most part, following the conventions will lead to predictable results.  However, in this situation, the convention is for ActiveRecord to default to using whatever time zone your server is in when retrieving dates.  This is a problem for us, since we would like to work with our dates in some other time zone.  The solution requires us to add an entry to the bottom of the environment.rb file (under the /public directory):&lt;br /&gt;
	&lt;pre&gt;&lt;code&gt;ActiveRecord::Base.default_timezone = :est&lt;/code&gt;&lt;/pre&gt;
					This will tell ActiveRecord to retrieve all dates as Eastern Time Zone dates, regardless of the server's actual time zone.
					&lt;/p&gt;
					&lt;p&gt;  Now all of the bases are covered, and we have come up with a first run solution to the problem.  If this solution works for you, and you are happy with keeping track of all these conversions, then go for it.  I personally would like a better solution.  A solution that would allow me to move my application, or my database, to a server living in a different time zone.  I would also like the freedom to change my mind as to what time zone my application prefers to work in (think about selling your application to a customer.  Shouldn't &lt;em&gt;they&lt;/em&gt; choose the time zone?)
					&lt;/p&gt;
          &lt;br/&gt;
					&lt;h4&gt;Enter UTC Time&lt;/h4&gt;
					&lt;p&gt;
					UTC, or Universal Time Code, is a modern day synonym for Greenwich Mean Time (they are not &lt;em&gt;exactly&lt;/em&gt; the same, but for our purposes here, they can be thought of as the same.)  If we store all of our dates in UTC, then we have the freedom of moving our application and our database to servers in any time zone.  Additionally, we can use an environment variable to tell our application what time zone to use when generating timestamps off of the system clock.  The Ruby &lt;a href=&quot;&quot;&gt;Time API&lt;/a&gt; is written to transparently handle all of the conversions between our local time zone dates, and the UTC dates we will be storing in the database.  
					&lt;/p&gt;	
					&lt;h4&gt;Let's Implement&lt;/h4&gt;
					&lt;p&gt;
					First we'll edit our environment.rb file to inform ActiveRecord that our dates are stored in UTC:&lt;br /&gt;
					&lt;pre&gt;&lt;code&gt;ActiveRecord::Base.default_timezone = :utc&lt;/code&gt;&lt;/pre&gt;
					Now, we'll add an additional entry to the environment.rb file to set up an environment variable informing rails that the local time zone should be Eastern Time:&lt;br /&gt;
					&lt;pre&gt;&lt;code&gt;ENV['TZ'] = 'US/Eastern'&lt;/code&gt;&lt;/pre&gt;
					And thats it!  Our application is now configured for portable time zones.  As a best practice, I would recommend appending '_UTC' to the end of the database column name responsible for storing your dates.  This will make it obvious to anyone viewing the table that the dates are stored in UTC.
					&lt;/p&gt;
          &lt;br/&gt;
          &lt;br/&gt;
					&lt;h4&gt;Common Usage of The Time API&lt;/h4&gt;
					&lt;p&gt;
					Our app is now configured and ready to roll, so lets look at how we can easily work with our new portable dates with the use of the Ruby Time library. For the following code snippets, let's assume we have a 'Blog' model with a column 'date_added_utc'&lt;br /&gt;
&lt;/p&gt;
					&lt;ul&gt;
						&lt;li&gt;
							&lt;code&gt;Time.now&lt;/code&gt; -&amp;gt; The current timestamp in Eastern Time.
						&lt;/li&gt;
						&lt;li&gt;
							&lt;code&gt;Time.now.utc&lt;/code&gt; -&amp;gt; The UTC representation of the current timestamp.  This should be used to convert times to UTC before being stored in the database. 
						&lt;/li&gt;
						&lt;li&gt;
						&lt;code&gt;Blog.find(id).date_added.utc.localtime&lt;/code&gt; -&amp;gt; The Eastern Time zone representation of the date_added_utc field.  This should be used when retrieving dates from the database.
						&lt;/li&gt;
						&lt;li&gt;
							&lt;code&gt;Blog.find(id).date_added_utc.utc?&lt;/code&gt; -&amp;gt; Evaluates to True.  Use this method to test if dates are in UTC form.
						&lt;/li&gt;
					&lt;/ul&gt;
&lt;br /&gt;

					&lt;h4&gt;Aren't We Forgetting Something?&lt;/h4&gt;
					&lt;p&gt;
					When discussing the problems with time zones, we said that &lt;code style=&quot;padding-left:0&quot;&gt;mysql&amp;gt;sysdate()&lt;/code&gt; generated times in the wrong time zone.  We haven't said a word about it since.  I personally feel that you shouldn't ever have to use this in your Rails apps, since you would be straying from the ORM-driven path provided by ActiveRecord.  However, I realize that some developers might wish to use straight SQL in their applications, so I'm here to help.  If you would like to generate current UTC timestamps in sql, you can use the &lt;code style=&quot;padding-left:0&quot;&gt;convert_tz&lt;/code&gt; construct (If your using MySql, this is only available in versions 4.1.3 and greater.)  The syntax is as follows:&lt;br/&gt;
					&lt;pre&gt;&lt;code&gt;mysql&amp;gt;convert_tz(systime(), 'PST', 'UTC')&lt;/code&gt;&lt;/pre&gt;
					This will return the conversion of the current system time from Pacific Time to UTC time.  Remember, we are once again at the mercy of the location of the database server.  In order to make this a bit more maintainable, we could use a sepaarate environment variable to specify the time zone of the database server so it won't be hard-coded in our application.  But again, my advice is to not use database-generated timestamps in favor of working directly in Ruby.  If you disagree, then this should give you some direction as to how to use them practically to keep your application maintainable. 
					&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>New York City Randomness</title>
     <link href="http://joestelmach.com/2006/01/02/New-York-City-Randomness.html"/>
     <updated>2006-01-02T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2006/01/02/New-York-City-Randomness</id>
     <content type="html">&lt;p&gt;
	&lt;img src=&quot;/images/randomBoots.jpg&quot; alt=&quot;Random Ugly Boots&quot; style=&quot;float:left;margin:0 15px 15px 0&quot;/&gt;
	New York City is filled with so much absolute randomness, that I often feel the need to document some things as I go through the day.  This picture surely speaks for itself, but I think it helps to point out that the price tag is $250.00.  I have to concede I did take part in some fashion crazes during the late 80's and early 90's (Z cavaricci anyone?)  But at least I can say I was just a stupid kid back then.  Grown women are buying these things!  Weird.
	&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>The Daily What The F&#37;&#64;&#33;</title>
     <link href="http://joestelmach.com/2005/12/29/The-Daily-WTF.html"/>
     <updated>2005-12-29T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/12/29/The-Daily-WTF</id>
     <content type="html">&lt;p&gt;
		When people get depressed, it sometimes helps to remind them of certain situations that are worse than the one they are currently in.  If I'm saddened by the fact that I got sick and had to miss the Dave Matthews concert, its easy for me to come to grips with reality when I'm reminded of the fact that some people are sick all of the time, not just for a few days.  
	&lt;/p&gt;
	&lt;p&gt;
		The same concept is certainly valid in the jungle of software maintenance.  If your buddy is given the task of adding some functionality to a piece of obfuscated code, it might help to remind him of some code that has much more serious problems.  This easy to do, given the large collection of nauseating code samples available at &lt;a href=&quot;http://www.thedailywtf.com&quot;&gt;The Daily WTF&lt;/a&gt;.  A simple click of this link, and I assure you that your buddy will be feeling better in no time.
	&lt;/p&gt;
	&lt;p&gt;
		I will leave you with the sole inspiration of this post.  An error message that I hope to never see again during the rest of my career:
	&lt;img src=&quot;/images/wtf.jpg&quot; alt=&quot;error message&quot; style=&quot;float:none&quot;/&gt;
	&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Ipod Love</title>
     <link href="http://joestelmach.com/2005/12/23/Ipod-Love.html"/>
     <updated>2005-12-23T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/12/23/Ipod-Love</id>
     <content type="html">&lt;p&gt;
					I love when this happens...You're wandering along mindlessly listening to your iPod on random play, and you realize, &quot;I haven't heard this song in the longest time.&quot;  Then it all comes pouring back.  The posters that were hanging on the wall in your old bedroom.  The 'best friend' that you haven't spoken with in years.  The girl that broke your heart.  Everything.  These memories come streaming from this song. This music. This chaos of analog waves bouncing around in your head.  The feeling really is amazing.
				&lt;/p&gt;
				&lt;p&gt;
				So if you haven't guessed it, I was fortunate enough to have this experience the other day.  The song was &lt;a href='http://www.google.com/musics?lid=0jSrkXICz7C&amp;amp;aid=1TJdFLDISoE&amp;amp;sid=bVt5XYxg1LB'&gt;Hurt&lt;/a&gt; by &lt;a href='http://www.google.com/musica?aid=1TJdFLDISoE'&gt;Nine Inch Nails&lt;/a&gt;, which was released on The &lt;a href='http://www.google.com/musicl?lid=0jSrkXICz7C&amp;amp;aid=1TJdFLDISoE'&gt;Downward Spiral&lt;/a&gt; album back in 1994.  It's probably been about 6 years since I last heard this song, so I was content with the fact that my iPod chose to play it out of the thousands of choices it had.  But when it rains it pours, right?  A couple days later, I learned while reading Spin Magazine that &lt;a href='http://www.google.com/musica?aid=ArGFpW4fIAL&amp;amp;oi=musicr'&gt;Johnny Cash&lt;/a&gt; did a cover of the song in 2002 on his &lt;a href='http://www.google.com/musicl?lid=quB3IH5V6_G&amp;amp;aid=ArGFpW4fIAL'&gt;American IV: The Man Comes Around&lt;/a&gt; album.  
				&lt;/p&gt;
				&lt;p&gt;I'm here to say that the Johnny Cash version is amazing.  I love how a song can lead multiple lives between artists.  The emotional differences between Trent Reznor in his 20's and Johnny Cash in his 70's is a lot of fun to compare and pick apart.  Download both versions - you won't be dissapointed.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>The Joys Of Rails - ORM and MVC Under One Roof!</title>
     <link href="http://joestelmach.com/2005/12/20/Joys-Of-Rails.html"/>
     <updated>2005-12-20T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/12/20/Joys-Of-Rails</id>
     <content type="html">&lt;p&gt;
				Well, my foray into Ruby territory has led to a complete re-write of this PHP based site (this marks the first post under the new publishing system.)  As I've posted here before, I'm quite impressed with the Rails framework and it's ability to lessen the development of web applications down to implementing what the application &lt;em&gt;actually&lt;/em&gt; does, instead of wasting time implementing system-level details.  These details are not trivial - mapping relational database tables to objects and creating an MVC environment for your code to operate in is  a significant undertaking, as most developers would agree (If you disagree, I'd love to chat.)   
				&lt;/p&gt;
				&lt;p&gt;
				But wait!  Rails isn't the first framework to offer these conveniences.  What about Struts, Hibernate, blah, blah, blah.  I've used them. I even &lt;em&gt;like&lt;/em&gt; them.  But seriously, configuring these frameworks to work with one another can be mind numbing.  Let's not even go into the initial steps involving the inclusion of 8,369 jar files into your project - can you say 'ClassNotFoundException'?  The fact that Rails includes an ORM implementation AND an MVC implementation, both under the SAME project, is something very special.  Let's look at some pitfalls that Rails makes a thing of the past.
				&lt;/p&gt;
				&lt;h4&gt;Java Beans&lt;/h4&gt;
				&lt;p&gt;
				Plain vanilla Java beans are a great way to store, access, and transfer data in the object domain.  This is not rocket science and has been well known for a long time.  The problem is that everyone wants their own slice of the pie.  Both Hibernate and Struts want to use their own set of java beans, even though they both describe &lt;em&gt;exactly&lt;/em&gt; the same data.  What's even more annoying is that Struts requires its java beans to ride the short bus to school: they can only store String objects (Okay, and Boolean, but that doesn't really help.)  This means that your data needs to be continually shuffled between the Struts beans, your business objects, and the beans used in your persistence layer. 
				&lt;/p&gt;
				&lt;p&gt;Many developers, including myself, feel that multiple sets of java beans are a redundant waste of time, code, and money.  This is the topic of many flame wars, and can be compared to the Eagles playing the Giants.  The bottom line is that I don't want to write &lt;em&gt;any&lt;/em&gt; java beans.  getThis(), setThat(), how about forgetItAllAndUseRails().
				&lt;/p&gt;

				&lt;h4&gt;XML&lt;/h4&gt;
				&lt;p&gt;
				I've been writing J2EE applications long enough that editing XML configuration files has become second nature to me.  If someone is touting that their jar file will make your life easier, you can expect that it needs at least one XML file.  This isn't exactly a &lt;em&gt;bad&lt;/em&gt; idea, its just that it may be an unnecessary step and can lead to lots of headaches during maintenance.  
				&lt;/p&gt;
				&lt;p&gt;
				Okay, now its time for another flame war: Rails circumvents XML files by having the developer follow naming conventions.  Yes, this means that you &lt;em&gt;must&lt;/em&gt; name things in certain ways if you want them to work properly.  This rates right up there with Emacs vs. Vi.  I can't count the number of times I've gotten into an argument over the naming of different things: 
				&lt;/p&gt;
				&lt;ul&gt;
					&lt;li&gt;&quot;We shouldn't use underscores in the table and column names, your waisting a character!&quot;&lt;/li&gt;
					&lt;li&gt;This table should be plural since the cardinality of the relationship is one to many!&quot;&lt;/li&gt;
					&lt;li&gt;That variable name is descriptive, but its way too long!&quot;&lt;/li&gt;
				&lt;/ul&gt;
				&lt;p&gt;
				It turns out that there are no absolute rules when it comes to naming these types of things, and I might not agree with all of the naming conventions chosen for Rails, but at the end of the day I really don't care.  Those conventions make sense to some people (very smart people actually,) and I can live with them if it means that I don't have to waste any more time editing XML files.  I think in most cases (not all cases,) XML is an application band-aid, especially when the XML is being used for configuration.  The only problem is that the application never heals, so the band-aid is never removed. 
				&lt;/p&gt;
		
				&lt;h4&gt;Conclusions&lt;/h4&gt;
				&lt;p&gt;
					I'm not convinced 100% that Rails will take over the world.  But I am convinced that ORM and MVC should be available in a single framework (Not to mention the other great features of Rails like the testing module.) 
				&lt;/p&gt;
				&lt;pre&gt;&lt;code&gt;&amp;lt;action path = &quot;convert&quot;
    type = &quot;com.joestelmach.actions.StrutsToRubyConverter&quot;
    input = &quot;struts.jsp&quot;&amp;gt;
  &amp;lt;forward name=&quot;rubyConversionSuccess&quot; path=&quot;theJoysOfRuby.jsp&quot; &amp;gt;
&amp;lt;/action&amp;gt;&lt;/code&gt;&lt;/pre&gt;

</content>
   </entry>
 
   <entry>
     <title>Ruby Suggestion</title>
     <link href="http://joestelmach.com/2005/11/25/Ruby-Suggestion.html"/>
     <updated>2005-11-25T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/11/25/Ruby-Suggestion</id>
     <content type="html">&lt;p&gt;
					As I inch my way towards the Ruby conversion of this site, I can't help but to stop and think about how cool this stuff really is.  If you are a web developer, I suggest you try the following:
				&lt;/p&gt;
				&lt;ul&gt;
					&lt;li&gt;Buy a copy of &lt;a href=&quot;http://www.pragmaticprogrammer.com/titles/rails/index.html&quot;&gt;&lt;em&gt;Agile Web Development With Rails&lt;/em&gt;&lt;/a&gt;. (Don't walk, RUN.)&lt;/li&gt;
					&lt;li&gt;Open the book to page 385 and read the chapter on Ajax support titled &lt;em&gt;The Web, 2.0&lt;/em&gt;.&lt;/li&gt;
					&lt;li&gt;If you are not completely blown away by what you are reading, then I have some doubts as so how much web development you've done in the past.&lt;/li&gt;
				&lt;/ul&gt;
				&lt;p&gt;
				Let me say that I'm not a big fan of buzzwords.  In fact, I &lt;em&gt;loathe&lt;/em&gt; them. One of the biggest dangers to a company's software development is a bunch of middle-managers with their head's full of buzzwords (&quot;We need to move all internal database access to a web service with SOAP built on top of SOA with a Portlet view ASAP!&quot;)  However, after reading this chapter, I feel strongly that AJAX will help to lift the &lt;em&gt;'Web 2.0'&lt;/em&gt; buzzword to industry-altering status. 
				&lt;/p&gt;
				&lt;p&gt;
				&lt;em&gt;&quot;I remember the days when a web form needed to be submitted to an actual web server to be processed.  Your typing wasn't even spell-checked for you!&quot;&lt;/em&gt;
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Guster At Nokia Theater</title>
     <link href="http://joestelmach.com/2005/11/22/Guster-At-Nokia-Theater.html"/>
     <updated>2005-11-22T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/11/22/Guster-At-Nokia-Theater</id>
     <content type="html">&lt;p&gt;
				&lt;img src=&quot;/images/guster2.jpg&quot; alt=&quot;Picture of Guster&quot; style=&quot;float:left;margin:0 15px 15px 0;&quot;/&gt;
				Guster has got to be one of the most unique bands of our time.&amp;nbsp;&amp;nbsp;Sure, lots of people have never heard of them, but seriously, how often do you get to experience a band play with a drumstick-less percussionist?  I've had the oppurtunity several times now, all of which were at a Guster concert. 
				&lt;/p&gt;
				&lt;p&gt;
				The most recent of these experiences was this past Saturday night, when Guster played at the Nokia Theatre in Times Square.&amp;nbsp;&amp;nbsp; Wow.&amp;nbsp;&amp;nbsp;What - A - Venue.&amp;nbsp;&amp;nbsp;This place was ridiculously fancy for a concert like this.&amp;nbsp;&amp;nbsp;When I think of Guster, I think of places like &lt;em&gt;The Electric Factory&lt;/em&gt; and &lt;em&gt;Irving Plaza&lt;/em&gt;, not some place with stained hard-wood flooring and chandeliers.&amp;nbsp;&amp;nbsp;More importantly, the acoustical properties of the stage were spectacular.
				&lt;/p&gt;
				&lt;p&gt;
				The show itself was great.&amp;nbsp;&amp;nbsp;More evidence of Guster's uniqueness was displayed as Chewbaka (from Star Wars,) was brought onto stage in between songs.&amp;nbsp;&amp;nbsp;This reminds me of a particular Guster show in Philly that happened to be right around the start of Hanukkah.&amp;nbsp;&amp;nbsp;A request was made to play the Dredyl Song, which the band granted, but with a Guster-esh twist.&amp;nbsp;&amp;nbsp;The Philadelphia Eagles mascot was brought onto the stage to light a giant menorah with a plunger.&amp;nbsp;&amp;nbsp;Never a dull moment.
				&lt;/p&gt;
				&lt;p&gt;
				The band treated us to a second encore, which consisted of a completely acoustic performace of &lt;em&gt;Jesus on the Radio&lt;/em&gt;.&amp;nbsp;&amp;nbsp;Let me re-iterate here.&amp;nbsp;&amp;nbsp;A &lt;b&gt;completely acoustic&lt;/b&gt; performance.&amp;nbsp;&amp;nbsp;In all the shows I've seen (lots) I've never experienced a band give an all-acoustic performance to a couple thousand people.&amp;nbsp;&amp;nbsp;When does Guster play again?
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Hurricane Wilma</title>
     <link href="http://joestelmach.com/2005/11/12/Hurricane-Wilma.html"/>
     <updated>2005-11-12T00:00:00-05:00</updated>
     <id>http://joestelmach.com/2005/11/12/Hurricane-Wilma</id>
     <content type="html">&lt;p&gt;
				&lt;img src=&quot;/images/hurricaneWilma.jpg&quot; alt=&quot;Picture of Hurricane Wilma Destruction&quot; style=&quot;float:left;margin:0 15px 15px 0&quot;/&gt;
				As I sit on this turbulent plane flying back to Philadelphia, I can't help but to think how lucky I am to live in New Jersey (I know, that sounds funny.) But all kidding aside, the aftermath of hurricane Wilma is a lot worse than most people in the northeast imagine in their minds.  The media's coverage of this hurricane doesn't come close to describing the destruction I've witnessed these past few days while driving from Ft. Lauderdale to Key West.  Imagine throwing most of your belongings (including major appliances that were once a permanent fixture of your home,) out to the curb to be collected by some government agency.  
				&lt;/p&gt;
				&lt;p&gt;I don't doubt that hurricane Rita was a bit more devastating than Wilma, but I find the lack of media attention to Wilma to be a bit startling.  The media absolutely loves to go crazy over life-threatening events.  Consider the New York subway scare that happened last month (Remember, someone was supposed to blow up the subway with a baby carriage.)  I witnessed at least a half dozen news trucks parked out front of Penn Station for several days during the scare to do their news casts.  They were just sitting there, almost waiting for fire and smoke to come pouring out of Madison Square Garden so they could get the best ratings on the 11 o'clock news.  But unlike the subway scare, hurricane Wilma produced actual death and destruction.  I don't get it.
				&lt;/p&gt;
				&lt;p&gt;
				I think the Ft. Lauderdale cab driver was quite articulate in his description of the hurricane: '&lt;em&gt;So much damage my friend, no more trees, no more coconuts&lt;/em&gt;'.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Why The Lucky Stiff</title>
     <link href="http://joestelmach.com/2005/10/27/Why-The-Lucky-Stiff.html"/>
     <updated>2005-10-27T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/27/Why-The-Lucky-Stiff</id>
     <content type="html">&lt;p&gt;
				I've spent my bus ride this week reading through &lt;a href=&quot;http://www.joelonsoftware.com/articles/BestSoftwareWriting.html&quot;&gt;&lt;em&gt;The Best Software Writing I&lt;/em&gt;&lt;/a&gt;, which consists of a bunch of weblogs and essays that have been selected and introduced by Joel Spolsky.  I'm a big fan of Joel's writing and overall beliefs when it comes to software development, so I figured the book would be worth my time.  While the entire book is worth reading, I'd have to say that the last entry, which is titled &lt;em&gt;A Quick (And Hopefully Painless) Ride Through Ruby (With Cartoon Foxes)&lt;/em&gt;, is by far the most entertaining piece of writing on software development that I've ever come across.
				&lt;/p&gt;
				&lt;p&gt;
				The first indication of this article's uniqueness has to be the fact that the author's name is given as 'why the lucky stiff'.  While I'm still unsure of what that means, I do know that I learned more about Ruby in the 15 minutes I spent reading this article then I did in a week working through the tutorial in the &lt;a href=&quot;http://www.pragmaticprogrammer.com/titles/rails/index.html&quot;&gt;&lt;em&gt;Agile Web Development with Rails&lt;/em&gt;&lt;/a&gt; book. The cartoon idea has been used successfully before, like in the &lt;a href=&quot;http://www.oreilly.com/catalog/hfjava/&quot;&gt;&lt;em&gt;Head First Java&lt;/em&gt;&lt;/a&gt; series of books (which I happen to love by the way,)  but this article really brings it to the next level.  Here, we are crossing the line into politically incorrect software writing, and I believe the result is fabulous and incredibly effective.
				&lt;/p&gt;
				&lt;p&gt;
				I was overjoyed to learn that the selection I was reading is just the first chapter of a work in progress that's available &lt;a href=&quot;http://poignantguide.net/ruby&quot;&gt;here&lt;/a&gt;.  The author (whose name I still do not know,) also has a &lt;a href=&quot;http://whytheluckystiff.net&quot;&gt;weblog&lt;/a&gt;.  It would be worth your while to add it to your collection of RSS feeds.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Chuck D From Public Enemy</title>
     <link href="http://joestelmach.com/2005/10/17/Chuck-D.html"/>
     <updated>2005-10-17T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/17/Chuck-D</id>
     <content type="html">&lt;p&gt;
				I was just skimming through this month's issue of &lt;em&gt;Spin&lt;/em&gt; Magazine, when I stumbled upon an interview with Chuck D from Public Enemy.  When the interviewer asked how he can defend the artistic legitimacy of something like Ludacris' &quot;Move Bitch,&quot; Chuck D responded with:
				&lt;/p&gt;
				&lt;blockquote&gt;
				&quot;You &lt;em&gt;can't&lt;/em&gt; defend it.  How do you defend rock groups throwing TVs out hotel-room windows?  You can't; they're just assholes.&quot;
				&lt;/blockquote&gt;
				&lt;p&gt;
				I couldn't agree more with Chuck D's position here.  This comment makes me want to go download some Public Enemy music. 
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Weezer and Foo Fighters @ Continental</title>
     <link href="http://joestelmach.com/2005/10/15/Weezer-And-Foo-Fighters.html"/>
     <updated>2005-10-15T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/15/Weezer-And-Foo-Fighters</id>
     <content type="html">&lt;img src=&quot;/images/weezerNj.jpg&quot; alt=&quot;Picture of Weezer&quot; style=&quot;float:right;margin:0 0 15px 15px&quot;/&gt;
&lt;p&gt;
				Ok, so I'm starting to feel a bit like a concert junkie here.  I went and saw Weezer and Foo Fighters last night at Continental Arena in the beautiful Meadowlands.  The best part - VIP floor standing tickets, which I am still in shock for being able to buy.  As you can see, we were pretty damn close.
				&lt;/p&gt;	
				&lt;p&gt;
					This marks the third time that I've seen Weezer in concert, and I have to say that I was a bit disappointed this time around.  I can think of a few reasons for a lackluster performance:   
				&lt;/p&gt;
				&lt;ul&gt;
					&lt;li&gt;Rivers needs to have sex.  Celibacy is just no good for a rock star.&lt;/li&gt;
					&lt;li&gt;The pressures of being a Harvard student must be fairly difficult to deal with.  Maybe Rivers has a mid term next week.&lt;/li&gt;
					&lt;li&gt;Maybe the band (and me,) is just getting older.  It's not 1995 anymore.&lt;/li&gt;
				&lt;/ul&gt;
				&lt;img src=&quot;/images/fooFightersNj.jpg&quot; style=&quot;float:left;margin:15px 15px 15px 0;&quot; alt=&quot;Picture of David Grohl&quot; /&gt;
				&lt;p&gt;
				Foo Fighters on the other hand, whom I've never seen before last night, were just incredible.  Simply put, David Grohl is amazing.  He flows flawlessly from guitar to drums to screaming his lungs out.  I don't remember ever being this impressed with a band after seeing them for the first time.  When referring to illegally downloaded music, Grohl said something to the effect of: &lt;em&gt;&quot;I don't care how you heard it, I don't care if you took the song from your friends ipod, I just care if you know the song and would like to hear me play it.&quot;&lt;/em&gt;  Those are the words of a musician who cares more about music then about money.  Unlike some other bands we know of (cough, cough - Metallica.)
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Ruby On Rails</title>
     <link href="http://joestelmach.com/2005/10/13/Ruby-On-Rails.html"/>
     <updated>2005-10-13T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/13/Ruby-On-Rails</id>
     <content type="html">&lt;p&gt;
				All this talk about Ruby on Rails - &lt;a href=&quot;http://www.alistapart.com&quot;&gt;A List Apart&lt;/a&gt; is now using it, a multitude of users on &lt;a href=&quot;http://www.theserverside.com&quot;&gt;The Server Side&lt;/a&gt; and other message boards are using it, and they are all saying the same thing - it's the hottest new thing in web development.  What's next?  Will I read on Slashdot tommorow morning that Amazon.com and ebay have switched over to a Ruby on Rails system?  Not likely, but my interest has been stirred enough to install the framework and work through the basic &lt;a href='http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html'&gt;tutorial&lt;/a&gt; involving the creation of a thrilling recipe book application.
				After completing the tutorial, which took about 20 minutes once I got past some installation headaches, I have to say that I am highly impressed.  I am so taken aback by the results that I'm thinking of moving this PHP-based site over to Ruby on Rails immediately (cold weather is coming soon anyway, I'll need a winter project.)  
&lt;/p&gt;
				&lt;p&gt;
					The framework is not without flaw though.  Documentation is sparse, and as I mentioned before, the installation on my powerbook was a bit of a struggle (Admittedly, I didn't look all that hard for help outside of the documentation, but should I really have to?)
				The trouble started while working through the recipe tutorial. All was going fine until about page 3, when it came time to start up the web server and test the application, which resulted in the following strange error:
&lt;/p&gt;
				&lt;div class='command'&gt;
					ActiveRecord::StatementInvalid in Recipe#new&lt;br /&gt;
					No database selected: SHOW FIELDS FROM recipes
					script/server:49
				&lt;/div&gt;
&lt;p&gt;
				After a bit of frustration, I realized that I had never installed the framework's mysql component.  I attempted this with the following command, as per the documentation:
&lt;/p&gt;
				&lt;div class='command'&gt;gem install mysql &lt;/div&gt;
				&lt;p&gt;Which resulted in the following nasty output:&lt;/p&gt;
				&lt;div class='command'&gt;
					pbook:/Users/joe/Rails root# gem install mysql -- -with-mysql-dir=/usr/local/mysql&lt;br /&gt;
					Attempting local installation of 'mysql'&lt;br /&gt;
					Local gem file not found: mysql*.gem&lt;br /&gt;
					Attempting remote installation of 'mysql'&lt;br /&gt;
					Building native extensions.  This could take a while...&lt;br /&gt;
					ERROR:  While executing gem ... (RuntimeError)&lt;br /&gt;
					ERROR: Failed to build gem native extension.&lt;br /&gt;
					Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.6 for inspection.&lt;br /&gt;
					ruby extconf.rb install mysql -- -with-mysql-dir=/usr/local/mysql\nchecking for mysql_query() in -lmysqlclient... no&lt;br /&gt;
					checking for main() in -lm... yes&lt;br /&gt;
					checking for mysql_query() in -lmysqlclient... no&lt;br /&gt;
					checking for main() in -lz... yes&lt;br /&gt;
					checking for mysql_query() in -lmysqlclient... no&lt;br /&gt;
					checking for main() in -lsocket... no&lt;br /&gt;
					checking for mysql_query() in -lmysqlclient... no&lt;br /&gt;
					checking for main() in -lnsl... no&lt;br /&gt;
					checking for mysql_query() in -lmysqlclient... no&lt;br /&gt;

	&lt;/div&gt;
&lt;p&gt;
	I decided to try and install from source, noting from the manual that this must be done with gcc 3.3 as follows: 
&lt;/p&gt;
	&lt;div class='command'&gt;
		sudo gcc_select 3.3&lt;br /&gt;
ruby extconf.rb install mysql -- --with-mysql-config=/usr/local/mysql-standard-4.1.12-apple- darwin7.9.0-powerpc/bin/mysql_config
	&lt;/div&gt;
&lt;p&gt;
	All was happy after this.  I still can't get over the amount of work I didn't have to do to get this thing to do something interesting.  No sql strings leading to concatenation-hell, no connection management, no form processing, and barely any code at all.  Pretty cool.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Third Eye Blind and David Gray</title>
     <link href="http://joestelmach.com/2005/10/09/Third-Eye-Blind-and-David-Gray.html"/>
     <updated>2005-10-09T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/09/Third-Eye-Blind-and-David-Gray</id>
     <content type="html">&lt;p&gt;
				&lt;img src='/images/davidGrayNy.jpg' style='float:right;margin:0 0 15px 15px;' alt='David Gray Picture'/&gt;
				I think I broke a personal record this past week for the most concerts seen in a one week period.  Following the Pearl Jam show on Saturday, I went and saw Third Eye Blind for the first time at the Starland Ballroom.  Once I got past the fact that the only people in the audience older than me were there with their kids, I had an awesome time.  Hearing &lt;em&gt;Motorcycle Drive By&lt;/em&gt; live in a little Jersey Bar like the Starland was nothing short of spectacular. 
				&lt;/p&gt;
				&lt;p&gt;
				The following night I was fortunate enough to see David Gray from the 15th row at Radio City.  Quite a different crowd and performance compared to the night before.  He played his new album, &lt;em&gt;Life In Slow Motion&lt;/em&gt;, basically in its entirety.  I was a little dissapointed that I didn't hear much off of &lt;em&gt;White Ladder&lt;/em&gt;, but he did play &lt;em&gt;Babylon&lt;/em&gt;, which was pretty much the only song that got that old crowd off its feet.  Like I said, a bit different than the Third Eye Blind concert. 
				&lt;/p&gt;
				&lt;p&gt;
					I'm gonna rest up the next couple of days so I'll be ready to see Weezer and Foo Fighters this Friday at Continental Arena.  I think that the only benefit to being done with school is that I can now afford to see lots of shows. 
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Pearl Jam @ The Borgata</title>
     <link href="http://joestelmach.com/2005/10/03/Pearl-Jam-Borgata.html"/>
     <updated>2005-10-03T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/10/03/Pearl-Jam-Borgata</id>
     <content type="html">&lt;p&gt;
				&lt;img src='/images/pearlJamBorgata.jpg' style='float:right;margin:0 0 15px 15px;' alt='Pearl Jam Picture'/&gt;
				By some brilliant stroke of luck, I was able to get tickets to see Pearl Jam last night at the Borgata.  Yes, the Borgata, whose seating capacity is just shy of 3700, hosted Pearl Jam, who has no problem selling out crowds of 25,000 or more.  Such a big band in such a small place.  
				&lt;/p&gt;
				&lt;p&gt;We got there just before Sleater-Kinney came out to open up the show and were greeted by Eddie Vedder performing a cover of Bruce Springsteen's &lt;em&gt;Atlantic City&lt;/em&gt;.  How appropriate.  As he walked off stage, he said to the crowd &lt;em&gt;'I hope I didn't mess that up too bad, but if I did, I'll have the entire evening to make it up to you.'&lt;/em&gt;  As the night went on, the concert was nothing but the typical Pearl Jam style: Drink lots of wine and play for a really long time.
				&lt;/p&gt;
				&lt;p&gt;
				Listening to them play the old stuff like &lt;em&gt;Alive, Porch,&lt;/em&gt; and &lt;em&gt;Evenflow&lt;/em&gt; really brought me back to the days of baggy pants and skateboards.  I think I'm getting old.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Back to School this Fall</title>
     <link href="http://joestelmach.com/2005/09/28/Back-To-School.html"/>
     <updated>2005-09-28T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/09/28/Back-To-School</id>
     <content type="html">&lt;p&gt;
					Going back to school for my Phd in Computer Science has certainly crossed my mind plenty of times.  The working world I'm currently immersed in is simply not cutting it for me in terms of mental stimulation.  Since a Phd is not likely at this time due to not having a topic I'd like to pursue, and not being in a position to be broke for the next four years, I decided to go back to school to get in touch with my creative side instead.  I'm taking a course in Black and White Photography at the &lt;a href='http://www.schoolofvisualarts.edu/'&gt;School of Visual Arts&lt;/a&gt;.  So far, it seems like a Phd might have been cheaper and maybe even easier!  I had no idea what I was getting myself into.  
					&lt;/p&gt;
					&lt;p&gt;
					This picture should give you an idea as to how much stuff I needed to buy just to get started with this course.  &lt;img src='/images/photoSupplies.jpg' alt='Picture of Photo Supplies' style=&quot;float:left;margin:15px 15px 15px 0;&quot;/&gt;  If you're wondering what all this stuff could possibly be used for, let me just add that all the film taken for the class will be developed at home.  This process begins by popping open the film, cutting it off the roll, and threading it onto a spool. This wouldn't be all that bad, except for the fact that it all must be done inside a lightproof bag (yes, there are holes in the bag for you to stick your arms through,) which means you can't exactly see what you're doing.  The film is then developed in the bath tub and hung on the shower curtain to dry.  Like I said, I had no idea. 
					&lt;/p&gt;
					&lt;p&gt;I think the course will prove to be valuable even for a geek programmer like myself.  Creativity during coding is very similar to, if not the same thing, as an artist's creativity.  I firmly believe that combining the talents of an artist and a coder can offer some fresh perspectives on any programming project.
					&lt;img src='/images/camera.jpg' style='float:left;margin:15px 15px 15px 0;' alt='Picture of camera'/&gt;
					&lt;/p&gt;
					&lt;p&gt;
					I'm sure some people, including most of my colleagues, will either disagree with me on this point or tell me that a programmer has no right being creative in the first place.  I think most of these people have never been exposed to any kind of artistic activity.  Some of the most talented people in Computer Science (people like &lt;a href='http://www.paulgraham.com'&gt;Paul Graham&lt;/a&gt; , author of &lt;a href='http://www.paulgraham.com/hackpaint.html'&gt;Hackers and Painters&lt;/a&gt; comes to mind,) have studied some form of artistic expression in the past.  Whatever stance you take on this, I'm sure you'll agree with me on one thing:  This old school Nikon FM2 film camera is HOT!
					&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Reflections of a Ti</title>
     <link href="http://joestelmach.com/2005/09/20/Reflections-Of-a-Ti.html"/>
     <updated>2005-09-20T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/09/20/Reflections-Of-a-Ti</id>
     <content type="html">&lt;p&gt;
					As I wait patiently for my shiny new Beemer to arrive, I thought it necessary to reflect on how truly awesome my '96 318ti was at one time, even if it has been burnt to a crisp and sold off to salvage.  The image you see below represents the ti's true heyday, the year that the car was invited to compete at the IASCA World Finals in Greenville, SC.  The year was 1999, and the amplifiers in the trunk were polished brighter than the wheels.  For some reason I doubt I will ever have a trunk that looks like that again.  But who knows. &lt;br/&gt;&lt;img style=&quot;margin:10px auto 10px auto&quot; src=&quot;/images/318trunk.jpg&quot; alt=&quot;BMW 318ti - 1999&quot; /&gt;
					&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>My Love For Vi</title>
     <link href="http://joestelmach.com/2005/09/19/My-Love-For-Vi.html"/>
     <updated>2005-09-19T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/09/19/My-Love-For-Vi</id>
     <content type="html">&lt;p&gt;
				There are certain things in life that I wish I had: a Porsche 911 turbo, a two bedroom brownstone in Hoboken, and a full featured vi text editor.  My love for vi started sometime around the Spring semester of 2001, when I was a sophomore in college.  The phrase &lt;em&gt;'Pico makes you dumb!'&lt;/em&gt; was constantly thrown at me by my squeaky-voiced unix guru of a professor.  Ever since then, I've found myself to be much more productive using the vi keybindings.  This wasn't a problem for the rest of college and grad school, as this practice was acceptable and even encouraged by my professors and peers.  Then came the real world I am now stuck in, full of WordPad using, vi hating (or vi oblivious,) point and click loving co-workers.
				&lt;/p&gt;
				&lt;p&gt;
				These people wouldn't learn vi if they were paid double time to do it.  &lt;em&gt;'It's so cryptic, how could you ever use that' &lt;/em&gt; they say, as I shake my head in disagreement.  &lt;em&gt;'Where's the tabbed interface?' &lt;/em&gt; they ask.  Now I'm cornered.  I start to explain how the editor can handle multiple buffers at the same time, but then I realize that they're right.  I would like a tabbed interface.  I would like to have multiple vim windows running under OS X (without having some stupid helper application that sits on my Desktop where I drag files to.)  I wouldn't mind a file browser with a native view of the file system.    
				&lt;/p&gt;
				&lt;p&gt;
				It doesn't seem likely for a application like this to emerge, even with the seemingly endless number of hardcore programmers that would rather die than use a different editor.  Maybe some of these programmers don't need or even want the cute bells and whistles I'm hoping for.  Or maybe the real world is turning me into a softie.  One thing is for sure: If I ever become a WordPad user, then I'm taking up a career in art.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Coldplay</title>
     <link href="http://joestelmach.com/2005/09/05/Coldplay-PNC.html"/>
     <updated>2005-09-05T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/09/05/Coldplay-PNC</id>
     <content type="html">&lt;p&gt;
	&lt;img src=&quot;/images/xy.jpg&quot; alt=&quot;Album Cover&quot; style=&quot;float:right;margin:0 0 15px 15px;&quot;/&gt;
	I Went and saw Coldplay at The PNC Arts Center this weekend.  Here's a few things that I learned:
&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;Kingdom Come&lt;/em&gt; was written by Chris Martin as a tribute to Johnny Cash, but was not recorded until after Johnny Cash died in 2003.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;The Scientist&lt;/em&gt; is more of an amazing song than I thought it was before.&lt;/li&gt;
	&lt;li&gt;Hearing them perform &lt;em&gt;Fix You&lt;/em&gt; is one of the most amazing concert experiences possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	Needless to say, we had a great time.  I highly recommend seeing these guys if you ever get the opportunity.
&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>The Wait Begins</title>
     <link href="http://joestelmach.com/2005/08/30/The-Wait-Begins.html"/>
     <updated>2005-08-30T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/08/30/The-Wait-Begins</id>
     <content type="html">&lt;p&gt;
					My search for a pre-owned 330ci somewhere in the New Jersey region has come to an end.  It didn't seem likely that a black on grey manual trans. would show up anytime soon, so I placed an order for a brand spankin' new 325i.  Black Sapphire Metallic, Sport Package, Premium Package, Xenon Lights ... I'm getting giddy just typing about it.  I'll have the car sometime in mid-October, which is a hell of a long time from now.  Patience.
				&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Further Seems Forever</title>
     <link href="http://joestelmach.com/2005/08/23/Further-Seems-Forever.html"/>
     <updated>2005-08-23T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/08/23/Further-Seems-Forever</id>
     <content type="html">&lt;p&gt;&lt;img src=&quot;/images/furtherSeemsForever.jpg&quot; alt=&quot;Album Cover&quot; style=&quot;float:right;margin:5px 0 15px 15px;&quot;/&gt;
                I've been a pretty big Dashboard Confessional fan for the past three years, and their new album couldn't be released soon enough.  While browsing around at the iTunes music store tonight, I somehow came across an album by a band called Further Seems Forever.  Apparently, Chris Carrabba was the lead singer up until 2001, when they released the album The Moon is Down.  I'm not gonna lie, I'm pretty excited about this.  If you're a Dashboard fan, you should definately check it out. 
        &lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Good Bye Buddy</title>
     <link href="http://joestelmach.com/2005/08/16/Good-Bye-Buddy.html"/>
     <updated>2005-08-16T00:00:00-04:00</updated>
     <id>http://joestelmach.com/2005/08/16/Good-Bye-Buddy</id>
     <content type="html">&lt;p&gt;&lt;img src=&quot;/images/IMG_1107.JPG&quot; alt=&quot;Burnt Beemer&quot; style=&quot;float:right;margin:5px 0 15px 15px;&quot;/&gt;
                                                        Well, I thought the day would never come.  My beloved 1996 BMW with 160,000 miles has finally bit the dust.  Not because the engine died.  Not because something has worn out that's too expensive to fix.  The reason is that Prestige Auto Body in Fort Lee New Jersey does not know how to fix cars.  &lt;/p&gt;

                                                        &lt;p&gt;Back in May, some guy in a mini-van ran through a stop sign and dented my rear quarter panel.  I took the car to the geniuses at Prestige and waited almost two months to get the car back.  Two weeks later I was waiting at a red light by my apartment when the driver side tail light bursted into flames.  Imagine the sadness I ensued while watching the Edgewater Fire Department put out a fire in the trunk of the car I've had for the past 6 years.  I loved that car.  Check the photo section soon for some more pics.  I see a 330ci in my future. 
                                                        &lt;/p&gt;

</content>
   </entry>
 
 
</feed>

