<?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>Anomalous &#187; Rabbott</title>
	<atom:link href="http://ryanabbott.com/author/rabbott/feed/" rel="self" type="application/rss+xml" />
	<link>http://ryanabbott.com</link>
	<description>If things seem a bit odd, thats probably because.. they are.</description>
	<lastBuildDate>Fri, 11 Feb 2011 15:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-beta2-14519</generator>
		<item>
		<title>Using Two Layouts in a Single Rails Controller</title>
		<link>http://ryanabbott.com/2011/01/using-two-layouts-in-a-single-rails-controller/</link>
		<comments>http://ryanabbott.com/2011/01/using-two-layouts-in-a-single-rails-controller/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 15:11:38 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=69</guid>
		<description><![CDATA[Sometimes, whether it is best or not, you run into the issue of having a single controller needing to display two different layouts. I&#8217;ve only run into this a hand full of times but it was annoying each time because &#8230; <a href="http://ryanabbott.com/2011/01/using-two-layouts-in-a-single-rails-controller/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes, whether it is best or not, you run into the issue of having a single controller needing to display two different layouts. I&#8217;ve only run into this a hand full of times but it was annoying each time because Rails doesn&#8217;t handle it by default. Here is my solution:</p>
<script src="http://gist.github.com/800360.js"></script>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2011/01/using-two-layouts-in-a-single-rails-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storing Uploaded Files on Server Filesystem with Rails</title>
		<link>http://ryanabbott.com/2010/08/storing-uploaded-files-on-server-filesystem-with-rails/</link>
		<comments>http://ryanabbott.com/2010/08/storing-uploaded-files-on-server-filesystem-with-rails/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 03:57:59 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=64</guid>
		<description><![CDATA[Storing files in large BLOB columns of your database has its place, but in situations in which that is not the case, one needs a well organized way to keep files on the server. Often times folks will create a &#8230; <a href="http://ryanabbott.com/2010/08/storing-uploaded-files-on-server-filesystem-with-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Storing files in large BLOB columns of your database has its place, but in situations in which that is not the case, one needs a well organized way to keep files on the server. Often times folks will create a folder called &#8220;uploaded_files&#8221; and dump all of their files into that directory.. which works until you get more than 200 files in that directory &#8211; then what!? The directory cannot be copied and cannot be opened remotely because of its size, and even if it can be, how do you find a file if need be &#8212; you can&#8217;t!</p>
<p>Tonight I put together a very basic upload project to display how I sometimes accomplish the file upload and storage.</p>
<p><a href="http://github.com/loudpixel/simple-rails-file-uploads">http://github.com/loudpixel/simple-rails-file-uploads</a> will show you how to manage files on your server in a well organized way. This method enables you to define a base directory where the files will be stored (e.g. /public/uploaded_files &#8211; just like before) but when it saves files to the file system it organizes them in folders in the format of YYYY/MM/DD/ based on the created_at value of the files.</p>
<p>Do you store files a different way, have questions as to why I use this method?</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/08/storing-uploaded-files-on-server-filesystem-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Non-alphanumeric Characters Using REGEX</title>
		<link>http://ryanabbott.com/2010/08/removing-non-alphanumeric-characters-using-regex/</link>
		<comments>http://ryanabbott.com/2010/08/removing-non-alphanumeric-characters-using-regex/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 03:09:14 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=59</guid>
		<description><![CDATA[We use this fancy (not really) method at Loudpixel that allows us to create dynamic stylesheets (not using a framework, just creating application.css.erb) in order to apply certain styles (mainly colors and images) to specific areas of our layouts. In &#8230; <a href="http://ryanabbott.com/2010/08/removing-non-alphanumeric-characters-using-regex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We use this fancy (not really) method at <a href="http://loudpixel.com">Loudpixel</a> that allows us to create dynamic stylesheets (not using a framework, just creating application.css.erb) in order to apply certain styles (mainly colors and images) to specific areas of our layouts. In order to do this we want to use a company&#8217;s name as a css rule.</p>
<p>When I initially implemented this I just down-cased the company name, which worked for the brand I was testing with so I moved on. Shortly thereafter I noticed some errors showing up in our dynamic stylesheet, why, well because not every company&#8217;s name is one word, with no apostrophes or any other foreign characters!</p>
<p>So in order to solve this issue, I slapped in a simple REGEX that removes all non-alphanumeric characters from the company&#8217;s name AND downcases it &#8211; perfect for css rules!</p>
<script src="http://gist.github.com/533212.js"></script>
<p>This really has many uses when you consider file names, URLs, CSS rules, and markup classes and ID&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/08/removing-non-alphanumeric-characters-using-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing the Twitter &#8220;Who To Follow&#8221; widget</title>
		<link>http://ryanabbott.com/2010/08/removing-the-twitter-who-to-follow-widget/</link>
		<comments>http://ryanabbott.com/2010/08/removing-the-twitter-who-to-follow-widget/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:44:33 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=55</guid>
		<description><![CDATA[I don&#8217;t know why, but I really don&#8217;t like software attempts to tell me who I&#8217;m friends with, and/or who I should be friends with.. The new Twitter &#8220;Who To Follow&#8221; widget drives me nuts, for two reasons: The fact &#8230; <a href="http://ryanabbott.com/2010/08/removing-the-twitter-who-to-follow-widget/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know why, but I really don&#8217;t like software attempts to tell me who I&#8217;m friends with, and/or who I should be friends with.. The new Twitter &#8220;Who To Follow&#8221; widget drives me nuts, for two reasons:</p>
<ol>
<li>The fact that its just based on people that I follow and that follow me, what does that mean now a days, people follow others for the most outrageous reasons (to get a follow back, to get attention from that person, to send that person a DM, because that person asked), rarely is it because they are genuinely interested anymore..</li>
<li>I am one of the few people who still use the twitter homepage, and I am used to the link to my mentions being in one spot, now its 300 pixels lower, which throws of my ability to quickly check it &#8211; my mouse is on auto-pilot to the old spot</li>
</ol>
<p>So today I figured I&#8217;d try something, something to try and get the stupid thing to go away.. and, IT WORKED!</p>
<p>Twitter will replace suggestions with another if you click the &#8216;x&#8217; icon by the users, within a few clicks the javascript will fail and you will be down to one suggestion, so do the same to the one that is left. Shortly you&#8217;ll have no suggestions when the javascript fails for both, refresh the page, rinse, and repeat. For me, all it took was 3 or 4 refreshes &#8211; taking a total of about 3 minutes to remove the &#8220;Who To Follow&#8221; widget.</p>
<p>I have no idea if it will come back, but I am satisfied for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/08/removing-the-twitter-who-to-follow-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sexy Data Visualizations</title>
		<link>http://ryanabbott.com/2010/06/sexy-data-visualizations/</link>
		<comments>http://ryanabbott.com/2010/06/sexy-data-visualizations/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 02:28:55 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=52</guid>
		<description><![CDATA[Maybe its the nerd in me, but I really enjoy a great data visualization. Every time I see one of those crazy sets of data, displayed in some crazy hover over, clickable charts, I get excited. In an attempt to &#8230; <a href="http://ryanabbott.com/2010/06/sexy-data-visualizations/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Maybe its the nerd in me, but I <em>really </em>enjoy a great data visualization. Every time I see one of those crazy sets of data, displayed in some crazy hover over, clickable charts, I get excited. In an attempt to some day match one of them I randomly catch myself searching the web for charting libraries. After a couple of months of searching I found a gem, and wanted to send a shout out to the author, and his library &#8211; Highcharts!</p>
<p>Highcharts has many great features, here is my top 5:</p>
<ol>
<li><strong>It is written in *pure* JavaScript</strong> &#8211; Unlike many of the Flash based charting libraries, Highcharts is written in JavaScript. Why is this such a great thing? Usability, of course! If you are looking to create a data visualization that will need to work on more than just laptop and desktop computers (such as iPad, iPhone, iPod, mobile phones, and game consoles), and need interactivity &#8211; JavaScript is your best bet. These charts display beautifully on such devices &#8211; check out <a href="http://www.campaignmonitor.com/" target="_blank">Campaign Monitor&#8217;s</a> <a href="http://www.campaignmonitor.com/blog/post/3161/say-goodbye-to-flash-with-our-new-javascript-charts/" target="_blank">adoption of Highcharts</a> for proof. On top of this, the code is well written, and well tested, which results in an extremely fast rendering of each chart.</li>
<li><strong>It&#8217;s interactive, with plenty of customization</strong> &#8211; Highcharts allows the developer to write custom code that is called from multiple events (click, mouseOver, mouseOut, and show are just a few). With this ability charts can become extremely interactive, allowing users to interact with data they otherwise couldn&#8217;t.</li>
<li><strong>Developer provides fantastic support</strong> &#8211; Many projects out there today are just side projects for developers, which is great, but means that support is fairly limited. Torstein Hønsi is developing Highcharts and Highslide full time &#8211; so depending on your timezone you can typically get a response within the day for almost any question you may have.</li>
<li><strong>Great documention &#8211; </strong>Typically the last thing to come out of a software project is the documentation, and even then its always pretty sketch &#8211; or just generated docs. Highcharts offers a great <a href="http://highcharts.com/demo/" target="_blank">demo page</a>, as well as a complete <a href="http://www.highcharts.com/ref/" target="_blank">options reference</a>, and <a href="http://highcharts.com/documentation/how-to-use" target="_blank">how-to page</a>. Nine times out of Ten, I&#8217;m able to answer my own question by checking out one of these pages &#8211; that tenth time, see bullet #3 <img src='http://ryanabbott.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</li>
<li><strong>The price is right</strong> &#8211; Cheaper than its Flash competitor, Fusion Charts, Highcharts is offered at a great price for what it can offer your company or product. If for some reason you have more than 2 or 3 developers working on your charts it will run you around $500 USD, but chances are if you have this many developers on your products, your return on that investment is quite high as you are charging quite a bit for your product.</li>
</ol>
<p>As you can see, in just my top 5 reasons, Highcharts is very attractive. There isn&#8217;t much of a development community behind the library at this time, so if you want to help contribute to such projects checkout the <a href="http://github.com/loudpixel/highcharts-rails" target="_blank">Rails plugin</a>, or the <a href="http://bitbucket.org/roberto.aloi/highcharts-php/http://bitbucket.org/roberto.aloi/highcharts-php/" target="_blank">PHP plugin</a> to offer your expertise!</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/06/sexy-data-visualizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trust The Experts</title>
		<link>http://ryanabbott.com/2010/06/trust-the-experts/</link>
		<comments>http://ryanabbott.com/2010/06/trust-the-experts/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 06:48:34 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=43</guid>
		<description><![CDATA[I was just hired to complete X, but every time I share ideas with the client they seem to think they know more than I do, what&#8217;s the deal? Over the last few years I have noticed an ugly trend &#8230; <a href="http://ryanabbott.com/2010/06/trust-the-experts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>I was just hired to complete X, but every time I share ideas with the client they seem to think they know more than I do, what&#8217;s the deal?</p></blockquote>
<p>Over the last few years I have noticed an ugly trend developing. It seems that in the ever growing (and broad) field of technology, the individuals hired to render services for clients are rarely looked at as the expert &#8211; even though they were hired, because nobody in house has the knowledge to complete the task. This person was hired because they are knowledgeable; so regardless of what you think looks good, is a best practice, or is easier for users &#8211; you&#8217;re probably wrong.</p>
<p>So, next time you hire someone, keep in mind why you hired that person. Don&#8217;t tell them you want the logo bigger, the music louder, or more spacing &#8211; go do your job, and let them do theirs.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/06/trust-the-experts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metadata in Ruby on Rails</title>
		<link>http://ryanabbott.com/2010/05/metadata-in-ruby-on-rails/</link>
		<comments>http://ryanabbott.com/2010/05/metadata-in-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 13 May 2010 12:24:02 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=3</guid>
		<description><![CDATA[I have multiple pieces of data to store that all relate to one row in my database, but I don&#8217;t want to create a completely separate data model and/or table. Is it possible to store this data in a single &#8230; <a href="http://ryanabbott.com/2010/05/metadata-in-ruby-on-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>I have multiple pieces of data to store that all relate to one row in my database, but I don&#8217;t want to create a completely separate data model and/or table. Is it possible to store this data in a single column within the same database row?</p></blockquote>
<p>I recently had this exact problem, I had a single row in my database that referred to one or many (I am using Rails STI, the amount of data depends on the objects stored within the row) other pieces of arbitrary data. This is most commonly referred to as &#8216;metadata&#8217; and would typically have its own table of key value pairs and a foreign key; but in my case I wont need it that often, and didn&#8217;t want to create another table to handle such small amounts of data. So I thought &#8220;there is no way that someone else hasn&#8217;t faced this issue&#8221;, and naturally turned to Google.</p>
<p>I was surprised at how little I found; what I did find were different discussions about creating metadata for plugins, or even storing JSON in the column (not bad, but how do you search for data in JSON from MySQL?); nothing too helpful, leaving me to fend for myself.</p>
<p>After days of racking my brain I had a thought; XML has standards, it has practical uses, and it&#8217;s widely used and understood, so why not store the information I need as a mini XML document? This would allow me to store as much information as I want to, in one column &#8211; and using methods within MySQL I can even search the data. Below I will walk you through a simple Rails solution demonstrating how to use this metadata method, built on top of simple Single Table Inheritance (STI).</p>
<p>This example will use vehicles (cars and trucks) as our STI model, and our metadata will store information about each cars specifications.</p>
<p><strong>Basics of our STI classes, with metadata column</strong><br />
<script src="http://gist.github.com/395367.js"></script></p>
<p><strong>Writing to our metadata column</strong><br />
In order for the setter to write correctly, it expects a hash. The data submitted from a form (POST data) is already in the form of a hash, but the reason for implementing this method was to allow for more than one value to be stored here, this requires a little work on our end. Lets say we want to store information about the car that will go on the sticker within a dealership.. We never know what could end up on that sticker, but we have one column to store it.</p>
<p>In order to control what happens to the data within this field, we will need to write a custom setter for the metadata attribute. The setter method that we create will allow us to handle the incoming data in any way we want. The method we need to add to our Vehicle class would look like this<br />
<script src="http://gist.github.com/395362.js"></script></p>
<p>This setter expects a hash from our form, this is because of the <a href="http://api.rubyonrails.org/classes/ActiveRecord/Serialization.html#M001876">method</a> we use to convert the data to XML. Since we are providing the hash to the setter we will need to name our form fields accordingly, this can be accomplished like so<br />
<script src="http://gist.github.com/395369.js"></script></p>
<p>When this form is submitted, the following will be written to the database<br />
<script src="http://gist.github.com/395372.js"></script></p>
<p>As you can see, it looks like a mini XML document, header and all. The beauty of it, Rails has built in functionality to read this data, and SQL has built in methods to search this data!</p>
<p><strong>Reading our metadata column</strong><br />
Now, rails supports all the data types that your database supports as far as retrieving and displaying data, and the default getter methods work perfect for those &#8211; unfortunately XML is not one of them. In order to get the data out of our column, in a form that is easily readable by rails, we will add the following custom getter method to our Vehicle class<br />
<script src="http://gist.github.com/395366.js"></script></p>
<p>This getter will retrieve the XML in the column, and return it as a Ruby hash, resembling<br />
<script src="http://gist.github.com/395381.js"></script></p>
<p>Data is this form should be quite familiar, the Hash object is widely used within Ruby and Rails applications. And just like any other Hash, when we want to display this information, we could use something as simple as<br />
<script src="http://gist.github.com/395408.js"></script></p>
<p><strong>Searching this data using SQL</strong><br />
An important aspect of any data, is that it is searchable. Unlike JSON, XML can be searched within a database column using XPATH. Lets say, for instance, that we want to find all cars that are under $10,000.. We can use the following to accomplish that<br />
<script src="http://gist.github.com/395421.js"></script></p>
<p>So there you have it, a relatively easy, clean, scalable way to store arbitrary data associated with a single database row in your Rails applications. Please understand that this is a basic example, if you were to use such code you would want to make sure to take care of the appropriate error checking, and testing.</p>
<p>If you would like to view this post as a working example, I posted a <a href="http://github.com/abbottry/rails-metadata">sample app on github</a>.</p>
<p>I&#8217;m sure there are many ways of accomplishing this, this method worked for me.. Do you have a better method? Suggestions as to how I can improve this one?</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/05/metadata-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to become a Social Media Expert</title>
		<link>http://ryanabbott.com/2010/05/how-to-become-a-social-media-expert/</link>
		<comments>http://ryanabbott.com/2010/05/how-to-become-a-social-media-expert/#comments</comments>
		<pubDate>Mon, 10 May 2010 18:32:42 +0000</pubDate>
		<dc:creator>Rabbott</dc:creator>
				<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://ryanabbott.com/?p=23</guid>
		<description><![CDATA[I LOVE Social Media, How can I become an expert!? With the increasing number of people, brands, and apparently even animals using social media to spew out their thoughts, advertisements, ideas, opinions, pictures, etc. everyone sees a huge opportunity to &#8230; <a href="http://ryanabbott.com/2010/05/how-to-become-a-social-media-expert/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>I LOVE Social Media, How can I become an expert!?</p></blockquote>
<p>With the increasing number of people, brands, and apparently even <a href="http://twitter.com/ConansSquirrel">animals</a> using social media to spew out their thoughts, advertisements, ideas, opinions, pictures, etc. everyone sees a huge opportunity to make a quick buck. Realize though that only those whom are considered <em>experts</em> will benefit from Social Media.</p>
<p>Here is how they do it, the best of the best, the most recognized <em>experts</em> out there use this same exact method..</p>
<ol>
<li>Sign in to <strong>Twitter</strong></li>
<li>Click <strong>Settings</strong> in the upper right</li>
<li>Click the <strong>Profile </strong>tab</li>
<li>Find the text area associated with <strong>Bio</strong>, highlight the text within the text area and delete it</li>
<li>Insert &#8220;<strong>Social Media Expert</strong>&#8220;</li>
</ol>
<p>DONE! You just became a Social Media Expert on Twitter. The beauty of it all is that this method is so simple, you can do the same thing on Facebook, Foursquare, Gowalla, or any other social network that you want!</p>
<p>Be aware, this method does have a bug, people will not believe anything you say so long as this is in any of your bios, or on your business cards, because in all reality you probably know nothing. The fact of the matter is, you just sit on your computer spamming people with links to your &#8216;clients&#8217; products, Facebook pages, contests, polls, and blog posts. STOP.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanabbott.com/2010/05/how-to-become-a-social-media-expert/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

