<?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>Saving the Band</title>
	<atom:link href="http://george.savetheband.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://george.savetheband.net</link>
	<description>The sporadic online life of an information superhighwayman</description>
	<lastBuildDate>Wed, 03 Nov 2010 14:42:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Windows dot2tex and exemaker gotchas</title>
		<link>http://george.savetheband.net/2010/11/03/windows-dot2tex-and-exemaker-gotchas/</link>
		<comments>http://george.savetheband.net/2010/11/03/windows-dot2tex-and-exemaker-gotchas/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 14:42:30 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[dot2tex]]></category>
		<category><![CDATA[GraphViz]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[MiKTeX]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=339</guid>
		<description><![CDATA[This whole post deals with Python 2.7 on Windows. Your mileage may vary in other environments. I&#8217;m doing some writing on the topic of hybrid automata, and it looks like the best way to generate figures of the automata in LaTeX is with GraphViz and the dot2texi package, which works with the very nice dot2tex [...]]]></description>
			<content:encoded><![CDATA[<p>This whole post deals with Python 2.7 on Windows. Your mileage may vary in other environments.</p>
<p>I&#8217;m doing some writing on the topic of <a href="http://en.wikipedia.org/wiki/Hybrid_automaton">hybrid automata</a>, and it looks like the best way to generate figures of the automata in LaTeX is with GraphViz and the dot2texi package, which works with the very nice <a href="http://www.fauskes.net/code/dot2tex/">dot2tex</a> tool to generate figures from GraphViz dot formatted code embedded directly in LaTeX.</p>
<p>One of the issues, however, is that it expects an executable called &#8220;dot2tex&#8221; to be available on the shell. This means that, first and foremost, shell escape needs to be enabled when compiling the document (&#8211;shell-escape in many distributions, and &#8211;enable-write18 in MiKTeX, which I use). Adding this line to the beginning of the LaTeX source will handle it:</p>
<pre>%&amp; --shell-escape --enable-write18</pre>
<p>Next, since the executable file that&#8217;s installed (in Windows on Python 2.7 it goes, by default, to <code>C:\Python27\Scripts\dot2tex</code>) is made executable by a shebang on its first line, even if this file is on your path in Windows, it won&#8217;t do anything. So you need to use <a href="http://effbot.org/zone/exemaker.htm">ExeMaker</a>, which creates a very lightweight exe file to call a Python script. I put it in a directory that&#8217;s in my PATH (I made <code>C:\Users\george\bin</code> for this purpose) ran it like this:</p>
<pre>C:\Users\george&gt; rename C:\Python27\Scripts\dot2tex dot2tex.py
C:\Users\george&gt; exemaker C:\Python27\Scripts\dot2tex.py</pre>
<p>In my case, this created dot2tex.exe and dot2tex.py in C:\Users\george\bin. However, running dot2tex.exe causes an error:</p>
<pre>C:\Users\george&gt;dot2tex
Traceback (most recent call last):
  File "C:\Users\george\bin\dot2tex.py", line 6, in &lt;module&gt;
    from dot2tex.dot2tex import main
  File "C:\Users\george\bin\dot2tex.py", line 6, in &lt;module&gt;
    from dot2tex.dot2tex import main
ImportError: No module named dot2tex</pre>
<p>A bit of poking around reveals that this is due to the way that Python searches paths in import statements: the script, dot2tex.py, conflicts in its name with the module that we want to import, and the first directory that Python searches when looking for a file to import is the directory containing the executing script (or, in interactive mode, the working directory). The workaround I came up with, which seems to work well, is just to add two lines to dot2tex.py:</p>
<pre>import sys
del sys.path[0]</pre>
<p>Now my dot2tex.py file (the one in <code>C:\Users\george\bin</code>) looks like this:</p>
<pre>#!C:\Python27\python.exe
import site
import sys
del sys.path[0]
#!C:\Python27\python.exe
from dot2tex.dot2tex import main
if __name__ == '__main__':
    main()</pre>
<p>So far, this seems to have fixed all of my problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/11/03/windows-dot2tex-and-exemaker-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lemon-Lime Soda from the Keg (Recipe)</title>
		<link>http://george.savetheband.net/2010/10/04/lemon-lime-soda-from-the-keg-recipe/</link>
		<comments>http://george.savetheband.net/2010/10/04/lemon-lime-soda-from-the-keg-recipe/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 04:21:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Homebrewing]]></category>
		<category><![CDATA[Kegerator]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=319</guid>
		<description><![CDATA[The Cornelius kegs used by many homebrewers for kegging beer typically started their lives as soda kegs. So there&#8217;s no reason they can&#8217;t be used for that again in between beers. In fact, the middle tap in our kegerator typically dispenses what we call &#8220;lemonade&#8221; but what is, in fact, a very flavorful lemon-lime soda [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Cornelius_keg" target="_self">Cornelius kegs</a> used by many homebrewers for kegging beer typically started their lives as soda kegs. So there&#8217;s no reason they can&#8217;t be used for that again in between beers. In fact, the middle tap in our kegerator typically dispenses what we call &#8220;lemonade&#8221; but what is, in fact, a very flavorful lemon-lime soda (&#8220;homemade  7up&#8221;).</p>
<p>Here&#8217;s the (uncomplicated) recipe for a 5-gallon batch.</p>
<ul>
<li>1 32 Fl. Oz. bottle of lemon juice</li>
<li>2 15 Fl. Oz. bottles of lime juice</li>
<li>About half an ounce of concentrated Stevia sweetener</li>
<li>5 gallons of water</li>
</ul>

<a href='http://george.savetheband.net/2010/10/04/lemon-lime-soda-from-the-keg-recipe/2010-07-09-20-20-40/' title='2010-07-09 20.20.40'><img width="150" height="150" src="http://george.savetheband.net/wp-content/uploads/2010/10/2010-07-09-20.20.40-150x150.jpg" class="attachment-thumbnail" alt="2010-07-09 20.20.40" title="2010-07-09 20.20.40" /></a>
<a href='http://george.savetheband.net/2010/10/04/lemon-lime-soda-from-the-keg-recipe/2010-07-09-18-09-00/' title='2010-07-09 18.09.00'><img width="150" height="150" src="http://george.savetheband.net/wp-content/uploads/2010/10/2010-07-09-18.09.00-150x150.jpg" class="attachment-thumbnail" alt="2010-07-09 18.09.00" title="2010-07-09 18.09.00" /></a>

]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/10/04/lemon-lime-soda-from-the-keg-recipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cygwin, Mercurial, and Pageant with Plink</title>
		<link>http://george.savetheband.net/2010/09/23/cygwin-mercurial-and-pageant-with-plink/</link>
		<comments>http://george.savetheband.net/2010/09/23/cygwin-mercurial-and-pageant-with-plink/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 03:33:48 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[pageant]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=329</guid>
		<description><![CDATA[If you like to use Cygwin and Mercurial together, like I do, it might be handy to know how to get your Mercurial commands from inside Cygwin to use PuTTY&#8217;s Pageant as its agent for SSH keys.  It&#8217;s pretty simple, using PuTTY&#8217;s Plink. Plink is the PuTTY tool designed for non-interactive ssh usage. Just add [...]]]></description>
			<content:encoded><![CDATA[<p>If you like to use Cygwin and Mercurial together, like I do, it might be handy to know how to get your Mercurial commands from inside Cygwin to use PuTTY&#8217;s Pageant as its agent for SSH keys.  It&#8217;s pretty simple, using PuTTY&#8217;s Plink. Plink is the PuTTY tool designed for non-interactive ssh usage.</p>
<p>Just add an ssh entry to the [ui] section of your .hgrc file:</p>
<pre>[ui]
ssh = "C:/Program Files/PuTTY/plink.exe"</pre>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/09/23/cygwin-mercurial-and-pageant-with-plink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Boolean Algebra of Blood Donation</title>
		<link>http://george.savetheband.net/2010/09/01/the-boolean-algebra-of-blood-donation/</link>
		<comments>http://george.savetheband.net/2010/09/01/the-boolean-algebra-of-blood-donation/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 19:17:05 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[math]]></category>
		<category><![CDATA[blood]]></category>
		<category><![CDATA[blood types]]></category>
		<category><![CDATA[logic]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=322</guid>
		<description><![CDATA[The blood types we usually talk about are determined by the presence or absence of three antigens (A, B, and Rh-D). Here&#8217;s a table, where presence of an antigen is denoted by a 1 (true) and absence, by a 0 (false). A B Rh-D Type 0 0 0 O- 0 0 1 O+ 0 1 [...]]]></description>
			<content:encoded><![CDATA[<p>The blood types we usually talk about are determined by the presence or absence of three antigens (A, B, and Rh-D). Here&#8217;s a table, where presence of an antigen is denoted by a 1 (true) and absence, by a 0 (false).</p>
<table border="1">
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>Rh-D</td>
<td>Type</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>O-</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
<td>O+</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>B-</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>B+</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>A-</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
<td>A+</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
<td>AB-</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>AB+</td>
</tr>
</tbody>
</table>
<p>You will reject a blood donation if it contains an antigen that your own blood does not. This is why O- is the &#8220;universal donor&#8221; (none of those antigens to reject) and AB+ is the &#8220;universal recipient&#8221; (you have them all naturally, so nothing is rejected). Let&#8217;s make a truth table for this, just for the A antigen:</p>
<table border="1">
<tbody>
<tr>
<td>Donor A</td>
<td>Recipient A</td>
<td>Can accept</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>Does that look familiar? It should; it&#8217;s the logical implication operation. So a person can receive another&#8217;s blood if the donor&#8217;s blood type bitwise implies the recipient&#8217;s blood type. Neat.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/09/01/the-boolean-algebra-of-blood-donation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New QuikTrip: The Happiest Place on Earth</title>
		<link>http://george.savetheband.net/2010/06/18/new-quiktrip-the-happiest-place-on-earth/</link>
		<comments>http://george.savetheband.net/2010/06/18/new-quiktrip-the-happiest-place-on-earth/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 06:08:04 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Local]]></category>
		<category><![CDATA[Pictures]]></category>
		<category><![CDATA[booze]]></category>
		<category><![CDATA[coffee]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[quiktrip]]></category>
		<category><![CDATA[tulsa]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=309</guid>
		<description><![CDATA[I hit the 15th and Denver QuikTrip for a late night snack. The new store is open. It&#8217;s huge and unbelievably nice. I was in awe, and so were the other customers at the time. I took a couple of photos. They have a selection of about 8 or so iced teas and multiple choices for [...]]]></description>
			<content:encoded><![CDATA[<p>I hit the 15th and Denver QuikTrip for a late night snack. The new store is open. It&#8217;s <strong>huge</strong> and unbelievably nice. I was in awe, and so were the other customers at the time. I took a couple of photos.</p>
<p>They have a selection of about 8 or so iced teas and multiple choices for lemonades:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.43.48.jpg"><img class="alignnone size-medium wp-image-312" title="2010-06-18 00.43.48" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.43.48-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>I believe they had to invent a dozen new Freezoni flavors for the frozen drink area:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.42.16.jpg"><img class="alignnone size-medium wp-image-310" title="2010-06-18 00.42.16" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.42.16-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>The iced tea center is straight ahead in this view, the frozen drink theme park is to the left; beer is all the way back and to the right, the checkout counter is to the left (you can see the back of the line), and to the right is &#8212; I kid you not &#8212; the soft serve and coffee shop. You make your selection on a touchscreen kiosk. I don&#8217;t know if it&#8217;s open 24 hours, but it was definitely staffed at 12:30 AM tonight.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.43.00.jpg"><img class="alignnone size-medium wp-image-311" title="2010-06-18 00.43.00" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.43.00-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>A view from the other side of the store. You can sorta make out the gigantic flat screens that are inset to the wall around the coffee shop counter for some reason.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.45.37.jpg"><img class="alignnone size-medium wp-image-313" title="2010-06-18 00.45.37" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-18-00.45.37-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>This place is seriously epic.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/06/18/new-quiktrip-the-happiest-place-on-earth/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Kegerator Build</title>
		<link>http://george.savetheband.net/2010/06/16/kegerator-build/</link>
		<comments>http://george.savetheband.net/2010/06/16/kegerator-build/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 22:59:00 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Beer]]></category>
		<category><![CDATA[Homebrewing]]></category>
		<category><![CDATA[Kegerator]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[homebrewing]]></category>
		<category><![CDATA[keezer]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=32</guid>
		<description><![CDATA[Note: if my blog is running too slow, or you want to see some more photos from the build, check my flickr keezer set. Inspired by Jester369&#8242;s post (among others) on HomeBrewTalk.com detailing their conversion of a chest freezer into a homebrew-appropriate kegerator (or &#8220;keezer&#8221;) I decided to follow suit. I bought an old, smallish [...]]]></description>
			<content:encoded><![CDATA[<p>Note: if my blog is running too slow, or you want to see some more photos from the build, check my flickr <a href="http://www.flickr.com/photos/duplico/sets/72157624160478305/">keezer set</a>.</p>
<p>Inspired by Jester369&#8242;s <a href="http://www.homebrewtalk.com/f51/keezer-project-31221/">post</a> (among others) on HomeBrewTalk.com detailing their conversion of a chest freezer into a homebrew-appropriate kegerator (or &#8220;keezer&#8221;) I decided to follow suit. I bought an old, smallish chest freezer off of Craigslist, and eventually Evan (the boyfriend) and I started building it.</p>
<p>Here&#8217;s the old freezer, downstairs in the storage unit; photos cannot possibly capture the ugliness of the faux wood plastic lid:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-07-16.16.15.jpg"><img class="alignnone size-medium wp-image-126" title="2010-02-07 16.16.15" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-07-16.16.15-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Because the outside was old, unattractive, and the hinge mechanism was old and rusty, we decided to totally remove the top and replace it with a new one that we&#8217;d build. Gross, rusty hinges:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-11-21.59.09.jpg"><img class="alignnone size-medium wp-image-129" title="2010-02-11 21.59.09" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-11-21.59.09-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>The replacement top would need to raise the top of the freezer to give enough clearance for proper operation of the kegs, which are tapped from the top. The common design idiom for this is to build a &#8220;collar&#8221; to elevate the lid.</p>
<p>Because we trashed the ugly lid and hinges, we opted to mount a mostly-permanent tall box (&#8220;coffin&#8221;) on the back to provide a mounting point for the faucets, then to put a countertop on the front, which can be lifted off to provide access. Below is an early concept sketch for the top, which gets the point across but doesn&#8217;t look a whole lot like the final product:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.46.12.jpg"><img class="alignnone size-medium wp-image-294" title="2010-06-15 20.46.12" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.46.12-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Sketch of the interface for the outside edges of the countertop to the collar:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.47.59.jpg"><img class="alignnone size-medium wp-image-293" title="2010-06-15 20.47.59" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.47.59-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>This is almost exactly what we wound up doing, except that we decided to hold off on the weatherstripping until we determined it was needed to improve the seal. In fact, it turned out that the panel fit snugly enough onto the collar that the weatherstripping was unnecessary (so we skipped it); however, we did put some strips of felt where the countertop meets the coffin to provide some &#8220;give&#8221;.</p>
<p>Also, the part labeled &#8220;cutting board&#8221; reflects my original desire to use  butcher block for the countertop, though it wound up being orders of magnitude cheaper to go with tile.</p>
<p>One last sketch before the actual photos from the build; this one is my proof-of-concept in determining what, exactly, I could fit in the compartment. Ultimately I decided to fix the number of taps at 3, which provides some wiggle room to clean up spills and condensation, as well as providing room for several six-packs (or, in practice, anything else that overflows from our main refrigerator). One grid unit is one inch:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.48.36.jpg"><img class="alignnone size-medium wp-image-292" title="2010-06-15 20.48.36" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-20.48.36-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>All right! On to the build. So the first thing we did was pack the thing in my hatchback, drive it to Evan&#8217;s work, and strip all the crap off: We removed the lid, the hinges, and the top layer of the paint:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-19.02.58.jpg"><img class="alignnone size-medium wp-image-134" title="2010-02-27 19.02.58" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-19.02.58-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Then it was black Rustoleum Appliance Epoxy to turn it the color we wanted:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-22.20.44.jpg"><img class="alignnone size-medium wp-image-145" title="2010-02-27 22.20.44" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-22.20.44-300x225.jpg" alt="" width="300" height="225" />a</a></p>
<p>Next, we learned the <em>wrong</em> way to build the collar: using right angle brackets and screws. The result was not quite square anywhere and, more importantly, not flat anywhere. Browsing other folks&#8217; writeups of their builds, I found that I was not the first person to learn that this is the wrong way to build a collar. If you&#8217;re doing a build yourself, <strong>do not use angle brackets to square your collar</strong>.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-23.21.03.jpg"><img class="alignnone size-medium wp-image-156" title="2010-02-27 23.21.03" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-27-23.21.03-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>What, you ask, is the <em>correct</em> way to build a collar? Glad you asked. It involves<a href="http://www.amazon.com/Wolfcraft-3415405-Right-Angle-Clamp/dp/B000JCGYD6"> right-angle clamps</a> (the link is to Amazon, though I got mine, a different brand, from Home Depot), which were a bit on the expensive side but easily the second most valuable tool in the entire process. I wish I&#8217;d bought eight of them instead of two.</p>
<p>This leads me into the most valuable tool in the entire process: the nail gun. The correct way to build the collar is to clamp the thing together, square and level, then nail or brad it together. After doing that, we used those angle brackets for reinforcement.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-28-16.03.43.jpg"><img class="alignnone size-medium wp-image-159" title="2010-02-28 16.03.43" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-28-16.03.43-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>All the pieces, plus the fridge, crammed into the back of my little hatchback (VW Rabbit):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-28-19.10.00.jpg"><img class="alignnone size-medium wp-image-170" title="2010-02-28 19.10.00" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-02-28-19.10.00-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Here it is, clamped together for an in-progress glamor shot in the corner of the apartment for which it is ultimately destined:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-02-20.37.43.jpg"><img class="alignnone size-medium wp-image-172" title="2010-03-02 20.37.43" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-02-20.37.43-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Here&#8217;s a photo of the assembled &#8220;coffin&#8221; (where the faucets will live) &#8212; nailed together and soon-to-be bracket-reinforced, all with the aid of the right-angle clamp again.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-10-17.06.51.jpg"><img class="alignnone size-medium wp-image-175" title="2010-03-10 17.06.51" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-10-17.06.51-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Here&#8217;s the base for the countertop, assembled and stained; this is the part that will be removable for access to the fridge compartment; you&#8217;re seeing it from the top-down here:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMAG0258.jpg"><img class="alignnone size-medium wp-image-216" title="IMAG0258" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMAG0258-178x300.jpg" alt="" width="178" height="300" /></a></p>
<p>Three screws in each corner of the plywood board so it&#8217;ll support all the glasses you&#8217;d ever want to fill:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMAG0259.jpg"><img class="alignnone size-medium wp-image-217" title="IMAG0259" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMAG0259-178x300.jpg" alt="" width="178" height="300" /></a></p>
<p>Ignoring the mess in the visible area of the apartment, here&#8217;s the product of Evan&#8217;s first-ever tiling job, prior to removing the leftover grout. Not too shabby:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1234.jpg"><img class="alignnone size-medium wp-image-238" title="IMG_1234" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1234-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>This interfaces to the collar in two ways; the 1&#215;4 border rests on the top of the collar, and the board under the tile rests on a 1&#215;2 support glued and screwed into the inside of the collar, pictured below:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1215.jpg"><img class="alignnone size-medium wp-image-224" title="IMG_1215" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1215-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>Here&#8217;s a view of the assembled product so far; all we&#8217;re really missing is the faucets and insulation:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1234.jpg"></a><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-10-22.57.47.jpg"><img class="alignnone size-medium wp-image-187" title="2010-03-10 22.57.47" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-03-10-22.57.47-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Since we removed the original lid and the plastic seal around the top, we needed a way to cover up the exposed insulation. I had some plexiglass sitting around and decided to cut it to size and seal it with silicone. Here&#8217;s one of the joints, in progress:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1226.jpg"><img class="alignnone size-medium wp-image-232" title="IMG_1226" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1226-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>To provide extra insulation, we used three-quarters-inch styrofoam insulation, doubled-up in many places; we wrapped it in heavy-duty aluminum foil to keep it all together:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/IMAG0162.jpg"><img class="alignnone size-medium wp-image-289" title="IMAG0162" src="http://george.savetheband.net/wp-content/uploads/2010/06/IMAG0162-300x178.jpg" alt="" width="300" height="178" /></a></p>
<p>The top insulation piece (pictured below) is separate from the countertop piece; this makes opening the fridge a two-step procedure but reduces the risk of knocking the insulation off:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/IMAG0159.jpg"><img class="alignnone size-medium wp-image-288" title="IMAG0159" src="http://george.savetheband.net/wp-content/uploads/2010/06/IMAG0159-300x178.jpg" alt="" width="300" height="178" /></a></p>
<p>Okay, so now that the insulation&#8217;s out of the way, the only thing left is to attach the faucets. Evan insisted that we put some kind of design behind the faucets; I finally agreed (and am glad I did!). We found a little bit of spare sheet metal and cut it into three three-tiered designs, each of which looks a little bit like this (from behind):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/2010-04-10-18.50.28.jpg"><img class="alignnone size-medium wp-image-191" title="2010-04-10 18.50.28" src="http://george.savetheband.net/wp-content/uploads/2010/04/2010-04-10-18.50.28-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Three of these attached to the front of the &#8220;coffin&#8221; look like this (after punching big holes in each of them, which, I&#8217;ll note, was a bit of a pain):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1238.jpg"><img class="alignnone size-medium wp-image-239" title="IMG_1238" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1238-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>After the fact, we noticed (and were not bothered in the least) that we had basically ripped off <a href="http://tribunelofts.com/">our apartment complex</a>&#8216;s logo (this design is on every elevator landing in the building):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1259.jpg"><img title="IMG_1259" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1259-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>A bottom-up view of the &#8220;coffin&#8221; piece with the bottom cut out, shanks and backing pieces attached, and insulation visible (plus the crown molding has been stained):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1248.jpg"><img class="alignnone size-medium wp-image-248" title="IMG_1248" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1248-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>Here&#8217;s the completed view of the top of the keezer, with the default black plastic handles on each of the faucets. Note also the <a href="http://www.reddit.com">Reddit</a> alien, which is just waiting for a hole to be drilled in the bottom to attach to the rightmost faucet, which is to dispense &#8220;/r/paleale&#8221;, my entry to the <a href="http://nefaria.com/reddit-homebrewing-competition/">Reddit Homebrewing Competition</a> in the American Pale Ale category.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1255.jpg"><img title="IMG_1255" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1255-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>Okay, so, all of that said; how am I to keep my chest freezer from turning my beer into slushies? With a new thermostat! I don&#8217;t need to replace any part of the freezer, of course, because it wants to take its contents down to 0°F. So I just kill the AC power to the freezer when it gets to the temperature I want it to be.</p>
<p>Lots of people use a &#8220;<a href="http://www.amazon.com/Johnson-Controls-Digital-Thermostat-Control/dp/B00368D6JA">Johnson</a>&#8221; for this. I thought $75 was a bit steep, so I built my own out of an <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8824">Arduino Pro Mini</a> (Sparkfun&#8217;s miniaturized, cheap Arduino variant), digital temperature <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=245http://">sensor</a> (that looks an awful lot like a transistor), and a relay control <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9096">board</a> for closer to $30.</p>
<p>Incidentally, I did accidentally slushify a keg of beer a couple of weeks ago; it was pretty much hilarious.</p>
<p>Here&#8217;s the assembled relay control board in an enclosure with AC in and out (on the right) and the VCC, ground, and control line for the relay (left):</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1242.jpg"><img class="alignnone size-medium wp-image-243" title="IMG_1242" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1242-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>Here&#8217;s the Arduino mounted on a piece of protoboard I had sitting around. The wires going toward the top connect to the temperature sensor. Not pictured (and still not connected, though it is built) is my <a href="http://www.batchpcb.com/product_info.php?products_id=30723&amp;check=fe229004baab384a74a4cc81562cc655">display PCB</a>.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1247.jpg"><img class="alignnone size-medium wp-image-247" title="IMG_1247" src="http://george.savetheband.net/wp-content/uploads/2010/04/IMG_1247-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>That&#8217;s it! Here&#8217;s the finished product at the time of activation:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/IMG_1254.jpg"><img class="alignnone size-medium wp-image-300" title="IMG_1254" src="http://george.savetheband.net/wp-content/uploads/2010/06/IMG_1254-224x300.jpg" alt="" width="224" height="300" /></a></p>
<p>Plus a bonus photo of the completed /r/paleale handle:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-23.55.47.jpg"><img class="alignnone size-medium wp-image-301" title="2010-06-15 23.55.47" src="http://george.savetheband.net/wp-content/uploads/2010/06/2010-06-15-23.55.47-225x300.jpg" alt="" width="225" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/06/16/kegerator-build/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Vulnerable Code: MoinMoin User</title>
		<link>http://george.savetheband.net/2010/06/07/vulnerable-code-moinmoin-user/</link>
		<comments>http://george.savetheband.net/2010/06/07/vulnerable-code-moinmoin-user/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 21:12:44 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[moinmoin]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[secure coding]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[vulnerable code]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=272</guid>
		<description><![CDATA[I&#8217;ve just started posting code samples from the wonderful SpotTheVuln.com on the walls in our building on 11&#215;17 cardstock behind thin plexiglass panes so they can be annotated with dry erase marker when people solve them or have comments: I love the site but wanted to branch out a little bit into some samples outside [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started posting code samples from the wonderful <a href="http://spotthevuln.com/" target="_self">SpotTheVuln.com</a> on the walls in our building on 11&#215;17 cardstock behind thin plexiglass panes so they can be annotated with dry erase marker when people solve them or have comments:</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/06/stv.jpg"><img class="alignnone size-medium wp-image-282" title="SpotTheVuln on the Wall" src="http://george.savetheband.net/wp-content/uploads/2010/06/stv-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>I love the site but wanted to branch out a little bit into some samples outside of the PHP and WordPress world. In my first attempt, I didn&#8217;t branch very far, and it&#8217;s a bit longer than I would have preferred, but here it is &#8212; from MoinMoin. Hopefully I included enough information to find the issue.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getUserId<span style="color: black;">&#40;</span>request, searchName<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;
    Get the user ID for a specific user NAME.
&nbsp;
    @param searchName: the user name to look up
    @rtype: string
    @return: the corresponding user ID or None
    &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> searchName:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">None</span>
    cfg = request.<span style="color: black;">cfg</span>
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        _name2id = cfg._name2id
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
        arena = <span style="color: #483d8b;">'user'</span>
        key = <span style="color: #483d8b;">'name2id'</span>
        cache = caching.<span style="color: black;">CacheEntry</span><span style="color: black;">&#40;</span>request, arena, key<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            _name2id = <span style="color: #dc143c;">pickle</span>.<span style="color: black;">loads</span><span style="color: black;">&#40;</span>cache.<span style="color: black;">content</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">pickle</span>.<span style="color: black;">UnpicklingError</span>, <span style="color: #008000;">IOError</span>, <span style="color: #008000;">EOFError</span>, <span style="color: #008000;">ValueError</span><span style="color: black;">&#41;</span>:
            _name2id = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
        cfg._name2id = _name2id
    <span style="color: #008000;">id</span> = _name2id.<span style="color: black;">get</span><span style="color: black;">&#40;</span>searchName, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">id</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
        <span style="color: #ff7700;font-weight:bold;">for</span> userid <span style="color: #ff7700;font-weight:bold;">in</span> getUserList<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
            name = User<span style="color: black;">&#40;</span>request, <span style="color: #008000;">id</span>=userid<span style="color: black;">&#41;</span>.<span style="color: black;">name</span>
            _name2id<span style="color: black;">&#91;</span>name<span style="color: black;">&#93;</span> = userid
        cfg._name2id = _name2id
        arena = <span style="color: #483d8b;">'user'</span>
        key = <span style="color: #483d8b;">'name2id'</span>
        cache = caching.<span style="color: black;">CacheEntry</span><span style="color: black;">&#40;</span>request, arena, key<span style="color: black;">&#41;</span>
        cache.<span style="color: black;">update</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">pickle</span>.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span>_name2id, PICKLE_PROTOCOL<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">id</span> = _name2id.<span style="color: black;">get</span><span style="color: black;">&#40;</span>searchName, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">id</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> User:
    <span style="color: #483d8b;">&quot;&quot;&quot;A MoinMoin User&quot;&quot;&quot;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, request, <span style="color: #008000;">id</span>=<span style="color: #008000;">None</span>, name=<span style="color: #483d8b;">&quot;&quot;</span>, password=<span style="color: #008000;">None</span>,
                 auth_username=<span style="color: #483d8b;">&quot;&quot;</span>, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Initialize User object
&nbsp;
        @param request: the request object
        @param id: (optional) user ID
        @param name: (optional) user name
        @param password: (optional) user password (unicode)
        @param auth_username: (optional) already authenticated user name
                              (e.g. when using http basic auth) (unicode)&quot;&quot;&quot;</span>
        <span style="color: #008000;">self</span>._cfg = request.<span style="color: black;">cfg</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">valid</span> = <span style="color: #ff4500;">0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">trusted</span> = <span style="color: #ff4500;">0</span>
        <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> = <span style="color: #008000;">id</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">auth_username</span> = auth_username
        <span style="color: #008000;">self</span>.<span style="color: black;">auth_method</span> = kw.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'auth_method'</span>, <span style="color: #483d8b;">'internal'</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">auth_attribs</span> = kw.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'auth_attribs'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># we got an already authenticated username:</span>
        check_pass = <span style="color: #ff4500;">0</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #008000;">self</span>.<span style="color: black;">auth_username</span>:
            <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> = getUserId<span style="color: black;">&#40;</span>request, <span style="color: #008000;">self</span>.<span style="color: black;">auth_username</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> password <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
                check_pass = <span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">load_from_id</span><span style="color: black;">&#40;</span>check_pass<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">name</span> == <span style="color: #008000;">self</span>.<span style="color: black;">auth_username</span>:
                <span style="color: #008000;">self</span>.<span style="color: black;">trusted</span> = <span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">self</span>.<span style="color: black;">name</span>:
            <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> = getUserId<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._request, <span style="color: #008000;">self</span>.<span style="color: black;">name</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span>:
                <span style="color: #008000;">self</span>.<span style="color: black;">load_from_id</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> = <span style="color: #008000;">self</span>.<span style="color: black;">make_id</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> = <span style="color: #008000;">self</span>.<span style="color: black;">make_id</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> __filename<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Get filename of the user's file on disk
        @rtype: string
        @return: full path and filename of user account file
        &quot;&quot;&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._cfg.<span style="color: black;">user_dir</span>, <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #483d8b;">&quot;...NONE...&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> save<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Save user account data to user account file on disk.
&nbsp;
        This saves all member variables, except &quot;id&quot; and &quot;valid&quot; and
        those starting with an underscore.
        &quot;&quot;&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span>
&nbsp;
        user_dir = <span style="color: #008000;">self</span>._cfg.<span style="color: black;">user_dir</span>
        filesys.<span style="color: black;">makeDirs</span><span style="color: black;">&#40;</span>user_dir<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">last_saved</span> = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        data = <span style="color: #dc143c;">codecs</span>.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.__filename<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">&quot;w&quot;</span>, config.<span style="color: black;">charset</span><span style="color: black;">&#41;</span>
        data.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;# Data saved '%s' for id '%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>
            <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._cfg.<span style="color: black;">datetime_fmt</span>, <span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
            <span style="color: #008000;">self</span>.<span style="color: #008000;">id</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        attrs = <span style="color: #008000;">vars</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">items</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        attrs.<span style="color: black;">sort</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> key, value <span style="color: #ff7700;font-weight:bold;">in</span> attrs:
            <span style="color: #ff7700;font-weight:bold;">if</span> key <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">self</span>._cfg.<span style="color: black;">user_transient_fields</span> <span style="color: #ff7700;font-weight:bold;">and</span> key<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!</span>= <span style="color: #483d8b;">'_'</span>:
                <span style="color: #808080; font-style: italic;"># Encode list values</span>
                <span style="color: #ff7700;font-weight:bold;">if</span> key <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'quicklinks'</span>, <span style="color: #483d8b;">'subscribed_pages'</span><span style="color: black;">&#93;</span>:
                    value = encodeList<span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span>
                line = u<span style="color: #483d8b;">&quot;%s=%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>key, <span style="color: #008000;">unicode</span><span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
                data.<span style="color: black;">write</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
        data.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.<span style="color: black;">disabled</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">valid</span> = <span style="color: #ff4500;">1</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/06/07/vulnerable-code-moinmoin-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comments Now Support SexpCode</title>
		<link>http://george.savetheband.net/2010/05/26/comments-now-support-sexpcode/</link>
		<comments>http://george.savetheband.net/2010/05/26/comments-now-support-sexpcode/#comments</comments>
		<pubDate>Thu, 27 May 2010 01:18:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[bbcode]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[sexpcode]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=267</guid>
		<description><![CDATA[Koen Crolla has specified a replacement for BBCode (that atrocious square-bracketed markup language for bulletin boards) called SexpCode. It uses S-expressions (think the LISP language), with &#8216;staches instead of the usual parentheses . Comments in this blog are now SexpCode-enabled. The source for my comment below is {b This} is {i {u my} {o playing} [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cairnarvon.rotahall.org/" target="_self">Koen Crolla</a> has <a href="http://cairnarvon.rotahall.org/2010/05/25/towards-a-better-bbcode/" target="_self">specified</a> a replacement for <a href="http://en.wikipedia.org/wiki/Bbcode" target="_self">BBCode</a> (that atrocious square-bracketed markup language for bulletin boards) called SexpCode. It uses <a href="http://en.wikipedia.org/wiki/S_expression" target="_self">S-expressions</a> (think the LISP language), with <a href="http://fold.sigusr2.net/2010/03/mustache.html">&#8216;staches</a> instead of the usual parentheses . Comments in this blog are now SexpCode-enabled.</p>
<p>The source for my comment below is <code>{b This} is {i {u my} {o playing} with} {code SexpCode}.</code></p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/05/26/comments-now-support-sexpcode/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Java is not Python and Cygwin is not Linux</title>
		<link>http://george.savetheband.net/2010/05/07/java-is-not-python/</link>
		<comments>http://george.savetheband.net/2010/05/07/java-is-not-python/#comments</comments>
		<pubDate>Fri, 07 May 2010 06:19:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[beanshell]]></category>
		<category><![CDATA[bsh]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[generics]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[repl]]></category>
		<category><![CDATA[required: class or array]]></category>
		<category><![CDATA[type erasure]]></category>
		<category><![CDATA[typechecking]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=262</guid>
		<description><![CDATA[I&#8217;m burning the midnight oil working on a project in Java and came upon a number of gripes, all right in a row, that I thought were all worth blogging about in case I can help make somebody else&#8217;s night a little bit better. So here are some things I learned today. Java is not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m burning the midnight oil working on a project in Java and came upon a number of gripes, all right in a row, that I thought were all worth blogging about in case I can help make somebody else&#8217;s night a little bit better. So here are some things I learned today.</p>
<p><strong>Java is not Python.</strong> Java&#8217;s changes that introduced generics (to allow expressions like, for example, &#8220;Vector&lt;Integer&gt;&#8221;) were pretty much all in the compiler. The bytecode stays the same; the compiler just gets some additional data to use for typechecking. Then your beautifully generic Java 5.0 code undergoes a process called <a href="http://en.wikipedia.org/wiki/Generics_in_Java#Type_erasure">type erasure</a> producing the same &#8212; but better typechecked &#8212; bytecode that your old 1.4 code would have. The result is that when I, with my limited understanding of Java generics, tried to write overly dynamic code, the compiler scoffed.</p>
<p>&#8220;required: class or array&#8221;, it said. What it really meant was, &#8220;You can&#8217;t use a generic type in an instanceof operation, you dummy, because I&#8217;m about to erase that type and replace it with Object.&#8221; Doi.</p>
<p><strong>Cygwin is not Linux. </strong> Especially where Java is concerned. I spent about 20 minutes trying to figure out why I couldn&#8217;t pass the JDK an absolute classpath from Cygwin when relative classpaths worked just fine. It was because the JDK I was calling is Windows native, not Cygwin, so it doesn&#8217;t understand the Unix-style directory structure I was giving it.</p>
<p><strong>Java is not Python (redux).</strong> I&#8217;ve mostly been using Python for my various and sundry programming needs over the past couple of years. And it&#8217;s impressive how quickly one gets used to a REPL (read-eval-print-loop) &#8212; and how useful it is for quick debugging and answers.</p>
<p>For instance, I missed having a REPL when I had a simple question: can I typecast null to whatever object type I want (the answer is yes, by the way, which makes a lot of sense when you think about it)? I was in the midst of a fairly significant rewrite so I couldn&#8217;t just try it and run it. So I saw four choices: assume it would work and test it later, assume it wouldn&#8217;t work and rewrite it, look it up, or write a Java program to test it.</p>
<p>Turns out that there&#8217;s actually a fifth option: use the Java REPL. It&#8217;s called <a href="http://www.beanshell.org/">BeanShell</a> (or bsh), and I feel pretty much ridiculous for not having found it before. Maybe you&#8217;ll enjoy it.</p>
<p>Okay, back to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/05/07/java-is-not-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Beer In Primary Fermentation: Untitled Pale Ale</title>
		<link>http://george.savetheband.net/2010/04/11/new-beer-in-primary-fermentation-untitled-pale-ale/</link>
		<comments>http://george.savetheband.net/2010/04/11/new-beer-in-primary-fermentation-untitled-pale-ale/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 03:45:44 +0000</pubDate>
		<dc:creator>duplico</dc:creator>
				<category><![CDATA[Beer]]></category>
		<category><![CDATA[homebrewing]]></category>
		<category><![CDATA[pale ale]]></category>
		<category><![CDATA[reddit]]></category>

		<guid isPermaLink="false">http://george.savetheband.net/?p=118</guid>
		<description><![CDATA[In concert with my upcoming kegging setup, I&#8217;ve just brewed the beer that ought to be my first kegged beer. I&#8217;m also aiming to enter it in the Reddit Homebrewing Competition. It&#8217;s pretty straightforward and virtually all extract, but that&#8217;s fine with me. I made a couple of weird decisions, namely the darkness of the [...]]]></description>
			<content:encoded><![CDATA[<p>In concert with my upcoming kegging setup, I&#8217;ve just brewed the beer that ought to be my first kegged beer. I&#8217;m also aiming to enter it in the <a href="http://nefaria.com/reddit-homebrewing-competition/" target="_self">Reddit Homebrewing Competition</a>.</p>
<p>It&#8217;s pretty straightforward and virtually all extract, but that&#8217;s fine with me. I made a couple of weird decisions, namely the darkness of the crystal malt. I&#8217;m a little concerned about how dark it&#8217;s looking in primary at the moment &#8212; I know, I know, what did I expect from crystal 120L? &#8212; though the photo makes it look a lot darker than it actually is.</p>
<p>I&#8217;m also worried I went too far with the hops, but I suppose we&#8217;ll see what we see. I have some hophead friends. As they say: don&#8217;t worry, relax, have a homebrew. And I plan to.</p>
<p>I&#8217;ll name it once I&#8217;ve tasted it.</p>
<p><a href="http://george.savetheband.net/wp-content/uploads/2010/04/palealeprimary.jpg"><img class="alignnone size-medium wp-image-122" title="Untitled Pale Ale in Primary" src="http://george.savetheband.net/wp-content/uploads/2010/04/palealeprimary-224x300.jpg" alt="" width="224" height="300" /></a></p>
<table border="0" cellspacing="5" cellpadding="0" width="100%" summary="header" bgcolor="#CCCCCC">
<tbody>
<tr>
<td><big><strong>Untitled &#8220;Pale&#8221; Ale</strong></big></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" summary="recipe">
<tbody>
<tr>
<td><strong>Recipe</strong></td>
<td width="15"></td>
<td>Reddit Pale Ale</td>
<td width="25"></td>
<td><strong>Style</strong></td>
<td width="15"></td>
<td>American Pale Ale</td>
</tr>
<tr>
<td><strong>Brewer</strong></td>
<td></td>
<td>George Louthan</td>
<td></td>
<td><strong>Batch</strong></td>
<td></td>
<td>5.00 gal</td>
</tr>
<tr>
<td><strong>Extract</strong></td>
</tr>
</tbody>
</table>
<p><big><strong>Recipe Characteristics</strong></big></p>
<table border="0" cellspacing="0" cellpadding="0" summary="characteristics">
<tbody>
<tr>
<td><strong>Recipe Gravity</strong></td>
<td width="15"></td>
<td>1.048 OG</td>
<td width="25"></td>
<td><strong>Estimated FG</strong></td>
<td width="15"></td>
<td>1.012 FG</td>
</tr>
<tr>
<td><strong>Recipe Bitterness</strong></td>
<td></td>
<td>36 IBU</td>
<td></td>
<td><strong>Alcohol by Volume</strong></td>
<td></td>
<td>4.7%</td>
</tr>
<tr>
<td><strong>Recipe Color</strong></td>
<td></td>
<td>12° SRM</td>
<td></td>
<td><strong>Alcohol by Weight</strong></td>
<td></td>
<td>3.7%</td>
</tr>
</tbody>
</table>
<p><big><strong>Ingredients</strong></big></p>
<table border="0" cellspacing="0" cellpadding="0" summary="ingredients">
<tbody>
<tr>
<td><strong>Quantity</strong></td>
<td width="15"></td>
<td><strong>Grain</strong></td>
<td width="15"></td>
<td><strong>Type</strong></td>
<td width="15"></td>
<td><strong>Use</strong></td>
</tr>
<tr>
<td>1.00 lb</td>
<td></td>
<td>Breiss Bavarian Wheat DME</td>
<td></td>
<td>Extract</td>
<td></td>
<td>Extract</td>
</tr>
<tr>
<td>5.00 lb</td>
<td></td>
<td>Breiss Pilsen Light DME</td>
<td></td>
<td>Extract</td>
<td></td>
<td>Extract</td>
</tr>
<tr>
<td>0.50 lb</td>
<td></td>
<td>CaraPils</td>
<td></td>
<td>Grain</td>
<td></td>
<td>Steeped</td>
</tr>
<tr>
<td>0.50 lb</td>
<td></td>
<td>Crystal 120L</td>
<td></td>
<td>Grain</td>
<td></td>
<td>Steeped</td>
</tr>
<tr>
<td><strong>Quantity</strong></td>
<td width="15"></td>
<td><strong>Hop</strong></td>
<td width="15"></td>
<td><strong>Type</strong></td>
<td width="15"></td>
<td><strong>Time</strong></td>
</tr>
<tr>
<td>0.75 oz</td>
<td></td>
<td>Cascade</td>
<td></td>
<td>Pellet</td>
<td></td>
<td colspan="2">5 minutes</td>
</tr>
<tr>
<td>1.25 oz</td>
<td></td>
<td>Cascade</td>
<td></td>
<td>Pellet</td>
<td></td>
<td colspan="2">30 minutes</td>
</tr>
<tr>
<td>1.00 oz</td>
<td></td>
<td>Hallertauer</td>
<td></td>
<td>Pellet</td>
<td></td>
<td colspan="2">60 minutes</td>
</tr>
<tr>
<td><strong>Quantity</strong></td>
<td width="15"></td>
<td><strong>Misc</strong></td>
<td width="15"></td>
<td><strong>Notes</strong></td>
</tr>
</tbody>
</table>
<p><big><strong>Recipe Notes</strong></big></p>
<p>Steep specialty grains for 30 minutes at 155F.</p>
<p>60 minute boil.</p>
<p><big><strong>Batch Notes</strong></big></p>
<p>Hops added directly to boil and strained out with a kitchen strainer when transferring to primary. Some remain, which should contribute something like a dry hopping effect; I&#8217;ll rack off of the settled hop fragments into secondary and probably filter more efficiently then, as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.savetheband.net/2010/04/11/new-beer-in-primary-fermentation-untitled-pale-ale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

