<?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>John Hobbs on coding, Omaha, and life in general</title> <atom:link href="http://www.velvetcache.org/feed" rel="self" type="application/rss+xml" /><link>http://www.velvetcache.org</link> <description>I Love Darcy. I Love Code. I love Omaha.</description> <lastBuildDate>Thu, 24 May 2012 15:00:48 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Thursday Quote: Mike Solomon</title><link>http://www.velvetcache.org/2012/05/24/thursday-quote-mike-solomon</link> <comments>http://www.velvetcache.org/2012/05/24/thursday-quote-mike-solomon#comments</comments> <pubDate>Thu, 24 May 2012 15:00:48 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Quotes]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2245</guid> <description><![CDATA[&#8220;Linux is good in terms of manholes, there&#8217;s always a way to get in and see how your system is behaving.&#8221; - Mike SolomonScalability at YouTube Related posts: Thursday Quote: Mike Haertel Thursday Quote: Linus Torvalds Linux On The Desktop
Related posts:<ol><li><a
href='http://www.velvetcache.org/2011/06/02/thursday-quote-mike-haertel' rel='bookmark' title='Thursday Quote: Mike Haertel'>Thursday Quote: Mike Haertel</a></li><li><a
href='http://www.velvetcache.org/2011/06/16/thursday-quote-linus-torvalds-2' rel='bookmark' title='Thursday Quote: Linus Torvalds'>Thursday Quote: Linus Torvalds</a></li><li><a
href='http://www.velvetcache.org/2006/09/20/linux-on-the-desktop' rel='bookmark' title='Linux On The Desktop'>Linux On The Desktop</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Linux is good in terms of manholes, there&#8217;s always a way to get in and see how your system is behaving.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- Mike Solomon<br/><a
href="http://www.youtube.com/watch?v=G-lGCC4KKok" target="_blank"><em>Scalability at YouTube</em></a></p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2011/06/02/thursday-quote-mike-haertel' rel='bookmark' title='Thursday Quote: Mike Haertel'>Thursday Quote: Mike Haertel</a></li><li><a
href='http://www.velvetcache.org/2011/06/16/thursday-quote-linus-torvalds-2' rel='bookmark' title='Thursday Quote: Linus Torvalds'>Thursday Quote: Linus Torvalds</a></li><li><a
href='http://www.velvetcache.org/2006/09/20/linux-on-the-desktop' rel='bookmark' title='Linux On The Desktop'>Linux On The Desktop</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/05/24/thursday-quote-mike-solomon/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thursday Quote: Robert C. Gallagher</title><link>http://www.velvetcache.org/2012/05/17/thursday-quote-robert-c-gallagher</link> <comments>http://www.velvetcache.org/2012/05/17/thursday-quote-robert-c-gallagher#comments</comments> <pubDate>Thu, 17 May 2012 15:00:20 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Life]]></category> <category><![CDATA[Change]]></category> <category><![CDATA[Funny]]></category> <category><![CDATA[Quotes]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2240</guid> <description><![CDATA[&#8220;Change is inevitable — except from a vending machine.&#8221; - Robert C. Gallagher Related posts: Thursday Quote: Elbert Hubbard Thursday Quote: Pamela Slim Thursday Quote: Randy Pausch
Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/07/01/thursday-quote-elbert-hubbard' rel='bookmark' title='Thursday Quote: Elbert Hubbard'>Thursday Quote: Elbert Hubbard</a></li><li><a
href='http://www.velvetcache.org/2010/10/14/thursday-quote-pamela-slim' rel='bookmark' title='Thursday Quote: Pamela Slim'>Thursday Quote: Pamela Slim</a></li><li><a
href='http://www.velvetcache.org/2010/10/21/thursday-quote-randy-pausch' rel='bookmark' title='Thursday Quote: Randy Pausch'>Thursday Quote: Randy Pausch</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Change is inevitable — except from a vending machine.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- Robert C. Gallagher</p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/07/01/thursday-quote-elbert-hubbard' rel='bookmark' title='Thursday Quote: Elbert Hubbard'>Thursday Quote: Elbert Hubbard</a></li><li><a
href='http://www.velvetcache.org/2010/10/14/thursday-quote-pamela-slim' rel='bookmark' title='Thursday Quote: Pamela Slim'>Thursday Quote: Pamela Slim</a></li><li><a
href='http://www.velvetcache.org/2010/10/21/thursday-quote-randy-pausch' rel='bookmark' title='Thursday Quote: Randy Pausch'>Thursday Quote: Randy Pausch</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/05/17/thursday-quote-robert-c-gallagher/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thursday Quote: Joshua Bloch</title><link>http://www.velvetcache.org/2012/05/10/thursday-quote-joshua-bloch</link> <comments>http://www.velvetcache.org/2012/05/10/thursday-quote-joshua-bloch#comments</comments> <pubDate>Thu, 10 May 2012 15:00:04 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Quotes]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2237</guid> <description><![CDATA[&#8220;Basically I&#8217;ve become harder on myself over the years &#8212; that&#8217;s what it takes to write good programs. You really can&#8217;t accept bad habits from yourself.&#8221; - Joshua Bloch
Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/01/20/thursday-quote-abelson-sussman' rel='bookmark' title='Thursday Quote: Abelson &amp; Sussman'>Thursday Quote: Abelson &#038; Sussman</a></li><li><a
href='http://www.velvetcache.org/2011/06/30/thursday-quote-eric-s-raymond' rel='bookmark' title='Thursday Quote: Eric S. Raymond'>Thursday Quote: Eric S. Raymond</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Basically I&#8217;ve become harder on myself over the years &#8212; that&#8217;s what it takes to write good programs. You really can&#8217;t accept bad habits from yourself.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- Joshua Bloch<br/><<em><a
href="http://www.amazon.com/gp/product/1430219483/ref=as_li_ss_tl?ie=UTF8&#038;tag=o053-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430219483">Coders at Work: Reflections on the Craft of Programming</a></em></p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/01/20/thursday-quote-abelson-sussman' rel='bookmark' title='Thursday Quote: Abelson &amp; Sussman'>Thursday Quote: Abelson &#038; Sussman</a></li><li><a
href='http://www.velvetcache.org/2011/06/30/thursday-quote-eric-s-raymond' rel='bookmark' title='Thursday Quote: Eric S. Raymond'>Thursday Quote: Eric S. Raymond</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/05/10/thursday-quote-joshua-bloch/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thursday Quote: Albert Einstein</title><link>http://www.velvetcache.org/2012/05/03/thursday-quote-albert-einstein</link> <comments>http://www.velvetcache.org/2012/05/03/thursday-quote-albert-einstein#comments</comments> <pubDate>Thu, 03 May 2012 15:00:43 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Life]]></category> <category><![CDATA[Quotes]]></category> <category><![CDATA[Truth]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2234</guid> <description><![CDATA[&#8220;Anyone who doesn&#8217;t take truth seriously in small matters cannot be trusted in large ones either.&#8221; - Albert Einstein Related posts: Thursday Quote: Dhanji R. Prasanna Thursday Quote: Paul Graham Thursday Quote: John Casasanta
Related posts:<ol><li><a
href='http://www.velvetcache.org/2012/01/19/thursday-quote-dhanji-r-prasanna' rel='bookmark' title='Thursday Quote: Dhanji R. Prasanna'>Thursday Quote: Dhanji R. Prasanna</a></li><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/03/24/thursday-quote-john-casasanta' rel='bookmark' title='Thursday Quote: John Casasanta'>Thursday Quote: John Casasanta</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Anyone who doesn&#8217;t take truth seriously in small matters cannot be trusted in large ones either.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- Albert Einstein</p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2012/01/19/thursday-quote-dhanji-r-prasanna' rel='bookmark' title='Thursday Quote: Dhanji R. Prasanna'>Thursday Quote: Dhanji R. Prasanna</a></li><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/03/24/thursday-quote-john-casasanta' rel='bookmark' title='Thursday Quote: John Casasanta'>Thursday Quote: John Casasanta</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/05/03/thursday-quote-albert-einstein/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thursday Quote: Kent Beck</title><link>http://www.velvetcache.org/2012/04/26/thursday-quote-kent-beck</link> <comments>http://www.velvetcache.org/2012/04/26/thursday-quote-kent-beck#comments</comments> <pubDate>Thu, 26 Apr 2012 15:00:13 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Life]]></category> <category><![CDATA[Quotes]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2231</guid> <description><![CDATA[&#8220;All methodologies are based on fear. - Kent Beck Related posts: Thursday Quote: Rollo May Thursday Quote: Harold Ableson Thursday Quote: Scott Belsky
Related posts:<ol><li><a
href='http://www.velvetcache.org/2011/02/17/thursday-quote-rollo-may' rel='bookmark' title='Thursday Quote: Rollo May'>Thursday Quote: Rollo May</a></li><li><a
href='http://www.velvetcache.org/2010/07/15/thursday-quote-harold-ableson-2' rel='bookmark' title='Thursday Quote: Harold Ableson'>Thursday Quote: Harold Ableson</a></li><li><a
href='http://www.velvetcache.org/2010/11/25/thursday-quote-scott-belsky' rel='bookmark' title='Thursday Quote: Scott Belsky'>Thursday Quote: Scott Belsky</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;All methodologies are based on fear.</p></blockquote><p
style="text-align: right; font-weight: bold;">- Kent Beck</p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2011/02/17/thursday-quote-rollo-may' rel='bookmark' title='Thursday Quote: Rollo May'>Thursday Quote: Rollo May</a></li><li><a
href='http://www.velvetcache.org/2010/07/15/thursday-quote-harold-ableson-2' rel='bookmark' title='Thursday Quote: Harold Ableson'>Thursday Quote: Harold Ableson</a></li><li><a
href='http://www.velvetcache.org/2010/11/25/thursday-quote-scott-belsky' rel='bookmark' title='Thursday Quote: Scott Belsky'>Thursday Quote: Scott Belsky</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/26/thursday-quote-kent-beck/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thursday Quote: Dana Contreras</title><link>http://www.velvetcache.org/2012/04/19/thursday-quote-dana-contreras</link> <comments>http://www.velvetcache.org/2012/04/19/thursday-quote-dana-contreras#comments</comments> <pubDate>Thu, 19 Apr 2012 15:00:41 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Quotes]]></category> <category><![CDATA[Systems Administration]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2228</guid> <description><![CDATA[&#8220;Look, all I&#8217;m saying is that 9.9999% is &#8220;five nines&#8221; too.&#8221; - Dana Contreras Related posts: Thursday Quote: Jeff Foster Thursday Quote: Jeff Atwood Thursday Quote: Gina Trapani
Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/05/27/thursday-quote-jeff-foster' rel='bookmark' title='Thursday Quote: Jeff Foster'>Thursday Quote: Jeff Foster</a></li><li><a
href='http://www.velvetcache.org/2010/08/26/thursday-quote-jeff-atwood' rel='bookmark' title='Thursday Quote: Jeff Atwood'>Thursday Quote: Jeff Atwood</a></li><li><a
href='http://www.velvetcache.org/2011/03/03/thursday-quote-gina-trapani' rel='bookmark' title='Thursday Quote: Gina Trapani'>Thursday Quote: Gina Trapani</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Look, all I&#8217;m saying is that 9.9999% is &#8220;five nines&#8221; too.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- <a
href="https://twitter.com/#!/DanaDanger/status/179835030502244352" target="_blank">Dana Contreras</a></p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/05/27/thursday-quote-jeff-foster' rel='bookmark' title='Thursday Quote: Jeff Foster'>Thursday Quote: Jeff Foster</a></li><li><a
href='http://www.velvetcache.org/2010/08/26/thursday-quote-jeff-atwood' rel='bookmark' title='Thursday Quote: Jeff Atwood'>Thursday Quote: Jeff Atwood</a></li><li><a
href='http://www.velvetcache.org/2011/03/03/thursday-quote-gina-trapani' rel='bookmark' title='Thursday Quote: Gina Trapani'>Thursday Quote: Gina Trapani</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/19/thursday-quote-dana-contreras/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Reading Code: Drew Gourley&#8217;s Countdown Script</title><link>http://www.velvetcache.org/2012/04/17/reading-code-drew-gourleys-countdown-script</link> <comments>http://www.velvetcache.org/2012/04/17/reading-code-drew-gourleys-countdown-script#comments</comments> <pubDate>Tue, 17 Apr 2012 13:30:50 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Code Reading]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Programming]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2332</guid> <description><![CDATA[A core step of growing as a programmer is reading code. I claim to be a fan of reading other peoples code, but I never seem to do it. Yesterday the excellent @DrewGourley tweeted about some code he deployed on &#8230; <a
href="http://www.velvetcache.org/2012/04/17/reading-code-drew-gourleys-countdown-script">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.velvetcache.org/2008/05/20/javascript-countdown-timer' rel='bookmark' title='Javascript Countdown Timer'>Javascript Countdown Timer</a></li><li><a
href='http://www.velvetcache.org/2010/02/16/territorial-seeds-user-script' rel='bookmark' title='Territorial Seeds User Script'>Territorial Seeds User Script</a></li><li><a
href='http://www.velvetcache.org/2011/10/06/kohana-3-oauth-twitter-demo-code' rel='bookmark' title='Kohana 3 OAuth &amp; Twitter Demo Code'>Kohana 3 OAuth &#038; Twitter Demo Code</a></li></ol>]]></description> <content:encoded><![CDATA[<p>A core step of growing as a programmer is reading code. I claim to be a fan of reading other peoples code, but I never seem to do it.  Yesterday the excellent <a
href="http://twitter.com/DrewGourley" target="_blank">@DrewGourley</a> tweeted about some code he deployed on the (gorgeous) new <a
href="http://mahamusicfestival.com" target="_blank">MahaMusicFestival.com</a>.</p><p><blockquote
class="twitter-tweet"><p>The code behind the coundown timer on the new @<a
href="https://twitter.com/mahafestival">mahafestival</a> website is custom from the ground up and is absolutely gorgeous. Just saying&#8230;</p><p>&mdash; Gunnar Gourley (@DrewGourley) <a
href="https://twitter.com/DrewGourley/status/191918262089547776" data-datetime="2012-04-16T15:57:34+00:00">April 16, 2012</a></p></blockquote><p>Since I enjoy Drew&#8217;s work (the <a
href="http://oxidedesign.com/" target="_blank">Oxide site</a> has lots of really neat stuff), but I&#8217;ve never really read any of it, I thought I&#8217;d give some code reading a whirl.  As a little experiment I&#8217;ve decided to transcribe my thoughts through the entire reading process; I&#8217;m typing it as I read.</p><p>This may turn out scattered, but it will show how I read code, and hopefully poke a little hole of insight into Drew&#8217;s code.</p><div
class="update"><p><strong>Note:</strong> The code on Maha has since changed, and probably will in the future. For reference I&#8217;ve saved off a copy of the code I read, so you can follow along if you&#8217;d like. Please recognize that this is <strong>not</strong> my work, it&#8217;s all Drew and the Oxide crews&#8217; &#8211; <a
href="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/maha.js">maha.js</a>.</p><p>Also, I went back and cleaned up some grammar and spelling errors, but for the most part this is verbatim what I wrote as I was reading.</p></div><h2>The Code</h2><p>So the product I&#8217;m going to poke around in is the countdown timer on <a
href="http://mahamusicfestival.com" target="_blank">MahaMusicFestival.com</a> &#8211; going there to check it out I find this cool piece.</p><p><a
href="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdown.png" rel="lightbox"><img
src="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdown.sm.png" /></a></p><p>And, the slick part is this great number animation, which I have captured for posterity here.</p><p><video
width="248" height="266" controls="controls"><br
/> <source
src="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdownv2_conv.mp4" type="video/mp4" /><br
/> <source
src="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdownv2_conv.ogg" type="video/ogg" /><br
/> Your browser does not support the video tag.<br
/> </video></p><p>So let&#8217;s find the source for it.  Popping open view-source I quickly find a script tag for <a
href="http://mahamusicfestival.com/wp-content/themes/maha2012/js/maha.js" target="_blank">http://mahamusicfestival.com/wp-content/themes/maha2012/js/maha.js</a> in the header.  Since every other script tag there is for something generic (jQuery, Modernizr, etc) I&#8217;m guessing this is it.  Also it looks like the site is based on WordPress &#8211; it&#8217;s amazing how flexible themes can be.</p><p>Clicking over to that source I see it&#8217;s a collection of JavaScript bits for the site, wrapped in a jQuery ready event.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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></pre></td></tr></table></div></p><p>That&#8217;s a nice, and very correct way of using jQuery for page load.  I&#8217;m usually lazy and just do this:</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">$<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></pre></td></tr></table></div></p><p>I should probably up my game a bit there, huh?  Just in case another library has taken over <tt>$</tt> onload of my scripts.</p><p>Scrolling down I see some relevant functions that are all prefixed with <tt>Oxide</tt>, like <tt>OxideSlider</tt>.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>19
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> OxideSlider<span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div></p><p>My first thought here was &#8220;namespace pollution!&#8221;, but then I realized that this is all encapsulated in that <tt>ready</tt> closure, so it&#8217;s good to go.</p><p>Lot&#8217;s of stuff I could look at here, but I&#8217;m on a mission: coundown code.  Browsing down I find my target. Lines 87-208 seem to be what I&#8217;m after.  I&#8217;ll deal with this in chunks now.</p><h2>Declarations</h2><p>First thing up is the variable declarations.  Nice and orderly.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>87
88
89
90
91
92
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> $dayspan <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#days span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        $hourspan <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#hours span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        $minutespan <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#minutes span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        $secondspan <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#seconds span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        d<span style="color: #339933;">,</span> h<span style="color: #339933;">,</span> m<span style="color: #339933;">,</span> s<span style="color: #339933;">,</span> go <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
        di <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><p>I see a few things here.  First, I like the notation of <tt>$dayspan</tt> &#8211; prefixing variables with <tt>$</tt> is a good way to visually identify jQuery objects, sort of a <a
