<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.9.2 (http://www.squarespace.com/) on Wed, 10 Mar 2010 06:11:56 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>Simplifi.es - because coding should be fun</title><subtitle>Simplifies</subtitle><id>http://simplifi.es/home/</id><link rel="alternate" type="application/xhtml+xml" href="http://simplifi.es/home/"/><link rel="self" type="application/atom+xml" href="http://simplifi.es/home/atom.xml"/><updated>2010-01-01T18:40:53Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.9.2 (http://www.squarespace.com/)">Squarespace</generator><entry><title>Changing Course</title><category term="site"/><category term="site"/><id>http://simplifi.es/home/2010/1/1/changing-course.html</id><link rel="alternate" type="text/html" href="http://simplifi.es/home/2010/1/1/changing-course.html"/><author><name>Eldon Alameda</name></author><published>2010-01-01T10:05:55Z</published><updated>2010-01-01T10:05:55Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p><span class="full-image-block ssNonEditable"><img src="http://simplifi.es/storage/post-images/baby_new_year.jpg?__SQUARESPACE_CACHEVERSION=1262340409561" alt="" /></span><br /><br />It's the end of the decade and as always it's the perfect time to reflect upon my own life and determine how things are <em>really</em> going as well as committing to make the necessary course corrections.<br /><br />As such as I've spent of lot of time lately contemplating to see if deep down I'm actually happy with the direction that my life and career are heading. Unfortunately for me - I'm not sure that they are. <br /><br />That's not to say that the last year has been a failure. There have been quite a number of positive changes that I've made in the last year. I&rsquo;ve received a fair share of extremely positive feedback and recognition both professionally and personally this year. I was able to successfully end some professional and personal relationships that were draining me.&nbsp; I was able to take the family on another vacation enjoying both Disney World and our first <a href="http://disneycruise.disney.go.com/">cruise</a> together. I&rsquo;ve learned that I really like mixed drinks with <a href="http://www.patronspirits.com/">Patron</a> in them. I was also able to find and begin work on learning a new hobby (but more on that in some future post).<br /><br />Now I'm not a big believer in <em>New Years Resolutions</em>, preferring instead to focus on goals (1 year, 5 year, etc), but when life itself needs some radical changes it requires going beyond just simple goal setting. As such - I present below (for accountability) some of the ideals and goals for the next year that I will be using to make a life course correction.</p>
<p><span style="font-size: 120%;"><strong><span style="text-decoration: underline;">Make Myself Happy</span></strong></span><br />I am going to continue focusing on doing things that make me happy regardless of what anyone else thinks or says about them. Anyone that knows me personally can vouch for the fact that I'm not exactly <a href="http://verydemotivational.com/wp-content/uploads/2009/12/129046544509030726.jpg">&ldquo;Mr. Politically Correct&rdquo;</a> to begin with and I have no issues with declaring that my musical tastes are <a href="http://popup.lala.com/popup/504684639485071570">not exactly "cool"</a>.&nbsp; So it&rsquo;s not like this should be a huge challenge for me but there&rsquo;s always the risk of allowing my own happiness to fall victim to keeping other people happy.&nbsp; So what does this mean in practical terms? I&rsquo;m not sure yet but in essence - I&rsquo;m acknowledging that I will be making some people unhappy this year by choosing to pursue my passions and finding things and activities that bring joy and laughter to my life.<br /><br /><span style="font-size: 120%;"><span style="text-decoration: underline;"><strong>Is the Juice Worth the Squeeze?</strong></span></span><br />I&rsquo;m going to weigh every opportunity that I have this year with the question "Is the juice worth the squeeze?".&nbsp; The movie buffs reading this might recognize this is a quote from a fairly <a href="http://www.youtube.com/watch?v=8nLwCOWly1k">dumb <span>movie</span> </a>&ndash; but regardless there&rsquo;s something about the philosophy that appeals to me. It&rsquo;s too easy (for me at least) to be seduced by certain types of opportunities that end up costing me too much in time, money, happiness, etc. So I am pledging to myself to honestly ask this question over every decision that I can this year. This includes career choices I need to make, choosing which conferences (if any) to attend, what relationships I&rsquo;m going to allow into my life, how I will invest my time, and what changes I will fight for (or against) in the code that I write.<br /><br /><span style="text-decoration: underline;"><span style="font-size: 120%;"><strong>Actually write on this blog</strong></span></span><br />I had to renew the domain name for this site last week &ndash; which in addition to the changing of the years was a nice reminder of how little I actually used this blog in 2009 (only 4 posts!). My main problem is that I'm too much of a perfectionist and only want to post when what I'm writing is significant. However looking over the four posts that I did make this year, none of them were profound nor significant. So for 2010, I'm committing to write at least one blog post a week. Granted they may not as interesting as I would prefer but anything is better than silence. <br /><br /><span style="font-size: 120%;"><span style="text-decoration: underline;"><strong>Stop wasting time</strong></span></span><br />Going along with the above question, I am also going to use more wisdom in <a href="http://icanhascheezburger.files.wordpress.com/2009/11/funny-pictures-bear-is-coming-for-you.jpg">how I invest my time.</a> Without a doubt my daughter has to come first in how I invest my free time, but beyond her there are a number of things that I need to invest more time into as well (Personal health, working on hobbies, studying, etc, etc.)&nbsp; Currently I push myself past the point of exhaustion each week (<a href="http://icanhascheezburger.files.wordpress.com/2008/03/funny-pictures-morning-person-lemurs.jpg">mostly from lack of sleep</a>) and am still unable to spend time on all of the things that are critical to my long term happiness. Obviously some activities are going to get cut this year in order.<br /><br /><span style="font-size: 120%;"><span style="text-decoration: underline;"><strong>Write what I want to write</strong></span></span><br />I&rsquo;m going to begin work on a new book this year however I'm not sure what that book will be about at this time. I&rsquo;ve already had a couple of offers extended to me to write another Ruby book. But the problem with dealing with technical book publishers is that they tend to stifle creativity. So I&rsquo;m going to do a bit of exploratory writing this year and determine exactly what I want to write before I begin any conversations with a publisher again. I'm not even sure that my next book will be a technical book (always thought it would be fun to write a screenplay), but I am committed to the ideal that my third book will satisfy my personal standards for what I envision it to be. <br /><br /><span style="font-size: 120%;"><span style="text-decoration: underline;"><strong>Keep my promise</strong></span></span><br />I'm going to fulfill the goal/promise that I have made with my best friend and take a trip to Vegas with him this year to catch up on our lives, <a href="http://themoviemash.com/blog/wp-content/uploads/2009/06/hangover-vegas4.jpg">blow off some steam</a> and basically do all the things that Vegas has to offer <a href="http://moviesmedia.ign.com/movies/image/article/978/978017/the-hangover-20090429040037241_640w.jpg">to have a good time</a> (perhaps even sky-dive). It'd be nice if my stock options were able to cash in so we could get a <a href="http://www.lasvegassun.com/news/2009/jun/27/hangover-brings-new-customers-campaign-caesars/">"Hangover" style suite </a>for the trip as well &ndash; but I'm not going to delay the trip another year in the hopes of that lottery ticket ever being worth anything.</p>
<p><span style="font-size: 120%;"><span style="text-decoration: underline;"><strong>Live Better</strong></span></span><br />And of course - no new years goals/resolutions/whatever list would be complete without the requisite promise to do things to improve my health. I spent some time this last year setting up a decent exercise area in my basement but now it's just the matter of spending the required time each week down there. In addition I've been reading a book recommend by several other Rubyists named <a href="http://www.amazon.com/Eat-Live-Revolutionary-Formula-Sustained/dp/0316735507">Eat to Live</a> - it makes sense so far but reading ahead it's basically promoting a vegetarian lifestyle. Not sure if I could commit to that but I'm willing to <a href="http://ve3dmedia.ign.com/images/06/43/64304_lettuce-lingerie-01_orig.jpg">let the idea grow on me</a>.</p>
<p>Cheers and Happy New Year!</p>
<p>Eldon</p>]]></content></entry><entry><title>Ruby Learning Book Promotion</title><category term="book"/><category term="rails"/><category term="ruby"/><id>http://simplifi.es/home/2009/6/15/ruby-learning-book-promotion.html</id><link rel="alternate" type="text/html" href="http://simplifi.es/home/2009/6/15/ruby-learning-book-promotion.html"/><author><name>Eldon Alameda</name></author><published>2009-06-15T07:00:33Z</published><updated>2009-06-15T07:00:33Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p><span class="full-image-block ssNonEditable"><span><img src="http://simplifi.es/storage/post-images/whore.jpg?__SQUARESPACE_CACHEVERSION=1245049280665" alt="" /></span></span></p>
<p>Quick update that I'll be spending some time this week in the forums at the <a href="http://rubylearning.com/blog/">Ruby Learning</a> site answering questions about my Foundation Rails 2 book. If you register on the forums there and participate in the conversation this week, you might even be able to <a href="http://rubylearning.com/blog/2009/06/10/book-promotion-foundation-rails-2/">win a copy of the book</a>.</p>
<p>In the meantime, I completed a <a href="http://rubylearning.com/blog/2009/06/15/interview-author-eldon-alameda/">short Q&amp;A / Interview</a> for the promotion that was posted earlier this evening. Considering how bad of a mood I was in this weekend (due to having to fix some truly god-awful code), I think I was still able to come across semi-normal.</p>
<p>&nbsp;</p>]]></content></entry><entry><title>Blog Update</title><category term="site"/><id>http://simplifi.es/home/2009/6/9/blog-update.html</id><link rel="alternate" type="text/html" href="http://simplifi.es/home/2009/6/9/blog-update.html"/><author><name>Eldon Alameda</name></author><published>2009-06-09T04:28:40Z</published><updated>2009-06-09T04:28:40Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p><span class="full-image-inline ssNonEditable"><span><img src="http://simplifi.es/storage/post-images/not_enough_work.png?__SQUARESPACE_CACHEVERSION=1244522707040" alt="" /></span></span></p>
<p>Well it's been a crazy couple of months for me since I first started the work of moving everything to the new blog. I've actually been promoted twice(!) at my employer in that short period of time. First I was promoted to the position of Architect. Then a few weeks ago, we broke up our engineering team into several streams and I was put in charge of the Core Product Development team - which basically means that I get to work solely on all the cool stuff. All of this happens during really interesting times for our little startup as we're working on some really exciting stuff and with some great companies.</p>
<p>The downfall to all of that is that this poor little blog has been neglected right out of the gate.</p>
<p>But I'm back now and ready to start posting about some of the trials, tribulations and hard-earned lessons that I've experienced as a web developer. I've just killed the old blog and initiated a re-direct for the old domain name to point to here. This week I'll be posting some of my personal philosophies about programming as well as some of my frustrations of what I have to deal with when interviewing potential Rails developers to join my team.</p>
<p>It's about to get fun (finally!)</p>]]></content></entry><entry><title>Simplifying FAQ's with jQuery</title><category term="jquery"/><category term="jquery"/><category term="tutorial"/><category term="tutorial"/><id>http://simplifi.es/home/2009/3/16/simplifying-faqs-with-jquery.html</id><link rel="alternate" type="text/html" href="http://simplifi.es/home/2009/3/16/simplifying-faqs-with-jquery.html"/><author><name>Eldon Alameda</name></author><published>2009-03-16T08:13:56Z</published><updated>2009-03-16T08:13:56Z</updated><content type="html" xml:lang="en-US"><![CDATA[<span class="full-image-block ssNonEditable"><span><img src="http://simplifi.es/storage/faq_page.jpg?__SQUARESPACE_CACHEVERSION=1237191491887" alt=""/></span></span>
<p>To kick things off here on the new blog with a little code - I thought I'd share a quick refactoring that I did recently. </p>

