<?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>On a Tangent &#187; Programming</title>
	<atom:link href="http://www.goodwin.id.au/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goodwin.id.au</link>
	<description>A blog about all sorts of stuff</description>
	<lastBuildDate>Mon, 18 Jul 2011 18:36:36 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.35</generator>
	<item>
		<title>Advancing Front Delaunay Triangulation Animation</title>
		<link>http://www.goodwin.id.au/2010/09/03/advancing-front-delaunay-triangulation-animation/</link>
		<comments>http://www.goodwin.id.au/2010/09/03/advancing-front-delaunay-triangulation-animation/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 10:58:07 +0000</pubDate>
		<dc:creator><![CDATA[Andrew]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Visualisation]]></category>

		<guid isPermaLink="false">http://www.goodwin.id.au/?p=254</guid>
		<description><![CDATA[Animation of the advancing front delaunay triangulation algorithm. Each of the frames of this animation were generated using PHP and the GD library. The first triangle constructed is called a supertriagnle. It is an equalateral triangle that entirely contains the convex hull of the points to be triangulated. The vertices of this construction will be [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Animation of the advancing front delaunay triangulation algorithm.</p>
<p>Each of the frames of this animation were generated using PHP and the GD library.</p>
<div align="center"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/jZUWxT1Jk_Y&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jZUWxT1Jk_Y&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div>
<ol>
<li>The first triangle constructed is called a supertriagnle. It is an equalateral triangle that entirely contains the convex hull of the points to be triangulated. The vertices of this construction will be removed in the last step, leaving the triangulated network.</li>
<li>Points to be triangulated are added one by one. The list of points is ordered by their y co-ordinate.</li>
<li>The horizontal red line shown in the animation shows the advancing front. This is a horizontal line passing through the y co-ordinate of the most recent point added to the network.</li>
<li>Circumcircles pass through the three vertices of each triangle in the network. As each additional point is added to the structure, triangles who&#8217;s circumcircle contains the new point are identified. These circumcircles are drawin in red and their associated triangles highlighted yellow and removed. </li>
<li>New triangles are formed between the most recently inserted point and the segments of the void left after removing the flagged triangles.</li>
<li>The speed of the algorithm is improved by flagging all triangles who&#8217;s circumcircle is entirely behind the advancing front. Triabngles below this line no longer require testing in point 4 above. These are identified in green and then added to the pool of dark grey triangles that no longer need to considered with the addition of each new point.</li>
<li>After the final point is added, the vertices of the supertriangle and any triangles that share these vertices are removed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.goodwin.id.au/2010/09/03/advancing-front-delaunay-triangulation-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating the Creation of Website Thumbnails</title>
		<link>http://www.goodwin.id.au/2006/01/29/automating-the-creation-of-website-thumbnails/</link>
		<comments>http://www.goodwin.id.au/2006/01/29/automating-the-creation-of-website-thumbnails/#comments</comments>
		<pubDate>Sun, 29 Jan 2006 07:15:32 +0000</pubDate>
		<dc:creator><![CDATA[Andrew]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php thumbnails gd newcastlemusic]]></category>

		<guid isPermaLink="false">http://www.goodwin.id.au/?p=258</guid>
		<description><![CDATA[Describes the steps taken to generate website thumbnails in bulk. Over 4000 links were crawled, rendered and watermarked in an automated process.]]></description>
				<content:encoded><![CDATA[<p>Recently I undertook the task of making thunbnails of each and every website in the <a href="http://www.newcastlemusic.net/">Newcastle Music Directory</a>. It turned out to be a non-trivial excercise, taking a lot longer than I originally thought. Let me draw the distiction here between making a thumbnail of an image, and making a thumbnail of a website. The former involves reducing the dimensions of a single image so that it can be previewed at a smaller size whilst the latter involves rendering the componants of a webpage to produce a single image that represents what the user sees when browsing that page.</p>
<p><div id="attachment_263" style="width: 210px" class="wp-caption alignleft"><a href="http://www.goodwin.id.au/wp-content/uploads/2006/01/00241.png"><img src="http://www.goodwin.id.au/wp-content/uploads/2006/01/00241.png" alt="Web Of Life Website Thumbnail" title="Web Of Life Website Thumbnail" width="200" height="200" class="size-full wp-image-263" /></a><p class="wp-caption-text">Web Of Life Website Thumbnail</p></div>I explored several different options for doing this including the <a href="http://dlib.anu.edu.au/dlib/january06/foulonneau/01foulonneau.html">Thumbnail Grabber</a> Application from the <a href="http://www.uiuc.edu/">The University of Illinois</a> <a href="http://www.openarchives.org/">Open Archives Initiative</a> <a href="http://uilib-oai.sourceforge.net/">Metadata Harvesting Project</a>, however this proved to be tricky to set up and I abandoned the idea of using that piece of software.</p>
<p>Another option was to manually use the <a href="http://www.seoconsultants.com/windows/print-screen/">Print Screen</a> key while each webpage is being shown in the browser, but with 6500 links in the directory, this would be very time consuming indeed, especially if I were to repeat the task periodically as I intend to.</p>
<p>After almost giving up on the idea I stumbled upon the <a href="http://www.phpclasses.org/browse/package/918.html">Page Snapshot</a> class at <a href="http://www.phpclasses.org">phpclasses.org</a>. I found that code to be bloated and cumbersome, but it did lead me along a path that lead to a solution. The Page Snapshot class executes a command vie the <a href="http://www.php.net/exec">exec</a> command in PHP that requests a given URL in a web browser, it then waits a predetermined amount of time and takes a screen capture using <a href="http://www.hyperionics.com/hsdx/">Hypersnap</a>. I used this same process, rewriting the code to suit my needs.</p>
<p>Hypersnap can be invoked via the command line and the file save format and capture area can be specified via command line options, making it a suitable tool for my needs. Used in conjunction with <a href="http://www.newcastlemusic.com/nmbot.php">NMBot</a> my screen capture process obeys <a href="http://www.robotstxt.org">robots.txt rules</a>.</p>
<p><div id="attachment_266" style="width: 210px" class="wp-caption alignright"><a href="http://www.goodwin.id.au/wp-content/uploads/2006/01/00661.png"><img src="http://www.goodwin.id.au/wp-content/uploads/2006/01/00661.png" alt="Website Thumbnail for the Beach Hotel Merewether" title="Website Thumbnail for the Beach Hotel Merewether" width="200" height="200" class="size-full wp-image-266" /></a><p class="wp-caption-text">Website Thumbnail for the Beach Hotel Merewether</p></div>I decided that <a href="http://www.mozilla.com">Firefox</a> was the best web browser to use for the rendering process because of the incredible amount of control users have over the application compared to other browsers such as <a href="http://www.microsoft.com/windows/ie/">Internet Explorer</a> or <a href="http://www.opera.com">Opera</a>. For example I removed the status bar, address bar and links bar to mazimise the render area. I used the fantastic <a href="http://chrispederick.com/work/webdeveloper/">Web Developer plugin</a> to set the render area to be exactly 1000 pixels wide. Javascript was left running on but I prevented popup windows, resizing of windows, image animations, marquee text and blinking text using Firefox&#8217;s extensive options. Although I have <a href="http://adblock.mozdev.org/">Adblock</a> installed I decided to leave advertising on (could have turned off using adblock) so that the thumbnails represent the true look and feel of the original website. Finally I disabled the vertical and horizontal scrollbars so that they would not appear in the screen capture.</p>
<p>My PHP script allowed 20 seconds for all of the pages elements to be rendered, so the entire process took about 36 hours to complete. The thumbnails will be used on the Newcastle Music Directory website in the near future.</p>
<p>Here&#8217;s a video showing the first 4000 or so thumbnails:</p>
<div align="center"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/mxqKn_iUCwI&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mxqKn_iUCwI&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div>
<p><i>Edit &#8211; April 2010: I never ended up using the thumbnails on the site.</i> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.goodwin.id.au/2006/01/29/automating-the-creation-of-website-thumbnails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
