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

	<title>sn.printf.net</title>
	<link rel="self" href="http://sn.printf.net/atom.xml"/>
	<link href="http://sn.printf.net/"/>
	<id>http://sn.printf.net/atom.xml</id>
	<updated>2010-03-11T20:30:26+00:00</updated>
	<generator uri="http://www.planetplanet.org/">Planet/2.0 +http://www.planetplanet.org</generator>

	<entry xml:lang="en">
		<title type="html">ZumoDrive, Tarsnap</title>
		<link href="http://shrughes.com/p/zumodrive-tarsnap/"/>
		<id>http://shrughes.com/?p=206</id>
		<updated>2010-03-11T13:00:39+00:00</updated>
		<content type="html">&lt;p&gt;ZumoDrive made this post: &lt;a href=&quot;http://blog.zumodrive.com/sometimes-you-have-to-roll-a-hard-six&quot;&gt;http://blog.zumodrive.com/sometimes-you-have-to-roll-a-hard-six&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Colin Percival, maker of &lt;a href=&quot;http://www.tarsnap.com/&quot;&gt;Tarsnap&lt;/a&gt;, made this reply: &lt;a href=&quot;http://www.daemonology.net/blog/2010-03-11-zumodrive-rolls-a-hard-six.html&quot;&gt;http://www.daemonology.net/blog/2010-03-11-zumodrive-rolls-a-hard-six.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Hacker News discussion: &lt;a href=&quot;http://news.ycombinator.com/item?id=1183308&quot;&gt;http://news.ycombinator.com/item?id=1183308&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">On Point-free Style</title>
		<link href="http://shrughes.com/p/on-point-free-style/"/>
		<id>http://shrughes.com/?p=174</id>
		<updated>2010-03-08T23:34:59+00:00</updated>
		<content type="html">&lt;p&gt;With a &lt;a href=&quot;http://buffered.io/2009/06/27/point-free-style-what-is-it-good-for/&quot;&gt;blog posting&lt;/a&gt; and then with &lt;a href=&quot;http://news.ycombinator.com/item?id=1175946&quot;&gt;some people sperging about the posting on Hacker News&lt;/a&gt;, I feel it&amp;#8217;s time to write a post on the utility of point-free style, or &amp;#8220;point-less&amp;#8221; style as some call it.&lt;/p&gt;
&lt;p&gt;One Hacker News poster, hristov, apparently reporting live from spergatory, had this to say:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;First I would like to say that I am only learning Haskell, and have done nothing but toy programs thus far. But the point free style is something that I really do not like about Haskell. It makes code much more complicated for the dubious benefit of saving a couple of keystrokes.For example, take the code from the article:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is without point free style: sum xs = foldr (+) 0 xs&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;And this is with: sum = foldr (+) 0&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;You have saved a total of 4 keystrokes. And made that line of code look really weird and hard to understand.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thus, now when you look at code you cannot say at first glance how many arguments a function takes. The second line of code looks like sum takes 0 arguments. But you have to look more carefully at the definition of the function, and see that it uses foldr, and know that foldr takes three arguments, but here only two are defined, and then you figure out that someone is using point free style and then you figure out that sum, actually takes one argument that must be a list.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;And this of course, is a simple example. Here we have a big clue in that the function is defined with zero arguments, and most functions take at least one argument, therefore the function probably uses the point free notation. But for a more complex and longer function, the point free style can very easily confuse someone reading the code.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;So yeah, I think point free style is one of these annoying features of Haskell, that seem to be put in so that users of Haskell can pat themselves on the back and feel like they are very smart. But in the end it does not add much to the language and makes it much less accessible.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I have no idea whether this is a common form of misconfigured worldview.  Anyway, the Hacker News poster is right, and the blog poster is a bad person for confusing him.  (This shouldn&amp;#8217;t be surprising, because blog posters who put a &amp;#8220;Conclusion&amp;#8221; section in their posts tend to be bad people.)  But where the Hacker News poster is right is where he says that using point-free style for top level definitions is pointless.  He&amp;#8217;s sort of right.  He&amp;#8217;s right because it is pointless.  The definition &lt;code&gt;sum xs = foldr (+) 0 xs&lt;/code&gt; is generally more readable to everybody than the definition &lt;code&gt;sum = foldr (+) 0&lt;/code&gt;.  It does no harm to write out the parameter, and it does make things more clear, because you&amp;#8217;re advertising the arity of your function.  It helps anybody who&amp;#8217;s new to your codebase.&lt;/p&gt;
&lt;p&gt;But it&amp;#8217;s not as bad as the Hacker News poster makes out, which is why his worldview is misconfigured.  It&amp;#8217;s not so bad when you see&lt;/p&gt;
&lt;pre&gt;sum :: Num a =&amp;gt; [a] -&amp;gt; a
sum = foldr (+) 0&lt;/pre&gt;
&lt;p&gt;It&amp;#8217;s not!  You have the type signature right there.  It&amp;#8217;s basically standard to put type signatures on all your top-level functions.  And when you do that, it&amp;#8217;s not so confusing.&lt;/p&gt;
&lt;p&gt;Both the blog poster and the Hacker News poster are missing the more useful applications of point-free style, which is for the purpose of passing parameters to higher order functions and for avoiding horrible nests of parentheses.&lt;/p&gt;
&lt;p&gt;For example, when solving &lt;a href=&quot;http://projecteuler.net/index.php?section=problems&amp;id=62&quot;&gt;Project Euler problem 62&lt;/a&gt;, the easiest way to tackle it was to chain a bunch of list manipulation operations together.&lt;/p&gt;
&lt;pre&gt;minimum
. head
. filter ((== 5) . length)
. concat
. map (groupBy ((==) `on` sort) . sortBy (compare `on` sort))
. groupBy ((==) `on` length)
. map (show . (^3))
$ [0..]
&lt;/pre&gt;
&lt;p&gt;We have a ton of point-free examples there.  It is natural to use point-free style and function combinators for everything there.  If we didn&amp;#8217;t, it would look like this:&lt;/p&gt;
&lt;pre&gt;minimum
 (head
  (filter (\ns -&amp;gt; length ns == 5)
          (concat
           (map (\xs -&amp;gt; groupBy (\x y -&amp;gt; sort x == sort y)
                                (sortBy (\x y -&amp;gt; compare (sort x)
                                                         (sort y))
                                        xs))
                (groupBy (\x y -&amp;gt; length x == length y)
                         (map (\k -&amp;gt; show (k^3)) [0..]))))))
&lt;/pre&gt;
&lt;p&gt;How do you like that?  The parenthesis management is horrifying.  We could, then, make one small baby step towards point free style, and bring back the big chain of function composition, without touching the parameters we pass to map, groupBy, sortBy, and such.&lt;/p&gt;
&lt;pre&gt;minimum
. head
. filter (\ns -&amp;gt; length ns == 5)
. concat
. map (\xs -&amp;gt; groupBy (\x y -&amp;gt; sort x == sort y)
                      (sortBy (\x y -&amp;gt; compare (sort x)
                                               (sort y))
                              xs))
. groupBy (\x y -&amp;gt; length x == length y)
. map (\k -&amp;gt; show (k^3))
$ [0..]&lt;/pre&gt;
&lt;p&gt;An alternate baby step would have been first to make the parameters in point-free style.&lt;/p&gt;
&lt;pre&gt;minimum
 (head
  (filter ((== 5) . length)
          (concat
           (map (groupBy ((==) `on` sort)
                 . sortBy (compare `on` sort))
                (groupBy ((==) `on` length)
                         (map (show . (^3)) [0..]))))))&lt;/pre&gt;
&lt;p&gt;But really, we should just go for the best of both worlds.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The blog poster is dumb for making a blog posting about point-free style and demonstrating with top-level functions.  The real benefit of point-free style is for making function parameters and avoiding big gobs of syntax.  But don&amp;#8217;t hate on the blog poster, because he doesn&amp;#8217;t say wrong things.  The Hacker News poster is excused, because he&amp;#8217;s a newbie to Haskell, and he&amp;#8217;s reacting to the blog poster&amp;#8217;s examples.  He also gets a pass because you can tell he&amp;#8217;s generally an immature retard, which we know because he says, &lt;em&gt;&amp;#8220;You have saved a total of 4 keystrokes,&amp;#8221;&lt;/em&gt; as if keystrokes was ever the point.  Go count your lines of code, son, and when you&amp;#8217;re done counting them, then maybe you get to make grandiose generalizations about the users of and an emergent property of a language you don&amp;#8217;t understand.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Things I have learned</title>
		<link href="http://blake8086.blogspot.com/2010/03/things-i-have-learned.html"/>
		<id>tag:blogger.com,1999:blog-5195382480858168001.post-1839974966495444076</id>
		<updated>2010-03-08T19:33:21+00:00</updated>
		<content type="html">It is hard to debug UI issues, because you can never tell if that white screen you're looking at is really the widget you think it is, or maybe it didn't load and that's the background, or maybe it loaded and it's just colored entirely white, or maybe something white is on top of it, or maybe your code is in an infinite loop and it erased the last UI element, but hasn't loaded the new one.&lt;br /&gt;&lt;br /&gt;Argh.&lt;br /&gt;&lt;br /&gt;I got the phone taking a picture without any of the camera interface crap, and saved it to memory.  Now to take a million photos and save them all.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5195382480858168001-1839974966495444076?l=blake8086.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Blake Householder</name>
			<email>noreply@blogger.com</email>
			<uri>http://blake8086.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">angryinterface</title>
			<subtitle type="html">Bad interfaces make us angry.  We love a good interface.</subtitle>
			<link rel="self" href="http://blake8086.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5195382480858168001</id>
			<updated>2010-03-10T21:30:16+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Flipping Out and Coding</title>
		<link href="http://shrughes.com/p/flipping-out-and-coding/"/>
		<id>http://shrughes.com/?p=167</id>
		<updated>2010-03-05T18:43:07+00:00</updated>
		<content type="html">&lt;p&gt;The last time I just flipped out and wrote some code at full intensity was at a programming contest two and a half years ago, in my senior year at college.  The last time before that was at a job in the summer between sophomore and junior year, connecting up some LabVIEW diagrams.  The last time before that was in my first semester, freshman year, when I made a chess engine in a weekend for some class I was taking.  Then the last time before that was in 11th grade when I told somebody I could make a tetris game in a day and proceeded to do so in QBASIC.  The last time before that was when I made a fancy spreadsheet in Microsoft Works &amp;#8216;99 to manage an NCAA basketball pool I was running in eighth grade.  That was the first program I wrote, and there are no more instances of intense concentration before that, that involved programming.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t know as much about programming then, and yet somehow I feel that I had more energy to just get stuff done, to just get code down on the computer, to quickly and nonchalantly look up documentation without making a big deal about it, to just care about getting something up and working.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m going to devote this weekend to the art of flipping out and getting some code done.  Sorry about posting late today.  I&amp;#8217;m sure the last six hours were miserable for you.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Visualizing Duplicates and Triplicates</title>
		<link href="http://shrughes.com/p/visualizing-duplicates-and-triplicates/"/>
		<id>http://shrughes.com/?p=159</id>
		<updated>2010-03-04T13:00:37+00:00</updated>
		<content type="html">&lt;p&gt;This is a followup to the previous post, &lt;em&gt;&lt;a href=&quot;http://shrughes.com/p/estimating-the-number-of-distinct-numbers/&quot;&gt;Estimating the number of distinct numbers&lt;/a&gt;&lt;/em&gt;.  In that post, we ask how many distinct values we&amp;#8217;ll get when making 100,000 independent picks from the integers between 1 and 1,000,000.  The answer we got was approximate, non-rigorous, and 95,163.&lt;/p&gt;
&lt;p&gt;I began by documenting my first attempt to solve the problem, which ended up going sorely wrong.  We let x be the number of distinct values we&amp;#8217;d end up getting.  Based on the reasoning that x/1,000,000 is the probability of a given pick being a duplicate, we solved the equation&lt;/p&gt;
&lt;p&gt;x = 100,000 − (x/1,000,000)*100,000&lt;/p&gt;
&lt;p&gt;which gives the solution&lt;/p&gt;
&lt;p&gt;x = 90,909.090909090909090&amp;#8230;&lt;/p&gt;
&lt;p&gt;This ended up being wrong.  But the reasoning sounded so right!  What went wrong there?  We subtracted the number of duplicates from the number of picks, and wouldn&amp;#8217;t that give us the answer?&lt;/p&gt;
&lt;p&gt;No.  It wouldn&amp;#8217;t.  Let&amp;#8217;s look back.&lt;/p&gt;
&lt;p&gt;We correctly surmised that (x/1,000,000) would be the expected proportion of picks that were duplicates, since there were x distinct values, and the probability of any pick hitting a set of size x, out of a set of size 1,000,000, is x/1,000,000.&lt;/p&gt;
&lt;p&gt;We then went and applied that proportion to an equation describing the number of distinct numbers picked.&lt;/p&gt;
&lt;p&gt;That was wrong.  There&amp;#8217;s the picks, and there&amp;#8217;s the numbers that get picked, and they are two different things.  We took a proportion describing the domain, and applied it to the range.&lt;/p&gt;
&lt;p&gt;Another way of looking at the problem is by looking at the actual way the proportions relate:  When a number is picked twice, 2 of the picks get counted as &amp;#8220;picks that ended up being a duplicate number,&amp;#8221; while 1 distinct value gets created.  Our equation above assumed that 0 distinct values would get created, instead of crediting pairs of duplicate picks for the one distinct value that they produce.  Later, when we divided the proportion by 2 (for a different reason), we ended up correcting for this error.  The correction would have been exact, if it were not for the presence of triplicates.  Here&amp;#8217;s a drawing.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://shrughes.com/wp-content/uploads/duplicatesgraph.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-160&quot; title=&quot;duplicatesgraph&quot; src=&quot;http://shrughes.com/wp-content/uploads/duplicatesgraph.png&quot; alt=&quot;&quot; width=&quot;200&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As we pick numbers, we start at the bottom and follow the curve upward, counting each new pick we get.  Each horizontal row represents some number that has been picked, and as the curve doubles back, that means the number got picked again.  Since we have duplicates we&amp;#8217;d &amp;#8220;turn around&amp;#8221; before reaching 100K and go in the opposite direction, covering a few rows again &amp;#8212; they represent numbers that got picked twice.  The value A describes the number of picks we&amp;#8217;d get that end up being duplicates, and B describes the number of distinct values we get.  C describes the number of values that end up being picked more than once.  C ends up being approximately half of A.  It would be exactly half of A, if there were no triplicates.  But we have to consider those, and the curve curls back up to represent triplicates.  There should probably be another curl, a fraction of a pixel in length, back down, to represent quadruplicates.  We&amp;#8217;ll approximately calculate the actual number of triplicates we expect, and quadruplicates, and such, tomorrow, since I&amp;#8217;m sick of blogging today.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Helping People</title>
		<link href="http://shrughes.com/p/helping-people/"/>
		<id>http://shrughes.com/?p=138</id>
		<updated>2010-02-28T13:00:44+00:00</updated>
		<content type="html">&lt;p&gt;Look at me.  I have a blog.  Look, my opinions are on it!  Read my opinions.  Revel in how witty I am.&lt;/p&gt;
&lt;p&gt;I have opinions on a lot of things, and you should listen to them.  Hear me talk about programming.  Here, me talk about programming languages.  Revel in how witty I am.  Hear me talk about how you should live your life.  Hear me talk about the latest phenomena in modern internet society.  These are my opinions, and they are mine.&lt;/p&gt;
&lt;p&gt;By all means, write a counter-posting, offering a point-by-point rebuttal to my points.  But make a link, pointing back to mine.  Don&amp;#8217;t have a blog?  Well then, nobody cares about you.  You don&amp;#8217;t exist.  You don&amp;#8217;t matter.  You are nothing.  Get a blog.  And make a link to mine.&lt;/p&gt;
&lt;p&gt;I have insights into the world that you could only dream of  understanding.  Make a link to my posting on the latest news  aggregators.&lt;/p&gt;
&lt;p&gt;Post comments about my opinion on the news aggregators.  Is this a new username you&amp;#8217;ve chosen?  You should think twice before having opinions.  Build up some cred by not having an opinion about anything.   Post factual rebuttals about mistakes of fact, but don&amp;#8217;t even think  about attacking the general conclusion.  That way, more people will  listen to you, and so you will be better able to spread your intelligent  insights into the populace.&lt;/p&gt;
&lt;p&gt;HELPING PEOPLE&lt;/p&gt;
&lt;p&gt;is the purpose of having a blog.  Your blog must be productive and help people understand the crazy world that we live in!&lt;/p&gt;
&lt;p&gt;My blog is not &amp;#8220;better&amp;#8221; than yours, for how could one design a valid comparison function between blogs?  But yours will be improved when you make a link to mine.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m going to make more postings, acting like I have new ideas.  You will read them and be informed.  My posting is not self-aggrandic—it&amp;#8217;s a humble quest to increase the probability that wayward net travelers come across something of substance, so that their lives, and mental health, and the accurateness of their opinions, and those of people around them, will be enhanced substantially by listening to what I have to say about programming.  Make a link.&lt;/p&gt;
&lt;p&gt;My metadiscussion about blogging is more profound than any non-metadiscussion that you may have.  I&amp;#8217;m now talking about metadiscussion, which makes this level-two metadiscussion.  Here is where a normal peon would make a joke about maxing out at level-seventy metadiscussion, but I do not limit my sights to topical references.  It is inevitable that the first seventy levels of metadiscussion be followed by a seventy-first, and so on.  Here we are, talking about enumerating the levels of metadiscussion.  We could now use ordinal numbers to identify the subsequent meta-levels, but in mentioning such an idea, we have surpassed all the ordinal numbers.&lt;/p&gt;
&lt;p&gt;I hope you find it worth your time to strive to have a worldview similar to mine.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Writing Numbers</title>
		<link href="http://shrughes.com/p/writing-numbers/"/>
		<id>http://shrughes.com/?p=133</id>
		<updated>2010-02-27T13:00:54+00:00</updated>
		<content type="html">&lt;p&gt;In my &lt;a href=&quot;http://shrughes.com/p/estimating-the-number-of-distinct-numbers/&quot;&gt;previous post&lt;/a&gt;, I discussed some stuff, and I wrote some numbers down.&lt;/p&gt;
&lt;p&gt;1,000,000&lt;/p&gt;
&lt;p&gt;95,163&lt;/p&gt;
&lt;p&gt;100,000&lt;/p&gt;
&lt;p&gt;91,000&lt;/p&gt;
&lt;p&gt;90,909.090909090&amp;#8230;&lt;/p&gt;
&lt;p&gt;95,162.58&lt;/p&gt;
&lt;p&gt;Before I inserted the commas into the numbers, I found that it was easy to make mistakes by writing 100000 instead of 1000000.  Generally, that was hard to read.  However, 91000 isn&amp;#8217;t hard to read, and neither are 95162.58 or 95163.  So in the previous post I inserted the numbers.&lt;/p&gt;
&lt;p&gt;The point of this post is that while previously, I always refrained from putting period separators into numbers,  I have now changed my attitude, slightly.&lt;/p&gt;
&lt;p&gt;I would also consider using thin spaces as the digit grouping separator, as suggested in Jukka K. Korpela&amp;#8217;s epic, &lt;a href=&quot;http://www.cs.tut.fi/~jkorpela/math/index.html#thinsp&quot;&gt;Math in HTML (and CSS)&lt;/a&gt;.  However, that would take too much effort.&lt;/p&gt;
&lt;p&gt;It would be nice to have a variant of Markdown that took sections bounded by dollar signs, as seen in LaTeX, and converted them to HTML and CSS in the ways that document recommends.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Virtual Currency</title>
		<link href="http://blake8086.blogspot.com/2010/02/virtual-currency.html"/>
		<id>tag:blogger.com,1999:blog-5195382480858168001.post-3059013895215130948</id>
		<updated>2010-02-27T01:19:41+00:00</updated>
		<content type="html">What's the difference between real currency and virtual currency?&lt;br /&gt;&lt;br /&gt;The only thing I can really come up with is that there are laws pertaining to real currency.&lt;br /&gt;&lt;br /&gt;I keep waiting for someone to make a decent virtual currency exchange.  I think all you would have to do is get some VC funding and get a few major players onboard with you.  As soon as a large enough currency allows you to trade for real money or goods, you'll be able to do all your business government tax-free.  You'll still have to pay Facebook or Microsoft or Apple or whoever, but not your local or federal government.&lt;br /&gt;&lt;br /&gt;It is a brave new world we live in where every company is trying to build their own money system.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5195382480858168001-3059013895215130948?l=blake8086.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Blake Householder</name>
			<email>noreply@blogger.com</email>
			<uri>http://blake8086.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">angryinterface</title>
			<subtitle type="html">Bad interfaces make us angry.  We love a good interface.</subtitle>
			<link rel="self" href="http://blake8086.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5195382480858168001</id>
			<updated>2010-03-10T21:30:16+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Switch!</title>
		<link href="http://blake8086.blogspot.com/2010/02/switch.html"/>
		<id>tag:blogger.com,1999:blog-5195382480858168001.post-769885665601616282</id>
		<updated>2010-02-27T01:09:48+00:00</updated>
		<content type="html">I have switched to primarily developing an app that will let people share sketches in a more... asynchronous way.  I now have an app that I can scribble a white line on.  Woo!&lt;br /&gt;&lt;br /&gt;Hilton has agreed to work with me on our iSketch clone, and I think we'll get a lot accomplished, I'll be doing server dev, marketing, support, and some client-side, and he will do the majority of client-size.&lt;br /&gt;&lt;br /&gt;I think that a major mistake many app developers make is to follow these three steps:&lt;br /&gt;1) produce quality app&lt;br /&gt;2) ???&lt;br /&gt;3) profit!&lt;br /&gt;&lt;br /&gt;Except when 3 never materializes, they blame anything and anyone for it.  &quot;The app store is broken!&quot; &quot;Apple is fucking us again!&quot; &quot;The users don't appreciate quality apps!&quot; &quot;Rargh!&quot;  Step 2 is actually marketing.  If you took the best product in the world and stuck it on a random shelf at Wal-Mart, you could expect only a handful of sales, at best.  This is what you're doing on the App Store.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5195382480858168001-769885665601616282?l=blake8086.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Blake Householder</name>
			<email>noreply@blogger.com</email>
			<uri>http://blake8086.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">angryinterface</title>
			<subtitle type="html">Bad interfaces make us angry.  We love a good interface.</subtitle>
			<link rel="self" href="http://blake8086.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5195382480858168001</id>
			<updated>2010-03-10T21:30:16+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Estimating the number of distinct numbers</title>
		<link href="http://shrughes.com/p/estimating-the-number-of-distinct-numbers/"/>
		<id>http://shrughes.com/?p=126</id>
		<updated>2010-02-26T13:00:02+00:00</updated>
		<content type="html">&lt;p&gt;In a &lt;a href=&quot;http://shrughes.com/p/hide-your-filesizes-people/&quot;&gt;previous post&lt;/a&gt;, I estimated that if you picked a hundred thousand random numbers from one to a million, independently, i.e. &amp;#8220;with replacement,&amp;#8221; as some call it, you could expect to get 95,163 different values.  Maybe sometimes you&amp;#8217;ll get more or less (since the outcome is random), but you&amp;#8217;ll probably get something close to that number.  That&amp;#8217;s an approximate guess &amp;#8212; I&amp;#8217;m not sure if that&amp;#8217;s really the closest integer to the true average value &amp;#8212; and that&amp;#8217;s because I&amp;#8217;m an amateur when it comes to math.  We might as well chronicle how you&amp;#8217;d get to such a value.&lt;/p&gt;
