<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Now 100% meme free.</description><title>Chris J Cowan</title><generator>Tumblr (3.0; @chrisjcowan)</generator><link>http://chrisjcowan.com/</link><item><title>The Alot is Better Than You at Everything</title><description>&lt;a href="http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html"&gt;The Alot is Better Than You at Everything&lt;/a&gt;: &lt;p&gt;“The Alot is an imaginary creature that I made up to help me deal with my compulsive need to correct other people’s grammar.”&lt;/p&gt;</description><link>http://chrisjcowan.com/post/864058128</link><guid>http://chrisjcowan.com/post/864058128</guid><pubDate>Mon, 26 Jul 2010 20:46:43 -0600</pubDate><category>humor</category></item><item><title>The Mandelbrot set canvas demo</title><description>&lt;p&gt;Some more fun with the &lt;a href="http://en.wikipedia.org/wiki/Canvas_element"&gt;canvas element&lt;/a&gt;, this time with that old fractal standby, &lt;a href="http://en.wikipedia.org/wiki/Mandelbrot_set"&gt;the Mandelbrot set&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;p&gt;&lt;a href="#" onclick="mandelbrotSet('mandelbrotCanvas'); return false;"&gt;Run Demo&lt;/a&gt; (The image may take a few seconds to render.)&lt;/p&gt;

&lt;p&gt;&lt;canvas id="mandelbrotCanvas" width="400" height="333" style="border: 1px solid black;"&gt;
  I’m sorry, but your browser doesn’t support the canvas element.
&lt;/canvas&gt;&lt;/p&gt;

