<?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>Seocracy.com &#187; ruby/rails</title>
	<atom:link href="http://seocracy.com/category/rubyrails/feed/" rel="self" type="application/rss+xml" />
	<link>http://seocracy.com</link>
	<description>A blog about technical SEO, Ruby, Web Apps, and more</description>
	<lastBuildDate>Wed, 28 Apr 2010 21:47:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Detecting anomalous spikes in a line graph via sub-sampling and standard deviation</title>
		<link>http://seocracy.com/2010/04/detecting-anomalous-spikes-in-a-line-graph-via-sub-sampling-and-standard-deviation/</link>
		<comments>http://seocracy.com/2010/04/detecting-anomalous-spikes-in-a-line-graph-via-sub-sampling-and-standard-deviation/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 21:47:09 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ruby/rails]]></category>

		<guid isPermaLink="false">http://seocracy.com/?p=372</guid>
		<description><![CDATA[Woah, what a title&#8230;
What I want to talk about isn&#8217;t as complicated as it sounds. Basically, in collecting daily site specific metrics for the purposes of SEO, you sometimes get some bad data from your third-party sources.
These bad data points can skew your graphs and make it almost impossible to visually derive any useful information [...]]]></description>
			<content:encoded><![CDATA[<p>Woah, what a title&#8230;</p>
<p>What I want to talk about isn&#8217;t as complicated as it sounds. Basically, in collecting daily site specific metrics for the purposes of SEO, you sometimes get some bad data from your third-party sources.</p>
<p>These bad data points can skew your graphs and make it almost impossible to visually derive any useful information from them.</p>
<p>For example:</p>
<p style="text-align: center;"><a href="http://seocracy.com/wp-content/uploads/2010/04/indexed_before.png"><img class="size-full wp-image-373  aligncenter" style="margin-top: 0px; margin-bottom: 0px;" title="Indexed pages" src="http://seocracy.com/wp-content/uploads/2010/04/indexed_before.png" alt="Indexed Pages - before" width="491" height="169" /></a></p>
<p style="text-align: center;">
<p style="text-align: left; ">The graph above (click to expand) shows the number of pages for a 6 month date range. In early January the data spikes dramatically upwards. This is clearly an anomaly, as the day after, the data is back in its normal range. The trouble here is that this anomalous point skews the entire graph, making it impossible to derive any real insights from it. The above graph is rendered useless by that one piece of anomalous data.</p>
<p style="text-align: left; ">Here is the same graph WITHOUT that one bad piece of data (click to expand)</p>
<p style="text-align: center; "><a href="http://seocracy.com/wp-content/uploads/2010/04/indexed_after.png"><img class="size-full wp-image-380 aligncenter" title="indexed_after" src="http://seocracy.com/wp-content/uploads/2010/04/indexed_after.png" alt="indexed_after" width="529" height="167" /></a></p>
<p style="text-align: center; ">
<p style="text-align: left; ">It&#8217;s amazing how one bad data point can skew your entire graph, isn&#8217;t it? Now we have an image that is useful!</p>
<p style="text-align: left; ">
<p style="text-align: left; ">Here&#8217;s some (hackish &amp; sketchy) code to identify these statistical anomalies and replace them:</p>
<p style="text-align: left; ">
<p><script src="http://gist.github.com/382699.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://seocracy.com/2010/04/detecting-anomalous-spikes-in-a-line-graph-via-sub-sampling-and-standard-deviation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amazon S3 bucket limit</title>
		<link>http://seocracy.com/2009/08/amazon-s3-bucket-limit/</link>
		<comments>http://seocracy.com/2009/08/amazon-s3-bucket-limit/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 09:33:53 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Theory]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby/rails]]></category>

		<guid isPermaLink="false">http://seocracy.com/?p=321</guid>
		<description><![CDATA[
So, today I learned that Amazon S3 limits the amount of buckets you are allowed to have at any one time. This was a HUGE pain in the ass for me, as I just rewrote my S3 caching libraries to separate my caching into daily buckets.

The idea I had was that I would keep 30 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-320 alignnone" title="I CALL SHENANIGANS ON AMAZON S3!!!" src="http://seocracy.com/wp-content/uploads/2009/08/theybestealinmybucket.jpg" alt="theybestealinmybucket" width="640" height="340" /></p>
<p>So, today I learned that Amazon S3 limits the amount of buckets you are allowed to have at any one time. This was a HUGE pain in the ass for me, as I just rewrote my S3 caching libraries to separate my caching into daily buckets.</p>
<p><img class="alignnone size-full wp-image-328" title="headesk" src="http://seocracy.com/wp-content/uploads/2009/08/headesk1.png" alt="headesk" width="614" height="314" /></p>
<p>The idea I had was that I would keep 30 days worth of buckets before automatically shuffling all those buckets into long term archival at the end of each month.</p>
<p>You see, Amazon S3 doesn&#8217;t allow for folders within buckets (not technically, I&#8217;ll get to that later), and I think it&#8217;s bloody ridiculous for me to store the ~15 millions xml cache files I need daily access to in just one massive bucket. So, I thought my plan to create daily buckets was pretty damn good. Apparently Amazon disagrees, as hey have set a limit on the number of buckets I can have associated with my account (FYI, I have ~90 buckets right now and that&#8217;s where the limit is).</p>
<p>So, I&#8217;ve been looking into my options, and I have decided that I&#8217;m going to have to go back to my original set up of storing all 15 million (and growing) xml files in one bucket. As some of you may know, S3 GUIs like S3Fox are able to show sub-folders within buckets, so I figure I will go this route. My first step was to take a crack at the Ruby S3 library from Amazon (<strong>not</strong> the AWS gem, which is crap for multi threaded environments) to see how I can create folders within buckets. Turns out, you can&#8217;t. At least, not out of the box. You see, AmazonS3 doesn&#8217;t actually SUPPORT sub-folders within buckets.</p>
<p>Stupid, right? I know.</p>
<p>So, how does S3Fox do it? It turns out they create virtualized folders by creating a special object that acts as a folder, then you access your stored objects by appending that folder object name to the actual file key. For a directory named &#8220;/foo&#8221;, you would create an object with the key &#8220;foo_$folder$&#8221;. Then, to get a directory listing of all files stored under the foo path, you just query S3 for objects with keys that start with &#8220;/foo&#8221;, and you ignore any objects that end with &#8220;_$folder$&#8221;.</p>
<p>I&#8217;m about to waste my day setting this up, and I&#8217;m none to happy about it. It seems like a hackish and shitty work around for an obvious service flaw. I&#8217;m sure there is some technically-reasonable answer for why Amazon has set an arbitrary limit for buckets and also why they don&#8217;t allow you to create folders, but I don&#8217;t know what it is. Anyone have any answers?</p>
<p>Hat-Tip the <a href="http://deadprogrammersociety.blogspot.com/2008/01/making-s3-folders-in-ruby.html" target="_blank">Dead Programmer Society</a> for the code to create virtualized folders in S3.</p>
]]></content:encoded>
			<wfw:commentRss>http://seocracy.com/2009/08/amazon-s3-bucket-limit/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Rails: Mysql::Error: Lost connection</title>
		<link>http://seocracy.com/2009/05/rails-mysqlerror-lost-connection/</link>
		<comments>http://seocracy.com/2009/05/rails-mysqlerror-lost-connection/#comments</comments>
		<pubDate>Thu, 28 May 2009 15:13:01 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[mysql error]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://seocracy.com/?p=302</guid>
		<description><![CDATA[One of my in development projects was getting triggering a ton of &#8220;Mysql::Error: Lost connection&#8221; errors recently, and I couldn&#8217;t figure out the root cause of it.
There are many of different reasons why this error can occur, and in my case, it was a reason that no one else has written about (that I could [...]]]></description>
			<content:encoded><![CDATA[<p>One of my in development projects was getting triggering a ton of &#8220;Mysql::Error: Lost connection&#8221; errors recently, and I couldn&#8217;t figure out the root cause of it.</p>
<p>There are many of different reasons why this error can occur, and in my case, it was a reason that no one else has written about (that I could find), so I figured I&#8217;d post up the cause of my problem (and the solution).</p>
<p>This application was on a shared development server with a few other applications. They all used the same mySQL server. One of my other applications had a corruption in a few of its tables, and whenever this application was called, it would crash the mySQL server, triggering a &#8220;Mysql::Error: Lost connection&#8221; for all my other applications connected to the mySQL server at that same time. </p>
<p>I tracked down this issue by check the mysql logs, and then I simply reloaded last nights backup of the corrupt database, and everything was fine! It just goes to show you how important it is to always perform regular backups of your databases.</p>
<p>I hope this helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://seocracy.com/2009/05/rails-mysqlerror-lost-connection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