<p>You see at my current employer, I've inherited a crap-load of legacy code that was written by a large number of developers of various skill levels. So every day is a bit of an adventure where one day I'm pleasantly surprised by how well some functionality was designed and written - and other days..... well let's just say that some sections of the code make me want to rip my own eyeballs out of my skull.</p> 

<p>Today's discussion isn't one of those absolutely horrible examples - but it is one of those items that demonstrates how easy it can be to overcomplicate a solution in ways that makes it no fun to maintain.</p> 

<p>In this example - I had been assigned a story to update the frequently asked questions (FAQ) page for our application with seven new entries. I opened up the view template and found that the the FAQ entries were built using an ordered list that looked like this:</p>
<pre class="brush: xml; gutter: false;">
  &lt;ol class="faq_list">
    &lt;li onclick="$('faq_1').toggle();">
      &lt;p class="question">
        Is this implementation too verbose?
      &lt;/p>
      &lt;p class="answer" id="faq_1">
        Yes, god yes.
      &lt;/p>
    &lt;/li>
    &lt;li onclick="$('faq_2').toggle();">
      &lt;p class="question">
        Is this something that you would want to have to mess with?
      &lt;/p>
      &lt;p class="answer" id="faq_2">
        No! This weak crap gets old really fast.
      &lt;/p>
    &lt;/li>
  &lt;/ol>