&lt;script&gt;
function mandelbrotSet(canvasId)
{
  //
  // Set up canvas, graphics context, and pixel data objects.
  //
  var canvas = document.getElementById(canvasId);
  var ctx = canvas.getContext("2d");
  var canvasData = ctx.createImageData(canvas.width, canvas.height);
  var pixelIndex = 0;

  //
  // Set up complex plane viewport and pixel mapping.
  //
  var minRe = -2.25, maxRe = 0.75, minIm = -1.25, maxIm = 1.25;
  var pixelWidth = (maxRe - minRe) / canvas.width;
  var pixelHeight = (maxIm - minIm) / canvas.height;

  //
  // Set up iteration parameters. 
  //
  var maxIterations = 50, bound = 20;

  //
  // Pre-compute color assignments for various iterations.
  //
  var greenColors = new Array(), blueColors = new Array();
  for (var i = 0; i &lt; maxIterations; i++)
  {
    var angle = 0.2 * i;
    greenColors[i] = (64 * (Math.cos(angle) + 1)) + 50;
    blueColors[i] = (64 * (Math.sin(angle) + 1)) + 50;
  }

  //
  // Iterate over every pixel in the canvas, and over every corresponding
  // value of c.
  //
  for (var y = 0, cIm = maxIm; y &lt; canvas.height; y++, cIm -= pixelHeight)
  {
    for (var x = 0, cRe = minRe; x &lt; canvas.width; x++, cRe += pixelWidth)
    {
       // Set up iteration for this particular value of c.
       var zRe = 0, zIm = 0;

       // Begin iterating f(z) = z^2 + c.
       for (i = 0; i &lt; maxIterations; i++)
       {
         // Need squared z components for z^2 and bound checking.
         var zReSq = zRe * zRe, zImSq = zIm * zIm;

         // Compute f(z) and assign that value to z.
         zIm = 2 * zRe * zIm + cIm;
         zRe = zReSq - zImSq + cRe;

         // Check if we're in bounds. |z|^2 = zRe^2 + zIm^2
         if (zReSq + zImSq &gt; bound) break;
       }

       // Done with iteration. Now decided which color to use for pixel.
       var red, green, blue;
       if (i == maxIterations)
       {
         // Iterated without exceeding bound. Use black.
         red = green = blue = 0; 
       }
       else
       {
          // Use color based on when iteration stopped.
          red = 100;
          green = greenColors[i];
          blue = blueColors[i];
        }

        // Now store color in pixel data.
        canvasData.data[pixelIndex++] = red;
        canvasData.data[pixelIndex++] = green;
        canvasData.data[pixelIndex++] = blue;
        canvasData.data[pixelIndex++] = 255; // alpha channel
    }
  }

  //
  // Display pixel data on canvas.
  //
  ctx.putImageData(canvasData, 0, 0);
}
&lt;/script&gt;</description><link>http://chrisjcowan.com/post/770639912</link><guid>http://chrisjcowan.com/post/770639912</guid><pubDate>Sun, 04 Jul 2010 16:51:00 -0600</pubDate><category>canvas</category><category>html5</category><category>demo</category><category>math</category></item><item><title>Foundations of Computer Science</title><description>&lt;a href="http://infolab.stanford.edu/~ullman/focs.html"&gt;Foundations of Computer Science&lt;/a&gt;: &lt;p&gt;A free introductory computer science book from Standford.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/725476226</link><guid>http://chrisjcowan.com/post/725476226</guid><pubDate>Tue, 22 Jun 2010 08:24:00 -0600</pubDate><category>programming</category><category>book</category></item><item><title>List of freely available programming books</title><description>&lt;a href="http://stackoverflow.com/questions/194812/list-of-freely-available-programming-books"&gt;List of freely available programming books&lt;/a&gt;: &lt;p&gt;Lists of free programming books generated by the users of &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/716026453</link><guid>http://chrisjcowan.com/post/716026453</guid><pubDate>Sat, 19 Jun 2010 14:56:00 -0600</pubDate><category>programming</category><category>book</category></item><item><title>There Are No Famous Programmers</title><description>&lt;a href="http://sheddingbikes.com/posts/1275989245.html"&gt;There Are No Famous Programmers&lt;/a&gt;: &lt;p&gt;As a programmer, this fact is comforting.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/676807939</link><guid>http://chrisjcowan.com/post/676807939</guid><pubDate>Tue, 08 Jun 2010 09:02:00 -0600</pubDate></item><item><title>Fanboyism and Brand Loyalty</title><description>&lt;a href="http://youarenotsosmart.wordpress.com/2010/05/19/fanboyism-and-brand-loyalty/"&gt;Fanboyism and Brand Loyalty&lt;/a&gt;: &lt;p&gt;I wish everyone on the internet could be made to read this an understand it:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;The Misconception:&lt;/strong&gt; You prefer the things we [sic] own over the things we [sic] don’t because we made rational choices when we bought them.&lt;/p&gt;
  
  &lt;p&gt;&lt;strong&gt;The Truth:&lt;/strong&gt; You prefer the things you own because you rationalize your past choices to protect your sense of self.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://chrisjcowan.com/post/664354099</link><guid>http://chrisjcowan.com/post/664354099</guid><pubDate>Fri, 04 Jun 2010 15:07:00 -0600</pubDate></item><item><title>John Gruber jumps the shark</title><description>&lt;a href="http://whydoeseverythingsuck.com/2010/06/john-gruber-jumps-shark.html"&gt;John Gruber jumps the shark&lt;/a&gt;: &lt;p&gt;I’ve been reading Gruber’s &lt;a href="http://daringfireball.net/"&gt;Daring Fireball&lt;/a&gt; almost since the beginning. Last week I decided to stop reading it because the blog started sounding more and more like propaganda for our Dear Leader Jobs. Or maybe I’m more and more sick of Apple related news and discussion? Regardless, it’s good to see that I’m not the only one.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/663549368</link><guid>http://chrisjcowan.com/post/663549368</guid><pubDate>Fri, 04 Jun 2010 09:05:59 -0600</pubDate></item><item><title>Living in denial: Why sensible people reject the truth</title><description>&lt;a href="http://www.newscientist.com/article/mg20627606.100-living-in-denial-why-sensible-people-reject-the-truth.html?full=true"&gt;Living in denial: Why sensible people reject the truth&lt;/a&gt;: &lt;p&gt;“The first thing to note is that denial finds its most fertile ground in areas where the science must be taken on trust.”&lt;/p&gt;</description><link>http://chrisjcowan.com/post/651289570</link><guid>http://chrisjcowan.com/post/651289570</guid><pubDate>Mon, 31 May 2010 16:55:00 -0600</pubDate><category>science</category><category>critical thinking</category></item><item><title>Dive Into HTML5</title><description>&lt;a href="http://diveintohtml5.org/"&gt;Dive Into HTML5&lt;/a&gt;: &lt;p&gt;A free (and currently still being written) book about HTML5 by &lt;a href="http://diveintomark.org/"&gt;Mark Pilgrim&lt;/a&gt;.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/650258800</link><guid>http://chrisjcowan.com/post/650258800</guid><pubDate>Mon, 31 May 2010 09:44:00 -0600</pubDate><category>html5</category><category>book</category></item><item><title>Canvas element demo</title><description>&lt;p&gt;I was having a little bit of fun with the &lt;a href="http://en.wikipedia.org/wiki/Canvas_element"&gt;canvas