href="http://en.wikipedia.org/wiki/Hungarian_notation" target="_blank">Hungarian Notation</a> for jQuery.</p><p>Second, I&#8217;m a bit skittish of <tt>d, h, m, s, go</tt> and <tt>di</tt>. I can instictively identify what the first four are (day, hour, minute, second) but the last two elude me.  I&#8217;m sure this will become clear as I read on, but since it feels weird to me I guess that means I like my variable names a bit more descriptive. Learning about myself through others!</p><h2>Core Function</h2><p>Up next appears to be the core function of which this all revolves around, <tt>OxideCountdown</tt>.  And it&#8217;s a doosie, so I&#8217;m going to try and chunk it out in pieces.</p><p>First up are some variable assingments.  Interestingly <tt>d, h, m, s</tt> are <strong>not</strong> integers, that&#8217;s what I was expecting.  This function might hold some surprises for me!</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>94
95
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">function</span> OxideCountdown<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        d <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> h <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> m <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> s <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> go <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><p>So, this next chunk seems to be pulling the current values out of the spans, one at a time.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        $dayspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            n <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            d.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            go <span style="color: #339933;">=</span> go <span style="color: #339933;">+</span> n<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $hourspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            n <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            h.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            go <span style="color: #339933;">=</span> go <span style="color: #339933;">+</span> n<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $minutespan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            n <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            m.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            go <span style="color: #339933;">=</span> go <span style="color: #339933;">+</span> n<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $secondspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            n <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            s.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            go <span style="color: #339933;">=</span> go <span style="color: #339933;">+</span> n<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><p>Interesting use of <tt>parseFloat</tt> here, as I would have expected <tt>parseInt</tt>.  Could this be related to the <a
href="http://parseintimate.com/" target="_blank">bugs in interpretation by <tt>parseInt</tt></a>?</p><p>So, it works it&#8217;s way through each time span, grabbing the value of the each digit in order and pushing it onto the corresponding array, so that each array would read out the same as the visual version, i.e. today <tt>d = [ 1, 1, 6 ];</tt></p><p>Also, it&#8217;s interesting to see that <tt>go</tt> seems to be an accumulator, but I&#8217;ve not figured out what for yet.  It&#8217;s just incrementing with all the values of all the digits, which doesn&#8217;t seem useful to me. i.e today <tt>go</tt> would equal <tt>8</tt> (<tt>1+1+6</tt>) after the <tt>$dayspan.each</tt>.  My curiosity is piqued!</p><p>Okay, on to the next chunk!</p><h2>Math!</h2><p>So here&#8217;s the next block, I warn you it&#8217;s a bit hairy!</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        di <span style="color: #339933;">=</span> d.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
        s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
            m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
            m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
            h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
            h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
            d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div></p><p>So I&#8217;m now seeing that <tt>di</tt> is how many digit&#8217;s will be displayed in the days area?  I&#8217;m lost now, I was operating on the assumption that each section has a fixed number of elements in it.  Let&#8217;s jump to the HTML real quick&#8230;</p><p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">	&lt;article&gt;
		&lt;div&gt;
			&lt;h4 id=&quot;seconds&quot;&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;7&lt;/span&gt;&lt;/h4&gt;
			&lt;p&gt;Seconds&lt;/p&gt;
		&lt;/div&gt;
		&lt;div&gt;
			&lt;h4 id=&quot;minutes&quot;&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;7&lt;/span&gt;&lt;/h4&gt;
			&lt;p&gt;Minutes&lt;/p&gt;
		&lt;/div&gt;
		&lt;div&gt;
			&lt;h4 id=&quot;hours&quot;&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;7&lt;/span&gt;&lt;/h4&gt;
			&lt;p&gt;Hours&lt;/p&gt;
		&lt;/div&gt;
		&lt;div&gt;
			&lt;h4 id=&quot;days&quot;&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;6&lt;/span&gt;&lt;/h4&gt;
			&lt;p&gt;Days&lt;/p&gt;
		&lt;/div&gt;
		&lt;br class=&quot;clearboth&quot; /&gt;
	&lt;/article&gt;</pre></div></div></p><p>So yeah, I suppose it&#8217;s possible that days might not have all those spans in it, but that seems true of all of the blocks if we are going down that route.  Hopefully reading more will shed some light.  But first, let&#8217;s double back and look at the math a piece at a time.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>117
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--;</span></pre></td></tr></table></div></p><p>Looks like this will be called once a second, and will decrement the right-most seconds column by one second (the reverse indexes here could get confusing).</p><p>It seems that the rest of this section is just balancing the carry for that subtraction.  Here&#8217;s the seconds code, but I stuck in comments where I heard them in my head.  The pattern repeats up until we hit tens of hours.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>118
119
120
121
122
123
124
125
126
127
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// Underrun on seconds, take away one from tens of seconds!</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// Underrun on tens of seconds, take away a minute!</span>
            s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
            m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div></p><p>Now that we have an underrun on tens of hours we have to tinker with days.  So there is what <tt>di</tt> is for!  Since the number of spans for days is (apparently) flexible, we are going to use the length of the days array to access the largest element.  Makes you wish JavaScript was allowed negative indicies on arrays (<tt>d[-1]</tt>), but that would of course break <tt>[]</tt> object notation for the key &#8220;-1&#8243;, which as we all know is <b>super</b> useful ;-p</p><p>The loop that follows just does the same carry algorithm on all the days blocks.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>134
