<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nolancaudill.com &#187; code</title>
	<atom:link href="http://nolancaudill.com/index.php/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://nolancaudill.com</link>
	<description>thoughts and whatnot</description>
	<lastBuildDate>Wed, 18 Nov 2009 03:47:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Shipping Software</title>
		<link>http://nolancaudill.com/index.php/2009/07/15/shipping-software/</link>
		<comments>http://nolancaudill.com/index.php/2009/07/15/shipping-software/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 02:03:56 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=188</guid>
		<description><![CDATA[Shipping ordinary software on time is damned hard. Shipping great software in any time frame is extraordinary. Shipping great software on time is the rarest of earthly delights. &#8211; Jim McCarthy, Dynamics of Software Development I received my copy of Dynamics of Software Development by Jim McCarthy in the mail today, and this quote was [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Shipping ordinary software on time is damned hard. Shipping great software in any time frame is extraordinary. Shipping great software on time is the rarest of earthly delights.<br />
&#8211; Jim McCarthy, <span style="text-decoration: underline;">Dynamics of Software Development</span></p></blockquote>
<p>I received my copy of <span style="text-decoration: underline;">Dynamics of Software Development</span> by Jim McCarthy in the mail today, and this quote was just sitting there on the first page.</p>
<p>I&#8217;ve shipped great software on time and I&#8217;ve shipped ordinary software late. This inconsistency to a logic-driven mind is maddening. I think I&#8217;m fairly decent at writing code, but getting the whole process to a point of repeatable success from a business standpoint is what I&#8217;m in the dark on.</p>
<p>Though my computer science education was fantastic in teaching me about logic and theory, the nuts and bolts of software engineering is something I am lacking. There was a software engineering course offered but I opted for the programming language design course, instead. I don&#8217;t regret that decision&#8211;I love programming languages&#8211;but  in the world of waiting customers and deadlines that come much too quickly, I&#8217;m having to play catch up.</p>
<p>So for now, it&#8217;s time to hit the books.</p>
<p><a href="http://nolancaudill.com/wp-content/uploads/2009/07/dilbert.gif"><img class="aligncenter size-full wp-image-191" title="Dilbert" src="http://nolancaudill.com/wp-content/uploads/2009/07/dilbert.gif" alt="Dilbert" width="500" height="152" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/07/15/shipping-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 will never go away (it seems)</title>
		<link>http://nolancaudill.com/index.php/2009/07/02/ie6-will-never-go-away-it-seems/</link>
		<comments>http://nolancaudill.com/index.php/2009/07/02/ie6-will-never-go-away-it-seems/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:35:58 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[browsers]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=171</guid>
		<description><![CDATA[The Yahoo! User Interface team updated their Graded Browser Support and IE6 is still alive as an A-grade browser, and that doesn&#8217;t appear to be changing anytime soon. The Graded Brower Support, or GBS, is the categorization of browsers into different levels that Yahoo! has agreed to support. An A-grade ranking means that the browser [...]]]></description>
			<content:encoded><![CDATA[<p>The Yahoo! User Interface team <a href="http://yuiblog.com/blog/2009/07/02/gbs-update-20090702/">updated</a> their <a href="http://developer.yahoo.com/yui/articles/gbs/">Graded Browser Support</a> and IE6 is still alive as an A-grade browser, and that doesn&#8217;t appear to be changing anytime soon.</p>
<div id="attachment_173" class="wp-caption aligncenter" style="width: 391px"><a href="http://developer.yahoo.com/yui/articles/gbs/"><img class="size-full wp-image-173" title="Yahoo! Graded Browser Support" src="http://nolancaudill.com/wp-content/uploads/2009/07/gbs.png" alt="Yahoo! Graded Browser Support" width="381" height="309" /></a><p class="wp-caption-text">Yahoo! Graded Browser Support</p></div>
<p style="text-align: center;">
<p>The Graded Brower Support, or GBS, is the categorization of browsers into different levels that Yahoo! has agreed to support. An A-grade ranking means that the browser has a large enough user base, and that those browsers will receive Yahoo!&#8217;s highest level of QA and testing support, while the other levels receive little to none. This doesn&#8217;t mean that Yahoo! sites (or sites that use the <a href="http://developer.yahoo.com/yui/">YUI tools</a>) will be broken in non A-grade browsers, it&#8217;s just that they won&#8217;t be QAed as thoroughly. Usually these fringe browsers like Chrome and Opera are <em>more</em> compliant to standards, and work automatically with valid HTML, CSS, and JavaScript. They don&#8217;t get the A-grade yet, mainly due to their small user base.</p>
<p>IE6 is still an A-grade browser, while they have plans to move browsers like Firefox 3.0 to <span style="text-decoration: line-through;">C-grade</span> X-grade status by the end of the year. This is amazing. For comparison, Firefox 3.0 came out about a year ago (ie, June 17, 2008), while IE6 came out in August <strong><em>2001</em></strong>. When IE6 was released, the WTC towers were still standing, no one had seen any of Lord of the Rings or Harry Potter movies, George Harrison was still alive, and it remained to be seen what kind of president George W. Bush was going to be. If IE6 was a human, it would be starting the 3rd grade soon. To put it in web terms, this was 4 years before the first video was uploaded to YouTube, 2.5 years before anyone Facebooked anyone, and even 3 years before Google went public. The browser&#8217;s been out awhile.</p>
<div id="attachment_174" class="wp-caption aligncenter" style="width: 306px"><a href="http://nolancaudill.com/wp-content/uploads/2009/07/2001_A_Space_odyssey.gif"><img class="size-full wp-image-174" title="2001_A_Space_odyssey" src="http://nolancaudill.com/wp-content/uploads/2009/07/2001_A_Space_odyssey.gif" alt="2001: An Ancient Web Browser" width="296" height="442" /></a><p class="wp-caption-text">2001: An Ancient Web Browser</p></div>
<p>The fact that Yahoo! has still shown a commitment to ensure that IE6 users get the best experience that Yahoo! can give them means two things — there are a still a lot of IE6 users and the company still makes money off of them. <a href="http://news.cnet.com/Firefox-users-ignore-online-ads,-report-says/2100-1024_3-5479800.html">This study</a> done 5 years ago (though still 3 years after IE6 came out) reported that IE users were 4 times more likely to click an online ad than Firefox users. Since Yahoo! is still courting to IE6 users, this must mean that those users are <em>still</em> clicking those ads.</p>
<p>At some point, Yahoo! and the web as a whole will have to drop their A-grade support for IE6. HTML5 and CSS3 are now ready to be consumed with Firefox 3.5, Safari 4, and Chrome 2.0 all available for download. This doesn&#8217;t mean that developers and designers have to completely break the web for IE6 users, but maybe these users don&#8217;t get the full experience that the new browsers can deliver. We can do what we can for the IE6 users, but also allow the newer browsers to take advantage of the new, exciting things.</p>
<p>I like the analogy that YUI has on their browser support page comparing the different browsers to televisions. You have TVs that handle the incoming signal differently, starting with hand-cranked survival radios that only pick up the audio, to black-and-white TVs, all the way to the 1080p Hi-Defs with millions of colors and surround sound. The broadcast stations send out the signal and your TV handles it as best as it can. No one is surprised when a black-and-white TV doesn&#8217;t have color and IE6 users shouldn&#8217;t be surprised that their favorite website doesn&#8217;t look the same as when seen in Firefox. As stated on the GBS page, &#8220;[s]upport does not mean that everybody gets the same thing.&#8221; This is a hard fact to digest for companies with a web presence and designers that believe in one true version of their art.</p>
<div id="attachment_177" class="wp-caption aligncenter" style="width: 410px"><a href="http://nolancaudill.com/wp-content/uploads/2009/07/Television.jpg"><img class="size-full wp-image-177" title="Television" src="http://nolancaudill.com/wp-content/uploads/2009/07/Television.jpg" alt="Hi-Def, 60's style." width="400" height="434" /></a><p class="wp-caption-text">Hi-Def, 60&#39;s style.</p></div>
<p style="text-align: center;">
<p>So, why don&#8217;t IE6 users upgrade their browsers? Simple — they don&#8217;t know what a browser is. <a href="http://www.youtube.com/watch?v=o4MwTvtyrUQ">This video</a> asks random people the simple question &#8220;what is a browser?&#8221;. The people they ask get the answer (sometimes hilariously) wrong, but these people are not stupid. It&#8217;s just that what browser they use is not important to them. All they care about are the sites they can access with it. And you know what, <em>they&#8217;re 100% right</em>. It <em>is</em> just about the web. The reason that web developers and designers are so passionate about browsers is that we are trying our damnedest to make the most forward-thinking, interactive, immersive sites for these people, but we can&#8217;t. IE6 &#8212; and its large market share &#8212; won&#8217;t let us.</p>
<p>Good news though is that I think this will change soon and IE6 will be nudged to the door by its own creator, Microsoft. The reason that people still use IE6 is because it was already installed on their Windows machines, so the browser changes when Microsoft says it does. Microsoft will soon see what Google saw when Google decided to build Chrome. Google owns the web, and Microsoft owns the browser. Google wanted a piece of that browser pie, as it meant that more people would be enjoying the web in its full capacity, so they created a browser. Microsoft saw this plan and realized if they wanted a slice of the web market they were going to need to put a real contender  into the search market (sorry, MSN), and thus Bing was born.</p>
<p>If Bing takes off, and I honestly think it will, the incentive will be there for Microsoft to really encourage their users to take advantage of the newest version of IE, and finally put IE6 out to pasture.</p>
<p>* Few small edits for clarity.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/07/02/ie6-will-never-go-away-it-seems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Truth about Software</title>
		<link>http://nolancaudill.com/index.php/2009/06/25/truth-about-software/</link>
		<comments>http://nolancaudill.com/index.php/2009/06/25/truth-about-software/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:10:46 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=159</guid>
		<description><![CDATA[I spend a lot of my time thinking about software develoment, keeping up with what works for other people and what works for me. I&#8217;ve recently read Peopleware and Code Complete, and I&#8217;ve formulated some thoughts about software development and technical management that I&#8217;ve been meaning to write about. Hopefully, this copy-and-paste will get me [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 8px; margin-bottom: 0px;">I spend a lot of my time thinking about software develoment, keeping up with what works for other people and what works for me. I&#8217;ve recently read <span style="text-decoration: underline;">Peopleware</span> and <span style="text-decoration: underline;">Code Complete</span>, and I&#8217;ve formulated some thoughts about software development and technical management that I&#8217;ve been meaning to write about. Hopefully, this copy-and-paste will get me going with that.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">I found this printed out on <a href="http://news.ycombinator.com/item?id=673737">Hacker News</a>, and I think there is a lot of truth in it about the perceptions of software and its development.</p>
<blockquote>
<p style="margin-top: 8px; margin-bottom: 0px;">The problem with IT, generally, is lack of respect. Because it&#8217;s something that looks easy and looks like something anyone could do, people don&#8217;t respect experience and talent.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">For some reason this just doesn&#8217;t work in other fields. While everyone feels they can put a sticking plaster on a cut, they go to a doctor for more serious stuff. Any fool can build a garden wall, but if they want a tower block one hires an architect and a construction company and lets them do decisions.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">Whereas, it&#8217;s quite common in IT for micromanagers to overrule the professionals.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">It doesn&#8217;t happen in building. Managers simply aren&#8217;t allowed to say things like &#8220;Oh, I don&#8217;t think we should RSJs in those load bearing walls&#8221;. If the architect says they&#8217;re needed, then they go in. We also don&#8217;t hire doctors by picking the tools they&#8217;ll use. When you want a doctor to take out an appendix, you want a qualified general surgeon. You don&#8217;t ask them whether they prefer a #3 or a #4 handle on their scalpels.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">And yet it&#8217;s pretty common to see projects which have picked a technology first (&#8220;Oh we&#8217;re going to use J2EE for this&#8221;) and THEN hire the team around that (&#8220;Wanted, tech arch, 5 years exp with J2EE, C , C++, JAVA, Perforce, Apache, Perl, Python.&#8221;) and only at that point produce the spec. And then if the job isn&#8217;t one the technology is suited for, that ends up being the developers fault and they&#8217;re the ones who work overtime to put that square peg in the round hole.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">It&#8217;s scarcely surprising that a) almost nothing works properly, b) there&#8217;s constant chaos and that therefore c) almost no-one finds their work rewarding in ways other than money.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">I freely admit that a lot of my time, I feel like some sort of thief. I sit in projects which are doomed. They&#8217;re more doomed than a plane that&#8217;s lost both wings and is on fire. I see the people around the project running about setting more of it on fire as it hurtles towards the ocean and removing more control surfaces and making it worse. And I watch developers switch in and out of seats as we trail wreckage and smoke down. And it&#8217;s always been like this. The project is a free-fall disaster before I join and after I leave and there&#8217;s just nothing, nothing, nothing I can do to rescue it at that point in time. And yet I&#8217;m being paid to be there.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">And I feel bad about that. I feel that I ought to be being paid to achieve something. But usually I&#8217;m just being paid to sit in a seat in a vehicle performing a ballistic trajectory straight into its crash site. And even if I quit then the next thing will be the same and whoever takes my place in this seat will be in the same situation.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">And this is not how I wanted to work. I wanted to build things that people wanted. Not turn up at an aircrash and fill a seat in it for a while. And while it&#8217;s financial fulfilling, it&#8217;s not very emotionally fulfilling.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">Most bridges don&#8217;t fall down. Most patients don&#8217;t die. Most IT projects are a failure in one way or another. It&#8217;s like being a surgeon back in the days before anaesthetics or antibiotics. Most of our patients die&#8230; and that&#8217;s got to be bad for morale.</p>
<p style="margin-top: 8px; margin-bottom: 0px;">And I can&#8217;t help but think that this really has its roots in the fact that people think software is simple enough that they can exercise control over it at a level they ought not to be and that they also don&#8217;t want to pay what it actually costs. Architects generally don&#8217;t compete on price and you don&#8217;t get to tell architects that their idea of how strong structural steel is is an underestimate you can feel you can ignore in this project. But people time and time and time again pick the cheapest option for software, design it like they&#8217;d design a tin shack and then act surprised when the end results turns out to be flimsy tin shack instead of a tower block.</p>
</blockquote>
<p style="margin-top: 8px; margin-bottom: 0px;"><span style="color: #000000;">Originally from <a href="http://discuss.joelonsoftware.com/default.asp?joel.3.762361.7">http://discuss.joelonsoftware.com/default.asp?joel.3.762361.7</a>, it appears.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/06/25/truth-about-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How many fume cupboards are needed?</title>
		<link>http://nolancaudill.com/index.php/2009/06/08/how-many-fume-cupboards-are-needed/</link>
		<comments>http://nolancaudill.com/index.php/2009/06/08/how-many-fume-cupboards-are-needed/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 01:36:27 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=150</guid>
		<description><![CDATA[I&#8217;ve recently been brushing up on my statistics by reading Principles of Statistics by M.G. Bulmer. I came across a problem and since I wrote some code to check my answer, I figured I&#8217;d post it with a short discussion about the answer. First, the question: In a certain survey of the work of chemical [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been brushing up on my statistics by reading <span style="text-decoration: underline;">Principles of Statistics</span> by M.G. Bulmer. I came across a problem and since I wrote some code to check my answer, I figured I&#8217;d post it with a short discussion about the answer.</p>
<p>First, the question:</p>
<p style="padding-left: 30px;">In a certain survey of the work of chemical research workers, it was found, on the basis of extensive data, that on average each man required no fume cupboard for 60 per cent of his time, one cupboard for 30 per cent and two cupboards for 10 per cent; three or more were never required. If a group of four chemists worked independently  of one another, how many fume cupboards should be availabe in order to provode adequate facilities for at least 95 per cent of the time?</p>
<p>My line of thinking to solve this was to find every combination of the 4 chemists needing 0, 1, or 2 cupboards, the probability of each of those combinations happening, and finally summing up the probability of all the hoods needed.</p>
<p>For example, out of the 81 different possible combinations of cupboards required (3 * 3 * 3* 3, with the 3 coming from 0, 1, or 2 hoods needed), there is only one way where 0 hoods are needed in total and this is where all 4 chemists need no cupboards. Following this, there are 4 ways to have 1 hood total be required, with each of the chemists exclusively requiring a cupboard and the other three needing none (1, 0, 0, 0 &amp; 0, 1, 0, 0 &amp; 0, 0, 1, 0 &amp; 0, 0, 0, 1).</p>
<p>So having one cupboard covers the probability of needing no cupbards amongst the 4 PLUS the probability of needing 1 cupboard amongst the 4.</p>
<p>I first did this problem long-handed, figuring out the probability of 0, 1, 2, and so on cupboards until I got to a sum that had a probability &gt; 0.95. I was making a simple arithmetic error (as usual) and my answer was not matching up with what was in the back of the book, so I thought I would write a simple program to calculate the answer since I was confident in what I was trying to do, but was just having trouble multiplying and adding.</p>
<p>Here&#8217;s the Python script I wrote (note: you need Python &gt;= 2.6 as I use itertools.product to recreate all the combinations of cupboards needed).</p>
<p>The output is the summing of each of the probability of needing 0 cupboards + 1 cupboard + 2 cupboards and so on. The line with the probablity greater than 0.95 is the answer. In this the case, the answer was 4, which would cover the chemists&#8217; needs 95.85 percent of the time.</p>
<pre>
<pre class="brush: python">
from collections import defaultdict
import itertools

probs = {
    &#039;0&#039;: 0.6,
    &#039;1&#039;: 0.3,
    &#039;2&#039;: 0.1
}

trials = itertools.product(&#039;012&#039;, repeat=4)

totals = defaultdict(float)

for trial in trials:
    #how many hoods needed in this trial
    trial_sum = sum(map(lambda x: int(x), trial))

    #figure probability of exact trial occurring
    total_prob = 1.0
    for item in trial:
        total_prob *= probs[item]

    #add probability of trial to total prob for this number of hoods needed
    totals[trial_sum] += total_prob

#print out all probabilities
keys = totals.keys()
keys.sort()

running_prob = 0.0

for i in keys:
    running_prob += totals[i]
    print i, running_prob * 100
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/06/08/how-many-fume-cupboards-are-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>twitter-last-status</title>
		<link>http://nolancaudill.com/index.php/2009/04/23/twitter-last-status/</link>
		<comments>http://nolancaudill.com/index.php/2009/04/23/twitter-last-status/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:15:13 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=146</guid>
		<description><![CDATA[It was a night of firsts. I wrote my first Twitter widget. It is the &#8216;Latest Tweet&#8217; widget on the far right column of the page that uses Twitter&#8217;s public JSONP API to pull in my last Twitter update. The only thing even mildly interesting is that it has a couple of regexes that finds [...]]]></description>
			<content:encoded><![CDATA[<p>It was a night of firsts.</p>
<p>I wrote my first Twitter widget. It is the &#8216;Latest Tweet&#8217; widget on the far right column of the page that uses Twitter&#8217;s public JSONP API to pull in my last Twitter update.</p>
<p>The only thing even mildly interesting is that it has a couple of regexes that finds any &#8216;@&#8217; names and links them up and (naively) hooks up any hyperlinks as well. These weren&#8217;t difficult, but they always take a little bit of tinkering to get right.</p>
<p>More excitingly, I think, is that I decided to push it out to <a href="http://github.com/mncaudill/twitter-last-status/tree/master">github</a> under a BSD license. This is technically my first open source software, minor as it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/04/23/twitter-last-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SICP and Lulu.com</title>
		<link>http://nolancaudill.com/index.php/2009/03/13/sicp-and-lulucom/</link>
		<comments>http://nolancaudill.com/index.php/2009/03/13/sicp-and-lulucom/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:50:21 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lulu]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sicp]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=121</guid>
		<description><![CDATA[I&#8217;ve been wanting to read SICP for awhile, but with lots of other books on my to-read list, as well as the $50 dollar price tag for a used copy, I&#8217;ve put it on hold. The price, while relatively steep, usually doesn&#8217;t stop me from picking up a highly-desired book, but I held off mainly [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to read <a href="http://mitpress.mit.edu/sicp/">SICP</a> for awhile, but with lots of other books on my to-read list, as well as the $50 dollar price tag for a used copy, I&#8217;ve put it on hold. The price, while relatively steep, usually doesn&#8217;t stop me from picking up a highly-desired book, but I held off mainly as the book is freely available on their website, under the Creative Commons Attribution-Noncommercial license and this seems like a lot to pay for a free-as-in-beer book.</p>
<p>Since SICP runs close to 600 printed pages and approximately 40 HTML files , I&#8217;d rather not read it in my browser and printing it on the home printer is not really an option. I decided that using <a href="http://lulu.com">Lulu</a> might be a workable solution.</p>
<p>Lulu takes PDFs so step one was to convert the SICP website to one big PDF.</p>
<p>First, I used wget to mirror the site. Now that I had all the files, I wanted to clean them up a little. Every single page had the previous and next links at the bottom and this was obviously not needed when the pages are in physical form. I ran the following sed command to remove these lines:</p>
<p><code>sed -i "/\[Go to/d" *html</code></p>
<p>The next step was to convert the HTML to PDF. I used htmldoc for this particular task.  First, I put all the names of the HTML files in one text file, on one line, and in the correct order. I called this file &#8220;all_files.txt&#8221;. The htmldoc command I used to convert to PDF is the following:</p>
<p><code>htmldoc -f sicp.pdf --webpage --left .75in --right .75in `cat all_files.txt`</code></p>
<p>I then uploaded this file up to Lulu and designed my (very) simple cover. I made it clear on the back  cover text that I was printing this book under the rights granted by the aforementioned license and would receive no profit from this book with a link back to the original source. I&#8217;m not a lawyer so I hope that covers all bases.</p>
<p>Lulu has a convenient feature that will let you do a private printing. I could probably make  this book public, setting my profit to zero, and even though that would be covered under the license, it still feels strange to do.</p>
<p>I am very curious how this book will turn out. The Lulu process was actually fun and if this turns out well, I could see myself using the service again. Once I get the book, I&#8217;ll post my reviews of the service and possibly some pictures of the final product. Nonetheless, I&#8217;m excited to get a print version of this book for a much-reduced price.</p>
<p><strong>Edited to add:<br />
</strong>Here&#8217;s the download for the PDF: <a href="/files/sicp.pdf">sicp.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/03/13/sicp-and-lulucom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping the music going</title>
		<link>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/</link>
		<comments>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 21:19:21 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[last.fm]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=107</guid>
		<description><![CDATA[I love listening to last.fm&#8217;s similar artist radio stations. I constantly forget that the music I am listening to is coming from one of my Firefox tabs, and will accidentally close it from time to time, stopping whatever music is playing. I decided to fix this for myself using a ridiculously short Greasemonkey script, using [...]]]></description>
			<content:encoded><![CDATA[<p>I love listening to last.fm&#8217;s similar artist radio stations. I constantly forget that the music I am listening to is coming from one of my Firefox tabs, and will accidentally close it from time to time, stopping whatever music is playing.</p>
<p>I decided to fix this for myself using a ridiculously short Greasemonkey script, using the window object&#8217;s &#8220;onbeforeunload&#8221; function to make sure I actually meant to close the tab/window.</p>
<p><a href="http://nolancaudill.com/wp-content/uploads/2009/02/lastfm.user.js">Here</a> it is for consumption. This is obviously not a work of genius or of any considerable effort, just a fix for my own absentmindedness.</p>
<p><strong>Updated:<br />
</strong>I added a little more functionality to the script. There is now a button that will show up in the top right corner that will let you turn off and on the close prompt so that you can browse the last.fm without getting the &#8216;Are you sure?&#8217; prompt on every page load.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something new, Something Clojure</title>
		<link>http://nolancaudill.com/index.php/2008/12/30/something-new-something-clojure/</link>
		<comments>http://nolancaudill.com/index.php/2008/12/30/something-new-something-clojure/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 02:50:58 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=31</guid>
		<description><![CDATA[I&#8217;ve been shopping for a new programming language to learn the past few months and I&#8217;ve decided to jump on the functional wagon and expand my mind a little. For my day job, I&#8217;m a PHP and Javascript developer, enjoying the latter more the former, and for personal scripts and side projects, I&#8217;ve been a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been shopping for a new programming language to learn the past few months and I&#8217;ve decided to jump on the functional wagon and expand my mind a little.</p>
<p>For my day job, I&#8217;m a PHP and Javascript developer, enjoying the latter more the former, and for personal scripts and side projects, I&#8217;ve been a Python guy for years.</p>
<p>I wanted something that was a departure from these more imperative languages which obviously lends itself to the functional languages. At the same time, I wanted something that wasn&#8217;t purely academic, but I could build real-world software with it that other people could easily use.</p>
<p>I&#8217;ve been fascinated with Lisp and its S-expressions and the idea of <a href="http://en.wikipedia.org/wiki/Homoiconicity">code being data</a> and vice versa. At the same time the speedy, static-typed languages like OCaml and Haskell were very intriguing.</p>
<p>After playing with OCaml for a week or two and also working through the first few chapters of <a title="Real World Haskell" href="http://book.realworldhaskell.org/">Real World Haskell</a> and watching the entertaining Simon Peyton-Jones,  I enjoyed them, but I wasn&#8217;t infatuated with them. No magic spark, I guess you could say. I think it comes down to me being more inclined to the dynamically-typed languages which seems to cut down one more barrier between me and the implementation of my code.</p>
<p>So ruling out the OCaml and Haskell brand of typed, functional languages, I found myself working my way back to Lisp. Surveying the Lisp scene, I found myself confronted with quite a few choices of Lisp implementations. I decided to go with Clojure, as from my readings, it seems to be a nice Lisp, even coming from the older Lisp guys and you get the almost endless number of  libraries of Java, as well as  the speedy JVM that runs on all the major platforms. I&#8217;m sold.</p>
<p>I&#8217;ve played with <a href="http://www.sbcl.org/">SBCL</a> going through bits and pieces of <a title="Practical Common Lisp" href="http://gigamonkeys.com/book/">Practical Common Lisp</a> and I really enjoy the expressiveness and the speed of going from the idea of what you want to do to actually seeing it run. Stuart Holloway (of nearby Chapel Hill) has <a href="http://blog.thinkrelevance.com/2008/9/16/pcl-clojure">written</a> a series of blog posts porting pieces of the PCL code to Clojure which should serve as a nice introductions as well as the <a href="http://clojure.blip.tv/">screencasts</a>.</p>
<p>I&#8217;ll post updates on new discoveries I make, and any software I decide to work on.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2008/12/30/something-new-something-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helping jQuery Out</title>
		<link>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/</link>
		<comments>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 23:31:28 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=26</guid>
		<description><![CDATA[I&#8217;ve made a commitment to myself to start helping out with some of my favorite open source projects. I&#8217;ve started helping in my own little way by hanging out in the jQuery IRC channel. It&#8217;s not much effort and I&#8217;ve already helped a few people, which feels good. I&#8217;m &#8216;mncaudill&#8217; in there, so feel free [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a commitment to myself to start helping out with some of my favorite open source projects. I&#8217;ve started helping in my own little way by hanging out in the jQuery IRC channel. It&#8217;s not much effort and I&#8217;ve already helped a few people, which feels good. I&#8217;m &#8216;mncaudill&#8217; in there, so feel free to say hi.</p>
<p>I&#8217;d eventually like to start contributing code, but I&#8217;d like to get used to the community first and see how things are done. With such an intentionally lead codebase, contributing actual code might be a challenge, so helping people out in the channel might be the best way to help.</p>
<p>Next up, I&#8217;d also like to help out with django by doing the same. With a more extensive codebase where size is not as big of as concern as it is in jQuery, getting a patch in or two would not be as difficult I would imagine.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up lighttpd/Apache for Django on Slicehost</title>
		<link>http://nolancaudill.com/index.php/2008/02/10/setting-up-lighttpdapache-for-django-on-slicehost/</link>
		<comments>http://nolancaudill.com/index.php/2008/02/10/setting-up-lighttpdapache-for-django-on-slicehost/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 03:34:14 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/index.php/2008/02/10/setting-up-lighttpdapache-for-django-on-slicehost/</guid>
		<description><![CDATA[I finally made the jump and moved the websites I was hosting on my home PC and moved them out to slicehost. Signing up for my slice could not have been easier and so far it has been a flawless experience. The PickledOnion articles were nice to double-check myself to make sure I didn&#8217;t miss [...]]]></description>
			<content:encoded><![CDATA[<p>I finally made the jump and moved the websites I was hosting on my home PC and moved them out to <a href="http://slicehost.com">slicehost</a>. Signing up for my slice could not have been easier and so far it has been a flawless experience. The PickledOnion articles were nice to double-check myself to make sure I didn&#8217;t miss anything.</p>
<p>I opted for the Ubuntu 7.10 256 MB slice since that was what the sites were priorly hosted on. I decided that I wanted to do things by <a href="http://djangobook.com">the book</a> so I set up a lighttpd server that served my media straight up and funneled all Django requests through Apache/mod_python. I couldn&#8217;t find an exact way to this previously published so I thought I would add a few code snippets to help others looking to do the same.</p>
<p>First off, I got the Apache/mod_python setup working. This was pretty much a cut and paste from the deployment docs found in the Django book. Nothing tricky there. By default, Apache runs on port 80, but that will be changed later on.</p>
<p>The next step was to get lighttpd working properly. The relevant snippet is below:</p>
<pre>
$HTTP["host"] =~ "^(www.)?example.com" {
    $HTTP["url"] !~ "^/(public|media)/" {
        proxy.server = ( "" =&gt;
            ( (
                "host" =&gt; "127.0.0.1",
                "port" =&gt; 81
            ) )
        )
    }
}</pre>
<p>Broken down, this says if we get a request for example.com and the URL does not contain one of our media directories (read: a Django request), proxy it to port 81. This way lighttpd will serve up all the  static files and then redirect the Django stuff to our Apache instance that will be listening on port 81.</p>
<p>After that, change the ports.conf file for your Apache instance to listen on port 81, and the &#8220;server.port&#8221; variable in your lighttpd.conf to listen on port 80, and then restart both servers. If everything went correctly, you should now have a 2 servers doing what they do best and have a happy machine to boot.</p>
<p>I did add a couple of lines to my Apache conf to get better performance.</p>
<p>First off, I turned off KeepAlive as suggested  by <a href="http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/">Jacob Kaplan-Moss</a>. KeepAlive is useful if you are using Apache to serve up several files over one TCP connection, like multiple images on a page load. Since on every page load we are making just one request to Apache (for the HTML itself) and lighttpd is handling all of the static serving (which it is very good at it), KeepAlive helps us none and actually hurts us as Apache will quickly become RAM hungry holding on to your full Django code when there is no need for it.</p>
<p>Second tuning measure was to bump MaxRequestsPerChild up. I set mine at 500 and saw a big RAM usage drop. This way since these are fairly RAM-heavy Apache processes, they&#8217;ll get cleaned up once they reach a certain number.</p>
<p>Overall, I have been very pleased with slicehost and the Django book was very helpful in getting everything up and running.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2008/02/10/setting-up-lighttpdapache-for-django-on-slicehost/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->