<?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>Schadenfreude &#187; web design</title>
	<atom:link href="http://www.ralree.com/tag/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Sun, 28 Feb 2010 04:18:37 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fun with browser error pages</title>
		<link>http://www.ralree.com/2007/10/26/fun-with-browser-error-pages/</link>
		<comments>http://www.ralree.com/2007/10/26/fun-with-browser-error-pages/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 00:30:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web programming]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/26/fun-with-browser-error-pages</guid>
		<description><![CDATA[So, I though it would be interesting to mimic browser behavior with error pages.  I decided I needed to make a page that looked exactly like the Firefox Server-not-found page.  I managed to copy the source using Firebug, and I extracted the css out of the jar files on my system.  Anyway, [...]]]></description>
			<content:encoded><![CDATA[<p>So, I though it would be interesting to mimic browser behavior with error pages.  I decided I needed to make a page that looked exactly like the Firefox Server-not-found page.  I managed to copy the source using <a href="http://addons.mozilla.org/firefox/1843">Firebug</a>, and I extracted the css out of the <strong>jar</strong> files on my system.  Anyway, I ended up with <a href="http://www.ralree.info/error/errortest-ie.html.txt">some source for IE</a> and <a href="http://www.ralree.info/error/errortest-ff.html.txt">some source for Firefox</a>.</p>
<h2><a href="http://www.ralree.info/error">Test this in IE and Firefox</a></h2>
<p>I left little invisible links in each one (search for &#8216;Supplies&#8217; on the page).  I also removed all the default javascript from the Firefox version and replaced the Try Again action with a simple reload one-liner.</p>
<p>Then, I just wrote some awesome PHP to take care of which one to load, and called it index.php:</p>
<pre><code>
&lt;?php
if (preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT'])) {
  readfile("errortest-ie.html");
} else {
  readfile("errortest-ff.html");
}
?&gt;
</code></pre>
<p>And we&#8217;re done.  Not bad, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/10/26/fun-with-browser-error-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site5 promo code for October</title>
		<link>http://www.ralree.com/2007/10/20/site5-promo-code-for-october/</link>
		<comments>http://www.ralree.com/2007/10/20/site5-promo-code-for-october/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 04:05:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[shopping]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/20/site5-promo-code-for-october</guid>
		<description><![CDATA[You can still get 13% off a new Site5 7.5TB/750GB/$7.50 Plan until November!  These guys are a great rails host.  Get this deal while it&#8217;s hot!
Code: HALLOWEEN2007

]]></description>
			<content:encoded><![CDATA[<h2>You can still get <strong>13%</strong> off a new Site5 <strong>7.5TB/750GB/$7.50</strong> Plan until November!  These guys are a great rails host.  Get this deal while it&#8217;s hot!</h2>
<h1>Code: <strong>HALLOWEEN2007</strong></h1>
<p><a href="http://www.site5.com/affiliates/idevaffiliate.php?id=1570"><img src="http://ralree.info/assets/2007/10/20/theplan_medium.png" alt="Go Now!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/10/20/site5-promo-code-for-october/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site5&#8217;s Limited-Time 750GB/7.5TB offer!</title>
		<link>http://www.ralree.com/2007/10/07/site5-s-limited-time-750gb-7-5tb-offer/</link>
		<comments>http://www.ralree.com/2007/10/07/site5-s-limited-time-750gb-7-5tb-offer/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 15:47:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[site5]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/site5-s-limited-time-750gb-7-5tb-offer</guid>
		<description><![CDATA[
The Site5 deal just got better.  Join now!
Site5 has been great hosting.  The site you&#8217;re browsing now uses it.  I bought this deal when it was 55GB of storage, 5TB of bandwidth, and 55 domain pointers.  Now it&#8217;s 750GB, 7.5TB, and Unlimited domain pointers.  It&#8217;s great Linux-based hosting that is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.site5.com/affiliates/idevaffiliate.php?id=1570"><img src="http://ralree.info/assets/2007/10/7/endall_1.png" alt=""/></a></p>
<h2>The Site5 deal just got better.  <a href="http://www.site5.com/affiliates/idevaffiliate.php?id=1570">Join now!</a></h2>
<p>Site5 has been great hosting.  The site you&#8217;re browsing now uses it.  I bought this deal when it was 55GB of storage, 5TB of bandwidth, and 55 domain pointers.  Now it&#8217;s <strong>750GB, 7.5TB, and Unlimited domain pointers</strong>.  It&#8217;s great Linux-based hosting that is Ruby and Rails friendly.  They have support for every PHP application out there, as well as a <a href="http://forums.site5.com/index.php">great forum</a> and <a href="http://wiki.site5.com/Main_Page">wiki</a> that can help you with just about any issue you have.  </p>
<p>Here are some other posts I&#8217;ve made about it:</p>
<p><a href="http://ralree.info/2007/9/2/site5-s-5-dollar-hosting-deal-gets-better-again">This one</a> is from when they tripled their deal about a month ago.  There is a bandwidth test in there that shows me getting <strong>1.86 MEGABYTES</strong> per second transfer from them.  They are <strong>not</strong> a slow host.</p>
<p><a href="http://ralree.info/2007/5/16/site5-doubles-5-deal">This one</a> is from when they doubled the deal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/10/07/site5-s-limited-time-750gb-7-5tb-offer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google releases an IFRAME generator for Google Maps</title>
		<link>http://www.ralree.com/2007/09/08/google-releases-an-iframe-generator-for-google-maps/</link>
		<comments>http://www.ralree.com/2007/09/08/google-releases-an-iframe-generator-for-google-maps/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 15:50:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/google-releases-an-iframe-generator-for-google-maps</guid>
		<description><![CDATA[Yes, it&#8217;s true, Google has released a simple iframe generator so you can embed Google Maps into anything, like this:
View Larger Map
For the record, Brickskeller is a pretty awesome pub.  I highly recommend it if you are in the D.C. area.
]]></description>
			<content:encoded><![CDATA[<p>Yes, it&#8217;s true, Google has released a simple iframe generator so you can embed Google Maps into anything, like this:</p>
<p><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=brickskeller&amp;sll=37.0625,-95.677068&amp;sspn=59.50923,83.847656&amp;ie=UTF8&amp;t=h&amp;om=1&amp;ll=39.070379,-76.981201&amp;spn=0.751737,1.31012&amp;z=10&amp;iwloc=A&amp;cid=38909985,-77048784,16283471360474262209&amp;output=embed&amp;s=AARTsJoMBeRgpNBy-g0A9JmMl_uXgoHMqw"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=brickskeller&amp;sll=37.0625,-95.677068&amp;sspn=59.50923,83.847656&amp;ie=UTF8&amp;t=h&amp;om=1&amp;ll=39.070379,-76.981201&amp;spn=0.751737,1.31012&amp;z=10&amp;iwloc=A&amp;cid=38909985,-77048784,16283471360474262209&amp;source=embed" style="text-align:left">View Larger Map</a></small></p>
<p>For the record, <strong>Brickskeller</strong> is a pretty awesome pub.  I highly recommend it if you are in the D.C. area.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/09/08/google-releases-an-iframe-generator-for-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OMG Java is lame</title>
		<link>http://www.ralree.com/2007/08/21/omg-java-is-lame/</link>
		<comments>http://www.ralree.com/2007/08/21/omg-java-is-lame/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 06:04:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/omg-java-is-lame</guid>
		<description><![CDATA[This Demo is an example of a major issue in Java.  They seriously need to at least give the user a warning before fullscreening.  I mean, that demo could have been really bad.  Hint: goatse.
On the other hand, this would be AWESOME for presentations.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://evil.hackademix.net/fullscreen/applet.html">This Demo</a> is an example of a major issue in Java.  They seriously need to at least give the user a warning before fullscreening.  I mean, that demo could have been <strong>really</strong> bad.  Hint: goatse.</p>
<p>On the other hand, this would be AWESOME for presentations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/08/21/omg-java-is-lame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Adblock Google Blockers Away</title>
		<link>http://www.ralree.com/2007/08/19/sending-adblock-users-where-they-belong/</link>
		<comments>http://www.ralree.com/2007/08/19/sending-adblock-users-where-they-belong/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 17:42:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[_why]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/sending-adblock-users-where-they-belong</guid>
		<description><![CDATA[Of course I know that a simple Greasemonkey script can very easily thwart this, but I don&#8217;t expect most people to go out and find it to defeat this.  If you don&#8217;t like my google ads, you can read this wonderful entry.



function sendJerksAway() {
      // Bye
    [...]]]></description>
			<content:encoded><![CDATA[<p>Of course I know that a simple Greasemonkey script can very easily thwart this, but I don&#8217;t expect most people to go out and find it to defeat this.  If you don&#8217;t like my google ads, you can read <a href="http://google.blognewschannel.com/archives/2007/07/24/google-recommends-turning-off-adblock/">this wonderful entry</a>.</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="r">function</span> sendJerksAway() {
      <span class="c">// Bye</span>
      <span class="fu">eval</span>(<span class="fu">unescape</span>(<span class="s"><span class="dl">&quot;</span><span class="k">%69%66%28%24</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%24%28%75%6e%65%73%63%61%70%65</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%28%27%25%35%62%25%36</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%65%25%36%31%25%36</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%64%25%36%35%25%33</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%64%25%36%37%25%36%66%25%36%66%25</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%36%37%25%36%63%25%36%35%25</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%35%66%25%36%31%25%36%34%25%37%33%25%35%66</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%25%36%36%25%37%32%25</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%36%31%25%36%64%25%36%35%25%35%64%27%29%29%2e%6c</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%65%6e%67%74%68%20%3d%3d</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%20%30%29%20%64%6f%63%75%6d%65%6e%74</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2e%6c%6f%63%61%74%69%6f</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%6e%20%3d%20%22%68%74%74%70%3a</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2f%2f%67%6f%6f%67%6c%65%2e%62%6c%6f</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%67%6e%65%77%73%63%68</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%61%6e%6e%65%6c%2e%63%6f%6d</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2f%61%72%63%68%69%76%65%73</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2f%32%30%30%37%2f%30%37</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2f%32%34%2f%67%6f%6f%67%6c%65%2d%72%65%63%6f%6d</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%6d%65%6e%64</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%73%2d%74%75%72%6e%69%6e%67</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%2d%6f%66%66%2d%61</span><span class="dl">&quot;</span></span> +
      <span class="s"><span class="dl">&quot;</span><span class="k">%64%62%6c%6f%63%6b%2f%22</span><span class="dl">&quot;</span></span>));
}
</code></pre>
</div>
</div>
<p>Then it&#8217;s just this:</p>
<pre><code>
&lt;body onLoad="sendJerksAway();"&gt;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/08/19/sending-adblock-users-where-they-belong/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>KLone &#8211; C on Rails!</title>
		<link>http://www.ralree.com/2007/06/10/klone-c-on-rails/</link>
		<comments>http://www.ralree.com/2007/06/10/klone-c-on-rails/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 17:13:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[klone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/klone-c-on-rails</guid>
		<description><![CDATA[Well, I was over at Debian Package of the Day when I noticed an article on KLone.  It&#8217;s a little application framework that allows you to do XHTML templating in C!  Then, you can compile it and send it off to any Linux machine (with a few dependencies of course) to run it. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I was over at <a href="http://debaday.debian.net">Debian Package of the Day</a> when I noticed <a href="http://debaday.debian.net/2007/06/03/klone-c-web-programming-framework/">an article</a> on <a href="http://www.koanlogic.com/kl/cont/gb/html/klone.html">KLone</a>.  It&#8217;s a little application framework that allows you to do XHTML templating in C!  Then, you can compile it and send it off to any Linux machine (with a few dependencies of course) to run it.  I got it, and it didn&#8217;t work for me at first.  Then, for some reason, it started working.  Here&#8217;s what I think did it:</p>
<p>In Ubuntu, I did this:</p>
<pre><code>
sudo apt-get install build-essential libssl-dev quilt klone klone-package
</code></pre>
<p>Then, I made a new test project:</p>
<pre><code>
make-klone-project create -p myhello
</code></pre>
<p>This creates a new project directory.  Now, go into it and make it your new home:</p>
<pre><code>
cd myhello-0.1/
cd userdata/
mkdir www etc
vim etc/kloned.conf
</code></pre>
<p>I&#8217;m just going to assume you&#8217;re using <em>vim</em> because, well, you should be.  Make the config file look something like this:</p>
<pre><code>
server_list my_http
allow_root yes

my_http
{
    type      http
    addr.type IPv4
    addr.port 8880
    dir_root  /www
}
</code></pre>
<p>Now lets give it something to work with (note we&#8217;re still in userdata):</p>
<pre><code>
vim www/index.klone
</code></pre>
<div class="CodeRay">
<div class="code">
<pre>
<span class="ta">&lt;html&gt;</span>
<span class="ta">&lt;head&gt;</span><span class="ta">&lt;title&gt;</span>Hello Lady!<span class="ta">&lt;/title&gt;</span><span class="ta">&lt;/head&gt;</span>
<span class="ta">&lt;body&gt;</span>
  <span class="c">&lt;%  io_printf(out, &quot;Hey, Lady!  You call him Dr. Jones!&quot;);  %&gt;</span>
<span class="ta">&lt;/body&gt;</span>
<span class="ta">&lt;/html&gt;</span>
</pre>
</div>
</div>
<p>Now add your precious files to the sauce:</p>
<pre><code>
cd ../../site/
klone -c import ../userdata/
# 2 dirs and 2 files imported
cd ..
</code></pre>
<p>Now, compile and run it:</p>
<pre><code>
kloned-build -o myapp userdata
./myapp -F  # This runs it in non-daemonized mode
</code></pre>
<p>If you don&#8217;t get any errors, congratulations.  That means I did something right.</p>
<p>Now, just hop over to <a href="http://localhost:8880">here</a> or wherever you specified it to run, and it will magically appear.</p>
<p>Now you can do this:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="ta">&lt;html&gt;</span>
<span class="ta">&lt;head&gt;</span><span class="ta">&lt;title&gt;</span>Hello World<span class="ta">&lt;/title&gt;</span><span class="ta">&lt;/head&gt;</span>
<span class="ta">&lt;body&gt;</span>
<span class="c">&lt;%
int i;
for(i=0; i &lt; 10; ++i) {
    io_printf(out, &quot;Hello Lady! %d&lt;br /&gt;&quot;, i);
}
%&gt;</span>
<span class="ta">&lt;/body&gt;</span>
<span class="ta">&lt;/html&gt;</span>
</code></pre>
</div>
</div>
<p>Then run this to rebuild and re-run the server:</p>
<pre><code>
kloned-build -o myapp userdata &#038;&#038; ./myapp -F
</code></pre>
<h2>Update</h2>
<p>So, I ran some tests, and I have to say, the speed increase from C might be really awesome every now and again.  Here&#8217;s the code:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
   clock_t curtime = clock();
   <span class="pp">#define</span> SEED <span class="i">35791246</span>
   <span class="pt">int</span> niter=<span class="i">10000000</span>;
   <span class="pt">double</span> x,y;
   <span class="pt">int</span> count=<span class="i">0</span>; <span class="c">/* # of points in the 1st quadrant of unit circle */</span>
   <span class="pt">double</span> z;
   <span class="pt">double</span> pi;

   <span class="c">/* initialize random numbers */</span>
   srand(SEED);
   count=<span class="i">0</span>;
   <span class="r">for</span> ( i=<span class="i">0</span>; i&lt;niter; i++) {
      x = (<span class="pt">double</span>)rand()/RAND_MAX;
      y = (<span class="pt">double</span>)rand()/RAND_MAX;
      z = x*x+y*y;
      <span class="r">if</span> (z&lt;=<span class="i">1</span>) count++;
      }
   pi=(<span class="pt">double</span>)count/niter*<span class="i">4</span>;
   io_printf(out, <span class="s"><span class="dl">&quot;</span><span class="k"># of trials= %d , estimate of pi is %g </span><span class="ch">\n</span><span class="dl">&quot;</span></span>,niter,pi);
   io_printf(out, <span class="s"><span class="dl">&quot;</span><span class="k">%f</span><span class="dl">&quot;</span></span>, (<span class="pt">double</span>)(clock() - curtime)/(<span class="pt">double</span>)CLOCKS_PER_SEC);
</code></pre>
</div>
</div>
<p>All this is is a Monte Carlo method of calculating pi that I stole from <a href="http://www.dartmouth.edu/~rc/classes/soft_dev/C_simple_ex.html">here</a>.  It takes <strong>0.56 seconds</strong> of CPU time on my Core 2 Duo @ 3.3Ghz.  Now for the Ruby on Rails test:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="c"># Controller</span>
    <span class="iv">@start</span> = <span class="co">Time</span>.now
    srand(<span class="i">35791246</span>)
    iter = <span class="i">10000000</span>
    count = <span class="i">0</span>
    <span class="i">0</span>.upto(iter) <span class="r">do</span> |i|
      x = rand().to_f
      y = rand().to_f
      z = x*x+y*y
      count += <span class="i">1</span> <span class="r">if</span> z &lt;= <span class="i">1</span>
    <span class="r">end</span>
    <span class="iv">@pi</span> = count.to_f / iter * <span class="i">4</span>
    <span class="iv">@end</span> = <span class="co">Time</span>.now
</code></pre>
</div>
</div>
<p>This finishes in <strong>20.75 seconds</strong> (about 40x slower).  C is great for things like this.  I hope to use KLone in the future for these kinds of tasks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/06/10/klone-c-on-rails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Precaching Images with Javascript</title>
		<link>http://www.ralree.com/2007/04/17/precaching-images-with-javascript/</link>
		<comments>http://www.ralree.com/2007/04/17/precaching-images-with-javascript/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 02:53:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/precaching-images-with-javascript</guid>
		<description><![CDATA[Today, Will told me about some awesome image caching.  I used it.



//Do some image caching
cached_image = Array(new Image(), new Image(), new Image(), new Image());
cached_image[0].src="image1.jpg";
cached_image[1].src="image2.jpg";


It’s amazing.
]]></description>
			<content:encoded><![CDATA[<p>Today, <a href="http://www.teknofire.net">Will</a> told me about some awesome image caching.  I used it.</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="c">//Do some image caching</span>
cached_image = <span class="pt">Array</span>(new <span class="pt">Image</span>(), new <span class="pt">Image</span>(), new <span class="pt">Image</span>(), new <span class="pt">Image</span>());
cached_image[0].src=<span class="s"><span class="dl">"</span><span class="k">image1.jpg</span><span class="dl">"</span></span>;
cached_image[1].src=<span class="s"><span class="dl">"</span><span class="k">image2.jpg</span><span class="dl">"</span></span>;</code></pre>
</div>
</div>
<p>It’s amazing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/04/17/precaching-images-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript blur problem</title>
		<link>http://www.ralree.com/2007/04/04/javascript-blur-problem/</link>
		<comments>http://www.ralree.com/2007/04/04/javascript-blur-problem/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 19:49:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/javascript-blur-problem</guid>
		<description><![CDATA[Today, I had a problem doing this:



&#60;input type='text' readonly onFocus="alert('manatee');this.blur();" /&#62;


The problem was it would go into an infinite alert loop.  That’s not cool.  The fix was to reverse the calls:



&#60;input type='text' readonly onFocus="this.blur();alert('manatee');" /&#62;


]]></description>
			<content:encoded><![CDATA[<p>Today, I had a problem doing this:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="ta">&lt;input</span> <span class="an">type</span>=<span class="s"><span class="dl">'</span><span class="k">text</span><span class="dl">'</span></span> <span class="an">readonly</span> <span class="an">onFocus</span>=<span class="s"><span class="dl">"</span><span class="k">alert('manatee');this.blur();</span><span class="dl">"</span></span> <span class="ta">/&gt;</span></code></pre>
</div>
</div>
<p>The problem was it would go into an infinite alert loop.  That’s not cool.  The fix was to reverse the calls:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="ta">&lt;input</span> <span class="an">type</span>=<span class="s"><span class="dl">'</span><span class="k">text</span><span class="dl">'</span></span> <span class="an">readonly</span> <span class="an">onFocus</span>=<span class="s"><span class="dl">"</span><span class="k">this.blur();alert('manatee');</span><span class="dl">"</span></span> <span class="ta">/&gt;</span></code></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/04/04/javascript-blur-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.445 seconds -->
