<?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>GigglingCorpse</title>
	<atom:link href="http://www.gigglingcorpse.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gigglingcorpse.com</link>
	<description>Fun for the whole family</description>
	<lastBuildDate>Wed, 09 Nov 2011 02:46:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The past present and future, all at your command with HTML5</title>
		<link>http://www.gigglingcorpse.com/2011/11/08/the-past-present-and-future-all-at-your-command-with-html5/</link>
		<comments>http://www.gigglingcorpse.com/2011/11/08/the-past-present-and-future-all-at-your-command-with-html5/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 02:13:12 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=3003</guid>
		<description><![CDATA[Dear Diary, With the onset of HTML5 becoming increasingly supported among the many browsers out there, there are going to be a number of important changes coming to the way things work. Things such as&#8230; the MathML and SVG support, a large number of new elements and deprecation of some older obsolete ones, and most [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Diary,</p>
<p>With the onset of HTML5 becoming increasingly supported among the many browsers out there, there are going to be a number of important changes coming to the way things work. Things such as&#8230; the MathML and SVG support, a large number of new elements and deprecation of some older obsolete ones, and most importantly (for the purposes of this article) an important change to the history API functionality!</p>
<p>Unfortunately, HTML5 isn&#8217;t supported in every browser&#8230; largely because older versions of browser either can&#8217;t support it or just aren&#8217;t being updated to support it. People should update their browser anyway&#8230; so many unnecessary headaches caused by having to go back and debug some random old version of IE or Firefox because someone is reluctant to update. I will say, props to Chrome for silently updating itself to the latest version and indicating that a core app restart is required with those little coloured arrows!</p>
<p>Due to this lack of support in all browser, *glares at IE*, another solution is required to properly combat this looming headache menace! One of the best tools at our disposal as web developers is the History.js HTML5/HTML4 wrapper.</p>
<p>You can find it here: <a href="https://github.com/balupton/history.js" target="_blank">https://github.com/balupton/history.js</a><br />
&#8230;and a demo here: <a href="http://balupton.github.com/history.js/demo/" target="_blank">http://balupton.github.com/history.js/demo/</a></p>
<p>Straight from the description on github: &#8220;History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState.&#8221;</p>
<p>The key thing that the History.js adds is complete cross browser support for history behaviour on all websites. Of course, browsers that support HTML5 have a much nicer experience, but it still works very neatly in general. Thankfully, it also includes plugins for major javascript frameworks, including jQuery, Mootools and Prototype.</p>
<p>An implementation using History.js</p>
<p>One of the tasks I was working on at work was to transition an aging web application which was still using a frameset for it&#8217;s layout into a single-page application. The catch was that part of the page load was an EXTREMELY heavy client side javascript menu. As a result, simply loading the entire page each time while navigating around the application was a bit of a performance issue, resulting in page load times nearly doubled.</p>
<p>My solution was to implement a chromeless loading system based around caching pages in the DOM and utilizing HTML5 history API calls wherever possible to allow for fast page transitions going back and forward in the browser.</p>
<p>I quickly found that HTML5 wasn&#8217;t fully supported (as expected), and also that it there was still inconsistent behaviour between different browsers. After a bit of searching around online, I came across History.js, realized its potential, and began implementing it into the application.</p>
<p>The basic idea behind what I wanted to do was keep enough meta information about each page the user navigated to such that I could determine if it was either cached already and could be swapped in, or if it needed to be requested and cached again. This was particularly important, because closing the browser would typically cause you to lose your history for that session, but it is possible to keep track of your history even between browser loads with History.js.</p>
<p>As a result, the general behaviour was to to either push a new page on to the history when performing new navigation, replace an existing cached page when a forced load was required (stale data or no longer cached due to browser reload), and wrap normal browser back and forward with a history state change event.</p>
<p>I actually found a funny little bug while working on this solution (which may be fixed now, I haven&#8217;t bothered to confirm), where if you are using the amplify.store.js storage solution for page caching via History.js, after 1000 page loads it would simply go into an infinite loop because it couldn&#8217;t find the next &#8220;unique&#8221; page identifier to use. Page identifiers were generated by selecting a number at random between 1 and 1000&#8230; and of course testing this on development, I would constantly be reloading pages and changing states&#8230; which lead to some fun times debugging the infinite loop.</p>
<p>Ultimately I had to skip using the storage system, and I implemented a version of it myself in the DOM itself. I like this solution better anyway, because it gave me direct control over what was cached and how it was manipulated more so than the storage system would.</p>
<p>At any rate, here are a few simple code snippets of how I was using History.js:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// set up history change event</span>
<span style="color: #003366; font-weight: bold;">var</span> History <span style="color: #339933;">=</span> window.<span style="color: #660066;">History</span><span style="color: #339933;">;</span>
History <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> History.<span style="color: #660066;">Adapter</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>window<span style="color: #339933;">,</span> <span style="color: #3366CC;">'statechange'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> … <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// pushing new state data (History.pushState and History.replaceState have identical syntax)</span>
History.<span style="color: #660066;">pushState</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	state<span style="color: #339933;">:</span> customState<span style="color: #339933;">,</span>
	timestamp<span style="color: #339933;">:</span> pageLoadTimestamp<span style="color: #339933;">,</span>
	page<span style="color: #339933;">:</span> pageKey<span style="color: #339933;">,</span>
	extraData<span style="color: #339933;">:</span> dataObject
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> pageTitle<span style="color: #339933;">,</span> pageUrl<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// state change event</span>
<span style="color: #003366; font-weight: bold;">var</span> onHistoryStateChange <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> HistoryState <span style="color: #339933;">=</span> History.<span style="color: #660066;">getState</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// access the custom data you've assigned to the history state</span>
	<span style="color: #006600; font-style: italic;">// HistoryState .data.state;</span>
	<span style="color: #006600; font-style: italic;">// HistoryState .data.timestamp;</span>
	<span style="color: #006600; font-style: italic;">// HistoryState .data.page;</span>
	<span style="color: #006600; font-style: italic;">//</span>
	<span style="color: #006600; font-style: italic;">// handle state change by either loading new page or loading cached page etc ...</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And lastly for more reading about manipulating the browser history, Mozilla Dev has a nice article that I found useful on it here:</p>
<p><a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history" target="_blank">https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history</a></p>
<p>Your friend,<br />
Jeff</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/11/08/the-past-present-and-future-all-at-your-command-with-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Books I&#8217;ve recently read</title>
		<link>http://www.gigglingcorpse.com/2011/08/01/books-ive-recently-read/</link>
		<comments>http://www.gigglingcorpse.com/2011/08/01/books-ive-recently-read/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 11:33:54 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2963</guid>
		<description><![CDATA[Home Fires by Gene Wolfe While it wasn&#8217;t quite what I&#8217;d expected, that is very much a good thing. I enjoyed it. If you&#8217;re looking for something a little science-fiction-y and a little adventure-y you might enjoy this one, especially if you take to the writing styles of Gene Wolfe (which I tend to). I [...]]]></description>
			<content:encoded><![CDATA[<h3>
<a href="http://www.amazon.ca/gp/product/0765328186/ref=as_li_ss_il?ie=UTF8&#038;tag=thefamwis-20&#038;linkCode=as2&#038;camp=15121&#038;creative=390961&#038;creativeASIN=0765328186"><img border="0" src="https://images-na.ssl-images-amazon.com/images/I/41EwkBLXxrL._SL110_.jpg" align="left" style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;"></a></p>
<p>Home Fires <small>by Gene Wolfe</small></h3>
<p>While it wasn&#8217;t quite what I&#8217;d expected, that is very much a good thing.  I enjoyed it.</p>
<p>If you&#8217;re looking for something a little science-fiction-y and a little adventure-y you might enjoy this one, especially if you take to the writing styles of Gene Wolfe (which I tend to). I would recommend it.</p>
<p>&nbsp;</p>
<h3>
<a href="http://www.amazon.ca/gp/product/0747595844/ref=as_li_ss_il?ie=UTF8&#038;tag=thefamwis-20&#038;linkCode=as2&#038;camp=15121&#038;creative=390961&#038;creativeASIN=0747595844"><img border="0" src="http://ws.assoc-amazon.ca/widgets/q?_encoding=UTF8&#038;Format=_SL110_&#038;ASIN=0747595844&#038;MarketPlace=CA&#038;ID=AsinImage&#038;WS=1&#038;tag=thefamwis-20&#038;ServiceVersion=20070822" align="left" style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 0px #aaa;" ></a></p>
<p>Harry Potter (all seven)</h3>
<p>Apparently after they made the sixth movie, somone decided to write some books!  At least that&#8217;s how it seemed to me, as I read all seven within this last month.  There&#8217;s a good chance you&#8217;ve read these and that&#8217;s now true of me as well!  </p>
<p>It did take me about three books to get into the series, but in the end I enjoyed it and even now miss my friends Ron and Hermoine a little (not so much Harry, I never truly considered him a friend).</p>
<p>There are things I liked and things I didn&#8217;t, though that is true of all books but the truly and completely terrible.  I would recommend them, though with some qualifications.</p>
<p>&nbsp;</p>
<h3>
<a href="http://www.amazon.ca/gp/product/076532458X/ref=as_li_ss_il?ie=UTF8&#038;tag=thefamwis-20&#038;linkCode=as2&#038;camp=15121&#038;creative=390961&#038;creativeASIN=076532458X"><img border="0" src="http://ws.assoc-amazon.ca/widgets/q?_encoding=UTF8&#038;Format=_SL110_&#038;ASIN=076532458X&#038;MarketPlace=CA&#038;ID=AsinImage&#038;WS=1&#038;tag=thefamwis-20&#038;ServiceVersion=20070822" align="left" style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" ></a><br />
The Sorcerer&#8217;s House <small>by Gene Wolfe</small></h3>
<p>More fantastic than future-set, I&#8217;d recommend it for anyone looking for that set in present-day.  It features the same sort of protagonist I&#8217;ve become familiar with from some of his other works.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>
<a href="http://www.amazon.ca/gp/product/0385663501/ref=as_li_ss_il?ie=UTF8&#038;tag=thefamwis-20&#038;linkCode=as2&#038;camp=15121&#038;creative=390961&#038;creativeASIN=0385663501"><img border="0" src="http://ws.assoc-amazon.ca/widgets/q?_encoding=UTF8&#038;Format=_SL110_&#038;ASIN=0385663501&#038;MarketPlace=CA&#038;ID=AsinImage&#038;WS=1&#038;tag=thefamwis-20&#038;ServiceVersion=20070822" align="left" style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" ></a><br />
Rant: An Oral Biography of Buster Casey <small>by Chuck Palahniuk</small></h3>
<p>A friend and I agreed to read each other&#8217;s recommendations, and this was one of hers.  It was interesting, and I might recommend it (though with more than a few qualifications).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>
<a href="http://www.amazon.ca/gp/product/0425192032/ref=as_li_ss_il?ie=UTF8&#038;tag=thefamwis-20&#038;linkCode=as2&#038;camp=15121&#038;creative=390961&#038;creativeASIN=0425192032"><img border="0" src="http://ws.assoc-amazon.ca/widgets/q?_encoding=UTF8&#038;Format=_SL110_&#038;ASIN=0425192032&#038;MarketPlace=CA&#038;ID=AsinImage&#038;WS=1&#038;tag=thefamwis-20&#038;ServiceVersion=20070822" align="left" style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" ></a><br />
Lightning <small>by Dean Koontz</small></h3>
<p>Another book that she recommended; though fine, it really wasn&#8217;t my style.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>But what to read next?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/08/01/books-ive-recently-read/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP autoload and smarty 3</title>
		<link>http://www.gigglingcorpse.com/2011/07/25/php-autoload-and-smarty-3/</link>
		<comments>http://www.gigglingcorpse.com/2011/07/25/php-autoload-and-smarty-3/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 05:19:53 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2957</guid>
		<description><![CDATA[I was setting up for some code today. Code which would use, among other things, Smarty 3 since that&#8217;s a thing now apparently. (It used to be Smarty 2, but I guess times change and numbers change.) There&#8217;s an __autoload function that I wrote a while ago and often use to, you know, automatically include [...]]]></description>
			<content:encoded><![CDATA[<p>I was setting up for some code today.  Code which would use, among other things, Smarty 3 since that&#8217;s a thing now apparently.  (It used to be Smarty 2, but I guess times change and numbers change.)  </p>
<p>There&#8217;s an __autoload function that I wrote a while ago and often use to, you know, automatically include files when instantiating classes.  But it didn&#8217;t work at all.<br />
The file itself with the __autoload function included fine, but autoload function was not being called.  It was pretty confusing, to be honest.</p>
<p>Jeff and I eventually traced this back to one line in my code &mdash; the line including the Smarty source file.</p>
<p>So I had a look in there and found this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * register the class autoloader
 */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SMARTY_SPL_AUTOLOAD'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SMARTY_SPL_AUTOLOAD'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>SMARTY_SPL_AUTOLOAD <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">set_include_path</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_include_path</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> PATH_SEPARATOR <span style="color: #339933;">.</span> SMARTY_SYSPLUGINS_DIR<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$registeredAutoLoadFunctions</span> <span style="color: #339933;">=</span> <span style="color: #990000;">spl_autoload_functions</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$registeredAutoLoadFunctions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'spl_autoload'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smartyAutoload'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Which looked suspiciously culpable.  So I added this line to my code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__autoload'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And then it worked!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/07/25/php-autoload-and-smarty-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>youtube powered video gallery and isometry</title>
		<link>http://www.gigglingcorpse.com/2011/06/29/youtube-powered-video-gallery-and-isometry/</link>
		<comments>http://www.gigglingcorpse.com/2011/06/29/youtube-powered-video-gallery-and-isometry/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 07:46:01 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2930</guid>
		<description><![CDATA[Are those two related? They may not be. (They might be; who knows?) Even so, I wanted to try out some isometry. You know, get some stuff displaying and sorting. That sort of thing? Big news: I did it! &#160; That&#8217;s all for isometry, on to youtube powered video galleries! http://www.youtube.com/watch?v=L5JHMpLIqO4 http://www.youtube.com/watch?v=VG82USg5mtE http://www.youtube.com/watch?v=-jMruFHTwrY http://www.youtube.com/watch?v=zxK8y7XuEu8 http://www.youtube.com/watch?v=ADBKdSCbmiM [...]]]></description>
			<content:encoded><![CDATA[<p>Are those two related?  They may not be.  (They might be; who knows?)</p>
<p>Even so, I wanted to try out some isometry.  You know, get some stuff displaying and sorting.  That sort of thing?  Big news:  I did it! <img src='http://www.gigglingcorpse.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><script src="http://www.google.com/jsapi" type="text/javascript"></script><script>
google.load("swfobject", "2.1");
google.setOnLoadCallback(
	function() {
		swfobject.embedSWF("http://www.gigglingcorpse.com/examples/iso-draw.swf", "IsoDraw001", "580", "250", "10");
});
</script></p>
<div id="IsoDraw001"></div>
<p>&nbsp;</p>
<p>That&#8217;s all for isometry, on to youtube powered video galleries!</p>
<link href="http://www.gigglingcorpse.com/dev/video-gallery/style.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://www.gigglingcorpse.com/dev/video-gallery/video-library.js" type="text/javascript"></script><br />
<script src="http://www.google.com/jsapi" type="text/javascript"></script><br />
<script type="text/javascript"> 
		google.load("jquery", "1");
		google.setOnLoadCallback(function() {
			videofy();
		});		
</script></p>
<ul class="video library">
<li>http://www.youtube.com/watch?v=L5JHMpLIqO4</li>
<li>http://www.youtube.com/watch?v=VG82USg5mtE</li>
<li>http://www.youtube.com/watch?v=-jMruFHTwrY</li>
<li>http://www.youtube.com/watch?v=zxK8y7XuEu8</li>
<li>http://www.youtube.com/watch?v=ADBKdSCbmiM</li>
<li>http://www.youtube.com/watch?v=28sAsvzMW6s</li>
<li>http://www.youtube.com/watch?v=V-24m-KRkn0</li>
</ul>
<p>&nbsp;</p>
<p>That&#8217;s one I made quickly.  It works like this:</p>
<p><em>First you have some HTML.</em></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ul class=&quot;video library&quot;&gt;
	&lt;li&gt;http://www.youtube.com/watch?v=L5JHMpLIqO4&lt;/li&gt;
	&lt;li&gt;http://www.youtube.com/watch?v=VG82USg5mtE&lt;/li&gt;
	&lt;li&gt;http://www.youtube.com/watch?v=-jMruFHTwrY&lt;/li&gt;	
	&lt;li&gt;http://www.youtube.com/watch?v=zxK8y7XuEu8&lt;/li&gt;	
	&lt;li&gt;http://www.youtube.com/watch?v=ADBKdSCbmiM&lt;/li&gt;	
	&lt;li&gt;http://www.youtube.com/watch?v=28sAsvzMW6s&lt;/li&gt;	
	&lt;li&gt;http://www.youtube.com/watch?v=V-24m-KRkn0&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>&nbsp;</p>
<p>Just throw the Youtube URLs into a list and add the classes <em>video</em> and <em>library</em> to it, and that&#8217;s all there is to the HTML!  (Well, there&#8217;s some minor javascript to include).</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;link href=&quot;http://www.gigglingcorpse.com/dev/video-gallery/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;script src=&quot;http://www.gigglingcorpse.com/dev/video-gallery/video-library.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;http://www.google.com/jsapi&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> 
		google.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jquery&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		google.<span style="color: #660066;">setOnLoadCallback</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			videofy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>&nbsp;</p>
<p>I included the Javascript file for you know doing stuff, as well as CSS file for some basic formatting.  It makes use of JQuery, which i&#8217;ve included by way of Google&#8217;s JsAPI (out of laziness).  And then when everything has loaded, there&#8217;s the one call to <em>videofy()</em>.</p>
<p>After that, the list gets converted into the video gallery you should see above!</p>
<p>Thank you for your time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/06/29/youtube-powered-video-gallery-and-isometry/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP stdClass property $t</title>
		<link>http://www.gigglingcorpse.com/2011/06/06/php-stdclass-property-t/</link>
		<comments>http://www.gigglingcorpse.com/2011/06/06/php-stdclass-property-t/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 03:57:16 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2914</guid>
		<description><![CDATA[Just recently one of my clients requested that I add a blogger feed on their website. Today I set about implementing that. I found that I retrieve the data as JSON, which is super handy because of PHP&#8217;s json_decode function. You can retrieve the JSON through a URL like this: http://blog.alteredeffect.com/feeds/posts/default?alt=json But I did run [...]]]></description>
			<content:encoded><![CDATA[<p>Just recently one of my clients requested that I add a <a href="http://blogger.com">blogger</a> feed on their website.  Today I set about implementing that.</p>
<p>I found that I retrieve the data as <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>, which is super handy because of PHP&#8217;s <a href="http://php.net/json_decode">json_decode</a> function.  You can retrieve the JSON through a URL like this: <a href="http://blog.alteredeffect.com/feeds/posts/default?alt=json">http://blog.alteredeffect.com/feeds/posts/default?alt=json</a></p>
<p>But I did run into an issue.  Most things, when deJSONed, turned into <a href="http://www.php.net/manual/en/language.types.object.php">stdClass</a> objects.  One property I needed to access was named &#8220;<em>$t</em>&#8220;, which as you may imagine I had some trouble accessing.  I tried single quotes and escaping the <em>$</em> character, but nothing seemed to work.</p>
<p>There&#8217;s almost definitely a better way, but I ended up casting to Array:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getT<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$obj</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$t</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">Array</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$t</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'$t'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And it seemed to work fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/06/06/php-stdclass-property-t/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP functions</title>
		<link>http://www.gigglingcorpse.com/2011/05/16/php-functions/</link>
		<comments>http://www.gigglingcorpse.com/2011/05/16/php-functions/#comments</comments>
		<pubDate>Mon, 16 May 2011 22:15:38 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually]]></category>
		<category><![CDATA[Dev]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2891</guid>
		<description><![CDATA[I sometimes find writing regular expressions of any complexity difficult. That&#8217;s true, though it would be more accurate if I&#8217;d said always. It&#8217;s not because regular expressions themselves are difficult (though there is a lot to remember, or look up), but it can be so easy to make mistakes and so difficult to find those [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes find writing regular expressions of any complexity difficult.  That&#8217;s true, though it would be more accurate if I&#8217;d said always.<br />
It&#8217;s not because regular expressions themselves are difficult (though there is a lot to remember, or look up), but it can be so easy to make mistakes and so difficult to find those mistakes in that confusing mass of characters.  </p>
<p>Eventually I give up and make a dedicated PHP file just to test the regular expression against various inputs.  In fact, I have done the same with other functions to ensure that they do what I expect them to.</p>
<p>And you know what they say:  <em>If you&#8217;ve done something more than once, and will probably do it again, why not automate it?  And if you can&#8217;t automate it, make a tool for it.</em>  There&#8217;s even the more appropriate:  <em>Make a web-tool for testing functions with arguments.</em><br />
(I have no idea if those are real saying or not.)</p>
<p>I like to listen to people and what they say, and so that is exactly what I did: <a href="http://gigglingcorpse.com/dev/phpfunctions/">http://gigglingcorpse.com/dev/phpfunctions</a></p>
<p>Here it is in iframe, although it doesn&#8217;t really fit:<br />
<iframe width="600" height="700" src="http://gigglingcorpse.com/dev/phpfunctions/" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/05/16/php-functions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rock, paper, scissors, bots!</title>
		<link>http://www.gigglingcorpse.com/2011/03/22/rock-paper-scissors-bots/</link>
		<comments>http://www.gigglingcorpse.com/2011/03/22/rock-paper-scissors-bots/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 16:10:12 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2881</guid>
		<description><![CDATA[This Google AI challenge thing seems so neat, and like it&#8217;d be fun! Because who doesn&#8217;t like bots?? A couple of nights ago I made a rock/paper/scissors bot arena. You can make bots using Javascript and have them compete. It seemed like it&#8217;d be fun to make, and who knows, maybe it&#8217;ll trick some people [...]]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://ai-contest.com/">Google AI challenge</a> thing seems so neat, and like it&#8217;d be fun!  Because who doesn&#8217;t like bots??</p>
<p>A couple of nights ago I made <a href="http://dev.alteredeffect.com/rockpaperscissors">a rock/paper/scissors bot arena</a>.  You can make bots using Javascript and have them compete.<br />
It seemed like it&#8217;d be fun to make, and who knows, maybe it&#8217;ll trick some people into trying out some easy programming since it&#8217;s all web-based.</p>
<p>It&#8217;s a little weirder than normal Javascript, but that&#8217;s because the code gets wrapped into an object before use:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> bot1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Random (from array)&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Actual bot code starts here</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ROCK</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">PAPER</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">SCISSORS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">/**
	 * This is the deciding function for your bot.
	 * It should return ROCK, PAPER, or SCISSORS.
	 **/</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">evaluate</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> values <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">// Pick a random element in the array</span>
		<span style="color: #000066; font-weight: bold;">return</span> values<span style="color: #009900;">&#91;</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>values.<span style="color: #660066;">length</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span>
&nbsp;
	 <span style="color: #006600; font-style: italic;">// And ends here</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>There are a couple of special functions:</p>
<ul>
<li><strong>this.evaluate = function()</strong> gets called when it&#8217;s time for the bot to <em>throw down</em>.</li>
<li><strong>this.opponentPicked = function( v )</strong> (if it exists) gets called with your opponents choice for the game that&#8217;s just finished.</li>
</ul>
<p>A good example of the <em>opponentPicked</em> function is the <em>Watcher</em> bot.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ROCK</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">PAPER</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">SCISSORS</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * This is the deciding function for your bot.
 * It should return ROCK, PAPER, or SCISSORS.
 **/</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">evaluate</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> total <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
		total <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> po <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>total <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> po <span style="color: #339933;">&gt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			po <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> 
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>3<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Let's you know what you're opponent has picked.  
 * This gets called after evaluate.
 * @param int v
 */</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">opponentPicked</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> v <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> v <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">&amp;&amp;</span> v <span style="color: #339933;">&lt;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span>.<span style="color: #660066;">length</span> <span style="color: #009900;">&#41;</span> 
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">memory</span><span style="color: #009900;">&#91;</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span> v <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>There are a bunch of example bots anyway.  Just don&#8217;t try <em>this is going to be bad</em>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/03/22/rock-paper-scissors-bots/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>changing the background colour of a table&#8217;s cell that is nested three tables deep</title>
		<link>http://www.gigglingcorpse.com/2011/03/20/changing-the-background-colour-of-a-tables-cell-that-is-nested-three-tables-deep/</link>
		<comments>http://www.gigglingcorpse.com/2011/03/20/changing-the-background-colour-of-a-tables-cell-that-is-nested-three-tables-deep/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 20:08:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[being helpful to people less experienced than myself in the ways of the world; mostly in the ways of the web actually]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2866</guid>
		<description><![CDATA[This is for Dennis, because he couldn&#8217;t find it on the internet: 0 0 1 0 HTML &#60;table border=&#34;1&#34;&#62; &#60;tr&#62; &#60;td&#62;0&#60;/td&#62; &#60;td&#62; &#60;table border=&#34;1&#34;&#62; &#60;tr&#62; &#60;td&#62;0&#60;/td&#62; &#60;td&#62; &#60;table border=&#34;1&#34;&#62; &#60;tr&#62; &#60;td&#62;1&#60;/td&#62; &#60;/tr&#62; &#60;/table&#62; &#60;/td&#62; &#60;/tr&#62; &#60;/table&#62; &#60;/td&#62; &#60;td&#62;0&#60;/td&#62; &#60;/tr&#62; &#60;/table&#62; So basically just three tables nested. CSS td td td:hover &#123; background-color: #aeaeae; &#125; td [...]]]></description>
			<content:encoded><![CDATA[<p>This is for Dennis, because he couldn&#8217;t find it on the internet:</p>
<table border="1">
<tbody>
<tr>
<td>0</td>
<td>
<table border="1">
<tbody>
<tr>
<td>0</td>
<td>
<table border="1">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>0</td>
</tr>
</tbody>
</table>
<style> td td td:hover { background-color: #aeaeae; } </style>
<h3>HTML</h3>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;table border=&quot;1&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;
			&lt;table border=&quot;1&quot;&gt;
				&lt;tr&gt;
					&lt;td&gt;0&lt;/td&gt;
					&lt;td&gt;
						&lt;table border=&quot;1&quot;&gt;
							&lt;tr&gt;
								&lt;td&gt;1&lt;/td&gt;
							&lt;/tr&gt;
						&lt;/table&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/table&gt;
		&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;</pre></div></div>

<p>So basically just three tables nested.</p>
<h3>CSS</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">td td td<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#aeaeae</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><em>td td td:hover</em> means that when the mouse is over a <em>td</em> tag, that is a descendant (within) of a <em>td</em> tag that is a descendant of a <em>td</em> tag this style is active.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/03/20/changing-the-background-colour-of-a-tables-cell-that-is-nested-three-tables-deep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oh books are so hard to find</title>
		<link>http://www.gigglingcorpse.com/2011/03/17/oh-books-are-so-hard-to-find/</link>
		<comments>http://www.gigglingcorpse.com/2011/03/17/oh-books-are-so-hard-to-find/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 06:07:24 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[books i liked]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2815</guid>
		<description><![CDATA[I&#8217;ve been looking lately for a book to read. A single book, and perhaps even twice that or more. It is frightening and frustrating in turns, and occasionally rewarding. I have read many, many books. It has led me to point where I have become far too picky about those which I&#8217;ll like, and not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking lately for a book to read.  A single book, and perhaps even twice that or more.  It is frightening and frustrating in turns, and occasionally rewarding.</p>
<p>I have read many, many books.  It has led me to point where I have become far too picky about those which I&#8217;ll like, and not in a way that seems match well with the groupings many seem to make.  Worse, I&#8217;m not sure how to describe my taste in such a way as to convince the internet to assist me.<br />
My experience has taught me, though perhaps not well.</p>
<p>I enjoy the fantastic, to distract me from a familiar world.  I hope for a certain moral ambiguity, not just for itself but for the way it enforces greater believability in characters  &#8211; especially antagonists.  I am so very opposed to the idea of good versus evil.<br />
I strongly dislike prophecies, especially as contrivance to propel the plot as they so often are.  In general, I tend away from wars and politics.  I find them boring and the sides often unrelateable or unrespectable.    An unexpected conclusion can be amazing.</p>
<p>I&#8217;m sure many people must share my taste, so maybe I can help them and they can help me in turn.  That or better, I can at least provide a list of books I&#8217;ve read recently and enjoyed just for something to post.</p>
<p>In no particular order save that which they came to mind (which I suspect may correlate to time elapsed since reading), I present to you:</p>
<p>&nbsp;</p>
<h2>A book for any occassion <small>(that involves reading one of these books)</small></h2>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Noise-Novel-Darin-Bradley/dp/0553386220/ref=sr_1_1?ie=UTF8&amp;qid=1300385327&amp;sr=8-1&amp;tag=thefamwis-20 "><img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="http://ecx.images-amazon.com/images/I/612CYCFiCZL._SL110_.jpg" alt="Noise: A novel" align="left" /> </a></p>
<h3>Noise: A novel <small>by Darin Bradley</small></h3>
<p>Two friends prepare very rationally for the zombie-less apocolypse.  I could respect the reasoning behind every decision they made and every action they took.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Reapers-Are-Angels-Alden-Bell/dp/0805092439/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300385741&amp;sr=1-1&amp;tag=thefamwis-20 "> <img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/41n64LbHBtL._SL110_.jpg" alt="The Reapers are the Angels" align="left" /></a></p>
<h3>The Reapers are the angels <small>by Alden Bell</small></h3>
<p>Zombies flow through the streets with the sun, but at night dream of better days when flesh was abundant and humans were surprised.  This isn&#8217;t the average zombie story.  The protagonist is a girl  born after their rise, and the zombied world is all she knows.  None of this boring and usual holing up to wait it out, hoping for the world to go back to normal. It is normal to her.<br />
After reading the first page, I thought I would hate this book.  It was actually really good.</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Sharp-Teeth-Toby-Barlow/dp/0061430226/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300424418&amp;sr=1-1&amp;tag=thefamwis-20 "> <img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/41GU8ta5UbL._SL110_.jpg" alt="Sharp Teeth" align="left" /></a></p>
<h3>Sharp Teeth <small>by Toby Barlow</small></h3>
<p>People and jobs and dogs and love.  Easy to read and different and good.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Six-Bad-Things-Charlie-Huston/dp/0345464796/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300424798&amp;sr=1-1&amp;tag=thefamwis-20 "> <img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/511ETABTC5L._SL110_.jpg" alt="Six bad things" align="left" /></a></p>
<h3>Six bad things <small>by Charlie Huston</small></h3>
<p>The second of three or four.  I read it first, <a href="http://www.gigglingcorpse.com/2007/05/23/sequels-as-stand-alone-works/">as I sometimes do</a>, and think it stands best alone.  Full of action and crime and even bits of mexico.  Quick and easy to read.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Anathem-Neal-Stephenson/dp/006147410X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300425252&amp;sr=1-1&amp;tag=thefamwis-20 "><br />
<img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/51Wdmi8DUzL._SL110_.jpg" alt="Anathem" align="left" /></a></p>
<h3>Anathem <small>by Neal Stephenson</small></h3>
<p>It took a while to get into, but I was soon captivated.  I remember reading it during the night over pizza, after long days spent walking the streets and parks of San Francisco.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Shadow-Claw-First-Half-Book/dp/0312890176/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300425416&amp;sr=1-1&amp;tag=thefamwis-20 "> <img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/41GQU9r1IeL._SL110_.jpg" alt="Shadow &amp; Claw" align="left" /> </a></p>
<h3>Shadow &amp; Claw: The First Half of &#8216;The Book of the New Sun&#8217; <small>by Gene Wolfe</small></h3>
<p>This and all the books that follow.  It takes place in a future so far distant.  Detailed, and vivid, and surreal at times.  Intricate with layers and beauty and characters and stories.  I&#8217;d like to read it again soon I think.  More difficult a read than the former entries, but more rewarding for it.</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Crying-Lot-49-Thomas-Pynchon/dp/006091307X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300425682&amp;sr=1-1&amp;tag=thefamwis-20 "><br />
<img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/21N8CHDKD4L._SL110_.jpg" alt="The Crying of Lot 49" align="left" /></a></p>
<h3>The Crying of Lot 49 <small>by Thomas Pynchon</small></h3>
<p>Strange and surreal, but that can be good.  More difficult a read than a few of the formers.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>So those are the books I&#8217;ve enjoyed most recently (ambiguity intended).  There have been many more in the past, but that was long ago.   I&#8217;ll leave them but for two that come to mind.</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Diamond-Age-Young-Illustrated-Primer/dp/0553380966/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300427193&amp;sr=1-1&amp;tag=thefamwis-20 "><br />
<img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/51eDiMq4dsL._SL110_.jpg" alt="The Diamond Age" align="left" /></a></p>
<h3>The Diamond Age: Or, A Young Lady&#8217;s Illustrated Primer <small>by Neal Stephenson</small></h3>
<p>My favourite.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.amazon.ca/Chasm-City-Alastair-Reynolds/dp/0575083158/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1300427386&amp;sr=1-1&amp;tag=thefamwis-20 "><br />
<img style="margin-right: 10px; margin-bottom: 10px; padding: 4px; border: solid 1px #aaa;" src="https://images-na.ssl-images-amazon.com/images/I/21lXXnOIB9L._SL110_.jpg" alt="Chasm City" align="left" /></a></p>
<h3>Chasm City <small>by Alastair Reynolds</small></h3>
<p>Awesome if you&#8217;re down for some noiry science fiction.  Good if you&#8217;re not.  One of my favourites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2011/03/17/oh-books-are-so-hard-to-find/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chromatic Restitution!</title>
		<link>http://www.gigglingcorpse.com/2010/12/13/chromatic-restitution/</link>
		<comments>http://www.gigglingcorpse.com/2010/12/13/chromatic-restitution/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 08:15:30 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[GDF]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game demo festival]]></category>

		<guid isPermaLink="false">http://www.gigglingcorpse.com/?p=2783</guid>
		<description><![CDATA[Last Game Demo Festival (GDF4, if i’ve decremented correctly) I thought up a neat but simple game idea, and my implementation was truly terrible. The result? A submission known as Worst Game Demo Ever (WGDE) which shames me even today. The problem was of course laziness. At least some representation of physics was important to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gdf.gigglingcorpse.com/demos/brad/ChromaticRestitution.html"><img src="http://www.gigglingcorpse.com/wp-content/uploads/2010/12/chromatic-restitution.png" alt="Chromatic Restituion" /></a></p>
<p>Last <a href="http://gdf.gigglingcorpse.com">Game Demo Festival</a> (GDF4, if i’ve decremented correctly) I thought up a neat but simple game idea, and my implementation was truly terrible.  The result?  A submission known as <a href="http://gigglingcorpse.com/dev/demo4/">Worst Game Demo Ever (WGDE)</a> which shames me even today.</p>
<p>The problem was of course laziness.<br />
At least some representation of physics was important to the design, and I had a very specific use of sound in mind.  Without those it wasn’t so much a game demo, and very much wasn’t the one I’d intended.</p>
<p>I tried again with GDF5, but decided to try a physics library and settled on <a href="http://www.box2dflash.org/">Box2d for flash</a>.  It wasn’t as difficult as I’d expected!  I’m happy with how using it turned out.  There were some strange issues that were almost definitely due to my misuse of the library, but avoidance solved those as it does most things.</p>
<p>In order to add a certain potential for complexity,  each <em>x</em> position was to play a different note on collision.  I totally (sorta) accomplished this using <a href="http://www.musicmasterworks.com/WhereMathMeetsMusic.html">frequencies</a>, <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html">sine waves</a>, and the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/SampleDataEvent.html">SampleDataEvent</a>.  For consistency in representation, the sound generated is stereo &#8211; loudest on the side it&#8217;s closest to (this is not the case in the example below).<br />
Click the grey box below and then hit keys to play sounds:</p>
<p><object type="application/x-shockwave-flash" data="http://gdf.gigglingcorpse.com/demos/brad/Notes.swf" width="580" height="40" class="embedflash"><param name="movie" value="http://gdf.gigglingcorpse.com/demos/brad/Notes.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<p>&nbsp;</p>
<p>Once sounds and physics were basically implemented, I added the import game-elements including and consisting solely of an ability to accrue points.  The point system works as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">var</span> coeff = <span style="color: #cc66cc;">1</span>;
	<span style="color: #000000; font-weight: bold;">var</span> bonus = <span style="color: #cc66cc;">0</span>;
	<span style="color: #000000; font-weight: bold;">var</span> base = <span style="color: #cc66cc;">10</span>;
	<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">value</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span>:
			coeff = <span style="color: #cc66cc;">1.2</span>;
			<span style="color: #b1b100;">break</span>;
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span>:
			coeff = <span style="color: #cc66cc;">1.4</span>;
			<span style="color: #b1b100;">break</span>;
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">0</span>:
			coeff = <span style="color: #cc66cc;">1.6</span>;
			bonus = <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>++explosionChain<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> ballPool <span style="color: #66cc66;">&gt;</span>= maxBalls <span style="color: #66cc66;">&#41;</span>
				ballPool++;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">var</span> p:<span style="color: #0066CC;">Number</span> = base<span style="color: #66cc66;">*</span>coeff+bonus;
	points += p;
	dispatchEvent<span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> GameEvent<span style="color: #66cc66;">&#40;</span> GameEvent.<span style="color: #006600;">SCORE_CHANGE</span>, points <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Make it harder</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> points <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">25</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		maxBalls = <span style="color: #cc66cc;">2</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> points <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">&#41;</span>
		maxBalls = <span style="color: #cc66cc;">3</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> points <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">200</span> <span style="color: #66cc66;">&#41;</span>
		maxBalls = <span style="color: #cc66cc;">4</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> points <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">350</span> <span style="color: #66cc66;">&#41;</span>
		maxBalls = <span style="color: #cc66cc;">5</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> points <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">600</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		maxBalls = <span style="color: #cc66cc;">6</span>;			
	<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Pretty simple!   The more times you hit a ball, the more points you get.  If you eliminate a ball, you get a bonus proportional to the length of your elimination-chain (the number of balls you have eliminated in a row).<br />
At certain score levels, your number of <em>maximum balls in current play</em> increases.  If the number of balls in the ball pool is greater than or equal to that value on an elimination, a ball will be added to your ball pool.  This is done so that players can’t simply eliminate the last one ball over and over.</p>
<p>&nbsp;</p>
<p>So that is <strong><a href="http://gdf.gigglingcorpse.com/demos/brad/ChromaticRestitution.html">Chromatic Restitution</a></strong>!  It’s closer to what I’d wanted, and I am happy with the result.</p>
<p>Of course there are some things I wish I’d added but forgot with the distraction of ever decreasing distance to deadline.  Additional sound events would have added texture: <em>wooshes</em> when you miss a ball, some sort of <em>triumphant ring</em> when you eliminate one &#8211; that sort of thing.<br />
Particles or some other animation on elimination, or even bounce (sparks) would have been nice.  In general more colours, lights and sounds and movement.  Casinos have taught me people love those things.</p>
<p>Karl added an <a href="http://openid.net/">OpenID</a> thing to the <a href="http://gdf.gigglingcorpse.com/wiki/index.php?title=GDF_library">GDF library</a>.  I attempted to add it to the GDF Overlay prior to my submission, but failed and was too tired and confused to worry about it.  That would have been a nice addition as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigglingcorpse.com/2010/12/13/chromatic-restitution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