135
136
137
138
139
140
141
142
143
144
145
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
            d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>di<span style="color: #339933;">--</span><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>d<span style="color: #009900;">&#91;</span>di<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                d<span style="color: #009900;">&#91;</span>di<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>di <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div></p><h2>Bug?</h2><p>At this point I noticed something I thought might be a bug.  In the tens of hours decrement block I saw that <tt>h[0]</tt> is set to &#8220;5&#8243;.  I&#8217;m not sure that is possible, since there are only 24 hours in the day, so it seems that at midnight a tick would mess up the count. I&#8217;m set up a quick test script for this, since I don&#8217;t want to stay awake until midnight watching :-)</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Preset the arrays in an expected failure condition</span>
<span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    h <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: #009900;">&#93;</span><span style="color: #339933;">,</span>
    m <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: #009900;">&#93;</span><span style="color: #339933;">,</span>
    s <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: #009900;">&#93;</span><span style="color: #339933;">,</span>
    di <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Code from http://mahamusicfestival.com/wp-content/themes/maha2012/js/maha.js?ver=3.3.1 ( 2012-04-16 18:44 Central)</span>
di <span style="color: #339933;">=</span> d.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
  s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  s<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
  m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
  m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  m<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
  h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">;</span>
  h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
  d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;d:&quot;</span><span style="color: #339933;">,</span> d <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;h:&quot;</span><span style="color: #339933;">,</span> h <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;m:&quot;</span><span style="color: #339933;">,</span> m <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;s:&quot;</span><span style="color: #339933;">,</span> s <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><p>After running it, I got bad output, sure enough.</p><p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">$ node test.js
