<?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>canspice.org &#187; sql</title>
	<atom:link href="http://www.canspice.org/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.canspice.org</link>
	<description>all about a canadian guy living in canada</description>
	<lastBuildDate>Sun, 05 Feb 2012 14:59:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>YAPC 10: You can do THAT without Perl?!?, by David Fetter</title>
		<link>http://www.canspice.org/2009/06/22/yapc-10-you-can-do-that-without-perl-by-david-fetter/</link>
		<comments>http://www.canspice.org/2009/06/22/yapc-10-you-can-do-that-without-perl-by-david-fetter/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 02:09:31 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[YAPC 10]]></category>
		<category><![CDATA[david fetter]]></category>
		<category><![CDATA[mandelbrot set]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.canspice.org/?p=1056</guid>
		<description><![CDATA[I admit, I originally thought this talk was titled &#8220;You can do THAT with Perl?!?&#8221; and got kind of annoyed when I didn&#8217;t see any Perl at all. You see, this talk was about new features in SQL, specifically their implementation in Postgres. The coolest thing in this talk (and at YAPC so far, in [...]]]></description>
			<content:encoded><![CDATA[<p>I admit, I originally thought this talk was titled &#8220;You can do THAT <em>with</em> Perl?!?&#8221; and got kind of annoyed when I didn&#8217;t see any Perl at all. You see, this talk was about new features in SQL, specifically their implementation in Postgres.</p>
<p>The coolest thing in this talk (and at YAPC so far, in my opinion) was creating a graphic of the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a> in SQL:</p>
<pre>WITH RECURSIVE
Z(Ix, Iy, Cx, Cy, X, Y, I)
AS (
    SELECT Ix, Iy, X::float, Y::float, X::float, Y::float, 0
    FROM
        (SELECT -2.2 + 0.031 * i, i FROM generate_series(0,101) AS i) AS xgen(x,ix)
    CROSS JOIN
        (SELECT -1.5 + 0.031 * i, i FROM generate_series(0,101) AS i) AS ygen(y,iy)
    UNION ALL
    SELECT Ix, Iy, Cx, Cy, X * X - Y * Y + Cx AS X, Y * X * 2 + Cy, I + 1
    FROM Z
    WHERE X * X + Y * Y < 16::float
    AND I < 100
),
Zt (Ix, Iy, I) AS (
    SELECT Ix, Iy, MAX(I) AS I
    FROM Z
    GROUP BY Iy, Ix
    ORDER BY Iy, Ix
)
SELECT array_to_string(
    array_agg(
        SUBSTRING(
            ' .,,,-----++++%%%%@@@@#### ',
            GREATEST(I,1)
    ),''
)
FROM Zt
GROUP BY Iy
ORDER BY Iy;</pre>
<p>I think I got that right...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.canspice.org/2009/06/22/yapc-10-you-can-do-that-without-perl-by-david-fetter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