</pre>
<p>So you can see that each question and answer were individually labeled with unique ID's designating their position in the list and that each list element had an onclick even embedded directly into the source that would toggle the display of the associated answer for each question. </p>

<p>Now to hide all those answers on page load there was a block of JavaScript at the bottom of the page that looked like this:</p>
<pre class="brush: js; gutter: false;">
  $('faq_1').hide();
  $('faq_2').hide();
  $('faq_3').hide();  
</pre>

<p>Now this solution might have made sense when the FAQ page only had 2 or 3 entries, but currently it had near 20 entries and I was about to add seven more. To make matters worse - the new ones were going to be inserted at various places within the existing list and not just seven new entries at the bottom. </p>

<p>So I could have done the easiest thing possible and simply worked those new answers into this existing template but that's just not the right thing to do. This solution was just too complex and I would have felt dirty if I had left it like this.</p>

<p>In these situation - the first thing I'm going to do is load up jQuery into the view, as jQuery has surprisingly become my JS framework of choice. </p>
<pre class="brush: ruby; gutter: false; toolbar: false;">
  &lt;%= javascript_include_tag 'jquery/jquery' %>
</pre>

<p>Unfortunately though, the initial group of developers for this application preferred other JS frameworks (technically they preferred multiple JS frameworks -- which is a rant for another day), and I'm currently in the process of slowly replacing those other frameworks with jQuery. So the next thing I need to do is tell jQuery to run in compatibility mode using the <a href="http://docs.jquery.com/Core/jQuery.noConflict">noConflict method</a>:</p>