d: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
h: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">9</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
m: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">9</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
s: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">9</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div></p><p>Corrected code would be this, which actually reaches backwards into <tt>h[1]</tt> to fix it.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>138
139
140
141
142
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
    h<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
    d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> d<span style="color: #009900;">&#91;</span>di <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div></p><div
class="update"><p><strong>Update:</strong> I shot Drew an email and he fixed it.  He even <a
href="https://twitter.com/DrewGourley/status/192089600339087360" target="_blank">gave me credit</a>!</p></div><h2>Moving On</h2><p>Ah ha! Now I finally see what <tt>go</tt> is for!</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>150
151
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>go <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            clearInterval<span style="color: #009900;">&#40;</span>timer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><p>It&#8217;s an accumulator to know when to <b>stop</b> this whole thing!  Evidently there is a timeout set on <tt>timer</tt>, which we haven&#8217;t seen yet.</p><p>When all the digits in the countdown are 0, the accumulator is also 0.  Tricky!</p><p>I would usually implement it as a boolean, but I like it this way. It&#8217;s trickier, but it cleans up a lot of potential <tt>if</tt> statements. Neat!</p><p>Now we are back to animate in all the various numbers, if they need animating.  Again we iterate over the digits in each span, and then apply a <b>really</b> cool custom animation on them if they have changed.</p><p>The animation takes advantage of hidden overflow in the CSS to animate the digit down and thus out of view, then moves it up above the visible area and animates in back down and into view again.  It&#8217;s a great combination of CSS and jQuery for a nice effect.</p><p>Since the bulk of this is stuff we&#8217;ve seen, I&#8217;ll just let show the code (though I am curious what&#8217;s going on in that &#8220;Messy&#8221; comment, crazy chaining!</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            $dayspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<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>parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> d<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>
                    $<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'-200px'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">//Messy: if ( $($dayspan[0]).text() == 0 ) { test1 = $($dayspan[0]).parent().parent().width(); $($dayspan[0]).fadeOut(function() { test2 = $(this).parent().parent().width(); $(this).parent().parent().css({width:test1+'px'}).animate({width:test2+'px'}); }); }</span>
            $hourspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<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>parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> h<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>
                    $<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'-200px'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $minutespan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<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>parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> m<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>
                    $<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'-200px'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $secondspan.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> e<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>parseFloat<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> s<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>
                    $<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span>
                    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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;">&#40;</span>e<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'-200px'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div></p><p>Lastly we declare and kick off the timer for the count down.  I would probably have moved this up, it&#8217;s a bit weird to see <tt>timer</tt> on line <tt>151</tt> <em>before</em> it&#8217;s declared.  It&#8217;s a little thing, and just my preference.</p><p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>208