&lt;p&gt;This post is going to be about how to come up with approximations for things, when you don&amp;#8217;t know the &amp;#8220;real&amp;#8221; way to get the right answer.&lt;/p&gt;
&lt;p&gt;So, if you pick 100,000 numbers from one to a million, and if you pick them independently, how many distinct values do you expect?  Well, you&amp;#8217;d expect something like 100,000 distinct values in total, with an adjustment for duplicates.  So for each value you picked, you&amp;#8217;d think that they&amp;#8217;d have a 10% chance of being a duplicate of another, since there&amp;#8217;s about 99,999 other values for them to collide with, out of a million, and 99,999/1,000,000 ≈ 0.1.  So we&amp;#8217;d expect 10% of the values to be duplicates, and so we&amp;#8217;d expect 90,000 distinct values to be produced.&lt;/p&gt;
&lt;p&gt;But wait!  We based our estimate of 90,000 on our assumption that our estimate would be about 100,000.  Now we have a more accurate estimate, so we could make a &lt;em&gt;new&lt;/em&gt; estimate based on that.  Since 89,999/1,000,000 ≈ 0.09, we&amp;#8217;d expect 9% of the values to be duplicates, and so we&amp;#8217;d expect 91,000 distinct values to be produced.&lt;/p&gt;
&lt;p&gt;With our new estimate, we could perform an another iteration to produce a more accurate estimate of the number we&amp;#8217;re trying to calculate.  Or we could set up an equation and solve it.  Let&amp;#8217;s call our estimate x.  If so, we think the probability of a distinct value would be x/1,000,000.  That means (x/1,000,000)*100,000 will give the number of picks that are duplicates.  The number of distinct values (x) would be equal to the number of picks (100,000) minus the number of duplicates ((x/1,000,000)*100,000), giving us the equation x = 100,000 − (x/1,000,000)*100,000.  Simplifying, we have x = 100,000 − x/10, which simplifies to 11x/10 = 100,000, and then x = 1,000,000/11 = 90,909.090909090&amp;#8230;&lt;/p&gt;
&lt;p&gt;So we&amp;#8217;ve estimated that the number of distinct values is 90,909.  Is that right?  Let&amp;#8217;s run a few simulations in Python:&lt;/p&gt;
&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; [len(set([random.randint(1, 1000000) for i in xrange(100000)])) for j in xrange(5)]
[95101, 95311, 95268, 95270, 95105]
&lt;/pre&gt;
&lt;p&gt;It looks like we&amp;#8217;re way off.  You could say we&amp;#8217;re off by a factor of two &amp;#8212; we expected about twice as many duplicates as we got.&lt;/p&gt;
&lt;p&gt;What went wrong?  Let&amp;#8217;s ask this: What did we assume?  We assumed that each pick&amp;#8217;s probability of getting a duplicate was equal to the number of total distinct values we&amp;#8217;ll end up getting, divided by a million.  Is that right, though?  (Based on our simulation, apparently not.)  We can answer why not by imagining ourselves picking a bunch of random numbers.  What&amp;#8217;s the chance of the first pick being a duplicate?  Zero.  What about the 50,000th pick?  It would be approximately 50,000/1,000,000, i.e 5%.  Then, on our 100,000th pick, the chance of it being a duplicate would be approximately 100,000/1,000,000, i.e. 10%.  So the probability goes from 0% up to about 10% in a roughly linear fashion.  The average is then 5%.  So we can expect 5% of our picks to collide with existing picks, and so we predict 95,000 distinct values.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s closer.  Of course, with that new estimate, instead of having the proportion go from 0% to 10%, we now can expect the proportion to go from 0% to 9.5%.  And so we expect the average to be 4.75%.  Taking 4.75% off of 100,000, we get 95,250.  We could iterate this again, but let&amp;#8217;s just solve an equation, like we did before.  The solution to x = 100,000 &amp;#8211; x/20 is 2,000,000/21, approximately 95238.&lt;/p&gt;
&lt;p&gt;That seems like a reasonable guess.  It&amp;#8217;s just an estimate, though.  Is it too high or is it too low?  Right now we&amp;#8217;re assuming the rate of getting duplicate elements grows linearly.  Of course, it doesn&amp;#8217;t.  We pick the first 50,000 picks with a lower rate of getting duplicates than the second 50,000 picks, which means our total number of distinct elements will be greater than 95,238/2.  We&amp;#8217;ve already accounted for that fact &amp;#8212; we expect 3/4 of our duplicate elements to be generated from between the 50,001st and 100,000th pick.  But we haven&amp;#8217;t accounted for the fact that the rate of getting duplicate elements is actually higher than we&amp;#8217;d have expected!  This means our estimate of 95,238 is an overestimate.&lt;/p&gt;
&lt;p&gt;What shall we do then?  Let&amp;#8217;s calculate the expected number of distinct values after the first 50,000 picks, and then based on the number we get, calculate the expected number of distinct values for the next 50,000 picks.&lt;/p&gt;
&lt;p&gt;First we use the same equation as before, but with 50,000 in place of 100,000.  Let&amp;#8217;s let w be the number of distinct elements after 50,000 picks.  Simplifying w = 50,000 &amp;#8211; (w/1,000,000)/2*50,000, we get w = 50,000 &amp;#8211; w/40, i.e w = 2,000,000/41 ≈ 48,780.5.&lt;/p&gt;
&lt;p&gt;Then, let x be the number of distinct elements after the next 50,000 picks.  We&amp;#8217;re expecting the average collision rate to be the average of x/1,000,000 and 4.87805%.  So we have x = 48,780.5 + 50,000 &amp;#8211; ((x/1,000,000 + 0.0487805)/2)*50,000.  Simplifying that, we have x = 98,780.5 &amp;#8211; (x+48,780.5)/40, i.e. 41x/40 = 98,780.5 &amp;#8211; 48,780.5/40, i.e. x = (40*98,780.5 &amp;#8211; 48,780.5)/41 ≈ 95,181.5.&lt;/p&gt;
&lt;p&gt;That should be a better estimate.  Let&amp;#8217;s do some simulations.  Let&amp;#8217;s take some averages of 100 simulations.&lt;/p&gt;
&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; sum([len(set([g.randint(1, 1000000) for i in xrange(100000)])) for j in xrange(100)])/100.0&lt;/pre&gt;
&lt;pre&gt;95160.339999999997&lt;/pre&gt;
&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; sum([len(set([g.randint(1, 1000000) for i in xrange(100000)])) for j in xrange(100)])/100.0&lt;/pre&gt;
&lt;pre&gt;95152.179999999993&lt;/pre&gt;
&lt;p&gt;It seems we&amp;#8217;re still overestimating the number of distinct values.  After all, each of our iterations produced an overestimate.&lt;/p&gt;
&lt;p&gt;I suppose we could break up our approximation into 4 blocks and get a more precise value.  Here&amp;#8217;s an alternate choice.  Set up a differential equation and solve it!&lt;/p&gt;
&lt;p&gt;If the number of distinct values we have at a given time is y, then the chance of getting a collision on our next choice is y/1,000,000, and the chance of getting a non-collision is (1,000,000 &amp;#8211; y)/1,000,000.&lt;/p&gt;
&lt;p&gt;So, that&amp;#8217;s our expected rate of change.  And so we have the differential equation&lt;/p&gt;
&lt;p&gt;y&amp;#8217; = (1,000,000 &amp;#8211; y)/1,000,000 = 1 &amp;#8211; y/1,000,000.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve completely forgotten how to solve equatons like this, so let&amp;#8217;s note that y = K*exp(-t/1,000,000) is the solution family to y&amp;#8217; = -y/1,000,000, and now we can try to tweak that a bit to get a solution to y&amp;#8217; = 1 &amp;#8211; y/1,000,000   Just by common sense, we expect a function that decays to 1,000,000, so we can guess y = 1,000,000 + K*exp(-t/1,000,000).  Given that there are 0 distinct values after 0 picks, we have the initial condition of y(0) = 0, and so we can solve for K, and thus y = 1,000,000 &amp;#8211; 1,000,000*exp(-t/1,000,000).&lt;/p&gt;
&lt;p&gt;So, if things go at our &amp;#8220;expected rate of change,&amp;#8221; we&amp;#8217;ll expect them to track along that differential equation.  There will be some random noise, but let&amp;#8217;s see where this goes.&lt;/p&gt;
&lt;p&gt;Plugging in t=100,000, we get 1,000,000 &amp;#8211; 1,000,000*exp(-1/10) ≈ 95,162.58.&lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s how I came up with 95,163, and it seemed close enough to the experimental evidence, so it was good enough for me.&lt;/p&gt;
&lt;p&gt;Is it really right, though?  Is our method of using a differential equation right?  Well, it&amp;#8217;s right in the sense that it gives a close answer.  It&amp;#8217;s a good idea &amp;#8212; better than the weird approximations we were using earlier.  But the truth is that we&amp;#8217;re approximating a discrete process, making 100,000 independent picks, with a continuous function.  It&amp;#8217;s kind of like the reverse of finding a numerical approximation to the differential equation.&lt;/p&gt;
&lt;p&gt;For a more revelatory example, suppose we try using this equation to give us an estimate for the number of distinct values after 1 pick.  We see that 1,000,000.0 &amp;#8211; 1,000,000*exp(-1/1,000,000) ≈ 0.99999949999619275.  Instead of getting the right answer, which is 1, we get an approximation based on the idea that the growth rate of the function falls from 1 to 999,999/1,000,000 on the interval.  It&amp;#8217;s off by about half a millionth.&lt;/p&gt;
&lt;p&gt;What about after two picks?  Our formula gives 1.999997999984771.  But the right answer is 1.999999.  We&amp;#8217;re off by one millionth, or two half-millionths &amp;#8212; one for the first pick, and one for the next.&lt;/p&gt;
&lt;p&gt;Generally speaking, on each timestep, we can expect the continuous approximation to take a half of a millionth off the growth rate, due to the continuous nature of the curve.  To compensate for this effect, we might add an extra half-millionth factor to the final estimation.  Multiplying 95,162.58 by (1 + 1/2,000,000), we get 95,162.63.  That&amp;#8217;s not enough to care about.&lt;/p&gt;
&lt;p&gt;What if we wanted a really exact answer, though?  We might say, okay, we&amp;#8217;re going to solve this using Euler&amp;#8217;s method, just like we&amp;#8217;re supposed to, and we&amp;#8217;ll update the expected value each time.  We can do that.&lt;/p&gt;
&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; y = 0.0
&amp;gt;&amp;gt;&amp;gt; for i in xrange(100000):
...     y += (1000000.0 - y)/1000000.0
...
&amp;gt;&amp;gt;&amp;gt; y
95162.627205942103
&lt;/pre&gt;
&lt;p&gt;Is that the exact, right answer, though?  Is that the true expected value?  Or have we found another approximation based on incorrect assumptions?&lt;/p&gt;
&lt;p&gt;Remember that this is a random process, and that the future rate of change depends on the outcome of current random numbers.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s play a game.  Roll a die, and square the value.  You might say (and you&amp;#8217;d be wrong if you did) that the expected value of a dice roll is 3.5, so the expected value of its square must be 3.5&lt;sup&gt;2&lt;/sup&gt;, which is 12.25.  You&amp;#8217;d be wrong, though, because the expected value is 15.16666&amp;#8230;  That&amp;#8217;s because the numbers around 3.5 spread out nonuniformly when you send them through the squaring operation.  If you sent them through a doubling, instead of a squaring, their distances would separate uniformly, and the expected value would remain correct.  With squaring, they separate nonuniformly, and the expected value doesn&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;We can&amp;#8217;t just run the expected value through a for loop and get the right expected value at the end.  We could probably do some more precise reasoning to adjust for this error.  But this blog entry is long enough.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Fixing a build failure</title>
		<link href="http://yokozar.org/blog/archives/192"/>
		<id>http://yokozar.org/blog/?p=192</id>
		<updated>2010-02-26T03:14:16+00:00</updated>
		<content type="html">&lt;p&gt;I haven&amp;#8217;t posted in a while, so I figured I&amp;#8217;d just give a sample of the kinds of things I deal with as an Ubuntu developer.&lt;/p&gt;
&lt;p&gt;When a Wine developer wants to implement support for playing mp3 files, the smart thing to do is to use a software library, in this case mpg123.  Wine is a good example of a large and still growing piece of software with a similarly expanding list of dependencies.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s my job to make sure all these bits work well together so that Wine can be built in a complete way for you &amp;#8211; without mpg123, Wine would have to be built without full support for mp3s, and sound on some apps would simply break.  Sometimes this means packaging software that isn&amp;#8217;t in the distribution yet.  Usually it means fixing bugs, and here we can see the true strength of the open source approach.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It starts with a bug report&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I was ready to put out a Wine release with its new mpg123 support, but Wine wasn&amp;#8217;t building on 64 bit.  This was a case where the mystery was more interesting because it was only partially broken: 32 bit worked perfectly.&lt;/p&gt;
&lt;p&gt;I knew right away that it was probably an Ubuntu-specific issue, although other distributions (especially Debian) might also be affected.  I &lt;a title=&quot;Wine bug - mpg123 not building&quot; href=&quot;http://bugs.winehq.org/show_bug.cgi?id=20042&quot;&gt;filed a bug&lt;/a&gt; upstream to try and nail down the specifics.  Everyone shares their relevant expertise here: a Wine developer notes that it&amp;#8217;s a mismatched symbol-header problem, I figure out the cause is Ubuntu&amp;#8217;s unexpected use of 32-bit headers on 64-bit systems, a community member provides a temporary workaround patch, an mpg123 developer tells why things were the way they were and how Ubuntu+Wine was the first to expose this problem, and Alexandre Julliard says what he&amp;#8217;d ultimately like as a best practice.&lt;/p&gt;
&lt;p&gt;This sort of collaboration is exactly what Open Source is about.  Everyone involved could just go to the same bug tracker and simply &lt;em&gt;get to work&lt;/em&gt; &amp;#8211; it didn&amp;#8217;t matter that all 6 of us were in different continents working for different companies on different projects.  Everything is laid bare, easy to see and thus easy to fix.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Getting it done&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At the end of the day, getting the fix out to users is what actually matters.  It&amp;#8217;s really disappointing when great code like mp3 support just doesn&amp;#8217;t happens because of something silly like an out of date distribution library.&lt;/p&gt;
&lt;p&gt;So, that&amp;#8217;s the final step in the chain &amp;#8211; the mpg123 developer puts out a new version of mpg123, and then I have to package that up and put it into the latest Ubuntu alpha.  This is where Launchpad&amp;#8217;s ability to have a single bug exist against multiple packages becomes especially helpful: by &lt;a title=&quot;Launchpad bug - Wine not building&quot; href=&quot;https://bugs.edge.launchpad.net/ubuntu/+source/ia32-libs/+bug/522916&quot;&gt;filing a launchpad bug&lt;/a&gt; I could track the changes I had to make to all 3 packages (mpg123, ia32-libs, and then wine).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Technical details for the interested&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s worth noting that this bug could have been prevented entirely if Ubuntu had proper multiarch support.  Multiarch means the ability to install 32-bit packages directly onto a 64-bit system, rather than having to use special separate 32-on-64 packages like ia32-libs.  Multiarch has been a slow, gradual redesign under development in Debian and Ubuntu for years now, and it just barely missed the Lucid cycle.&lt;/p&gt;
&lt;p&gt;This leaves us with the current implementation, which can at best be described as &amp;#8220;a tremendous hack.&amp;#8221;  32-bit libraries from needed packages are manually added to a giant list.  Then they&amp;#8217;re processed by a script and all thrown into one gigantic, 600+ megabyte package named ia32-libs.  This means that any program which needs 32-bit compatibility (such as Wine) has to depend on this massive source package, and any time a single component changes it needs to be manually updated.&lt;/p&gt;
&lt;p&gt;However, ia32-libs contains only the library files, not the header files, so when you build a 32-bit application on 64-bit Ubuntu you&amp;#8217;re actually building with the header files installed from the 64-bit version of the package.  This is normally fine, as most header files are identical across different architectures, however this wasn&amp;#8217;t the case with mpg123.  So we were using a 32-bit library that had different symbols than the 64-bit header file, and the build then fails with symbol errors.&lt;/p&gt;
&lt;p&gt;There are quite a few applications for 64-bit Ubuntu that need to make use of 32-bit libraries for various reasons, however Wine is by far the most dominant.  This makes me, the one responsible for Wine, also the official babysitter of ia32-libs and similarly broken packages.  Wine is special in a way, though, as unlike other applications there is no way to fix it by just making it 64-bit &amp;#8212; Wine will always need 32 bit libraries in order to run 32 bit Windows applications, which will remain incredibly common for at least another decade.&lt;/p&gt;</content>
		<author>
			<name>ShadowHawk</name>
			<uri>http://yokozar.org/blog</uri>
		</author>
		<source>
			<title type="html">YokoZar's Writings » Planet Ubuntu</title>
			<subtitle type="html">A blog about Ubuntu, Wine, and the occasional other interest</subtitle>
			<link rel="self" href="http://yokozar.org/blog/archives/tag/planet-ubuntu/feed"/>
			<id>http://yokozar.org/blog/archives/tag/planet-ubuntu/feed</id>
			<updated>2010-03-11T20:30:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Hide your filesizes, people.</title>
		<link href="http://shrughes.com/p/hide-your-filesizes-people/"/>
		<id>http://shrughes.com/?p=93</id>
		<updated>2010-02-24T13:00:03+00:00</updated>
		<content type="html">&lt;p&gt;I read this BoingBoing post:  &lt;a href=&quot;http://m.boingboing.net/2010/02/05/tahoe-lafs-a-p2p-fil.html&quot;&gt;Tahoe-LAFS: a P2P  filesystem that lets you use the cloud without trusting it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Can we trust it?  Can we really trust it? Reading the &lt;a href=&quot;http://allmydata.org/source/tahoe/trunk/docs/architecture.txt&quot;&gt;architecture document&lt;/a&gt; for Tahoe-LAFS, I found this text:&lt;/p&gt;
&lt;p&gt;In general, anyone who already knows the contents of a file will be in a strong position to determine who else is uploading or downloading it.&lt;/p&gt;
&lt;p&gt;&amp;#8230;&lt;/p&gt;
&lt;p&gt;Also note that the file size and (when convergence is being used) a keyed hash of the plaintext are not protected.&lt;/p&gt;
&lt;p&gt;Listen up, folks.  A file storage service that reveals file sizes is one that you cannot blindly trust.&lt;/p&gt;
&lt;p&gt;Consider the following scenario: You find yourself with a popular pirated movie file, whose size is 2143658709 bytes, and you decide to &amp;#8220;securely&amp;#8221; share it.  The people spying on you can see that you&amp;#8217;ve uploaded an encrypted file of this size to the cloud.  What are the odds that you happened to coincidentally come across a file that&amp;#8217;s exactly the same size?  Slim. Sufficiently slim for a subpoena, and bam, you could get busted by the copyright cops.&lt;/p&gt;
&lt;p&gt;It gets worse.  Suppose you&amp;#8217;ve extracted a zip file of some illegal content.  Even porn is illegal in some countries.  The set of file sizes in that collection is, say, some set of values, and we don&amp;#8217;t really care what they are.  Call it {&lt;em&gt;x&lt;/em&gt;&lt;sub&gt;1&lt;/sub&gt;, &amp;#8230;, &lt;em&gt;x&lt;/em&gt;&lt;sub&gt;&lt;em&gt;n&lt;/em&gt;&lt;/sub&gt;}.  The evil government watches you one day, and sees that you&amp;#8217;ve uploaded a bunch of files, and, in its scan for illegal porn collections, notes that {&lt;em&gt;x&lt;/em&gt;&lt;sub&gt;1&lt;/sub&gt;, &amp;#8230;, &lt;em&gt;x&lt;/em&gt;&lt;sub&gt;&lt;em&gt;n&lt;/em&gt;&lt;/sub&gt;} is a subset of the files you&amp;#8217;ve uploaded.  They&amp;#8217;ve caught you.  With an astronomically small chance of a false positive.&lt;/p&gt;
&lt;p&gt;The fact that you can&amp;#8217;t hide those file sizes in the noise of other files is somewhat counter-intuitive.  For example, suppose you have an illegal file collection with 100 text files.  All their file sizes are between one and a million bytes in length.  You upload that collection amid 99900 other files with randomly chosen lengths between one and a million.  By the way, that&amp;#8217;s an absurdly high amount of fluff files to be uploading.  So now you&amp;#8217;ve uploaded a hundred thousand files.  Your small subset is safely obfuscated within all those other files, right?  Wrong.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s the chance that a given set of 100000 numbers, chosen from one to a million, contains a certain subset of 100 numbers?  It&amp;#8217;s approximately 1/10&lt;sup&gt;100&lt;/sup&gt;.  That&amp;#8217;s right &amp;#8212; one over a googol.  Each number between one and a million has a 10% chance of being included in the set of 100000 random file sizes.  Actually, it&amp;#8217;s worse than that, since some file sizes will be repeated.  I think the expected number of distinct values is about 95163.  That makes it more like 1/10.5&lt;sup&gt;100&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;The lesson here is that, if your online upload service knows your file sizes, it cannot be blindly trusted.  They&amp;#8217;re only useful for keeping secret files that you&amp;#8217;ve generated.  They&amp;#8217;re not useful for secretly storing files whose existence is known to the authorities.  When you go about designing the ultimate encrypted peer-to-peer file cloud, please store data opaquely in fixed size blocks, that never get truncated.  You can figure out how to do this efficiently.  You can have a layer of indirection between uploaded chunks and individual files.  And don&amp;#8217;t even &lt;em&gt;think&lt;/em&gt; about allowing block sizes to be different discrete sizes, such as power of two.  You know you&amp;#8217;ll mess it up.  Be sufficiently paranoid.&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s be even more paranoid.  Upload files as rarely as possible.  Don&amp;#8217;t upload them eagerly.  For example, if somebody&amp;#8217;s slowly placing a set of illegal movies into a shared directory, eager scanning of a directory and eager uploading of individual files would reveal enough information about individual file sizes to provide an identifiable signature for the entire set.  Somebody watching network activity live would notice pauses after each group of chunks that corresponds to a file.  This would tell them information about the length of the file, rounded to the nearest whatever-your-chunk-size-is.  You&amp;#8217;d need to add absurd amounts of random padding to individual files to sufficiently obscure this information.  Upload files in groups.  It&amp;#8217;s safer and less expensive that way.  And while you&amp;#8217;re at it, don&amp;#8217;t just read-a-file-from-disk-and-upload-it, read-a-file-from-disk-and-upload-it, and so on.  Are you &lt;em&gt;sure&lt;/em&gt; the pauses between files are too small to observe on the network?  What if the shared directory you&amp;#8217;re uploading is really on a network file system?  &lt;em&gt;Are you sure?&lt;/em&gt; Read files concurrently and upload them interleavedly.  Be sufficiently paranoid.&lt;/p&gt;
&lt;p&gt;Follow-ups:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://shrughes.com/p/estimating-the-number-of-distinct-numbers/&quot;&gt;Estimating the number of distinct numbers&lt;/a&gt; &amp;#8212; on how I got 95163.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Apple’s Review Process Strikes Again</title>
		<link href="http://www.stromcode.com/2009/06/17/apples-review-process-strikes-again/"/>
		<id>http://www.stromcode.com/2009/06/17/apples-review-process-strikes-again/</id>
		<updated>2010-02-23T23:30:38+00:00</updated>
		<content type="html">For the first time, I have my own idiotic app review rejection story.  I have to say, until now I've been one of the lucky ones.  My developer app was approved in days, and every app and update I've put through has been approved with no hassles (save for the ...&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=yIl2AUoC8zA&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=s1i2Vhu8qK0:7fFvT0mNw7w:F7zBnMyn0Lo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=s1i2Vhu8qK0:7fFvT0mNw7w:V_sGLiPBpWU&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:l6gmwiTKsz0&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=l6gmwiTKsz0&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:gIN9vFwOqvQ&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=s1i2Vhu8qK0:7fFvT0mNw7w:gIN9vFwOqvQ&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=s1i2Vhu8qK0:7fFvT0mNw7w:TzevzKxY174&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=TzevzKxY174&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<author>
			<name>stromdotcom</name>
			<uri>http://www.stromcode.com</uri>
		</author>
		<source>
			<title type="html">Stromcode</title>
			<subtitle type="html">XNA, C++, PHP, Artificial Intelligence, ALife and Game Development</subtitle>
			<link rel="self" href="http://feeds.feedburner.com/Stromcode?format=xml"/>
			<id>http://feeds.feedburner.com/Stromcode?format=xml</id>
			<updated>2010-02-23T23:30:38+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Want to do ___? Tough.</title>
		<link href="http://www.stromcode.com/2009/06/12/want-to-do-___-tough/"/>
		<id>http://www.stromcode.com/2009/06/12/want-to-do-___-tough/</id>
		<updated>2010-02-23T23:30:38+00:00</updated>
		<content type="html">One of the reasons entrenched Windows users find switching to the Mac unappealing is that the interface is so different.  Different can be better. But in my opinion, after 6 months developing on the Mac, different is definitely NOT better.  I consider myself fairly used to the Mac interface and ...&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=yIl2AUoC8zA&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=wamGTkiTH10:csKxuwcM2Ss:F7zBnMyn0Lo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=wamGTkiTH10:csKxuwcM2Ss:V_sGLiPBpWU&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:l6gmwiTKsz0&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=l6gmwiTKsz0&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:gIN9vFwOqvQ&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=wamGTkiTH10:csKxuwcM2Ss:gIN9vFwOqvQ&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=wamGTkiTH10:csKxuwcM2Ss:TzevzKxY174&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=TzevzKxY174&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<author>
			<name>stromdotcom</name>
			<uri>http://www.stromcode.com</uri>
		</author>
		<source>
			<title type="html">Stromcode</title>
			<subtitle type="html">XNA, C++, PHP, Artificial Intelligence, ALife and Game Development</subtitle>
			<link rel="self" href="http://feeds.feedburner.com/Stromcode?format=xml"/>
			<id>http://feeds.feedburner.com/Stromcode?format=xml</id>
			<updated>2010-02-23T23:30:38+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The most important thing (to me) about the FCC’s investigation of Apple and AT&amp;amp;T</title>
		<link href="http://www.stromcode.com/2009/08/02/the-most-important-thing-to-me-about-the-fccs-investigation-of-apple-and-att/"/>
		<id>http://www.stromcode.com/2009/08/02/the-most-important-thing-to-me-about-the-fccs-investigation-of-apple-and-att/</id>
		<updated>2010-02-23T23:30:38+00:00</updated>
		<content type="html">You probably heard that the FCC has taken an interest in Apple's rejection of the Google Voice app and requested information from the three companies.  Anyone who has read Stromcode over the past 6 or so months knows that this news makes me uncommonly happy, but I haven't posted about ...&lt;div class=&quot;feedflare&quot;&gt;
&lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=yIl2AUoC8zA&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=Hawtt-4a3V4:2COM1WH-uWE:F7zBnMyn0Lo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=Hawtt-4a3V4:2COM1WH-uWE:V_sGLiPBpWU&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:l6gmwiTKsz0&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=l6gmwiTKsz0&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:gIN9vFwOqvQ&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?i=Hawtt-4a3V4:2COM1WH-uWE:gIN9vFwOqvQ&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://feeds.feedburner.com/~ff/Stromcode?a=Hawtt-4a3V4:2COM1WH-uWE:TzevzKxY174&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/Stromcode?d=TzevzKxY174&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;</content>
		<author>
			<name>stromdotcom</name>
			<uri>http://www.stromcode.com</uri>
		</author>
		<source>
			<title type="html">Stromcode</title>
			<subtitle type="html">XNA, C++, PHP, Artificial Intelligence, ALife and Game Development</subtitle>
			<link rel="self" href="http://feeds.feedburner.com/Stromcode?format=xml"/>
			<id>http://feeds.feedburner.com/Stromcode?format=xml</id>
			<updated>2010-02-23T23:30:38+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-ca">
		<title type="html">Remove Protected Foreign Fonts in Windows 7</title>
		<link href="http://typh.com/remove-protected-foreign-fonts-windows-7/"/>
		<id>http://typh.com/remove-protected-foreign-fonts-windows-7/</id>
		<updated>2010-02-23T23:30:10+00:00</updated>
		<content type="html">&lt;p&gt;Windows 7 installs a pile of foreign language fonts by default that clutter up the font selection menu (Aparajita, Batang, etc). There is a &amp;quot;hide&amp;quot; mechanism built into the font manager, but of course, it doesn't actually work (in my case, in Adobe CS4 specifically). If you try to delete one of these fonts manually, you'll get a dialog stating that they are a protected system font and cannot be deleted. Of course unless you're using the languages in question, this isn't true, and it's extremely irritating.&lt;/p&gt;
&lt;p&gt;Here's how to remove them. Click on the Start Orb, type in &lt;tt class=&quot;docutils literal&quot;&gt;cmd&lt;/tt&gt;. Right click on the &lt;tt class=&quot;docutils literal&quot;&gt;cmd&lt;/tt&gt; entry in the Menu and choose &lt;tt class=&quot;docutils literal&quot;&gt;Run as Administrator&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;In the cmd window, type:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;takeown &lt;span class=&quot;n&quot;&gt;/R&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/F&lt;/span&gt; C:\Windows\Fonts
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will give you ownership of the &lt;tt class=&quot;docutils literal&quot;&gt;Fonts&lt;/tt&gt; folder (/R flag for recursive). Follow this with:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;icacls C:\Windows\Fonts &lt;span class=&quot;n&quot;&gt;/grant&lt;/span&gt; administrators:F &lt;span class=&quot;n&quot;&gt;/t&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will give the administrators user group full control of the &lt;tt class=&quot;docutils literal&quot;&gt;Fonts&lt;/tt&gt; folder (/T for recursive). Finally, type:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;attrib -r -s C:\Windows\Fonts
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will remove the read-only and system attributes of the folder, which causes it to display as a normal folder with font files. You can now go in and delete the fonts you wish. Restart afterwards, as they seem to stick around until you do. Don't delete fonts if you don't know what they do, and don't complain to me if you mess up your system. Good luck!&lt;/p&gt;</content>
		<author>
			<name>Typh</name>
			<uri>http://typh.com/</uri>
		</author>
		<source>
			<title type="html">Jason Peddle's latest blog entries | typh.com</title>
			<subtitle type="html">Development blog by Jason Peddle, a freelance web developer in Toronto, Ontario. Likes to talk about Django, Python, jQuery, CSS, Vim, usability, and productivity.</subtitle>
			<link rel="self" href="http://typh.com/feeds/latest/"/>
			<id>http://typh.com/feeds/latest/</id>
			<updated>2010-03-11T20:30:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-ca">
		<title type="html">Django Syntax Highlighting with reStructuredText and Pygments</title>
		<link href="http://typh.com/django-highlighting-restructuredtext-and-pygments/"/>
		<id>http://typh.com/django-highlighting-restructuredtext-and-pygments/</id>
		<updated>2010-02-23T23:30:10+00:00</updated>
		<content type="html">&lt;p&gt;Despite launching my blog only last week using Markdown as my blogging markup language, after reading Eric Holscher's &lt;a class=&quot;reference external&quot; href=&quot;http://ericholscher.com/blog/2010/feb/5/large-problems-django-mostly-solved-documentation/&quot;&gt;Large Problems in Django, Mostly Solved: Documentation&lt;/a&gt;, I was curious if it would be much, if any, work to switch to reStructuredText and still retain the code highlighting support I was getting from &lt;a class=&quot;reference external&quot; href=&quot;http://www.freewisdom.org/projects/python-markdown/CodeHilite&quot;&gt;Markdown's CodeHilite extension&lt;/a&gt;. The actual highlighting comes from &lt;a class=&quot;reference external&quot; href=&quot;http://pygments.org/&quot;&gt;Pygments&lt;/a&gt;, which is stand alone and should be possible to hook into reStructuredText as well.&lt;/p&gt;
&lt;p&gt;Why bother switching? reStructuredText is pretty well loved among the Python community for documentation, and rightfully so. Although ReST is much more extensive than I need for blogging, I see no need to be using two markup languages. Plus, it saves me a module, since I don't have to install markdown.&lt;/p&gt;
&lt;p&gt;First, make sure you have &lt;tt class=&quot;docutils literal&quot;&gt;Docutils&lt;/tt&gt; and &lt;tt class=&quot;docutils literal&quot;&gt;Pygments&lt;/tt&gt; installed. I tend to install Python modules with &lt;a class=&quot;reference external&quot; href=&quot;http://pip.openplans.org/&quot;&gt;pip&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pip install docutils pygments
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;tt class=&quot;docutils literal&quot;&gt;django.contrib.markup&lt;/tt&gt; comes with a template filter, &lt;tt class=&quot;docutils literal&quot;&gt;|restructuredtext&lt;/tt&gt; that converts ReST into HTML, and if that works for your purposes, go ahead and use it. I, however, following advice from &lt;a class=&quot;reference external&quot; href=&quot;http://www.b-list.org/&quot;&gt;James Bennett's&lt;/a&gt; &lt;a class=&quot;reference external&quot; href=&quot;http://www.amazon.com/dp/1430219386/&quot;&gt;Practical Django Projects&lt;/a&gt; choose to store the rendered content in my database. This way it doesn't have to be parsed every time it is displayed. I peeked into the &lt;tt class=&quot;docutils literal&quot;&gt;restructuredtext&lt;/tt&gt; filter to see how it worked:&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;restructuredtext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;docutils.core&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;publish_parts&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;ImportError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;settings&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DEBUG&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TemplateSyntaxError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Error in {&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;% r&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;estructuredtext %} filter: The Python docutils library isn't installed.&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;force_unicode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;docutils_settings&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;getattr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;settings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;RESTRUCTUREDTEXT_FILTER_SETTINGS&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{})&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;parts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;publish_parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;smart_str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;writer_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;html4css1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;settings_overrides&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;docutils_settings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mark_safe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;force_unicode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;fragment&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]))&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;restructuredtext&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;is_safe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;So, basically it reads in your &lt;tt class=&quot;docutils literal&quot;&gt;RESTRUCTUREDTEXT_FILTER_SETTINGS&lt;/tt&gt; and renders using &lt;tt class=&quot;docutils literal&quot;&gt;docutils.core.publish_parts&lt;/tt&gt;. Personally, it's a pet peeve of mine when I find a template tag that has built in logic that would be useful outside the context of a template tag, but in this case, the template tag function will work fine if we import it and call it from the model:&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;django.db&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;django.contrib.markup.templatetags.markup&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;restructuredtext&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max_length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;slug&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SlugField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unique&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;editable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blank&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;content_raw&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kwargs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;content_raw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;restructuredtext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;content_raw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kwargs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;On save, I render whatever was typed into the &lt;tt class=&quot;docutils literal&quot;&gt;content_raw&lt;/tt&gt; to html, then store it in &lt;tt class=&quot;docutils literal&quot;&gt;content&lt;/tt&gt;. &lt;tt class=&quot;docutils literal&quot;&gt;content&lt;/tt&gt; is hidden in the admin (&lt;tt class=&quot;docutils literal&quot;&gt;editable=False&lt;/tt&gt;) and &lt;tt class=&quot;docutils literal&quot;&gt;content|safe&lt;/tt&gt; is used in the templates.&lt;/p&gt;
&lt;p&gt;ReST, as &lt;a class=&quot;reference external&quot; href=&quot;http://docutils.sourceforge.net/docs/user/rst/quickref.html&quot;&gt;documented&lt;/a&gt;, now works in my Entry model. However, it knows nothing about code syntax highlighting. The &lt;tt class=&quot;docutils literal&quot;&gt;Pygments&lt;/tt&gt; website has a &lt;a class=&quot;reference external&quot; href=&quot;http://pygments.org/docs/rstdirective/&quot;&gt;brief entry on ReST support&lt;/a&gt; that merely left me confused. Here's the gist of it: you need to create a &amp;quot;directive&amp;quot; (aka markup tag) to display source code and pygmentize it. &lt;tt class=&quot;docutils literal&quot;&gt;Pygments&lt;/tt&gt; graciously provides the necessary code in the &lt;tt class=&quot;docutils literal&quot;&gt;external&lt;/tt&gt; folder of the download, or you can &lt;a class=&quot;reference external&quot; href=&quot;http://dev.pocoo.org/projects/pygments/browser/external/rst-directive.py&quot;&gt;view it online&lt;/a&gt;. I have included it below, taking the liberty to uncomment the &amp;quot;linenos&amp;quot; variant option:&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    The Pygments reStructuredText directive&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    This fragment is a Docutils_ 0.5 directive that renders source code&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    (to HTML only, currently) via Pygments.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    To use it, adjust the options below and copy the code into a module&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    that you import on initialization.  The code then automatically&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    registers a ``sourcecode`` directive that you can use instead of&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    normal code blocks like this::&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;        .. sourcecode:: python&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;            My code goes here.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    If you want to have different code styles, e.g. one with line numbers&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    and one without, add formatters with their names in the VARIANTS dict&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    below.  You can invoke them instead of the DEFAULT one by using a&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    directive option::&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;        .. sourcecode:: python&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;            :linenos:&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;            My code goes here.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    Look at the `directive documentation`_ to get all the gory details.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    .. _Docutils: http://docutils.sf.net/&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    .. _directive documentation:&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;       http://docutils.sourceforge.net/docs/howto/rst-directives.html&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    :license: BSD, see LICENSE for details.&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Options&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# ~~~~~~~&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Set to True if you want inline CSS styles instead of classes&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;INLINESTYLES&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pygments.formatters&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HtmlFormatter&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# The default formatter&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;DEFAULT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HtmlFormatter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;noclasses&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;INLINESTYLES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Add name -&amp;gt; formatter pairs for every variant you want to use&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;VARIANTS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'linenos'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HtmlFormatter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;noclasses&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;INLINESTYLES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;linenos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;docutils&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nodes&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;docutils.parsers.rst&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;directives&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Directive&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pygments&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlight&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pygments.lexers&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get_lexer_by_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TextLexer&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Pygments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Directive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;sd&quot;&gt;&amp;quot;&amp;quot;&amp;quot; Source code syntax hightlighting.&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;required_arguments&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;optional_arguments&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;final_argument_whitespace&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;option_spec&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;directives&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VARIANTS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;has_content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;assert_has_content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;lexer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get_lexer_by_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;ValueError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;c&quot;&gt;# no lexer found - use the text one instead of an exception&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;lexer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TextLexer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# take an arbitrary option if more than one is given&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;formatter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VARIANTS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DEFAULT&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;parsed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;u'&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lexer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;formatter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nodes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;raw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parsed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'html'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;directives&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;register_directive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'sourcecode'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Pygments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;But what the heck do you do with this? You need to import it somewhere, anywhere really, where it will get loaded. I saved it as &lt;tt class=&quot;docutils literal&quot;&gt;rstdirective.py&lt;/tt&gt; and played it safe by importing it at the top of my &lt;tt class=&quot;docutils literal&quot;&gt;settings.py&lt;/tt&gt; file. Other people import it in the &lt;tt class=&quot;docutils literal&quot;&gt;__init__.py&lt;/tt&gt; of the app using it.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#settings.py&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;rstdirective.py&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you can outline code by using:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;sourcecode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;python&lt;/span&gt;

    import foo #source code!
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or, with line numbers:&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt;1
2
3
4&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;sourcecode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;python&lt;/span&gt;
    :linenos:

    import foo #source code!
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;The code should be rendered, marked up, and ready for color. &lt;tt class=&quot;docutils literal&quot;&gt;Pygments&lt;/tt&gt; doesn't come with any &lt;tt class=&quot;docutils literal&quot;&gt;CSS&lt;/tt&gt; files, although it does have a tool to create them automatically:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pygmentize -f html -S monokai -a .highlight &amp;gt; media/css/pygments.css
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Basically: create me &lt;tt class=&quot;docutils literal&quot;&gt;CSS&lt;/tt&gt; under the class &lt;tt class=&quot;docutils literal&quot;&gt;.highlight&lt;/tt&gt; using the theme &lt;tt class=&quot;docutils literal&quot;&gt;monokai&lt;/tt&gt;. You can preview the default &lt;a class=&quot;reference external&quot; href=&quot;http://paste.pocoo.org/&quot;&gt;Pygments themes&lt;/a&gt; here. If you're lazy/confused, richleland has a &lt;a class=&quot;reference external&quot; href=&quot;http://github.com/richleland/pygments-css&quot;&gt;github repo&lt;/a&gt; with the CSS files already generated, you just need to change the class from &lt;tt class=&quot;docutils literal&quot;&gt;.codehilite&lt;/tt&gt; to &lt;tt class=&quot;docutils literal&quot;&gt;.highlight&lt;/tt&gt;. Include the CSS in your template link you would any other CSS file, refresh, and enjoy!&lt;/p&gt;</content>
		<author>
			<name>Typh</name>
			<uri>http://typh.com/</uri>
		</author>
		<source>
			<title type="html">Jason Peddle's latest blog entries | typh.com</title>
			<subtitle type="html">Development blog by Jason Peddle, a freelance web developer in Toronto, Ontario. Likes to talk about Django, Python, jQuery, CSS, Vim, usability, and productivity.</subtitle>
			<link rel="self" href="http://typh.com/feeds/latest/"/>
			<id>http://typh.com/feeds/latest/</id>
			<updated>2010-03-11T20:30:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-ca">
		<title type="html">Customizing Django Comments</title>
		<link href="http://typh.com/customizing-django-comments/"/>
		<id>http://typh.com/customizing-django-comments/</id>
		<updated>2010-02-23T23:30:10+00:00</updated>
		<content type="html">&lt;p&gt;The &lt;tt class=&quot;docutils literal&quot;&gt;django.contrib.comments&lt;/tt&gt; app, like all good apps, comes with many default templates so you can get them up and running in minutes. Unfortunately, by default they will not match your website, since they couldn't possibly know about your site's template structure. Fortunately, because of the way template loading works in Django, it's easy to extend these templates to match.&lt;/p&gt;
&lt;p&gt;You may have noticed these lines in your &lt;tt class=&quot;docutils literal&quot;&gt;settings.py&lt;/tt&gt;:&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt;1
2
3
4&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;TEMPLATE_LOADERS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'django.template.loaders.filesystem.load_template_source'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'django.template.loaders.app_directories.load_template_source'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;When Django looks up a template, it will check these modules in order.&lt;/p&gt;
&lt;p&gt;&lt;tt class=&quot;docutils literal&quot;&gt;django.template.loaders.filesystem.load_template_source&lt;/tt&gt; will check the directories you specified in the &lt;tt class=&quot;docutils literal&quot;&gt;TEMPLATE_DIRS&lt;/tt&gt; setting. If it doesn't find the associated template, it will move onto
&lt;tt class=&quot;docutils literal&quot;&gt;django.template.loaders.app_directories.load_template_source&lt;/tt&gt;, which will look in the templates directories of apps you've listed in &lt;tt class=&quot;docutils literal&quot;&gt;INSTALLED_APPS&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.djangrrl.com/view/taking-ugly-out-django-comments/&quot;&gt;Barbara Shaurette&lt;/a&gt; recommended overriding any of the templates you wanted to customize by changing each to inherit from your base template, but there's a quicker way that lets you play dumb about how many templates there are (and any updates made to them).&lt;/p&gt;
&lt;p&gt;Copy only the &lt;tt class=&quot;docutils literal&quot;&gt;base.html&lt;/tt&gt; template (&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;[DJANGO_DIRECTORY]/contrib/comments/templates/comments/base.html&lt;/span&gt;&lt;/tt&gt;) to your template directory and edit it so that instead of having the page markup included, like this:&lt;/p&gt;
&lt;p&gt;&lt;tt class=&quot;docutils literal&quot;&gt;templates/comments/base.html&lt;/tt&gt;&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01//EN&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/html; charset=utf-8&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;endblock&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;endblock&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;... have it inherit from &lt;em&gt;your&lt;/em&gt; base template (or whatever template you want):&lt;/p&gt;
&lt;table class=&quot;highlighttable&quot;&gt;&lt;tr&gt;&lt;td class=&quot;linenos&quot;&gt;&lt;div class=&quot;linenodiv&quot;&gt;&lt;pre&gt;1
2
3
4&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'base.html'&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;
    &lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;endblock&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;endblock&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;Using this method, by overriding just the top level template, you've customized all the comment templates, without even having to know what they are.&lt;/p&gt;
&lt;p&gt;This method will of course work with any application. I just ran in to it specifically using the comments app.&lt;/p&gt;</content>
		<author>
			<name>Typh</name>
			<uri>http://typh.com/</uri>
		</author>
		<source>
			<title type="html">Jason Peddle's latest blog entries | typh.com</title>
			<subtitle type="html">Development blog by Jason Peddle, a freelance web developer in Toronto, Ontario. Likes to talk about Django, Python, jQuery, CSS, Vim, usability, and productivity.</subtitle>
			<link rel="self" href="http://typh.com/feeds/latest/"/>
			<id>http://typh.com/feeds/latest/</id>
			<updated>2010-03-11T20:30:05+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">A Fun Math Problem</title>
		<link href="http://shrughes.com/p/a-fun-math-problem/"/>
		<id>http://shrughes.com/?p=84</id>
		<updated>2010-02-22T19:56:51+00:00</updated>
		<content type="html">&lt;p&gt;What is the infimum of &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)|, over positive integers &lt;i&gt;n&lt;/i&gt;?&lt;/p&gt;
&lt;p&gt;Is it zero, or is it greater than zero?&lt;/p&gt;
&lt;p&gt;Ok, it&amp;#8217;s time to spoil the answer.&lt;/p&gt;
&lt;p&gt;With some lack of rigor, I think the probability is 1 that the minimum value exists and is greater than zero.&lt;/p&gt;
&lt;p&gt;Suppose two people play a number-picking game, where two players pick numbers, and then compare them against one another, infinitely many times.  Suppose the first person picks a (real) number uniformly on [0,1] and the second person picks 1/2&lt;sup&gt;&lt;i&gt;k&lt;/i&gt;&lt;/sup&gt; for his &lt;i&gt;k&lt;/i&gt;th choice.  What&amp;#8217;s the expected number of times the first person will pick a number less than the second person does, for the rest of time?  The answer is 1 &amp;#8212; there&amp;#8217;s a 1/2 chance of that happening for &lt;i&gt;k&lt;/i&gt;=1, a 1/4 chance for &lt;i&gt;k&lt;/i&gt;=2, and so on, so the expected number of times is 1/2 + 1/4 + 1/8 + &amp;#8230;, which equals 1.&lt;/p&gt;
&lt;p&gt;If we let &lt;i&gt;r&lt;/i&gt;(1), &lt;i&gt;r&lt;/i&gt;(2), &lt;i&gt;r&lt;/i&gt;(3), &amp;#8230; be the sequence of random numbers the first person picks, we would therefore expect there to be one value of &lt;i&gt;k&lt;/i&gt; for which &lt;i&gt;r&lt;/i&gt;(&lt;i&gt;k&lt;/i&gt;)/(1/2&lt;sup&gt;&lt;i&gt;k&lt;/i&gt;&lt;/sup&gt;) is less than 1.  Maybe there are two, or three such values of &lt;i&gt;k&lt;/i&gt;.  The probability that there are infinitely many such values is zero.&lt;/p&gt;
&lt;p&gt;Now consider |sin(&lt;i&gt;n&lt;/i&gt;)|.  For small values of &lt;i&gt;ε&lt;/i&gt;, and random values of &lt;i&gt;x&lt;/i&gt; the probability that |sin(&lt;i&gt;x&lt;/i&gt;)| &amp;lt; &lt;i&gt;ε&lt;/i&gt; is 2&lt;i&gt;ε&lt;/i&gt;/&lt;i&gt;π&lt;/i&gt;.  That&amp;#8217;s because the slope of |sin(_)| is 1 or -1 when it touches zero, and it touches zero at multiples of &lt;i&gt;π&lt;/i&gt;.  Now let&amp;#8217;s ask ourselves: How many times is &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)| less than 1?  Well, that&amp;#8217;s the same as playing a number guessing game where player one chooses |sin(&lt;i&gt;n&lt;/i&gt;)| and player two chooses 1/&lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;.  And |sin(&lt;i&gt;n&lt;/i&gt;)| is effectively a random number function.  What&amp;#8217;s the probability of player one choosing a value smaller than player two? Approximately 2(1/&lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;)/&lt;i&gt;π&lt;/i&gt;.  Or (2/&lt;i&gt;π&lt;/i&gt;)/&lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;. If we sum these probabilities, we get (2/&lt;i&gt;π&lt;/i&gt;)(1/1&lt;sup&gt;2&lt;/sup&gt; + 1/2&lt;sup&gt;2&lt;/sup&gt; + 1/3&lt;sup&gt;2&lt;/sup&gt; + &amp;#8230;) which equals (2/&lt;i&gt;π&lt;/i&gt;)(&lt;i&gt;π&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;/6) which equals &lt;i&gt;π&lt;/i&gt;/3.  So the expected number of times &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)| is less than 1 is about 1.04. This is not accurate &amp;#8212; for example, we assumed small values of &lt;i&gt;ε&lt;/i&gt; when computing 2&lt;i&gt;ε&lt;/i&gt;/&lt;i&gt;π&lt;/i&gt;, and early on in the sequence, we have large values of &lt;i&gt;ε&lt;/i&gt;, but we would still expect the expected number of times &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)| is less than 1 to be finite.&lt;/p&gt;
&lt;p&gt;What does this mean?  It means that, assuming the fractional parts of multiples of &lt;i&gt;π&lt;/i&gt; are random-looking, &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)| is less than 1 only for finitely many positive integers &lt;i&gt;n&lt;/i&gt;.  Which means that of this finite number, there is a minimum value.  One that is of course greater than zero.  So the infimum is not zero.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d say there&amp;#8217;s a good chance that sin(1) is the only value in the sequence &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;|sin(&lt;i&gt;n&lt;/i&gt;)| that is less than 1.  If we check the first ten million values in the sequence, we find that sin(1) is the only one so far.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The iPad and Tiling Window Managers</title>
		<link href="http://shrughes.com/p/the-ipad-and-tiling-window-managers/"/>
		<id>http://shrughes.com/?p=59</id>
		<updated>2010-02-19T13:00:17+00:00</updated>
		<content type="html">&lt;p&gt;Here&amp;#8217;s a prediction for you.  The iPad will eventually be able to run multiple applications at the same time.  Also, it will run them in a tiling window manager.&lt;/p&gt;
&lt;p&gt;Does anything else need to be said?  Is this not obvious?  A tiling window manager would be the ideal way for apps on the iPad to be run concurrently.  Turn the iPad sideways, open two apps, have the iPad tell them they&amp;#8217;re oriented vertically, and you&amp;#8217;re done!  This would be the conservative way to do things, that doesn&amp;#8217;t let users muck things up by having overlapping windows.  So that&amp;#8217;s the way I&amp;#8217;d expect Apple to go with this.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a less hopeful prediction: The iPad will eventually let you run two apps side by side, but not in any other configuration.&lt;/p&gt;
&lt;p&gt;But some day, the iPad or some other kind of tablet will have a tiling window manager.  You just watch.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">A Few Flaws in WordPress</title>
		<link href="http://shrughes.com/p/a-few-flaws-in-wordpress/"/>
		<id>http://shrughes.com/?p=26</id>
		<updated>2010-02-17T05:36:10+00:00</updated>
		<content type="html">&lt;p&gt;Now I&amp;#8217;d like to make fun of WordPress.  WordPress, you see, is not only a great convenience—it&amp;#8217;s also a fairly dopey piece of software. First, the default template includes a proclamation that it produces &amp;#8220;Valid XHTML&amp;#8221; with a link to the W3C validator.  As I&amp;#8217;ve obnoxiated in a previous posting, it includes some nonstandard attributes (named &amp;#8220;role&amp;#8221;) for Javascript purposes, and so it fails validation.  Well, that&amp;#8217;s kind of funny, but it&amp;#8217;s not really a big deal.&lt;/p&gt;
&lt;p&gt;Another problem is that Chrome keeps crashing when I try to read or administrate this blog.  And so I have to use Firefox.  I suppose that&amp;#8217;s not WordPress&amp;#8217;s fault, but it&amp;#8217;s peculiar.&lt;/p&gt;
&lt;p&gt;Now here&amp;#8217;s a serious complaint.  You can see the titles of not-yet-published posts.  Generally speaking, you can visit posts by id and you&amp;#8217;ll get redirected to the permalink page.  For example, if you visit &lt;a href=&quot;http://shrughes.com/?p=17&quot;&gt;http://shrughes.com/?p=17&lt;/a&gt;, you&amp;#8217;ll get redirected to &lt;a href=&quot;http://shrughes.com/p/waking-up-in-san-diego/&quot;&gt;http://shrughes.com/p/waking-up-in-san-diego/&lt;/a&gt;, which contains a published post about waking up in San Diego.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s look at what happens when we guess the post id for a post due to be released in the future.  If you visit &lt;a href=&quot;http://shrughes.com/?p=27&quot;&gt;http://shrughes.com/?p=27&lt;/a&gt;, you&amp;#8217;ll be redirected to &lt;a href=&quot;http://shrughes.com/p/an-example-unreleased-post/&quot;&gt;http://shrughes.com/p/an-example-unreleased-post/&lt;/a&gt;, which gives a friendly message telling you that this page does not exist.&lt;/p&gt;
&lt;p&gt;Right.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t really have a problem with my post titles being released without expecting it, partly because now I know about the problem.  I suspect that other bloggers, who have more serious reasons to delay publishing until certain times, might want to keep that information secret.  This seem like it would affect anybody who includes post titles in their permalink URLs, and who schedules posts for future publication.&lt;/p&gt;</content>
		<author>
			<name>shrughes</name>
			<uri>http://shrughes.com</uri>
		</author>
		<source>
			<title type="html">shrughes » Cool</title>
			<link rel="self" href="http://shrughes.com/c/cool/feed/"/>
			<id>http://shrughes.com/c/cool/feed/</id>
			<updated>2010-03-11T15:30:09+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Default Programs Editor 2.6 Update</title>
		<link href="http://factormystic.net/blog/default-programs-editor-2-6-update"/>
		<id>http://factormystic.net/blog/?p=203</id>
		<updated>2010-02-14T20:14:42+00:00</updated>
		<content type="html">&lt;p&gt;I discovered a couple stupid bugs right after I posted 2.5, so here&amp;#8217;s a quick 2.6 update to resolve them.&lt;/p&gt;
&lt;blockquote&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;Version 2.6.1837.1459 (February 14, 2010)&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;&lt;strong&gt;Bugs Fixed:&lt;/strong&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a discrepancy between value data types when saving to a .reg file vs saving to the registry when changing a context menu item name.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- DDE Message was not deleted if the program was running with elevated privileges.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- File type icon would sometimes not be detected correctly when the icon source was the default program.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;&lt;strong&gt;Crashes Fixed:&lt;/strong&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Deleting a context menu item would sometimes result in a crash.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Inputting invalid character for context menu item name sometimes caused a crash.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- In some cases, opening the autoplay handlers page for some media types caused a crash.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Saving context menu changes after editing a command label (including implicit edits) caused a crash.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;http://defaultprogramseditor.com&quot;&gt;Download now&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>FactorMystic</name>
			<uri>http://factormystic.net/blog</uri>
		</author>
		<source>
			<title type="html">Factor Mystic</title>
			<link rel="self" href="http://factormystic.net/blog/feed"/>
			<id>http://factormystic.net/blog/feed</id>
			<updated>2010-02-23T23:31:01+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Default Programs Editor 2.5 Update</title>
		<link href="http://factormystic.net/blog/default-programs-editor-2-5-update"/>
		<id>http://factormystic.net/blog/?p=198</id>
		<updated>2010-02-13T03:38:42+00:00</updated>
		<content type="html">&lt;p&gt;Default Programs Editor 2.5 was posted this week. The changelog is monstrous; this version has the most bug and crash fixes to date. If you&amp;#8217;ve got an idea or gripe, head over to &lt;a href=&quot;http://defaultprogramseditor.uservoice.com&quot;&gt;DPE&amp;#8217;s UserVoice forum&lt;/a&gt; and talk about it!&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Version 2.5.1823.2023 (February 9, 2010)&lt;/p&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;&lt;strong&gt;New Features:&lt;/strong&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ Added support for DropTarget objects as context menu commands.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ Added support for DelegateExecute objects as context menu commands.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ Added support for Dynamic Data Exchange messages invoked with context menu commands.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ On the Icon page, the raw resource path is now viewable and can be manually changed. It is also now possible to specify a file&amp;#8217;s own image in one click.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ When changing an extension&amp;#8217;s file type, a revamped file type selection process shows all file types, even unused ones.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ Added a checkbox to select/deselect all extensions on the extension selection page for Default Programs associations.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;+ Added file path display to the final success page when changes are saved to file.&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Bugs Fixed:&lt;/strong&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a bug where the exported command path wouldn&amp;#8217;t be a normal string like it should have been.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a bug where the wrong context menu item would be detected as the default.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed blank autoplay handler showing on the media options list after cancelling the creation of a new handler.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed incorrect default context menu item detection in some cases.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a bug where an exported context menu .reg file could have a malformed key path.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Saving edited file type Descriptions and Icons to file now correctly saves only those changed properties.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- The .reg file comment for Description and Icon changes will now also correctly describe which property is edited.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- The main instruction text on the Delete Extension page now reads appropriately.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- The link button to set a context menu item as default now enables or disables uniformly with the other controls.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Some resource strings were not resolved properly (such as certain file type descriptions).&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Missing publisher information added to Control Panel uninstall data.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Burnable Blu-ray discs now show correctly in the Autoplay media list.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed wrong capitalization for Blu-ray disc entry in the Autoplay media list.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- The behavior of the Done button on the Success page was not uniform for all page paths when launched from the Control Panel.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- The page history is cleared on the Success page to prevent old pages appearing as current.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed some extensions not being correctly detected as being registered for a Default Program.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed some extensions with blank descriptions on the Default Programs registration page.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Additional small internal improvements, optimizations, and interface adjustments.&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Crashes Fixed:&lt;/strong&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a crash when saving a new file type without an icon set.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Saving Autoplay settings after cancelling the creation of a new handler would cause a crash.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Clicking the Help button would sometimes result in a crash on some systems.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Attempting to install while another instance of the program was running caused a crash.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Selecting a new default verb sometimes caused a crash when saving changes to file.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Viewing certain file type descriptions sometimes caused a crash on the Extension Selection page.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- In certain cases, the program crashed when attempting to add or edit a context menu item where the destination registry key didn&amp;#8217;t yet exist.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Adding a new file type but not entering optional details caused a crash when saving changes to file.&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot;&gt;- Fixed a crash after clicking the Next button on the Default Programs selection page.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Holy cow! With the addition of DelegateExecute, DropTarget, and DDE support, Default Programs Editor is now the most powerful and easy to use file association utility on the planet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt; now at &lt;a href=&quot;http://defaultprogramseditor.com&quot;&gt;http://defaultprogramseditor.com&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://defaultprogramseditor.com&quot;&gt;&lt;/a&gt;&lt;strong&gt;Have an idea or feature request?&lt;/strong&gt; Put it on the feedback forum: &lt;a href=&quot;http://defaultprogramseditor.uservoice.com&quot;&gt;http://defaultprogramseditor.uservoice.com&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>FactorMystic</name>
			<uri>http://factormystic.net/blog</uri>
		</author>
		<source>
			<title type="html">Factor Mystic</title>
			<link rel="self" href="http://factormystic.net/blog/feed"/>
			<id>http://factormystic.net/blog/feed</id>
			<updated>2010-02-23T23:31:01+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Say Hello – Nasuni Launches Today!</title>
		<link href="http://feedproxy.google.com/~r/Jessenollercom/~3/SpQ2iwDU11M/"/>
		<id>http://jessenoller.com/?p=752</id>
		<updated>2010-02-09T13:35:03+00:00</updated>
		<content type="html">&lt;p&gt;&lt;img src=&quot;http://jessenoller.com/wp-content/uploads/2010/02/nasuni_final.png&quot; alt=&quot;nasuni_final.png&quot; border=&quot;0&quot; width=&quot;226&quot; height=&quot;62&quot; align=&quot;right&quot; /&gt; The company I&amp;#8217;ve worked for since July of last year &amp;#8211; &lt;a href=&quot;http://www.nasuni.com&quot; target=&quot;_blank&quot;&gt;Nasuni Corporation&lt;/a&gt; (a startup in Massachusetts) has gone live! This is the culmination of a lot of hard, but exceedingly fun and exciting work over the past months.&lt;/p&gt;
&lt;p&gt;The Nasuni team is an excellent one &amp;#8211; and one I am very, very proud to be a part of. Our product is called the Nasuni Filer &amp;#8211; a simple-to-use, versioned, encrypted and cloud-storage backed virtual NAS (network attached storage) server (click &lt;a href=&quot;http://www.nasuni.com/product/product-overview/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; for more information).&lt;/p&gt;
&lt;p&gt;Without going into all of the features, our goal in making this was to make cloud storage &lt;b&gt;simple&lt;/b&gt;, &lt;b&gt;accessible&lt;/b&gt; and &lt;b&gt;secure&lt;/b&gt; &amp;#8211; and I know we&amp;#8217;ve accomplished all three. All you do is download it, boot it and start using it &amp;#8211; once you do so you have access to truly unlimited storage. It&amp;#8217;s an unlimited filesystem for the cloud. Here&amp;#8217;s the elevator pitch:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
Nasuni has developed a virtual file server, called the Nasuni Filer, that delivers unlimited file storage and complete file protection for businesses. Working in partnership with leading cloud storage vendors, the Nasuni Filer leverages the vast capacity of the cloud to store and protect company files offsite, while retaining the local functionality and performance of a traditional NAS.&lt;/p&gt;
&lt;p&gt;This technology allows businesses to use the cloud provider of their choice as a replacement for traditional primary storage. Snapshots, file versioning, and offsite storage are integrated into the file server itself &amp;#8211; ensuring business file are safe and secure at all times. No need to manage complex backup and DR schemes &amp;#8211; if the file server is running, files are protected.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;We&amp;#8217;ve launched the &lt;a href=&quot;http://www.nasuni.com/free-trial/free-trial-registration/&quot; target=&quot;_blank&quot;&gt;Beta of the product&lt;/a&gt; today &amp;#8211; anyone can sign up, download and use it. Anyone can give us feedback and suggestions &amp;#8211; I encourage all of you who might need something like this to download and give it a try. If you want &amp;#8211; go check out the videos we&amp;#8217;ve put together &lt;a href=&quot;http://www.nasuni.com/support/how-videos/&quot; target=&quot;_blank&quot;&gt;showcasing the Filer&lt;/a&gt; (and better yet &amp;#8211; check out the awesome animated cartoon we have on the &lt;a href=&quot;http://www.nasuni.com/&quot; target=&quot;_blank&quot;&gt;front page&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Most of you know that my blog is mainly Python oriented. Suffice it to say, Nasuni &amp;#8211; and the Nasuni Filer make use of Python for a wide range of tasks. We use Python, Django and as much of the Python ecosystem as we can to drive everything from the website, to the GUI on the appliance itself &amp;#8211; Python is part of the DNA of the company, and it has served us well. Without Open Source and Python &amp;#8211; I don&amp;#8217;t think it would have been possible to build what we have built in as little time as we have.&lt;/p&gt;
&lt;p&gt;We have a strong dedication to not just Python, but open source in general (and a fair number of us will be at PyCon this month).  As time progresses, now that we&amp;#8217;re exiting stealth mode we plan on possibly open sourcing stuff we feel would benefit the community. Some of us already push patches back where and when we can, but as I said &amp;#8211; as time progresses this involvement will only increase.&lt;/p&gt;
&lt;p&gt;So not only am I proud to announce the product, be part of this team and to see what we&amp;#8217;ve made, I&amp;#8217;m also happy to thank so many people in the Python and OSS community which have helped us reach this point.&lt;/p&gt;
&lt;p&gt;So go &amp;#8211; &lt;a href=&quot;http://www.nasuni.com/&quot; target=&quot;_blank&quot;&gt;check it out&lt;/a&gt;, let us know what you think.&lt;/p&gt;</content>
		<author>
			<name>m0nk3yz</name>
			<uri>http://jessenoller.com</uri>
		</author>
		<source>
			<title type="html">jessenoller.com</title>
			<subtitle type="html">python, programming and other things</subtitle>
			<link rel="self" href="http://jessenoller.com/feed/"/>
			<id>http://jessenoller.com/feed/</id>
			<updated>2010-02-28T17:30:10+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Threading woo!</title>
		<link href="http://blake8086.blogspot.com/2010/01/threading-woo.html"/>
		<id>tag:blogger.com,1999:blog-5195382480858168001.post-2582494867989044180</id>
		<updated>2010-01-30T00:01:18+00:00</updated>
		<content type="html">Fixed an annoying UI bug where UI updates done outside the main thread fail to update until an event propagates into the main thread.  Now a user can &quot;login&quot; to the game.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5195382480858168001-2582494867989044180?l=blake8086.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Blake Householder</name>
			<email>noreply@blogger.com</email>
			<uri>http://blake8086.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">angryinterface</title>
			<subtitle type="html">Bad interfaces make us angry.  We love a good interface.</subtitle>
			<link rel="self" href="http://blake8086.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5195382480858168001</id>
			<updated>2010-03-10T21:30:16+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Woo ski trip!</title>
		<link href="http://blake8086.blogspot.com/2010/01/woo-ski-trip.html"/>
		<id>tag:blogger.com,1999:blog-5195382480858168001.post-1602703874048031596</id>
		<updated>2010-01-27T22:25:03+00:00</updated>
		<content type="html">I finally got back into development after a long bunch of trips and wedding planning.&lt;br /&gt;&lt;br /&gt;Now my app has the beginnings of a UI.  All I have to write is 50 other things and it will be working!&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5195382480858168001-1602703874048031596?l=blake8086.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Blake Householder</name>
			<email>noreply@blogger.com</email>
			<uri>http://blake8086.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">angryinterface</title>
			<subtitle type="html">Bad interfaces make us angry.  We love a good interface.</subtitle>
			<link rel="self" href="http://blake8086.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5195382480858168001</id>
			<updated>2010-03-10T21:30:16+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Alpha 2 ISO Testing begins</title>
		<link href="http://yokozar.org/blog/archives/184"/>
		<id>http://yokozar.org/blog/?p=184</id>
		<updated>2010-01-13T21:40:28+00:00</updated>
		<content type="html">&lt;p&gt;So here&amp;#8217;s the deal: you want to help contribute to Ubuntu in some small way but don&amp;#8217;t want to make much effort or risk your &amp;#8220;real&amp;#8221; computer.  Enter &lt;em&gt;ISO Testing&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Basically, you burn a disk and attempt to install.  If it works, you click a box, and if it doesn&amp;#8217;t, you click another and file a bug.  If the installer finished but turned everything pink and that&amp;#8217;s not really your thing, don&amp;#8217;t check the box for &amp;#8220;serious&amp;#8221;.&lt;/p&gt;
&lt;p&gt;This is one of the best ways of helping Ubuntu that doesn&amp;#8217;t actually involve using it.  So if you have a spare computer, partition, or even VM you can basically spend about 30 minutes after downloading and submit a good test report.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;To get started:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go &lt;a title=&quot;ISO tracker&quot; href=&quot;http://iso.qa.ubuntu.com/qatracker/&quot;&gt;here&lt;/a&gt; and make an account and then click about 4 buttons.  There&amp;#8217;s even a &amp;#8220;I&amp;#8217;ve started a test so others can try something else&amp;#8221; feature.&lt;/li&gt;
&lt;li&gt;A fuller explanation is at &lt;a title=&quot;ISO testing wiki page&quot; href=&quot;https://wiki.ubuntu.com/Testing/ISO/Procedures&quot;&gt;the wiki page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Once enough people give successful ISO test reports, the Alpha is released and the coolest of us can start general testing.  That&amp;#8217;s where you actually use the installed system and test all the experimental new features like being slightly less brown.  But before that can happen, testers need to know they can install and update without hassle &amp;#8211; the daily CDs are frequently unbootable for one reason or another, so that means the alpha CDs need to be good enough to install from.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Also, here is a picture of my cat:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;alignnone&quot; title=&quot;Buddy sleeping on bed and laundry&quot; src=&quot;http://yokozar.org/blog/content/buddy-bed-sleep.jpg&quot; alt=&quot;&quot; width=&quot;600&quot; height=&quot;450&quot; /&gt;&lt;/p&gt;</content>
		<author>
			<name>ShadowHawk</name>
			<uri>http://yokozar.org/blog</uri>
		</author>
		<source>
			<title type="html">YokoZar's Writings » Planet Ubuntu</title>
			<subtitle type="html">A blog about Ubuntu, Wine, and the occasional other interest</subtitle>
			<link rel="self" href="http://yokozar.org/blog/archives/tag/planet-ubuntu/feed"/>
			<id>http://yokozar.org/blog/archives/tag/planet-ubuntu/feed</id>
			<updated>2010-03-11T20:30:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Unladen Swallow: Python 3’s Best Feature.</title>
		<link href="http://feedproxy.google.com/~r/Jessenollercom/~3/LdQdxd4FhxE/"/>
		<id>http://jessenoller.com/?p=737</id>
		<updated>2010-01-07T02:58:43+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://jessenoller.com/wp-content/uploads/2010/01/holy-shit-awesome-2.jpg&quot;&gt;&lt;img src=&quot;http://jessenoller.com/wp-content/uploads/2010/01/holy-shit-awesome-2.jpg&quot; alt=&quot;holy-shit-awesome-2.jpg&quot; border=&quot;0&quot; width=&quot;350&quot; height=&quot;240&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;We all know (well &amp;#8211; unless you&amp;#8217;ve under a rock) about &lt;a href=&quot;http://code.google.com/p/unladen-swallow/&quot; target=&quot;_blank&quot;&gt;Unladen-Swallow&lt;/a&gt;, the semi-Google-Sponsored optimization-focused branch of Python 2.x. Collin, Jeffrey and many others have been working tirelessly on porting the CPython interpreter over to LLVM, applying optimization patches, writing &lt;a href=&quot;http://code.google.com/p/unladen-swallow/wiki/Testing&quot; target=&quot;_blank&quot;&gt;tests&lt;/a&gt;, etc all aimed at speeding up &lt;a href=&quot;http://code.google.com/p/unladen-swallow/wiki/Benchmarks&quot; target=&quot;_blank&quot;&gt;real-world&lt;/a&gt; operations and code since before last year&amp;#8217;s PyCon &amp;#8211; at that time, the first release was already working hard, rendering YouTube&amp;#8217;s templates. (See the &lt;a href=&quot;http://code.google.com/p/unladen-swallow/wiki/ProjectPlan&quot; target=&quot;_blank&quot;&gt;Project Plan&lt;/a&gt; for more information)&lt;/p&gt;
&lt;p&gt;You probably also saw the 2009Q3 testing/performance results (&lt;a href=&quot;http://code.google.com/p/unladen-swallow/wiki/Release2009Q3&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;), showing a hefty speed increase for various operation. The 2009Q4 will be coming soon.&lt;/p&gt;
&lt;p&gt;What you probably don&amp;#8217;t know &amp;#8211; yet, is that a PEP is coming, proposing Unladen Swallow be merged back to Python-core &amp;#8211; specifically, the Python 3k branch. Yeah, that&amp;#8217;s right &amp;#8211; a PEP to merge Unladen Swallow back into the mothership, but to Py3k &lt;b&gt;only&lt;/b&gt;. Talk about a shot in the arm!&lt;/p&gt;
&lt;p&gt;Quoting Collin Winter:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
Python 3 is the natural place for something like Unladen Swallow to land: Python 3 is clearly the future, and I think improved performance will be a strong selling point in the language&amp;#8217;s favor. What we and others have done for Python 2 applies directly to Python 3.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;#8230;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
One of the things we&amp;#8217;ve really focused on with Unladen Swallow is creating a solid foundation that the wider CPython developer community can build on top of. We&amp;#8217;ve fixed some nasty problems in the x86-64 JIT, for example, so that the CPython community can focus on the fun stuff &amp;#8212; more optimizations! Having the basic JIT infrastructure in place and well-tested opens up a world of opportunities that didn&amp;#8217;t exist before.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;#8230;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
I think PyPy&amp;#8217;s focus on research is incredibly valuable. Unladen Swallow has always been about, &amp;#8220;what can we achieve right now?&amp;#8221; One of our guiding principles has been, Do nothing original, don&amp;#8217;t be innovative. PyPy is looking 10 years down the road and thinking, What can we do if we question everything? I think having those different perspectives is important to the community. So, no, I don&amp;#8217;t see us in competition (with PyPy) at all.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;There&amp;#8217;s been a lot of talk about how slow adoption of 3k has been &amp;#8211; a backwards incompatible implementation of a widely used language will always have slow(er) adoption then releases of the same language, backwards compatible &amp;#8211; but I&amp;#8217;d argue that to an extent, part of the reason is that there &amp;#8220;haven&amp;#8217;t been enough carrots&amp;#8221; in the Py3k cart to provide enough of an incentive for projects, libraries, etc to move to it at an accelerated rate.&lt;/p&gt;
&lt;p&gt;This, well &amp;#8211; this changes things. A significantly faster interpreter, a more rational GIL thanks to &lt;a href=&quot;http://mail.python.org/pipermail/python-dev/2009-October/093321.html&quot; target=&quot;_blank&quot;&gt;Antoine Pitrou&lt;/a&gt; &amp;#8211; these are the improvements to Python 3 which make it the perfect target to aim for for new projects and libraries. It should drastically help provide the impetus for larger libraries to move over. Things like these are exactly why something like the &lt;a href=&quot;http://jessenoller.com/2009/12/04/pythons-moratorium-lets-think-about-this/&quot; target=&quot;_blank&quot;&gt;moratorium&lt;/a&gt; make sense, efforts can be focused on the ecosystem of python outside of the syntax, on the interpreter, the standard library, etc.&lt;/p&gt;
&lt;p&gt;This is huge; and with a little luck, a lot of discussion and debate &amp;#8211; and a ton of work, by the end of 2010, we&amp;#8217;ll have not only the best implementation of Python, as a language to date in Python 3 &amp;#8211; but the best interpreter as well.&lt;/p&gt;
&lt;p&gt;The PEP should go out for review soon, probably within the next two weeks &amp;#8211; and more details/information will be coming out at &lt;a href=&quot;http://us.pycon.org/2010/about/&quot; target=&quot;_blank&quot;&gt;PyCon&lt;/a&gt; in February (you&amp;#8217;re coming, right?!).&lt;/p&gt;
&lt;p&gt;Also see Michael Foord&amp;#8217;s &lt;a href=&quot;http://www.voidspace.org.uk/python/weblog/arch_d7_2010_01_02.shtml&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt; about this news too.&lt;/p&gt;</content>
		<author>
			<name>m0nk3yz</name>
			<uri>http://jessenoller.com</uri>
		</author>
		<source>
			<title type="html">jessenoller.com</title>
			<subtitle type="html">python, programming and other things</subtitle>
			<link rel="self" href="http://jessenoller.com/feed/"/>
			<id>http://jessenoller.com/feed/</id>
			<updated>2010-02-28T17:30:10+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">The future of Wine sound</title>
		<link href="http://yokozar.org/blog/archives/178"/>
		<id>http://yokozar.org/blog/?p=178</id>
		<updated>2009-12-24T14:38:23+00:00</updated>
		<content type="html">&lt;p&gt;Sound in Wine has been a big issue.  From a user&amp;#8217;s perspective, it didn&amp;#8217;t work well.  From a technical user&amp;#8217;s perspective, there were 3 different drivers to choose from and none of them worked well.  From a developer&amp;#8217;s perspective, no sound driver would ever work well.&lt;/p&gt;
&lt;p&gt;Wine was a victim of the proliferation of sound drivers on Linux.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;aligncenter&quot; title=&quot;Linux Audio Jungle&quot; src=&quot;http://yokozar.org/blog/content/linuxaudio.png&quot; alt=&quot;&quot; width=&quot;674&quot; height=&quot;438&quot; /&gt;&lt;/p&gt;
&lt;p&gt;At one point, Wine had separate sound drivers for ARTS, ESD, OSS, JACK, and ALSA.  None of them worked right, even if the user could figure out how to configure Wine to use the &amp;#8220;correct&amp;#8221; one.  Subtle changes to each API and differences between distribution versions made matters even worse.&lt;/p&gt;
&lt;p&gt;PulseAudio was supposed to be a solution to problems like this by being the one true Linux Sound System, but in some ways it made the problem worse.  Now Wine needed a separate PulseAudio sound driver, and no one wanted to write sound driver code since the whole thing was a big mess to begin with.  Worse, the most work had gone into making the ALSA driver better, and there were a few technical reasons why it seemed like a good choice to stick with ALSA and use it as a default.&lt;strong&gt;*&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So, the decision was made to go with ALSA and improve it a bit, and hope that PulseAudio&amp;#8217;s ALSA-compatibility layer would work well enough.  That didn&amp;#8217;t exactly happen &amp;#8211; PulseAudio didn&amp;#8217;t actually want to support some &amp;#8220;abuses&amp;#8221; of the ALSA API, as one dev put it.  Some users took to killing PulseAudio outright every time they wanted to use Wine.&lt;/p&gt;
&lt;p&gt;Things got a bit political.  Was Wine at fault here, or PulseAudio?  Should Wine include a PulseAudio driver, even if it was poorly maintained?  What would the default be?  Also, what the &lt;em&gt;hell&lt;/em&gt; were we gonna do about the Mac?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The solution, which in retrospect is pretty obvious&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Wine wasn&amp;#8217;t the only program facing this problem.  Anyone writing or porting a Linux game had to answer the question about how they would play sound &amp;#8211; almost none chose to write 7 separate audio drivers.  Instead they all did the smart thing, and used a higher level library.&lt;/p&gt;
&lt;p&gt;So, that&amp;#8217;s the plan &amp;#8211; Wine will use a sound library.  And then we&amp;#8217;ll let &lt;em&gt;them&lt;/em&gt; worry about actually talking to whatever sound system happens to be working best.  OpenAL is the smart choice here, for much the same reason that OpenGL was the smart choice for graphics.  We get Mac compatibility &amp;#8220;for free&amp;#8221; too.&lt;/p&gt;
&lt;p&gt;Now, why didn&amp;#8217;t this happen earlier?  Well, in fairness to Wine, OpenAL didn&amp;#8217;t actually exist in a usable form until Wine already had sound drivers for a few years.  A similar thing happened with wikis and distributed version control systems &amp;#8211; we eventually saw the light that &lt;em&gt;new&lt;/em&gt; open source projects had been following for years, and the project is better because of it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;*&lt;/strong&gt; As I understand it, a lot of Windows programs expected to be very close to the hardware and at the time many users were having issues with PulseAudio latency.&lt;/p&gt;</content>
		<author>
			<name>ShadowHawk</name>
			<uri>http://yokozar.org/blog</uri>
		</author>
		<source>
			<title type="html">YokoZar's Writings » Planet Ubuntu</title>
			<subtitle type="html">A blog about Ubuntu, Wine, and the occasional other interest</subtitle>
			<link rel="self" href="http://yokozar.org/blog/archives/tag/planet-ubuntu/feed"/>
			<id>http://yokozar.org/blog/archives/tag/planet-ubuntu/feed</id>
			<updated>2010-03-11T20:30:19+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">I want your awesome python snippets.</title>
		<link href="http://feedproxy.google.com/~r/Jessenollercom/~3/Q-uHiArYDEU/"/>
		<id>http://jessenoller.com/?p=734</id>
		<updated>2009-12-19T14:52:26+00:00</updated>
		<content type="html">&lt;p&gt;I&amp;#8217;m building (and will eventually post someplace) a collection of the cooler Python snippets I dredge up. I&amp;#8217;m looking for snippets which are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Short
&lt;li&gt; New-to-Python accessible
&lt;li&gt; Showcase the best ideas of python &amp;#8211; clean, simple, powerful.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The goal is to build up a small pile of code snippets that programming newbies, or programmers from other languages can look at and go &amp;#8220;wow, I got to get me some of that&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Anything is game; feel free to post them in the comments, on pastebin (obviously post the link), etc. &lt;/p&gt;</content>
		<author>
			<name>m0nk3yz</name>
			<uri>http://jessenoller.com</uri>
		</author>
		<source>
			<title type="html">jessenoller.com</title>
			<subtitle type="html">python, programming and other things</subtitle>
			<link rel="self" href="http://jessenoller.com/feed/"/>
			<id>http://jessenoller.com/feed/</id>
			<updated>2010-02-28T17:30:10+00:00</updated>
		</source>
	</entry>

</feed>