element&lt;/a&gt; today. The
patterns drawn are from an algorithm I found on page 3 of &lt;a href="http://www.amazon.com/New-Turing-Omnibus-Sixty-Six-Excursions/dp/0805071660/"&gt;&lt;em&gt;The New
Turing Omnibus&lt;/em&gt; by A. K. Dewdney&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;p&gt;The parameters to the algorithm are randomly generated, so if you click “Run Demo” again it will draw something new.&lt;/p&gt;

&lt;p&gt;&lt;a href="#" onclick="runCanvasDemo1('canvasDemo1'); return false;"&gt;
  Run Demo
&lt;/a&gt; (The image may take a few seconds to render.)&lt;/p&gt;

&lt;p&gt;&lt;canvas id="canvasDemo1" width="400" height="400" style="border: 1px solid black"&gt;
  I’m sorry, but your browser doesn’t support the canvas element.
&lt;/canvas&gt;&lt;/p&gt;

&lt;script type="text/javascript"&gt;
function GraphicsDemo1(canvasId)
{
    this.canvas = document.getElementById(canvasId);
    this.ctx = this.canvas.getContext("2d");
    this.canvasData = this.ctx.createImageData(this.canvas.width, 
                                               this.canvas.height);
}

GraphicsDemo1.prototype.setPixel = function (x, y, c)
{
    var idx = (x + y * this.canvasData.width) &lt;&lt; 2;

    var red = 100;
    var green = Math.floor(128 * (Math.cos(c) + 1));
    var blue = Math.floor(128 * (Math.sin(c) + 1));

    this.canvasData.data[idx + 0] = red;
    this.canvasData.data[idx + 1] = green;
    this.canvasData.data[idx + 2] = blue;
    this.canvasData.data[idx + 3] = 255;
};

GraphicsDemo1.prototype.showBuffer = function()
{
    this.ctx.putImageData(this.canvasData, 0, 0);
};

