<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>patrick elder</title>
	<link>http://www.patrickelder.com</link>
	<description>What ever happened to context?</description>
	<pubDate>Mon, 24 Mar 2008 23:45:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Installing MySql on Mac OS X</title>
		<link>http://www.patrickelder.com/installing-mysql-on-mac-os-x/</link>
		<comments>http://www.patrickelder.com/installing-mysql-on-mac-os-x/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 23:45:21 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/installing-mysql-on-mac-os-x/</guid>
		<description><![CDATA[Great &#8220;how-to&#8221; to install mysql on Mac OS X without a single problem.http://hivelogic.com/articles/installing-mysql-on-mac-os-x/ 
]]></description>
			<content:encoded><![CDATA[<p>Great &#8220;how-to&#8221; to install mysql on Mac OS X without a single problem.<a href="http://hivelogic.com/articles/installing-mysql-on-mac-os-x/" target="_blank">http://hivelogic.com/articles/installing-mysql-on-mac-os-x/</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/installing-mysql-on-mac-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Custom Validation for attachment_fu</title>
		<link>http://www.patrickelder.com/custom-validation-for-attachment_fu/</link>
		<comments>http://www.patrickelder.com/custom-validation-for-attachment_fu/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 20:44:27 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[attachment_fu]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/custom-validation-for-attachment_fu/</guid>
		<description><![CDATA[Any time a project I&#8217;m working requires uploading a file I turn to a trusty old friend called attachment_fu.  The plugin works great, but lacks the necessary validations.  It does have a built-in validates_as_attachment, but only prevents files outside of the set range from being uploaded.  What if I wanted to validate [...]]]></description>
			<content:encoded><![CDATA[<p>Any time a project I&#8217;m working requires uploading a file I turn to a trusty old friend called attachment_fu.  The plugin works great, but lacks the necessary validations.  It does have a built-in validates_as_attachment, but only prevents files outside of the set range from being uploaded.  What if I wanted to validate the content-type?  Well, after doing a little bit of research and digging through the plugin itself I settled on a great validation method.  This method can be applied to any one of your upload fields.</p>
<p>1. Pass the allowed content_types</p>
<pre class="syntax-highlight:ruby">
has_attachment  :storage =&gt; :s3,
:content_type =&gt; ['audio/mpeg', 'audio/mp3', 'audio/MP3']
</pre>
<p>2. Place this validate method in your upload model.</p>
<pre class="syntax-highlight:ruby">
def validate
errors.add_to_base(&quot;You must upload an mp3 for this song&quot;) unless self.filename

unless self.filename == nil

# Songs should only be MP3
[:content_type].each do |attr_name|
enum = attachment_options[attr_name]
unless enum.nil? || enum.include?(send(attr_name))
errors.add_to_base(&quot;The file must be an MP3&quot;)
end
end

end
end
</pre>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/custom-validation-for-attachment_fu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Custom field_error_proc in Ruby on Rails</title>
		<link>http://www.patrickelder.com/custom-error-messages/</link>
		<comments>http://www.patrickelder.com/custom-error-messages/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 19:42:57 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/custom-error-messages/</guid>
		<description><![CDATA[I was recently working a project that required pixel perfect CSS so Ruby on Rail&#8217;s packaged field_error_proc just wouldn&#8217;t cut it.  If you&#8217;ve ever written a scaffold with validations you&#8217;re familiar with what I&#8217;m talking about.  The injection of the field_with_errors div wrapped around the offending field.  I needed to highlight the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently working a project that required pixel perfect CSS so Ruby on Rail&#8217;s packaged field_error_proc just wouldn&#8217;t cut it.  If you&#8217;ve ever written a scaffold with validations you&#8217;re familiar with what I&#8217;m talking about.  The injection of the field_with_errors div wrapped around the offending field.  I needed to highlight the field&#8217;s background with a different color to let the user know there was an error.  Here&#8217;s what I did to work around the default.</p>
<p>Create a new file: initializers/custom_error_proc.rb</p>
<pre class="syntax-highlight:ruby">
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
#%(&lt;span&gt;*&lt;/span&gt;) + html_tag
error_style = &quot;background-color: #ffff80&quot;
if html_tag =~ /&lt;(input|textarea|select)[^&gt;]+style=/
style_attribute = html_tag =~ /style=['&quot;]/
html_tag.insert(style_attribute + 7, &quot;#{error_style}; &quot;)
elsif html_tag =~ /&lt;(input|textarea|select)/
first_whitespace = html_tag =~ /\s/
html_tag[first_whitespace] = &quot; style='#{error_style}' &quot;
end
html_tag
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/custom-error-messages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mediocrity in the Workplace</title>
		<link>http://www.patrickelder.com/mediocrity-in-the-workplace/</link>
		<comments>http://www.patrickelder.com/mediocrity-in-the-workplace/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 19:30:51 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/mediocrity-in-the-workplace/</guid>
		<description><![CDATA[Mediocrity in the work place will lead to a train wreck professionally and reek havoc on your life.
Unless you work at McDonalds (no offense), work needs to be an inspiring environment in every aspect.   After all, it&#8217;s not just a job; it&#8217;s a career and what you love (if you don&#8217;t love your job, do [...]]]></description>
			<content:encoded><![CDATA[<p>Mediocrity in the work place will lead to a train wreck professionally and reek havoc on your life.</p>
<p>Unless you work at McDonalds (no offense), work needs to be an inspiring environment in every aspect.   After all, it&#8217;s not just a job; it&#8217;s a career and what you love (if you don&#8217;t love your job, do something different).  A passion.  Take a second and think of what&#8217;s behind the curtains of mediocrity and how it applies to you.  Is it a lack of self-motivation?  What about a lack of resources?  Inexperience?  Just not interested in what you&#8217;re doing?  I believe that if you can relate to any of these you&#8217;re steering your career down the path of mediocrity.  Don&#8217;t let it happen to you.  Fundamental problem solving (that&#8217;s a bit redundant) &#8212; discover the problem, address it, lesson learned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/mediocrity-in-the-workplace/feed/</wfw:commentRss>
		</item>
		<item>
		<title>No IDE Needed</title>
		<link>http://www.patrickelder.com/no-ide-needed/</link>
		<comments>http://www.patrickelder.com/no-ide-needed/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 04:15:54 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Asides]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/no-ide-needed/</guid>
		<description><![CDATA[Software isn’t designed in an IDE or other tool. It’s imagined and created in our heads
]]></description>
			<content:encoded><![CDATA[<p>Software isn’t designed in an IDE or other tool. It’s imagined and created in our heads</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/no-ide-needed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Refactor Your WetWare</title>
		<link>http://www.patrickelder.com/refactor-your-wetware/</link>
		<comments>http://www.patrickelder.com/refactor-your-wetware/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 04:14:12 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Agile Development]]></category>

		<category><![CDATA[Books]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Life]]></category>

		<category><![CDATA[Theory]]></category>

		<category><![CDATA[Learning]]></category>

		<category><![CDATA[Pragmatic]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/refactor-your-wetware/</guid>
		<description><![CDATA[I&#8217;ve been quite idle, and I intend on changing that.  To start, I&#8217;d like to just address the concept of &#8220;context is key&#8221;.  Just sit and think about that for while.  When you&#8217;re finished read on&#8230;
Software isn’t designed in an IDE or other tool. It’s imagined and created in our heads. - [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been quite idle, and I intend on changing that.  To start, I&#8217;d like to just address the concept of &#8220;context is key&#8221;.  Just sit and think about that for while.  When you&#8217;re finished read on&#8230;</p>
<blockquote><p>Software isn’t designed in an IDE or other tool. It’s imagined and created in our heads. - Andy Hunt, from Refactor Your WetWare : Pragmatic Thinking and Learning</p></blockquote>
<p>I&#8217;m currently reading yet another wonderful book from the boys over at <a href="http://www.pragprog.com/" title="The Pragmatic Programmers Bookshelf" target="_blank">Pragmatic Programmers</a> called &#8220;<a href="http://www.pragprog.com/titles/ahptl" title="Refactor Your Wetware" target="_blank">Refactor Your WetWare : Pragmatic Thinking and Learning</a>&#8220;.  So far, it&#8217;s a great read.   I wouldn&#8217;t expect anything less from author, <a href="http://blog.toolshed.com/" title="Andy Hunt" target="_blank">Andy Hunt</a>.  He addresses a common issue programmers are continuously confronted with &#8212; learning more.  Not just new technologies or programming languages, but learning in the general sense &amp; the mechanics of continued education.</p>
<p>I highly recommend checking it out.  I&#8217;m sure many of my upcoming posts will be about concepts discussed in this book.</p>
<p>&#8220;Refactor Your WetWare : Pragmatic Thinking and Learning&#8221; will be the catalyst of your future as a software engineer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/refactor-your-wetware/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Evolve</title>
		<link>http://www.patrickelder.com/evolve/</link>
		<comments>http://www.patrickelder.com/evolve/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 03:47:49 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Asides]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/evolve/</guid>
		<description><![CDATA[We evolve ourselves only by feeding ourselves information
]]></description>
			<content:encoded><![CDATA[<p>We evolve ourselves only by feeding ourselves information</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/evolve/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fleeting</title>
		<link>http://www.patrickelder.com/fleeting/</link>
		<comments>http://www.patrickelder.com/fleeting/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 07:12:37 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Asides]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/fleeting/</guid>
		<description><![CDATA[There&#8217;s always time for later - later is eternal, now is fleeting
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s always time for later - later is eternal, now is fleeting</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/fleeting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dream</title>
		<link>http://www.patrickelder.com/dream/</link>
		<comments>http://www.patrickelder.com/dream/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 07:09:16 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Asides]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/dream/</guid>
		<description><![CDATA[I dream. Always. But I want my dreams to become real. No nostalgia. For me, the future is the first priority, the present the second, the past - a dream
]]></description>
			<content:encoded><![CDATA[<p>I dream. Always. But I want my dreams to become real. No nostalgia. For me, the future is the first priority, the present the second, the past - a dream</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/dream/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fight For It!</title>
		<link>http://www.patrickelder.com/fight-for-it/</link>
		<comments>http://www.patrickelder.com/fight-for-it/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 07:08:37 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
		
		<category><![CDATA[Asides]]></category>

		<guid isPermaLink="false">http://www.patrickelder.com/fight-for-it/</guid>
		<description><![CDATA[Nothing worth having in this world comes easy
]]></description>
			<content:encoded><![CDATA[<p>Nothing worth having in this world comes easy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickelder.com/fight-for-it/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