</pre></td><td
class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> timer <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span>OxideCountdown<span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div></p><h2>Conclusions</h2><p>So that was neat!</p><p>Since I found a bug Drew has fixed that and went back and tweaked the code a bit more.  Most notably he pulled out and boiled down the countdown animation into this function.</p><p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">function</span> OxideNumberDrop<span style="color: #009900;">&#40;</span>elem<span style="color: #339933;">,</span> array<span style="color: #339933;">,</span> index<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span>elem<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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;">&#40;</span>elem<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'-200px'</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>array<span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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: #009900;">&#125;</span></pre></div></div></p><p>This is a really great effect, I can&#8217;t emphasize how cool it looks.</p><p>Reading another persons code exposed a few things about my own coding style that I wasn&#8217;t conscious of.  What surprised me most is that I wasn&#8217;t bothered by any formatting issues. I&#8217;m rather opinionated on formatting, for instance I claim to despise cuddled else&#8217;s (no newline between a closing curly brace and an <tt>else</tt>), but Drew does that and I breezed right over them.</p><p>It was also interesting to see a totally different approach to this problem. I implemented a countdown in the middle of last year, but it was day only and not JavaScript.  My natural approach would be handling time pieces as plain integers, so it was cool and kind of mind bending to see this approach of partitioning digits into arrays.</p><p>I think I will try to make a habit of this process, and I like the brain dump while reading, I think it helped it stick better to express it in writing while fresh in my mind.</p><p>Does anyone have any suggestions for what to read next? A favorite piece of code? Preferably something I can do in one sitting.</p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2008/05/20/javascript-countdown-timer' rel='bookmark' title='Javascript Countdown Timer'>Javascript Countdown Timer</a></li><li><a
href='http://www.velvetcache.org/2010/02/16/territorial-seeds-user-script' rel='bookmark' title='Territorial Seeds User Script'>Territorial Seeds User Script</a></li><li><a
href='http://www.velvetcache.org/2011/10/06/kohana-3-oauth-twitter-demo-code' rel='bookmark' title='Kohana 3 OAuth &amp; Twitter Demo Code'>Kohana 3 OAuth &#038; Twitter Demo Code</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/17/reading-code-drew-gourleys-countdown-script/feed</wfw:commentRss> <slash:comments>4</slash:comments> <enclosure
url="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdownv2_conv.mp4" length="46867" type="video/mp4" /> <enclosure
url="http://static.velvetcache.org/pages/2012/04/17/reading-code-drew-gourleys-countdown-script/countdownv2_conv.ogg" length="54928" type="audio/ogg" /> </item> <item><title>Thursday Quote: Zach Holman</title><link>http://www.velvetcache.org/2012/04/12/thursday-quote-zach-holman</link> <comments>http://www.velvetcache.org/2012/04/12/thursday-quote-zach-holman#comments</comments> <pubDate>Thu, 12 Apr 2012 15:00:56 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[Life]]></category> <category><![CDATA[Quotes]]></category> <category><![CDATA[Work]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2218</guid> <description><![CDATA[&#8220;Hours are bullshit. Worry about good work.&#8221; - Zach HolmanHow Github Works Related posts: Thursday Quote: Paul Graham Thursday Quote: Will Wilkinson Thursday Quote: Ward Cunningham
Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/08/18/thursday-quote-will-wilkinson' rel='bookmark' title='Thursday Quote: Will Wilkinson'>Thursday Quote: Will Wilkinson</a></li><li><a
href='http://www.velvetcache.org/2012/02/23/thursday-quote-ward-cunningham' rel='bookmark' title='Thursday Quote: Ward Cunningham'>Thursday Quote: Ward Cunningham</a></li></ol>]]></description> <content:encoded><![CDATA[<p><blockquote>&#8220;Hours are bullshit. Worry about good work.&#8221;</p></blockquote><p
style="text-align: right; font-weight: bold;">- Zach Holman<br/><a
href="http://zachholman.com/posts/how-github-works/" target="_blank">How Github Works</a></em></p><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2010/03/25/thursday-quote-paul-graham' rel='bookmark' title='Thursday Quote: Paul Graham'>Thursday Quote: Paul Graham</a></li><li><a
href='http://www.velvetcache.org/2011/08/18/thursday-quote-will-wilkinson' rel='bookmark' title='Thursday Quote: Will Wilkinson'>Thursday Quote: Will Wilkinson</a></li><li><a
href='http://www.velvetcache.org/2012/02/23/thursday-quote-ward-cunningham' rel='bookmark' title='Thursday Quote: Ward Cunningham'>Thursday Quote: Ward Cunningham</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/12/thursday-quote-zach-holman/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CSS Seven-Segment Display Tutorial</title><link>http://www.velvetcache.org/2012/04/11/css-seven-segment-display-tutorial</link> <comments>http://www.velvetcache.org/2012/04/11/css-seven-segment-display-tutorial#comments</comments> <pubDate>Thu, 12 Apr 2012 02:46:23 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Tutorial]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2277</guid> <description><![CDATA[I had an idea for a little project today that needed a seven-segment display. As a first pass I&#8217;m going to implement it in all software before seeking out hardware for it. Knowing I wanted to run my prototype in &#8230; <a
href="http://www.velvetcache.org/2012/04/11/css-seven-segment-display-tutorial">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.velvetcache.org/2009/12/07/css-heart' rel='bookmark' title='CSS Heart'>CSS Heart</a></li><li><a
href='http://www.velvetcache.org/2010/01/26/clean-prism-install-on-sidux' rel='bookmark' title='Clean Prism Install on Sidux'>Clean Prism Install on Sidux</a></li><li><a
href='http://www.velvetcache.org/2006/08/31/javascript-rating-meter' rel='bookmark' title='Javascript Rating Meter'>Javascript Rating Meter</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I had an idea for a little project today that needed a <a
href="http://en.wikipedia.org/wiki/Seven-segment_display" target="_blank">seven-segment display</a>.  As a first pass I&#8217;m going to implement it in all software before seeking out hardware for it.</p><p>Knowing I wanted to run my prototype in the browser I looked for a way to show a seven-segment display.  I considered images, but then I decided to challenge myself to implement it in CSS only.</p><p>I recently read the <a
href="http://jtauber.github.com/articles/css-hexagon.html" target="_blank">CSS Hexagon Tutorial</a> by <a
href="http://twitter.com/jtauber" target="_blank">James Tauber</a> and I felt I could apply some of those techniques to get this working.</p><h2>Step One: A Segment</h2><p>The obvious first step is to get a single segment displayed.</p><p>The basic shape of a segment is actually well defined in all four edges of the box from the hexagon tutorial.</p><div
id="css-demo-one" class="demo"><div
class="box"></div></div><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#36FF36</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#3636FF</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FFFF36</span><span style="color: #00AA00;">;</span></pre></div></div><p>So now I just needed to extract a single edge for my first segment, which proved quite simple.</p><div
id="css-demo-two" class="demo"><div
class="segment"></div></div><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span></pre></div></div><h2>Step Two: Fill It Out</h2><p>Iterating from that first segment is easy, just change which borders you need for which segment you require.  However, I needed a positioning system.  I decided to go with absolute positioning, with a relative wrapper. Traditionally these displays are addressed with each segment being a letter, so I followed that pattern.</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;seven-segment&quot;&gt;
  &lt;div class=&quot;a&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;b&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;c&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;d&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;e&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;f&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;g&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</pre></div></div><div
id="css-demo-three" class="demo"><div
class="seven-segment"><div
class="a"></div><div
class="b"></div><div
class="c"></div><div
class="d"></div><div
class="e"></div><div
class="f"></div><div
class="g"></div></div></div><p>The CSS for this is quite similar from segment to segment, it&#8217;s mostly positioning and picking which border to colorize.</p><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.seven-segment</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.a</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.b</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.c</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.d</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">320px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.e</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.f</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><h2>Step Three: G Segment</h2><p>Here&#8217;s where it gets interesting.  Our standard segment shape will not work for the center segment, the G segment, which is beveled on both sides, something we can&#8217;t do with a single <tt>div</tt>.  First let&#8217;s split it up and treat it differently for top and bottom.</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;g&quot;&gt;
  &lt;div class=&quot;top&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;bottom&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</pre></div></div><p>Now we&#8217;ll style these using our regular segment markup.</p><div
id="css-demo-four" class="demo"><div
class="g"><div
class="top"></div><div
class="bottom"></div></div></div><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">top</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p>It works, sort of.  We now have the shape we want, but it&#8217;s way too thick. It won&#8217;t fit in the slot we have without looking strange.</p><p>Halving the borders and extending the width makes it look better.</p><p>This would be a good stopping point, but the angled edges don&#8217;t seem as long in G, so I tried to fix that.</p><div
id="css-demo-five" class="demo"><div
class="seven-segment"><div
class="a"></div><div
class="b"></div><div
class="c"></div><div
class="d"></div><div
class="e"></div><div
class="f"></div><div
class="g"><div
class="top"></div><div
class="bottom"></div></p></div></div></div><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">130px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">top</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">130px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p>The best solution I came up with was dealing with it at a smaller size, then using a transform to scale it up to where I wanted it.  It&#8217;s not exact, and it&#8217;s not the same width as the other segments, but the slopes are right, it fits and it feels as close to balanced as I&#8217;ve been able to get.</p><div
id="css-demo-six" class="demo"><div
class="seven-segment"><div
class="a"></div><div
class="b"></div><div
class="c"></div><div
class="d"></div><div
class="e"></div><div
class="f"></div><div
class="g"><div
class="top"></div><div
class="bottom"></div></p></div></div></div><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">162px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span><span style="color: #00AA00;">;</span>
  -webkit-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.4</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -moz-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.4</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -ms-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.4</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -o-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.4</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.4</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.seven-segment</span> <span style="color: #6666ff;">.g</span> .<span style="color: #000000; font-weight: bold;">top</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#FF3636</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><h2>Conclusion</h2><p>That was pretty painless! I wish I had a better solution for G, but this one is passable.</p><p>You can check out a nifty demo with some JavaScript and on/off states <a
href="http://static.velvetcache.org/pages/2012/04/11/css-seven-segment-display-tutorial/demo.html" target="_blank">here</a>.</p><p>Got some ideas for how to make G better? Please share in the comments!</p><style>div.demo {
margin: 10px 0;
background: #666;
padding: 20px;
border-top: 2px solid #444;
border-left: 2px solid #444;
border-right: 2px solid #AAA;
border-bottom: 2px solid #AAA;
}
#css-demo-one .box {
height: 100px;
width: 100px;
border-top: 30px solid #FF3636;
border-bottom: 30px solid #36FF36;
border-left: 30px solid #3636FF;
border-right: 30px solid #FFFF36;
}
#css-demo-two .segment {
height: 0;
width: 100px;
border-top: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-three { height: 350px; }
#css-demo-three .seven-segment {
position: relative;
}
#css-demo-three .seven-segment .a {
position: absolute;
left: 10px;
height: 0;
width: 100px;
border-top: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-three .seven-segment .b {
position: absolute;
left: 150px;
top: 10px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-three .seven-segment .c {
position: absolute;
left: 150px;
top: 180px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-three .seven-segment .d {
position: absolute;
top: 320px;
left: 10px;
height: 0;
width: 100px;
border-bottom: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-three .seven-segment .e {
position: absolute;
left: 0;
top: 180px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-three .seven-segment .f {
position: absolute;
left: 0;
top: 10px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-four .g .bottom {
height: 0;
width: 100px;
border-top: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-four .g .top {
height: 0;
width: 100px;
border-bottom: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-five { height: 350px; }
#css-demo-five .seven-segment {
position: relative;
}
#css-demo-five .seven-segment .a {
position: absolute;
left: 10px;
height: 0;
width: 100px;
border-top: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-five .seven-segment .b {
position: absolute;
left: 150px;
top: 10px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-five .seven-segment .c {
position: absolute;
left: 150px;
top: 180px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-five .seven-segment .d {
position: absolute;
top: 320px;
left: 10px;
height: 0;
width: 100px;
border-bottom: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-five .seven-segment .e {
position: absolute;
left: 0;
top: 180px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-five .seven-segment .f {
position: absolute;
left: 0;
top: 10px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-five .seven-segment .g {
position: absolute;
top: 160px;
left: 10px;
}
#css-demo-five .seven-segment .g .bottom {
height: 0;
width: 130px;
border-top: 15px solid #FF3636;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
}
#css-demo-five .seven-segment .g .top {
height: 0;
width: 130px;
border-bottom: 15px solid #FF3636;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
}
#css-demo-six { height: 350px; }
#css-demo-six .seven-segment {
position: relative;
}
#css-demo-six .seven-segment .a {
position: absolute;
left: 10px;
height: 0;
width: 100px;
border-top: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-six .seven-segment .b {
position: absolute;
left: 150px;
top: 10px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-six .seven-segment .c {
position: absolute;
left: 150px;
top: 180px;
height: 100px;
width: 0;
border-right: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-six .seven-segment .d {
position: absolute;
top: 320px;
left: 10px;
height: 0;
width: 100px;
border-bottom: 30px solid #FF3636;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
#css-demo-six .seven-segment .e {
position: absolute;
left: 0;
top: 180px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-six .seven-segment .f {
position: absolute;
left: 0;
top: 10px;
height: 100px;
width: 0;
border-left: 30px solid #FF3636;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
}
#css-demo-six .seven-segment .g {
position: absolute;
top: 162px;
left: 35px;
-webkit-transform: scale(1.4);
-moz-transform: scale(1.4);
-ms-transform: scale(1.4);
-o-transform: scale(1.4);
transform: scale(1.4);
}
#css-demo-six .seven-segment .g .bottom {
height: 0;
width: 80px;
border-top: 15px solid #FF3636;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
}
#css-demo-six .seven-segment .g .top {
height: 0;
width: 80px;
border-bottom: 15px solid #FF3636;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
}</style><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2009/12/07/css-heart' rel='bookmark' title='CSS Heart'>CSS Heart</a></li><li><a
href='http://www.velvetcache.org/2010/01/26/clean-prism-install-on-sidux' rel='bookmark' title='Clean Prism Install on Sidux'>Clean Prism Install on Sidux</a></li><li><a
href='http://www.velvetcache.org/2006/08/31/javascript-rating-meter' rel='bookmark' title='Javascript Rating Meter'>Javascript Rating Meter</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/11/css-seven-segment-display-tutorial/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>ImageMagick Wallet Maker</title><link>http://www.velvetcache.org/2012/04/10/imagemagick-wallet-maker</link> <comments>http://www.velvetcache.org/2012/04/10/imagemagick-wallet-maker#comments</comments> <pubDate>Tue, 10 Apr 2012 18:15:46 +0000</pubDate> <dc:creator>John Hobbs</dc:creator> <category><![CDATA[Geek]]></category> <category><![CDATA[BASH]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Script]]></category> <guid
isPermaLink="false">http://www.velvetcache.org/?p=2262</guid> <description><![CDATA[I&#8217;ve got an older script for making thumbnails and contact sheets from a folder of images. Recently Phillip Vuchetich sent me a related script for taking images, scaling them to wallet sizes and composing them onto 4&#215;6 sheets for easy &#8230; <a
href="http://www.velvetcache.org/2012/04/10/imagemagick-wallet-maker">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets' rel='bookmark' title='ImageMagick Thumbnails and Contact Sheets'>ImageMagick Thumbnails and Contact Sheets</a></li><li><a
href='http://www.velvetcache.org/2007/05/24/disappointed-in-simplexml' rel='bookmark' title='Disappointed In SimpleXML'>Disappointed In SimpleXML</a></li><li><a
href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='HowTo&#8217;s'>HowTo&#8217;s</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve got an older script for making <a
href="http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets" target="_blank">thumbnails and contact sheets</a> from a folder of images.</p><p>Recently Phillip Vuchetich sent me a related script for taking images, scaling them to wallet sizes and composing them onto 4&#215;6 sheets for easy printing from kiosks.  It&#8217;s a neat application of the idea, and he said I could post his script, so here it is.  It&#8217;s also part of my <a
href="https://github.com/jmhobbs/helper-scripts" target="_blank">helper-scripts repo at Github</a>.</p><p>Thanks Phillip!</p><p
style="text-align: center;"><img
src="http://static.velvetcache.org/pages/2012/04/10/imagemagick-wallet-maker/example.jpg" alt="Example 4x6 Wallet Sheet" /><br/>Example 4&#215;6 Wallet Sheet</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
</pre></td><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Wallet Photo Script using ImageMagick</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (c) 2012 Phillip Vuchetich</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Permissions for the Wallet Photo Script are the same as the original script by John Hobbs.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This script was created to take an entire directory of photos as input,</span>
<span style="color: #666666; font-style: italic;"># rotate them to portrait layout, and create composite 2x2 sheets, suitable</span>
<span style="color: #666666; font-style: italic;"># for printing wallet sized photos standard 4&quot;x6&quot; (US) photo paper.</span>
<span style="color: #666666; font-style: italic;"># This was created to make it easy to send photos suitable for wallets or</span>
<span style="color: #666666; font-style: italic;"># scrapbooking sized photos to retail photo printing locations.</span>
<span style="color: #666666; font-style: italic;"># The use case is a manually pre-selected copy of images that are all placed</span>
<span style="color: #666666; font-style: italic;"># in the input directory (the current directory).</span>
<span style="color: #666666; font-style: italic;"># An output directory will be created if it does not exist.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Original script from John Hobbs:</span>
<span style="color: #666666; font-style: italic;"># Digital camera thumbnail/contact sheet tool.</span>
<span style="color: #666666; font-style: italic;"># http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets</span>
<span style="color: #666666; font-style: italic;"># http://github.com/jmhobbs/helper-scripts</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (c) 2009-2010 John Hobbs</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Permission is hereby granted, free of charge, to any person</span>
<span style="color: #666666; font-style: italic;"># obtaining a copy of this software and associated documentation</span>
<span style="color: #666666; font-style: italic;"># files (the &quot;Software&quot;), to deal in the Software without</span>
<span style="color: #666666; font-style: italic;"># restriction, including without limitation the rights to use,</span>
<span style="color: #666666; font-style: italic;"># copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span style="color: #666666; font-style: italic;"># copies of the Software, and to permit persons to whom the</span>
<span style="color: #666666; font-style: italic;"># Software is furnished to do so, subject to the following</span>
<span style="color: #666666; font-style: italic;"># conditions:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The above copyright notice and this permission notice shall be</span>
<span style="color: #666666; font-style: italic;"># included in all copies or substantial portions of the Software.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<span style="color: #666666; font-style: italic;"># EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES</span>
<span style="color: #666666; font-style: italic;"># OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<span style="color: #666666; font-style: italic;"># NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span>
<span style="color: #666666; font-style: italic;"># HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,</span>
<span style="color: #666666; font-style: italic;"># WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<span style="color: #666666; font-style: italic;"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR</span>
<span style="color: #666666; font-style: italic;"># OTHER DEALINGS IN THE SOFTWARE.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># CHANGELOG</span>
<span style="color: #666666; font-style: italic;"># 2012-04-10 - Small tweaks for error handling. (John Hobbs)</span>
<span style="color: #666666; font-style: italic;"># 2012-04-07 - Created Wallet Photo Script using John Hobbs's original script. (Phillip Vuchetich)</span>
<span style="color: #666666; font-style: italic;"># 2010-06-14 - Fixed contact sheet problem, thanks to Glenn Turnbull. (John Hobbs)</span>
<span style="color: #666666; font-style: italic;"># 2009-03-30 - Created script. (John Hobbs)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### SETTINGS ###</span>
<span style="color: #666666; font-style: italic;"># Scaling Methods:</span>
<span style="color: #666666; font-style: italic;"># resize (Best/Slow)</span>
<span style="color: #666666; font-style: italic;"># scale (Middle/Middle)</span>
<span style="color: #666666; font-style: italic;"># sample (Worst/Fast)</span>
<span style="color: #007800;">METHOD</span>=<span style="color: #ff0000;">&quot;resize&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Wallet image Size</span>
<span style="color: #666666; font-style: italic;"># For Wallets intended for 4&quot; x 6&quot; output, should be a multiple of 4x6 to minimize cropping.</span>
<span style="color: #666666; font-style: italic;"># Example: for 4x6, 300ppi use 600x900 (for each photo to be 2&quot;x3&quot;).</span>
<span style="color: #666666; font-style: italic;"># For 400 ppi use 800x1200</span>
<span style="color: #666666; font-style: italic;"># Talk to your photo print shop to ask what resolution the printers use, so that their image</span>
<span style="color: #666666; font-style: italic;"># software does not need to resize your image, as resizing will likely reduce quality a little.</span>
<span style="color: #666666; font-style: italic;"># Expect to see some white space, depending on the original image dimensions.</span>
<span style="color: #666666; font-style: italic;"># No cropping is performed.</span>
<span style="color: #007800;">CONTACTSIZE</span>=<span style="color: #ff0000;">&quot;600x900&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Contact Sheet Max Width</span>
<span style="color: #007800;">CONTACTWIDTH</span>=<span style="color: #ff0000;">&quot;2&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Contact Sheet Max Height</span>
<span style="color: #007800;">CONTACTHEIGHT</span>=<span style="color: #ff0000;">&quot;2&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Horizontal Spacing</span>
<span style="color: #007800;">CONTACTSPACINGH</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Vertical Spacing</span>
<span style="color: #007800;">CONTACTSPACINGV</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Contact Sheet Directory</span>
<span style="color: #007800;">CONTACTDIR</span>=<span style="color: #ff0000;">&quot;wallet&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Contact Sheet Quality</span>
<span style="color: #007800;">CONTACTQUALITY</span>=<span style="color: #ff0000;">&quot;100&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################</span>
&nbsp;
&nbsp;
<span style="color: #007800;">CONTACTCOUNT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CONTACTWIDTH</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$CONTACTHEIGHT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Allow .jpg and .JPG files - depending on how the file was stored.</span>
<span style="color: #007800;">PIX</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">*</span>.jpg <span style="color: #000000; font-weight: bold;">*</span>.JPG <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Processing <span style="color: #007800;">$PIX</span> Images&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating Wallet Photo Sheets&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$CONTACTDIR</span>
&nbsp;
<span style="color: #007800;">CTR</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">PAGES</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PIX</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PIX</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #007800;">PAGES</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PAGES</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">PAGE</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Allow .jpg and .JPG files - depending on how the file was stored.</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.jpg <span style="color: #000000; font-weight: bold;">*</span>.JPG; <span style="color: #000000; font-weight: bold;">do</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CTR</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">$CONTACTCOUNT</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CTR</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
       <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PAGE</span> of <span style="color: #007800;">$PAGES</span>&quot;</span>
       montage <span style="color: #660033;">-rotate</span> <span style="color: #ff0000;">&quot;90&gt;&quot;</span> <span style="color: #660033;">-quality</span> <span style="color: #007800;">$CONTACTQUALITY</span> <span style="color: #660033;">-tile</span> <span style="color: #800000;">${CONTACTWIDTH}</span>x<span style="color: #800000;">${CONTACTHEIGHT}</span> <span style="color: #660033;">-geometry</span> <span style="color: #800000;">${CONTACTSIZE}</span>+<span style="color: #800000;">${CONTACTSPACINGH}</span>+<span style="color: #800000;">${CONTACTSPACINGV}</span> <span style="color: #007800;">$LIST</span> jpg:- <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${CONTACTDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PAGE}</span>.jpg
       <span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;&quot;</span>
       <span style="color: #007800;">PAGE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$PAGE</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
   <span style="color: #000000; font-weight: bold;">fi</span>
   <span style="color: #007800;">LIST</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span> <span style="color: #007800;">$i</span>&quot;</span>
   <span style="color: #007800;">CTR</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CTR</span> + <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LIST</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PAGE</span> of <span style="color: #007800;">$PAGES</span>&quot;</span>
   montage <span style="color: #660033;">-rotate</span> <span style="color: #ff0000;">&quot;90&gt;&quot;</span> <span style="color: #660033;">-quality</span> <span style="color: #007800;">$CONTACTQUALITY</span> <span style="color: #660033;">-tile</span> <span style="color: #800000;">${CONTACTWIDTH}</span>x<span style="color: #800000;">${CONTACTHEIGHT}</span> <span style="color: #660033;">-geometry</span> <span style="color: #800000;">${CONTACTSIZE}</span>+<span style="color: #800000;">${CONTACTSPACINGH}</span>+<span style="color: #800000;">${CONTACTSPACINGV}</span> <span style="color: #007800;">$LIST</span> jpg:- <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${CONTACTDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PAGE}</span>.jpg
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div><p>Related posts:<ol><li><a
href='http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets' rel='bookmark' title='ImageMagick Thumbnails and Contact Sheets'>ImageMagick Thumbnails and Contact Sheets</a></li><li><a
href='http://www.velvetcache.org/2007/05/24/disappointed-in-simplexml' rel='bookmark' title='Disappointed In SimpleXML'>Disappointed In SimpleXML</a></li><li><a
href='http://www.velvetcache.org/2007/11/30/howtos' rel='bookmark' title='HowTo&#8217;s'>HowTo&#8217;s</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.velvetcache.org/2012/04/10/imagemagick-wallet-maker/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Dynamic page generated in 4.733 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-24 10:15:17 -->
<!-- Compression = gzip -->