function runCanvasDemo1(canvasId)
{
    var gfx = new GraphicsDemo1(canvasId);
    var n = 200, minN = 30;
    var width = gfx.canvas.width, height = gfx.canvas.height;
    var corna = Math.max(Math.floor(Math.random()*n), minN);
    var cornb = Math.max(Math.floor(Math.random()*n), minN);
    var side = Math.max(Math.floor(Math.random()*n), minN) ;
    var i, j;
    
    for (i = 0; i &lt; width; i++)
    {
    for (j = 0; j &lt; height; j++)
    {
        var x = corna + i * side / width;
        var y = cornb + j * side / height;
        var c = Math.floor(x * x + y * y);
            
            gfx.setPixel(i, j, c);
    }
    }
    
    gfx.showBuffer();
}
&lt;/script&gt;</description><link>http://chrisjcowan.com/post/648527626</link><guid>http://chrisjcowan.com/post/648527626</guid><pubDate>Sun, 30 May 2010 20:38:00 -0600</pubDate><category>canvas</category><category>html5</category><category>demo</category></item><item><title>Wrigley Field power outage causes delay</title><description>&lt;a href="http://mlb.mlb.com/news/article.jsp?ymd=20100526&amp;content_id=10472620&amp;vkey=news_mlb&amp;fext=.jsp&amp;c_id=mlb&amp;partnerId=rss_mlb"&gt;Wrigley Field power outage causes delay&lt;/a&gt;: &lt;p&gt;I guess you can call it a “dark delay”.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/638692850</link><guid>http://chrisjcowan.com/post/638692850</guid><pubDate>Thu, 27 May 2010 16:01:38 -0600</pubDate><category>MLB</category></item><item><title>First functional synthetic bacterial genome announced</title><description>&lt;a href="http://arstechnica.com/science/news/2010/05/first-functional-synthetic-bacterial-genome-announced.ars"&gt;First functional synthetic bacterial genome announced&lt;/a&gt;</description><link>http://chrisjcowan.com/post/616911146</link><guid>http://chrisjcowan.com/post/616911146</guid><pubDate>Thu, 20 May 2010 13:33:54 -0600</pubDate></item><item><title>Google Font Directory</title><description>&lt;a href="http://code.google.com/webfonts"&gt;Google Font Directory&lt;/a&gt;: &lt;p&gt;Wow cool. I’m getting tired of the normal “web safe” fonts.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/614826644</link><guid>http://chrisjcowan.com/post/614826644</guid><pubDate>Wed, 19 May 2010 20:07:00 -0600</pubDate><category>Typography</category></item><item><title>Caffeine may be protective against the cognitive decline seen in dementia and Alzheimer's disease</title><description>&lt;a href="http://www.sciencedaily.com/releases/2010/05/100517111937.htm"&gt;Caffeine may be protective against the cognitive decline seen in dementia and Alzheimer's disease&lt;/a&gt;: &lt;p&gt;Suddenly I feel a whole lot better about my caffeine addiction.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/613688009</link><guid>http://chrisjcowan.com/post/613688009</guid><pubDate>Wed, 19 May 2010 12:02:21 -0600</pubDate></item><item><title>Music Notation with HTML5 Canvas</title><description>&lt;a href="http://0xfe.blogspot.com/2010/05/music-notation-with-html5-canvas.html"&gt;Music Notation with HTML5 Canvas&lt;/a&gt;</description><link>http://chrisjcowan.com/post/592578564</link><guid>http://chrisjcowan.com/post/592578564</guid><pubDate>Wed, 12 May 2010 08:47:57 -0600</pubDate><category>html5</category></item><item><title>The death of the album (in handy graph form)</title><description>&lt;a href="http://arstechnica.com/tech-policy/news/2010/05/the-death-of-the-album-in-handy-graph-form.ars?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss"&gt;The death of the album (in handy graph form)&lt;/a&gt;</description><link>http://chrisjcowan.com/post/587366163</link><guid>http://chrisjcowan.com/post/587366163</guid><pubDate>Mon, 10 May 2010 12:35:13 -0600</pubDate></item><item><title>"A lot of people don’t like bumper stickers. I don’t mind bumper stickers. To me a bumper..."</title><description>“A lot of people don’t like bumper stickers. I don’t mind bumper stickers. To me a bumper sticker is a shortcut. It’s like a little sign that says ‘Hey, let’s never hang out.’”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Demetri Martin&lt;/em&gt;</description><link>http://chrisjcowan.com/post/532005234</link><guid>http://chrisjcowan.com/post/532005234</guid><pubDate>Sun, 18 Apr 2010 19:16:22 -0600</pubDate></item><item><title>Adam? …is there a reason your laptop is in the fridge?</title><description>&lt;a href="http://www.kempa.com/2006/10/02/adam-is-there-a-reason-your-laptop-is-in-the-fridge/"&gt;Adam? …is there a reason your laptop is in the fridge?&lt;/a&gt;: &lt;p&gt;Guy was able to get data off of his dying hard drive by putting his laptop in the fridge.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/531255639</link><guid>http://chrisjcowan.com/post/531255639</guid><pubDate>Sun, 18 Apr 2010 13:08:47 -0600</pubDate></item><item><title>Iceland's disruptive volcano</title><description>&lt;a href="http://www.boston.com/bigpicture/2010/04/icelands_disruptive_volcano.html"&gt;Iceland's disruptive volcano&lt;/a&gt;: &lt;p&gt;Nice picture set of the recent Icelandic volcano eruption.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/526163022</link><guid>http://chrisjcowan.com/post/526163022</guid><pubDate>Fri, 16 Apr 2010 11:22:40 -0600</pubDate><category>photography</category></item><item><title>Mythbusters in Lego</title><description>&lt;a href="http://www.flickr.com/photos/31157752@N04/sets/72157623795758452/"&gt;Mythbusters in Lego&lt;/a&gt;: &lt;p&gt;Pretty cool, but it needs an explosion.&lt;/p&gt;</description><link>http://chrisjcowan.com/post/518834391</link><guid>http://chrisjcowan.com/post/518834391</guid><pubDate>Tue, 13 Apr 2010 13:11:59 -0600</pubDate></item></channel></rss>
