<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nate Miller &#187; Featured Articles</title>
	<atom:link href="http://www.natemiller.org/category/featured-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.natemiller.org</link>
	<description>Waxing poetic about the internet</description>
	<lastBuildDate>Fri, 19 Mar 2010 22:07:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Art of Abstraction</title>
		<link>http://www.natemiller.org/2010/03/19/the-art-of-abstraction/</link>
		<comments>http://www.natemiller.org/2010/03/19/the-art-of-abstraction/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 22:07:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.natemiller.org/?p=120</guid>
		<description><![CDATA[Think for a moment about the word &#8216;abstract&#8217; and its definition. When you think of an object, like a table for sake of example, what image comes to your mind? Most certainly, your image is different from mine. My mental image of a table looks a lot like the dinner table I sat at while [...]]]></description>
			<content:encoded><![CDATA[<p>Think for a moment about the word &#8216;abstract&#8217; and its <a href="http://www.merriam-webster.com/dictionary/abstract" target="_blank">definition</a>. When you think of an object, like a table for sake of example, what image comes to your mind? Most certainly, your image is different from mine. My mental image of a table looks a lot like the dinner table I sat at while growing up, while your table may look like the one sitting in your dining room. Yet I can use the word &#8216;table&#8217; in a conversation and you will instantly know what I&#8217;m referencing without knowing exactly what my version of a table looks like. We take this mental feat for granted every day as it allows us to communicate easily without getting bogged down into details.</p>
<p>Why am I so interested in abstraction? As I grow older, my experiences shape my own personal perspective about various activities, processes, etc. My perspective is really an abstraction &#8211; a view of reality as I see it. Being able to abstract a process or object allows me to do complex things like design a website or write software. Similarly, personal abstractions grant me the ability to see common links between seemingly disparate processes, like graphic design and software design. On the surface, graphic and software design seem very dissimilar, but the processes which lead to good software are the same that lead to good design.</p>
<p>Successful graphic design requires the ability to break an object into its components. As a designer, I need to prioritize the messages in my work and build common threads which unite them into a single object (a website, a poster, etc). These common threads can be elements like color, logo, typography, and any number of similar choices. When each of these elements are combined by a skilled designer, great work happens. Imagine the last time you saw graphic design that really moved you. Did it make you want to purchase something? Did it make you think fondly of the company responsible for producing the work? Did you share this work with others and if so, did they feel the same way?</p>
<p>In today&#8217;s socially-connected world, we are constantly barraged with things that other people think are cool. When a large group of people react in a similar way to a single input &#8211; like a music video or a tv commercial &#8211; these people share a common abstraction. While everyone&#8217;s personal interpretation may be different, the aggregate of all interpretations can often be quite similar. This abstract entity &#8211; which cannot be held or quantified &#8211; can be as simple as a positive impression of a company. When shared across a large group of people, this abstraction becomes quite powerful. This is brand. But it&#8217;s also good design, productive software, and great music.</p>
<p>No matter what type of <em>thing</em> you are trying to create, the ultimate success of that thing is comprised of the many little creative choices determining the final finished work. When these little pieces are all skillfully connected, we allow our audience to successfully abstract meaning from our work. The production of a website, for instance, can easily include thousands of minute decisions which may impede a positive impression from our audience. The graphic appearance of website can be phenomenal, but if it is not easy to use, the audience is less likely to derive a positive impression. This is the art of abstraction &#8211; creating greater meaning from thousands of tiny moving pieces which often seem trivial when viewed on a smaller scale.</p>
<p>Abstraction ain&#8217;t easy &#8211; it&#8217;s actually quite difficult. As an endeavor, abstraction requires removing oneself from the smaller task at hand to visualize the end product. It&#8217;s so simple to get bogged down in the details of a process, but our biggest successes often come when we&#8217;re able to objectively look at the whole and adjust our behavior accordingly. This is perhaps why many psychologists have suggested that imagining oneself succeed can greatly increase the probability of success.</p>
<p>The next time you run into a problem with no apparent solution, try and remove yourself from the process and focus on the end goal. There&#8217;s always a way &#8211; it just depends on your <span style="text-decoration: line-through;">perspective</span> abstraction.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.natemiller.org/2010/03/19/the-art-of-abstraction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sync a database with Capistrano</title>
		<link>http://www.natemiller.org/2009/10/11/sync-a-remote-database-to-local-with-capistrano/</link>
		<comments>http://www.natemiller.org/2009/10/11/sync-a-remote-database-to-local-with-capistrano/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 08:53:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.natemiller.org/?p=78</guid>
		<description><![CDATA[A quick capistrano task for synchronizing a remote database to your local development environment]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick capistrano task for synchronizing a remote database to your local development environment:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;appname&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:application_path</span>, <span style="color:#996600;">&quot;/home/someurl/apps&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;appuser&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:password</span>, <span style="color:#996600;">&quot;***********&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
set <span style="color:#ff3333; font-weight:bold;">:production_database</span>,<span style="color:#996600;">'mydb_production'</span>
set <span style="color:#ff3333; font-weight:bold;">:production_dbhost</span>, <span style="color:#996600;">'localhost'</span>
set <span style="color:#ff3333; font-weight:bold;">:dbuser</span>, <span style="color:#996600;">'dbadmin'</span>
set <span style="color:#ff3333; font-weight:bold;">:dbpass</span>, <span style="color:#996600;">'************'</span>
&nbsp;
desc <span style="color:#996600;">&quot;Synchronizes remote database to local development database&quot;</span>
task <span style="color:#ff3333; font-weight:bold;">:sync_to_local</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:web</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    sql_out = <span style="color:#996600;">&quot;#{environment_database}.sql&quot;</span>
    run <span style="color:#996600;">&quot;mysqldump --user #{dbuser} --password=#{dbpass} #{environment_database} &gt; #{sql_out}&quot;</span>
    <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;sftp #{user}@mywebserver.com:#{sql_out} /tmp/#{sql_out}&quot;</span>
    run <span style="color:#996600;">&quot;rm #{sql_out}&quot;</span>
    <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;mysql -u #{dbuser} --password=#{dbpass} somedatabase_development &lt; /tmp/#{sql_out}&quot;</span>
    <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;rm /tmp/#{sql_out}&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.natemiller.org/2009/10/11/sync-a-remote-database-to-local-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Painless db backups in Rails</title>
		<link>http://www.natemiller.org/2009/10/10/create-a-database-backup-with-rails/</link>
		<comments>http://www.natemiller.org/2009/10/10/create-a-database-backup-with-rails/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 08:00:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://dev.natemiller.org/?p=3</guid>
		<description><![CDATA[A simple way to automate the generation of a MySQL database backup.]]></description>
			<content:encoded><![CDATA[<p>Quite often in Rails projects, I need some way to backup the contents of database quickly. The script below is an easy way to backup the database of your current environment using the database.yml file already set up in your Rails project. Feel free to modify the below script to do your bidding.</p>
<p>/script/backup_db:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/../config/boot'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'erb'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'yaml'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">unless</span> config = <span style="color:#CC00FF; font-weight:bold;">YAML</span>::<span style="color:#CC0066; font-weight:bold;">load</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">ERB</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">IO</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT <span style="color:#006600; font-weight:bold;">+</span>
<span style="color:#996600;">&quot;/config/database.yml&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span>RAILS_ENV<span style="color:#006600; font-weight:bold;">&#93;</span>
   abort <span style="color:#996600;">&quot;No database found for environment '#{RAILS_ENV}'&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
db_out_path = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'tmp'</span>, <span style="color:#996600;">&quot;dbdump_#{RAILS_ENV}.sql&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;mysqldump -u #{config['username']} --password=#{config['password']}
 #{config['database']} &gt;; #{db_out_path}&quot;</span></pre></div></div>

<p>To run your backup, just execute this from your rails root:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>backup_db RAILS_ENV=production</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.natemiller.org/2009/10/10/create-a-database-backup-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated image sharpening</title>
		<link>http://www.natemiller.org/2009/02/28/automated-image-sharpening/</link>
		<comments>http://www.natemiller.org/2009/02/28/automated-image-sharpening/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 18:41:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://dev.natemiller.org/?p=28</guid>
		<description><![CDATA[An easy way to automate image sharpening for photos uploaded into Ruby on Rails. This article discusses how to set up Paperclip and ImageMagick to unsharpen your photos automatically.]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
<p>Working in an agency setting, where the crispness and clarity of your images is extremely important, writing web systems that automatically generate thumbnails can be problematic. When resizing images downwards, as is often the case in thumbnail generation, pixel values are approximated from their original size. These approximations can result in thumbnail images which are blurry and difficult to read. The bigger the change in pixel size, the more dramatic the effect. So if you resize a 900&#215;900px image into 120&#215;120, you will see a major difference in clarity.</p>
<p>Photoshop has several methods for dealing with these approximations when resizing images &#8211; namely the Bicubic Sharpening interpolation method and the Unsharp filter. Both of these methods help improve image quality when resizing downwards.</p>
<p>The best way to see what I&#8217;m describing is through example:</p>
<div id="attachment_38" class="wp-caption alignnone" style="width: 455px"><img class="size-full wp-image-38" title="sharpening_example" src="http://www.natemiller.org/wp-content/uploads/2009/10/sharpening_example.jpg" alt="Example of image sharpening in action" width="445" height="263" /><p class="wp-caption-text">Example of image sharpening in action</p></div>
<p>If we rely on out-of-the-box image resizing methods typically available, we usually end up with thumbnails that look like the upper right photo: blurry and unclear. However, we can easily have our applications automatically apply an unsharpening mask when we generate thumbnails. For instance a common image library used in online applications is ImageMagick &#8211; which has all sorts of features which can help our images maintain quality at smaller sizes.</p>
<p>In a recent project, I was tasked with creating a portfolio system which would be used to showcase work. The requirements were that the system should upload an image file and automatically generate several sizes of thumbnails to be used throughout the website. However, the thumbnails need to have the same crispness of their original full-size counterparts.</p>
<h2>The Solution</h2>
<p>The solution is in fact amazingly simple. Here are some quick assumptions:</p>
<ul>
<li>The platform where we&#8217;re running our web app has &#8220;ImageMagick&#8221;:http://www.imagemagick.org/script/index.php installed</li>
<li> We&#8217;re using the &#8220;Papercilp&#8221;:http://www.thoughtbot.com/projects/paperclip plugin to handle uploading and thumbnail processing</li>
</ul>
<p>Here&#8217;s the code we place at the top of our model which will be responsible for accepting uploaded photos:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Project <span style="color:#006600; font-weight:bold;">&amp;</span>lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
   has_attached_file <span style="color:#ff3333; font-weight:bold;">:hero_shot</span>,
     <span style="color:#ff3333; font-weight:bold;">:styles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:large</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;500x500&quot;</span>,
     <span style="color:#ff3333; font-weight:bold;">:medium</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>; <span style="color:#996600;">&quot;300x300&amp;gt;&quot;</span>,
     <span style="color:#ff3333; font-weight:bold;">:thumb</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;100x100&amp;gt;&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,
     <span style="color:#ff3333; font-weight:bold;">:convert_options</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:all</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;-unsharp 0.3x0.3+5+0&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>With the above declaration in our model, Paperclip will create 3 thumbnails in 3 different sizes. The :convert_options hash is where we define how the photo will be processed and is responsible for performing the unsharpening. Passing the :convert_options hash allows us to specify specific instructions to ImageMagick &#8211; just like if we were using the ImageMagick library from the command line. Let&#8217;s take a look at the code which provides the unsharpening:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">-</span>unsharp 0.3x0.3<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">0</span></pre></div></div>

<p>So where did we come up with this strange looking command? Essentially this is the same as executing &#8220;convert -unsharp 0.3&#215;0.3+5+0 IMAGE.jpg NEW_IMAGE.jpg&#8221; from the command line. The :convert_options hash is basically a list of parameters that Paperclip will be passing to the ImageMagick &#8220;convert&#8221; command. The command above is telling ImageMagick to unsharpen each of our photos. If you want a more detailed explanation, please see <a href="http://redskiesatnight.com/2005/04/06/sharpening-using-image-magick/">this great blog post</a> about fine-tuning this command. As is shown here, this command is performing an unsharp mask of a radius of 0.3 pixels, with an amount of 5.0 applied to it (in relation to the Photoshop effect, this is equivalent to an amount value of 500% at 0.3 pixel radius).</p>
<p>That&#8217;s it &#8211; now when we upload a photo, Paperclip will automatically resize and unsharpen our photos. The result is thumbnail photos which are more clear and truer to the original image.</p>
<h3>Resources</h3>
<ul>
<li><a href="http://www.thoughtbot.com/projects/paperclip">Paperclip plugin/gem</a></li>
<li><a href="http://railscasts.com/episodes/134-paperclip">Railscasts &#8211; Paperclip</a></li>
<li><a href="http://redskiesatnight.com/2005/04/06/sharpening-using-image-magick/">Unsharpening with ImageMagick</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.natemiller.org/2009/02/28/automated-image-sharpening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

