<?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>lab.joelGillman.com &#187; clock</title>
	<atom:link href="http://lab.joelgillman.com/archives/tag/clock/feed" rel="self" type="application/rss+xml" />
	<link>http://lab.joelgillman.com</link>
	<description>Sketches, Code Bites and Toys</description>
	<lastBuildDate>Thu, 05 Nov 2009 23:19:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pseudo Work (fwork)</title>
		<link>http://lab.joelgillman.com/archives/159_pseudo-work</link>
		<comments>http://lab.joelgillman.com/archives/159_pseudo-work#comments</comments>
		<pubDate>Thu, 05 Nov 2009 22:16:30 +0000</pubDate>
		<dc:creator>joel gillman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://lab.joelgillman.com/?p=159</guid>
		<description><![CDATA[This script takes a text file (any text file should) and displays it one line at a time with short delays in between.  In other words, you can run this script to make it look like your computer is actually doing something worthwhile.
I had searched around the internet a few times but never really [...]]]></description>
			<content:encoded><![CDATA[<p>This script takes a text file (any text file should) and displays it one line at a time with short delays in between.  In other words, you can run this script to make it <em>look</em> like your computer is actually doing something worthwhile.</p>
<p>I had searched around the internet a few times but never really found anything like this, but that doesn&#8217;t mean it doesn&#8217;t look.  Maybe I&#8217;m just a bad internet searcher.  <a href="http://lab.joelgillman.com/archives/159_pseudo-work">Script after the jump</a>. <span id="more-159"></span></p>
<p><br/></p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:435px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co0">#!/bin/bash</span><br />
<br />
<span class="co0">#####################################################</span><br />
<span class="co0"># Pseudo Work (fwork) Script - by Joel Gillman 2009</span><br />
<span class="co0"># lab.joelgillman.com/archives/159_pseudo-work</span><br />
<span class="co0"># </span><br />
<span class="co0"># Please feel free to edit and change this as you</span><br />
<span class="co0"># &nbsp;like! If &nbsp;you do make any edits I would be curious</span><br />
<span class="co0"># &nbsp;to see what you've done so drop me a line!</span><br />
<span class="co0"># </span><br />
<span class="co0"># DISCLAIMER</span><br />
<span class="co0"># I am in no way a bash scripting expert. Most of what</span><br />
<span class="co0"># &nbsp;I write is copy and paste and trial and error.</span><br />
<span class="co0"># &nbsp;While this script shouldn't hurt anything in your</span><br />
<span class="co0"># &nbsp;system don't hold me responsible if it does! Use</span><br />
<span class="co0"># &nbsp;at your own risk.</span><br />
<span class="co0">#####################################################</span><br />
<br />
<br />
<span class="co0">## test if file (default or otherwise)</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$1&quot;</span> = <span class="st_h">''</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="re2">filename</span>=<span class="st0">&quot;<span class="es2">$HOME</span>/garbage.txt&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re5">-e</span> <span class="re1">$filename</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">0</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;No file specified and default file '~/garbage.txt' not found.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">exit</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
<span class="kw1">elif</span> <span class="br0">&#91;</span> <span class="re5">-e</span> $<span class="nu0">1</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="re2">filename</span>=$<span class="nu0">1</span><br />
<span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;No file found at $1&quot;</span><br />
&nbsp; &nbsp; <span class="kw3">exit</span><br />
<span class="kw1">fi</span><br />
<br />
<span class="co0">## execute fakeness</span><br />
<span class="kw1">while</span> <span class="kw2">read</span> p; <span class="kw1">do</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;<span class="es4">$(($RANDOM % 10)</span>)&quot;</span> <span class="re5">-eq</span> <span class="nu0">1</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> <span class="st0">&quot;R1 = (<span class="es2">$RANDOM</span> % 2)&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#91;</span> <span class="st0">&quot;<span class="es4">$(($RANDOM % 50)</span>)&quot;</span> <span class="re5">-eq</span> <span class="nu0">1</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> <span class="st0">&quot;R1 = (<span class="es2">$RANDOM</span> % 20)&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> <span class="st0">&quot;R1 = 0&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw3">let</span> <span class="st0">&quot;R2 = (<span class="es2">$RANDOM</span> % 10)&quot;</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="re1">$p</span><br />
&nbsp; &nbsp; <span class="kw2">sleep</span> <span class="re1">$R1</span>.<span class="re1">$R2</span><br />
<span class="kw1">done</span> <span class="sy0">&lt;</span> <span class="re1">$filename</span></div></div>
<p><a href="http://lab.joelgillman.com/thepress/wp-content/uploads/2009/11/fwork.zip">Download a zip&#8217;d version of the script</a>.<br />
You can <a href="http://lab.joelgillman.com/thepress/wp-content/uploads/2009/11/garbage.txt">download the (2.5MB) text file</a> I&#8217;ve been using.</p>
<p>Let me know what you think!  Any improvements or suggestions would be greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.joelgillman.com/archives/159_pseudo-work/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chess Clock</title>
		<link>http://lab.joelgillman.com/archives/27_chess-clock</link>
		<comments>http://lab.joelgillman.com/archives/27_chess-clock#comments</comments>
		<pubDate>Sun, 02 Mar 2008 21:43:28 +0000</pubDate>
		<dc:creator>joel gillman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Chess]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[modes]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[program]]></category>

		<guid isPermaLink="false">http://lab.joelgillman.com/archives/27_chess-clock</guid>
		<description><![CDATA[A friend and I have been playing Chess recently (neither of us are very good) and we decided we could use a chess clock to make the games faster and more stressful.  We decided to make a game of it and see who could program a rudimentary (but working) chess clock.  Here&#8217;s mine.
10 [...]]]></description>
			<content:encoded><![CDATA[<p>A friend and I have been playing Chess recently (neither of us are very good) and we decided we could use a chess clock to make the games faster and more stressful.  We decided to make a game of it and see who could program a rudimentary (but working) chess clock.  Here&#8217;s mine.<span id="more-27"></span></p>
<p><em>10 minutes per player is the default.<br />
&#8216;r&#8217; to reset<br />
&#8217;space&#8217; to switch players<br />
&#8216;p&#8217; to pause</em><br />
<applet class="span-12" code="ClockCounter" archive="http://lab.joelgillman.com/thepress/wp-content/uploads/2008/03/clockcounter.jar" width="400" height="200"></applet></p>
<p><a href="http://lab.joelgillman.com/thepress/wp-content/uploads/2008/03/clockcounter.pde">Source 1</a> <a href="http://lab.joelgillman.com/thepress/wp-content/uploads/2008/03/draw_clock.pde">2</a> and <a href="http://lab.joelgillman.com/thepress/wp-content/uploads/2008/03/chess_keyboard.pde">3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.joelgillman.com/archives/27_chess-clock/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