<pre class="brush: js; gutter: false; toolbar: false;">
  jQuery.noConflict();
</pre>

<p>Now that we have the template setup to use some better tools - I can go ahead and clean up the HTML implementation of those questions/answers by removing all those unnecessary onclick events and extraneous identifiers. So afterwards it should look like this:</p>

<pre class="brush: xml; gutter: false;">
  &lt;ol class="faq_list">
    &lt;li>
      &lt;p class="question">Is this getting any better?&lt;/p>
      &lt;p class="answer">Yes, simpler is always better&lt;/p>
    &lt;/li>
    &lt;li>
      &lt;p class="question">Will this still be painful to edit?&lt;/p>
      &lt;p class="answer">No. Now this is just some simple HTML&lt;/p>
    &lt;/li>
  &lt;/ol>
</pre>

<p>All that's left now is to add a few simple jQuery calls to handle our toggling the display of our questions and answers. To do that we build our code inside of the <a href="http://docs.jquery.com/Events/ready#fn">document ready event</a> (which checks the document and waits until it's ready to be manipulated before executing it's code.)</p>

<pre class="brush: js; gutter: false; toolbar: false;">
  jQuery(document).ready(function() {
  });
</pre>

<p>Within this ready event we'll first <a href="http://docs.jquery.com/Effects/hide">hide</a> all elements in our document that have a class of "answer".</p>

<pre class="brush: js; gutter: false; toolbar: false;">
  jQuery(".answer").hide();
</pre>

<p>Finally, we'll add a <a href="http://docs.jquery.com/Events/click">click handler</a> onto every element that has a class of "question". Within this click handler - we'll grab a reference to the very next element after the "question" class (which will be the related answer) using the <a href="http://docs.jquery.com/Traversing/next#expr">next function</a> and we'll call the <a href="http://docs.jquery.com/Effects/toggle#switch">toggle function</a> on it.</p>
<pre class="brush: js; gutter: false; toolbar: false;">
  jQuery(".question").click(function () {
    jQuery(this).next().toggle();
  });
</pre>

<p>In the end - our final solution that will now make adding new FAQ entries as easy as adding a couple HTML elements with a 'question' and 'answer' class will look like this when it's all put together.</p>
<pre class="brush: js; gutter: false;">
  jQuery.noConflict();
  jQuery(document).ready(function() {
    jQuery(".answer").hide();
    jQuery(".question").click(function () {
      jQuery(this).next().toggle();
    });
  });
</pre>

<p>Much simpler, and it would be a trivial matter to now extend this solution to use fancier animation or to do add a link that would expand all answers on the page.</p>]]></content></entry><entry><title>Being Premature</title><category term="site"/><id>http://simplifi.es/home/2009/3/4/being-premature.html</id><link rel="alternate" type="text/html" href="http://simplifi.es/home/2009/3/4/being-premature.html"/><author><name>Eldon Alameda</name></author><published>2009-03-04T01:58:46Z</published><updated>2009-03-04T01:58:46Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Well crap - I was hoping to hold off on letting any links out to this site until after I had finished touching up all the CSS and optimizing the layout of things a bit more.&nbsp;</p>
<p>But the Ruby Learning blog just listed my old blog site this morning in their post of the <a href="http://rubylearning.com/blog/2009/03/12/50-ruby-related-blogs-to-read/">50+ Ruby-related blogs to read</a>. So guess I need to let the cat out of the bag a little <a href="http://www.youtube.com/watch?v=wLQKsuogUXo">prematurely</a> with the new blog.&nbsp;</p>
<p>Right now - I'm researching client-side solutions for code highlighting so I can post up a couple simple tutorials and I already have a couple drafts started for some opinion pieces on how to become a better developer. So please add me to your RSS feeds or keep checking back as some real content should start flowing here in the near future.</p>
<p>Eldon</p>]]></content></entry></feed>