<?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>Rabbit Creative</title>
	<atom:link href="http://www.rabbitcreative.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rabbitcreative.com</link>
	<description>ruby, rails, objects and politics</description>
	<lastBuildDate>Thu, 18 Feb 2010 05:18:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Graphics programming with Math. Programming a graphical clock. Part 1.</title>
		<link>http://www.rabbitcreative.com/2010/02/17/graphics-programming-with-math-programming-a-graphical-clock-part-1/</link>
		<comments>http://www.rabbitcreative.com/2010/02/17/graphics-programming-with-math-programming-a-graphical-clock-part-1/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 19:57:39 +0000</pubDate>
		<dc:creator>Rabbit</dc:creator>
				<category><![CDATA[game programming]]></category>
		<category><![CDATA[gosu]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.rabbitcreative.com/?p=371</guid>
		<description><![CDATA[We’re going to use Ruby, Gosu and some trigonometry to create a graphical clock. Specifically, we will be programming the behavior and graphics for the second, minute and hour hands of an analog clock; the face of the clock will be represented by a simple graphic file (a .png, in our case). Following this exercise [...]]]></description>
			<content:encoded><![CDATA[<p>We’re going to use Ruby, Gosu and some trigonometry to create a graphical clock. Specifically, we will be programming the behavior and graphics for the second, minute and hour hands of an analog clock; the face of the clock will be represented by a simple graphic file (a .png, in our case). Following this exercise from start to finish should grant you a beginner’s understanding of some basic trigonometric concepts.</p>
<p>As we talk and learn about trigonometry, keep one thing in mind: trigonometry is easy. In fact, I&#8217;d argue that the portion of trigonometry that we will cover in this article can be understood intuitively. And soon you shall.</p>
<p>We begin our task by considering the following standard Cartesian coordinate system.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-1.png" alt="" title="diagram-1" width="620" height="492" class="alignnone size-full wp-image-372" /></p>
<p>Place a circle with radius 1 at the center of the graph, such that the circle’s center is aligned with the origin of the coordinate plane. This circle is called the unit circle.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-2.png" alt="" title="diagram-2" width="620" height="492" class="alignnone size-full wp-image-375" /></p>
<p>Let&#8217;s see this circle in greater detail by zooming in on it.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-3.png" alt="" title="diagram-3" width="620" height="492" class="alignnone size-full wp-image-376" /></p>
<p>The line that we draw is called the terminal side of our angle. All angles are measure from their initial side (the x-axis) to their terminal side. The angle created in the diagram below is 45 degrees. The green line below intersects the circumference of our circle at a specific point on the coordinate system.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-4.png" alt="" title="diagram-4" width="620" height="492" class="alignnone size-full wp-image-377" /></p>
<p>This is true for any line drawn from the origin through any position on the circumference of the circle, as illustrated in the next diagram.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-4.1.png" alt="" title="diagram-4.1" width="620" height="492" class="alignnone size-full wp-image-378" /></p>
<p>The upshot of all this is that, no matter the angle, given a point along the circumference of a unit circle, we can construct a right triangle, like so.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-5.png" alt="" title="diagram-5" width="620" height="492" class="alignnone size-full wp-image-379" /></p>
<p>The terminal side of our angle forms the hypotenuse of our right triangle, and is always equal to 1, as mentioned earlier. The point at which our line crosses the circumference of the circle actually gives us the lengths of the remaining two legs. The x-value of our point equals the length of the leg that lies along the x-axis (&#8220;side x&#8221;). The y-value of our point corresponds to the length of the leg that lies parallel to the y-axis (&#8216;&#8221;side y&#8221;).</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-6.png" alt="" title="diagram-6" width="620" height="492" class="alignnone size-full wp-image-380" /></p>
<p>Armed with the lengths of each leg of our triangle, it’s time to learn about two trigonometrical functions, sine and cosine. These functions will allow us to extract the information necessary to draw objects moving at any angle we want. Both functions take as their argument an angle, but in practice this can be any real number.</p>
<p>Side x of the triangle indicates how much horizontal distance is composed within the hypotenuse. This value is given to us by the cosine function, abbreviated in algebra as “cos”. The y side of the triangle indicates how much vertical distance is composed within the hypotenuse. This value is given to us by the sine function, abbreviated in algebra as “sin”. Together, these values tell us the amount of vertical movement needed and the amount of horizontal movement needed to move at the desired angle for 1 unit. “1 unit” in our case is “1 pixel”.</p>
<p><img src="http://www.rabbitcreative.com/wp-content/uploads/2010/02/diagram-7.png" alt="" title="diagram-7" width="620" height="492" class="alignnone size-full wp-image-381" /></p>
<p>The sine and cosine functions return numbers between -1 and 1, inclusive. Because of this, using sine and cosine gives us the core of what matters in all this — the direction of the angle without any significant distance (we can&#8217;t well represent 77% of one pixel!). Once we have our direction, we can multiply the factors given to us by sine and cosine functions to draw lines.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9576110003123309";
/* 468x60, created 2/17/10 */
google_ad_slot = "5134060023";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rabbitcreative.com/2010/02/17/graphics-programming-with-math-programming-a-graphical-clock-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokogiri vs. Hpricot.</title>
		<link>http://www.rabbitcreative.com/2010/02/12/nokogiri-vs-hpricot/</link>
		<comments>http://www.rabbitcreative.com/2010/02/12/nokogiri-vs-hpricot/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 20:17:06 +0000</pubDate>
		<dc:creator>Rabbit</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.rabbitcreative.com/?p=358</guid>
		<description><![CDATA[Nokogiri:
[root@demon trunk]# sudo gem install nokogiri
Building native extensions.  This could take a while&#8230;
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.
Hpricot:
[root@demon trunk]# sudo gem install hpricot
Building native extensions.  This could take a while&#8230;
Successfully installed hpricot-0.8.2
1 gem installed
Installing ri documentation for hpricot-0.8.2&#8230;
Installing RDoc documentation for hpricot-0.8.2&#8230;
Conclusion:
Nokigiri blows ass, always has, always will. [...]]]></description>
			<content:encoded><![CDATA[<p>Nokogiri:</p>
<p>[root@demon trunk]# sudo gem install nokogiri<br />
Building native extensions.  This could take a while&#8230;<br />
ERROR:  Error installing nokogiri:<br />
ERROR: Failed to build gem native extension.</p>
<p>Hpricot:</p>
<p>[root@demon trunk]# sudo gem install hpricot<br />
Building native extensions.  This could take a while&#8230;<br />
Successfully installed hpricot-0.8.2<br />
1 gem installed<br />
Installing ri documentation for hpricot-0.8.2&#8230;<br />
Installing RDoc documentation for hpricot-0.8.2&#8230;</p>
<p>Conclusion:</p>
<p>Nokigiri blows ass, always has, always will. Look, Hpricot&#8217;s author isn&#8217;t even around anymore! _why deleted the original repositories and I can STILL install it without problem. Reversely, Aaron Patterson is alive, around and well, and for some reason, his library doesn&#8217;t work. Wow. Just, wow.</p>
<p>In fact, let&#8217;s go a step further: Aaron&#8217;s written a <a href="http://www.engineyard.com/blog/2010/getting-started-with-nokogiri/">recent article on Engine Yard</a>. However, following these seemingly up-to-date instructions (written less than one month ago) and those instructions fail to install Nokogiri. Brilliant!</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9576110003123309";
/* 468x60, created 2/16/10 */
google_ad_slot = "3000608056";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rabbitcreative.com/2010/02/12/nokogiri-vs-hpricot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You talk too much.</title>
		<link>http://www.rabbitcreative.com/2010/01/12/you-talk-too-much/</link>
		<comments>http://www.rabbitcreative.com/2010/01/12/you-talk-too-much/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 22:18:42 +0000</pubDate>
		<dc:creator>Rabbit</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.rabbitcreative.com/?p=346</guid>
		<description><![CDATA[Trying to dump data from SQLite3 and import that data into MySQL? This post can be summed up thusly:
script/plugin install git://github.com/adamwiggins/yaml_db.git
rake db:dump
rake db:create
Update config/database.yml
rake db:load
But that&#8217;s just me. When I look at the commands above I know the context in which they should be used, therefore I want only that which is most pertinent.
]]></description>
			<content:encoded><![CDATA[<p>Trying to dump data from SQLite3 and import that data into MySQL? <a href="http://blog.heroku.com/archives/2007/11/23/yamldb_for_databaseindependent_data_dumps/">This post</a> can be summed up thusly:</p>
<p><code>script/plugin install git://github.com/adamwiggins/yaml_db.git</code></p>
<p><code>rake db:dump</code><br />
<code>rake db:create</code></p>
<p>Update config/database.yml</p>
<p><code>rake db:load</code></p>
<p>But that&#8217;s just me. When I look at the commands above I know the context in which they should be used, therefore I want only that which is most pertinent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rabbitcreative.com/2010/01/12/you-talk-too-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hpricot: undefined method &#8220;each&#8221; for Hpricot::Elem.</title>
		<link>http://www.rabbitcreative.com/2009/12/24/hpricot-undefined-method-each-for-hpricotelem/</link>
		<comments>http://www.rabbitcreative.com/2009/12/24/hpricot-undefined-method-each-for-hpricotelem/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 22:42:23 +0000</pubDate>
		<dc:creator>Rabbit</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.rabbitcreative.com/?p=342</guid>
		<description><![CDATA[You may see this error if you are including Enumerable in the same scope as your Hpricot code is running.
If you are, comment the include out, and ensure only the Hpricot code in question is running. If you feel you must use Enumerable, I suggest writing a class or module and include Enumerable specifically in [...]]]></description>
			<content:encoded><![CDATA[<p>You may see this error if you are including Enumerable in the same scope as your Hpricot code is running.</p>
<p>If you are, comment the include out, and ensure only the Hpricot code in question is running. If you feel you must use Enumerable, I suggest writing a class or module and include Enumerable specifically in that scope.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rabbitcreative.com/2009/12/24/hpricot-undefined-method-each-for-hpricotelem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authorize.net customer service.</title>
		<link>http://www.rabbitcreative.com/2009/09/29/authorize-net-customer-service/</link>
		<comments>http://www.rabbitcreative.com/2009/09/29/authorize-net-customer-service/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 22:05:28 +0000</pubDate>
		<dc:creator>Rabbit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rabbitcreative.com/?p=332</guid>
		<description><![CDATA[Ring, ring.
Authorize.net this is Bob, how can I help you?
Hi, Bob. I am trying to setup an account with you guys and I have a few questions.
Okay, are you currently a merchant?
No.
We have over 30 departments so I&#8217;m not sure where to direct your call.
Wow. Thank you for your help.
You&#8217;re welcome.
Click.

In related news, having completed [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Ring, ring.</p>
<p>Authorize.net this is Bob, how can I help you?</p>
<p>Hi, Bob. I am trying to setup an account with you guys and I have a few questions.</p>
<p>Okay, are you currently a merchant?</p>
<p>No.</p>
<p>We have over 30 departments so I&#8217;m not sure where to direct your call.</p>
<p>Wow. Thank you for your help.</p>
<p>You&#8217;re welcome.</p>
<p>Click.
</p></blockquote>
<p>In related news, having completed about 66% of my online application with Authorize.net, I have been assigned four sales representatives: <a href="mailto:bdiamond@authorize.net">Brad Diamond</a>, <a href="mailto:tdunn@authorize.net">Tyler Dunn</a>, <a href="mailto:bkamalu@authorize.net">Ben Kamalu</a> and <a href="mailto:sgriffiths@authorize.net">Scott Griffiths</a>.</p>
<p>At this point it doesn&#8217;t matter. I have chosen to ignore Authorize.net as a potential payment gateway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rabbitcreative.com/2009/09/29/authorize-net-customer-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
