<?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>searching for signal</title>
	<atom:link href="http://blog.n01se.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.n01se.net</link>
	<description>theoretically unambiguous</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:21:03 +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>How to capture httplib2 debug in a threaded app</title>
		<link>http://blog.n01se.net/?p=218</link>
		<comments>http://blog.n01se.net/?p=218#comments</comments>
		<pubDate>Sun, 29 Aug 2010 20:06:35 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[httplib]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=218</guid>
		<description><![CDATA[A couple months ago I blogged about my frustration with httplib logging. Andrew Dalke left a comment suggesting that I should replace sys.stdout, something I hadn't considered as a possibility. His suggestion sent me googling, which turned up this old email from Guido. Add threading.local and we have a solution! What we need is a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple months ago I blogged about <a href="http://blog.n01se.net/?p=213">my frustration with httplib logging</a>. Andrew Dalke <a href="http://blog.n01se.net/?p=213#comment-2315">left a comment</a> suggesting that I should replace <a href="http://docs.python.org/library/sys.html#sys.stdout">sys.stdout</a>, something I hadn't considered as a possibility. His suggestion sent me googling, which turned up this <a href="http://n01se.net/paste/sM72">old email from Guido</a>. Add <a href="http://docs.python.org/library/threading.html#threading.local">threading.local</a> and we have a solution!</p>
<p>What we need is a duck-typed replacement for sys.stdout that behaves like a writeable file, but also provides the ability to capture to thread-local storage. One of the ways to use threading.local is to subclass it. An instance of this subclass will have per-thread attributes, even if the instance itself is common to multiple threads.</p>
<p>Since <a href="http://docs.python.org/library/stringio.html">StringIO</a> intentionally doesn't implement isatty(), we need to make sure that gets passed through to the underlying file (we do this by catching the exception in getattr). And since we like seeing HTTP transactions when we're debugging, we include a writethrough mode that provides simultaneous capture and print.</p>
<pre class="brush:python;gutter:false">
import cStringIO, threading

class LocalCapturingWriter(threading.local):
    def __init__(self, fp, writethrough=False):
        self.__dict__['_fp'] = fp
        self.__dict__['_stringio'] = None
        self.__dict__['_writethrough'] = writethrough

    def start_capture(self):
        self.__dict__['_stringio'] = cStringIO.StringIO()

    def stop_capture(self):
        v = self._stringio.getvalue()
        self._stringio.close()
        self.__dict__['_stringio'] = None
        return v

    def write(self, s):
        if self._stringio:
            result = self._stringio.write(s)
        if not self._stringio or self._writethrough:
            result = self._fp.write(s)
        return result

    def __getattr__(self, name):
        if self._stringio is not None:
            try:
                return getattr(self._stringio, name)
            except:
                pass
        return getattr(self._fp, name)

    def __setattr__(self, name, value):
        if self._stringio:
            setattr(self._stringio, name, value)
        if not self._stringio or self._writethrough:
            setattr(self._fp, name, value)
</pre>
<p>And here's how to use it. First, the global settings:</p>
<pre class="brush:python;gutter:false">
import httplib2, sys

httplib2.debuglevel = 1

sys.stdout = LocalCapturingWriter(sys.stdout)
</pre>
<p>Then the code that runs in a thread to capture the debugging output. This will work as expected even in multiple threads simultaneously.</p>
<pre class="brush:python;gutter:false">
sys.stdout.start_capture()
try:
    response, content = \
        httplib2.Http().request("http://n01se.net")
finally:
    debug_trace = sys.stdout.stop_capture()

# Note that httplib2 doesn't include the content in its
# debug output.
debug_trace += "content: %r\n" % content
</pre>
<p>We're now using this in our Django app, with a custom Exception class (to hold the captured trace) and middleware that knows to look for it. The end result is that every time an exception occurs due to a problem talking to a backend server, the exception email includes the httplib2 trace. Yeah!</p>
<p>P.S. I wrote this entry less than a week after my previous entry, but then went on vacation and never managed to get it posted. Sorry for the delay...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=218</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python&#8217;s httplib uses print for debugging. Oh, it hurts&#8230;</title>
		<link>http://blog.n01se.net/?p=213</link>
		<comments>http://blog.n01se.net/?p=213#comments</comments>
		<pubDate>Sun, 04 Jul 2010 18:12:24 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[grumpy]]></category>
		<category><![CDATA[httplib]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=213</guid>
		<description><![CDATA[At work we have a production site that uses httplib (via httplib2) on the server to communicate with internal servers using a RESTful API. When something doesn't work as expected in this process, we like to know about it, so our app sends email with the exception traceback and whatever relevant data we can pull [...]]]></description>
			<content:encoded><![CDATA[<p>At work we have a production site that uses httplib (via httplib2) on the server to communicate with internal servers using a RESTful API. When something doesn't work as expected in this process, we like to know about it, so our app sends email with the exception traceback and whatever relevant data we can pull together.</p>
<p>One of the pieces of data I'd like to add to the email is the conversation between our server and the internal servers. On a development server, this is easy: Set httplib2.debuglevel=1 and watch the HTTP conversations scroll past on stdout.</p>
<p>On a staging or production server, one quickly discovers a crippling mistake made by the httplib authors: the library uses Python's "print" for debugging!</p>
<p>If the application were single-threaded, we could capture the trace by temporarily redirecting sys.stdout to an instance of StringIO (maybe using a context manager). Sure, it's more load on the server to capture the debug on every transaction, but I'll gladly pay that price for the hours we'll save when something goes wrong and we have the ability to debug it.</p>
<p>But it doesn't matter, because we haven't this option. Our app is multi-threaded and sys.stdout is global. We would have to serialize our HTTP transactions to prevent traces from being mixed together. Or fork to isolate sys.stdout. These aren't realistic approaches.</p>
<p>This sort of unfortunate shortcoming is to be expected in add-on libraries. After all, part of the reason they're not included with Python is that they don't necessarily meet the quality requirements of the core distribution. But I'm taken off-guard to find such an obvious shortcoming in the Python standard library. One of the things I'd hope to assume by using the standard library is a trust in the quality of the implementation, but a discovery like this forces me to question that assumption.</p>
<p>I'm pretty new to Python, so maybe I'm missing something. Is httplib a particularly poor example of the Python standard library? The existence of httplib2 seems to imply that (and also seems to imply that it's hard to get problems fixed in the core distribution). Maybe I need to find an add-on networking library that ignores httplib entirely...?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=213</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>a common css mistake</title>
		<link>http://blog.n01se.net/?p=203</link>
		<comments>http://blog.n01se.net/?p=203#comments</comments>
		<pubDate>Sat, 15 May 2010 03:39:13 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=203</guid>
		<description><![CDATA[I'm playing with febootstrap this evening, part of a continuing migration away from Ubuntu toward Debian and Fedora. I googled my way to Rich's febootstrap page. On my browser, it looks like this: The problem is that the page's css has the following rules: h1, h2, h3, h4 { color: #333; } pre { background-color: [...]]]></description>
			<content:encoded><![CDATA[<p>I'm playing with febootstrap this evening, part of a continuing migration away from Ubuntu toward Debian and Fedora. I googled my way to <a href="http://people.redhat.com/~rjones/febootstrap/">Rich's febootstrap page</a>. On my browser, it looks like this:</p>
<p><a href="http://blog.n01se.net/wp-content/uploads/2010/05/febootstrap-css-mistake2.png"><img src="http://blog.n01se.net/wp-content/uploads/2010/05/febootstrap-css-mistake2-e1273894578460.png" alt="" title="febootstrap-css-mistake" width="399" height="256" class="aligncenter size-full wp-image-209" /></a></p>
<p>The problem is that the page's css has the following rules:</p>
<pre class="brush:css;gutter:false">
h1, h2, h3, h4 {
  color: #333;
}

pre {
  background-color: #fcfcfc;
}
</pre>
<p>Both these rules assume the usual black-on-white color scheme, but I'm using a gtk theme with a dark background and light foreground, which firefox respects.  (Chromium doesn't have the issue because it enforces black-on-white defaults regardless of the gtk theme. I'm not sure how I feel about that; it fixes the problem but at the expense of ignoring my theme.)</p>
<p>This isn't to say anything bad about febootstrap, of course. I'm thrilled that somebody has finally written for Fedora what the excellent debootstrap has been providing for Debian and Ubuntu users for years! But I've come across this mistake enough times that Rich's site drew the unlucky number. <img src='http://blog.n01se.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=203</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;git along little dogies&#8230;&#8221;</title>
		<link>http://blog.n01se.net/?p=179</link>
		<comments>http://blog.n01se.net/?p=179#comments</comments>
		<pubDate>Sat, 24 Apr 2010 03:02:37 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=179</guid>
		<description><![CDATA[At my place of work we're moving our repo management from gitosis to an evaluation installation of  GitHub:FI. After spending a while searching around for moving, backing up and transferring  git repos I was unable to find a good example. I had to dig through the git manpages for quite a while to figure out what [...]]]></description>
			<content:encoded><![CDATA[<p>At my place of work we're moving our repo management from <a title="gitosis" href="http://eagain.net/gitweb/?p=gitosis.git" target="_blank">gitosis</a> to an evaluation installation of  <a title="GitHub:FI" href="http://fi.github.com" target="_blank">GitHub:FI</a>. After spending a while searching around for moving, backing up and transferring  git repos I was unable to find a good example. I had to dig through the git manpages for quite a while to figure out what I wanted. The solution is quite simple but it was not obvious what combination of git clone/fetch/push/pull or other commands was appropriate. Now, this may be due to my own stupidity but even when I had the solution in hand I was still unable to find pages which showed how fully copy a repo from one remote location to a new remote location. I'm posting what I found here for posterity.</p>
<h3>Movin' right along...</h3>
<p>The basic process of moving a repo including all branches and tags is as follows:</p>
<blockquote>
<pre>git clone --mirror git@gitosis:my-repo.git
git --bare --git-dir my-repo.git push --mirror git@githubfi:my-user/my-repo.git</pre>
</blockquote>
<p>The above assumes that the <code>git@githubfi:my-user/my-repo.git</code> repo was created as an empty repo some point before the last command was run.</p>
<p>With the default config settings, <code>git clone</code> will create remote tracking branches for all branches found in the remote repo but will only create a local branch for the repository's currently active branch. In order to fully mirror the repository and all references (branches and tags) locally, you need to use the <code>--mirror</code> option which will also create the repo as a bare repository.</p>
<h3>Rawhide!</h3>
<p>A normal working copy has, at the top level, your checked out files and a <code>.git/</code> sub-directory. A bare repository omits the working copy and has the contents of the <code>.git/</code> directory at the top level. Bare repositories are intended to be used remotely (such as by a repository management system) and, by default, are named with a <code>.git</code> suffix to distinguish them as seen in the repo URLs above. (e.g. <code>my-repo.git</code>)</p>
<p>Since a bare repo has no working copy to sit in, we need to tell git where and how to find it when we call git commands against the repository, hence the <code>--bare --git-dir my-repo.git</code> options. The <code>git push --mirror</code> assures that all refs (branches/tags) will be pushed to the new location instead the default behaviors of only pushing refs (branches/tags) specified on the command line or pushing the branches that match by name between the local and remote repositories if none are specified on the command line.</p>
<h3>More cowbell...</h3>
<p>There's one further thing to mention that may be helpful. While transitioning from gitosis to GitHub:FI I took the opportunity to make our <code>pre-receive</code> hook a bit more stringent in its checking of emails, requiring that the committer email be from our corporate domain on non-upstream branches. In order to do this I had to use <code>git filter-branch</code> to do a little cleanup. Because we had a bare repo, the invocation looked a bit different. I'm showing a simplified version below:</p>
<blockquote>
<pre>git clone --mirror git@gitosis:my-repo.git
git --bare --git-dir my-repo.git filter-branch --commit-filter \
    '[ "$GIT_COMMITTER_EMAIL" = "joe@home.org"] &amp;&amp; export GIT_COMMITER_EMAIL="joe@work.com"; \
        git commit-tree "$@"' \
    -- master devel staging v2.{30..45}
git --bare --git-dir my-repo.git push --mirror git@githubfi:my-user/my-repo.git</pre>
</blockquote>
<p>Note that history rewriting such as done by <code>git filter-branch</code> has implications for any repos that have been cloned out in the wild. Be sure you understand history rewriting before you use this command or there will be pain and sadness among the other developers. In our case, the above changes were done in a manner that was coordinated among the developers involved and was quite pain free. Note also that I did not rewrite the "upstream" branch which did not need to be purged of non-work addresses so I omitted it from the list of refs to be filtered. Further note that tags, since they are refs, also need to be rewritten so I passed our version tags to <code>git filter-branch</code> as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>daemonizing bash</title>
		<link>http://blog.n01se.net/?p=145</link>
		<comments>http://blog.n01se.net/?p=145#comments</comments>
		<pubDate>Tue, 20 Apr 2010 16:32:07 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[APUE]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[setsid]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=145</guid>
		<description><![CDATA[Before we jump into this, let's be clear about intent: There are better languages for writing daemons than bash. Honestly, any other language is probably a better choice. Writing a daemon implies that you're writing a sufficiently complex program that bash is already the wrong language, with or without daemonization! But if you find yourself [...]]]></description>
			<content:encoded><![CDATA[<p>Before we jump into this, let's be clear about intent: There are better languages for writing daemons than <a href="http://tiswww.case.edu/php/chet/bash/bashtop.html">bash</a>. Honestly, <i>any other language</i> is probably a better choice. Writing a daemon implies that you're writing a sufficiently complex program that bash is already the wrong language, with or without daemonization!</p>
<p>But if you find yourself in the unfortunate position of needing to daemonize an existing bash program, and you'd rather put off rewriting it in a more suitable language, keep reading! I found myself in that position recently and kept some notes.</p>
<p>Daemonizing a process consists of two primary tasks: forking to the background to return control to the shell, and preventing undesirable interaction between the process and the host. Rich Stevens enumerated the steps in his classic <a href="http://www.apuebook.com/">Advanced Programming in the UNIX Environment</a>. Here's my summary of his formula with implementation notes for bash.</p>
<ol>
<li><i>Call <a href="http://linux.die.net/man/2/fork">fork</a> (to guarantee the child is not a process group leader, necessary for setsid) and have the parent exit (to allow control to return to the shell).</i></p>
<p>Forking in bash is a simple matter of putting a command in the background using "&#038;". To put a sequence of commands in the background, use a subshell: "( commands ) &#038;". Note that bash doesn't provide any method for the child process to continue the same execution path as the parent, so the entirety of the child must be contained in the subshell. The easiest way to do this is implement the child as a bash function: "childfunc &#038;".</li>
<li><i>Call <a href="http://linux.die.net/man/2/setsid">setsid</a> to create a new session so the child has no controlling terminal. This simultaneously prevents the child from gaining access to the controlling terminal (using /dev/tty) and protects the child from signals originating from the controlling terminal (HUP and INT, for example).</i>
<p>Bash provides no method to call the setsid syscall for the current process. We have two less-than-ideal alternatives:</p>
<ol type=a>
<li>The <a href="http://userweb.kernel.org/~kzak/util-linux-ng/">util-linux-ng</a> package provides an external <a href="http://linux.die.net/man/1/setsid">setsid</a> command but this daemonizes an external command rather than the currently running script. It also makes collecting the PID of the child tricky because the setsid command will fork internally.</p>
<p>Having said all that, if your application allows you to use the setsid command, it's a good choice because bash can't otherwise fully protect against the child process opening /dev/tty. It's still a good idea to redirect std* to prevent stray output to the terminal.</li>
<li>Lacking the setsid syscall, there are steps we can take to partially protect the child process from the effects of the controlling terminal:
<ol type=i>
<li>Redirect std* to files or /dev/null</li>
<li>Guard against HUP and INT by signal handler in child</li>
<li>Guard against HUP by disown -h in parent</li>
</ol>
<p>Unfortunately without setsid there is no way to guard completely against a subchild opening /dev/tty until the terminal emulator exits, then /dev/tty will become unavailable.</li>
</ol>
<li><i>Change working directory to / to prevent the daemon from holding a mounted filesystem open.</i>
<p>Bash is good at this. <img src='http://blog.n01se.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li><i>Set umask to 0 to clear file mode creation mask.</i>
<p>I have to admit that I can't understand the point of this, in bash or any other language. It seems to me that the child will either set its umask explicitly before creating files, or it will set individual file permissions explicitly, or it will fall back on the caller's umask. In the last case, I want my inherited umask, not the wide-open zero.</p>
<p>If anybody wants to explain a good reason for step 4, I'm all ears... Until then, it's commented out in my implementation below.</li>
<li><i>Close unneeded file descriptors.</i>
<p>This step is fun in bash using eval and brace expansion...</li>
</ol>
<p>With those notes in-hand, here's my implementation. There are two<br />
functions here, "daemonize" for an external command using setsid,<br />
"daemonize-job" for a function in the running script.</p>
<pre class="brush:bash;gutter:false">
# redirect tty fds to /dev/null
redirect-std() {
    [[ -t 0 ]] &amp;&amp; exec &lt;/dev/null
    [[ -t 1 ]] &amp;&amp; exec &gt;/dev/null
    [[ -t 2 ]] &amp;&amp; exec 2&gt;/dev/null
}

# close all non-std* fds
close-fds() {
    eval exec {3..255}\&gt;\&amp;-
}

# full daemonization of external command with setsid
daemonize() {
    (                   # 1. fork
        redirect-std    # 2.1. redirect stdin/stdout/stderr before setsid
        cd /            # 3. ensure cwd isn't a mounted fs
        # umask 0       # 4. umask (leave this to caller)
        close-fds       # 5. close unneeded fds
        exec setsid "$@"
    ) &amp;
}

# daemonize without setsid, keeps the child in the jobs table
daemonize-job() {
    (                   # 1. fork
        redirect-std    # 2.2.1. redirect stdin/stdout/stderr
        trap '' 1 2     # 2.2.2. guard against HUP and INT (in child)
        cd /            # 3. ensure cwd isn't a mounted fs
        # umask 0       # 4. umask (leave this to caller)
        close-fds       # 5. close unneeded fds
        if [[ $(type -t "$1") != file ]]; then
            "$@"
        else
            exec "$@"
        fi
    ) &amp;
    disown -h $!       # 2.2.3. guard against HUP (in parent)
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=145</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using binding to mock out even &#8220;direct linked&#8221; functions in Clojure</title>
		<link>http://blog.n01se.net/?p=134</link>
		<comments>http://blog.n01se.net/?p=134#comments</comments>
		<pubDate>Sat, 17 Apr 2010 19:00:44 +0000</pubDate>
		<dc:creator>Chouser</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=134</guid>
		<description><![CDATA[The Clojure macro binding is frequently handy for mocking out functionality during testing, but this sometimes does not behave as desired in multi-threaded context. Fortunately, there's a solution... For example, at work we have unit tests on functions that may attempt to talk to network services, which we'd rather they not do: (defn send-request [request [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>The Clojure macro <tt class="docutils literal"><span class="pre">binding</span></tt> is frequently handy for mocking out
functionality during testing, but this sometimes does not behave as
desired in multi-threaded context.  Fortunately, there's a solution...</p>
<p>For example, at work we have unit tests on functions that may attempt
to talk to network services, which we'd rather they not do:</p>
<pre class="literal-block">
(defn send-request [request server]
  '(...do real RPC stuff here...))

(defn average-timestamp [time-servers]
  (/ (apply + (map #(send-request :get-timestamp %)
                   time-servers))
     (count time-servers)))
</pre>
<p>In order to test <tt class="docutils literal"><span class="pre">average-timestamp</span></tt>, we need a &quot;mock&quot; function that
will stand in for <tt class="docutils literal"><span class="pre">send-request</span></tt>.  This must be a function that
takes a request and a server and returns a timestamp, just like the
real send-request.  For this example, it can take the timestamp itself
as the &quot;server&quot; and simply return that timestamp.  For bonus points we
can make sure the request parameter is what we expect:</p>
<pre class="literal-block">
(defn mock-send-request [request server]
  (assert (= request :get-timestamp))
  server)  ; assume &quot;server&quot; is actually the timestamp

(mock-send-request :get-timestamp 5)
;=&gt; 5
</pre>
<p>Using <tt class="docutils literal"><span class="pre">binding</span></tt> we can temporarily replace <tt class="docutils literal"><span class="pre">send-request</span></tt> with
<tt class="docutils literal"><span class="pre">mock-send-request</span></tt>:</p>
<pre class="literal-block">
(binding [send-request mock-send-request]
  (send-request :get-timestamp 5))
;=&gt; 5

(binding [send-request mock-send-request]
  (average-timestamp [5 15]))
;=&gt; 10
</pre>
<p>So there's the background: a pretty normal way to mock out stuff in
Clojure.  What this doesn't address is when some clever co-worker (hi,
Nathan!) realizes that <tt class="docutils literal"><span class="pre">average-timestamp</span></tt> would work better if it
talked to multiple time-servers in parallel, and that this could be
easily accomplished by replacing the use of <tt class="docutils literal"><span class="pre">map</span></tt> with <tt class="docutils literal"><span class="pre">pmap</span></tt>:</p>
<pre class="literal-block">
(defn average-timestamp [time-servers]
  (/ (apply + (pmap #(send-request :get-timestamp %) time-servers))
     (count time-servers)))
</pre>
<p>This is an easy single-letter change that indeed works quite well with
the real <tt class="docutils literal"><span class="pre">send-request</span></tt>.  But when we try to use <tt class="docutils literal"><span class="pre">binding</span></tt> to mock it
out, we run into problems:</p>
<pre class="literal-block">
(binding [send-request mock-send-request]
  (average-timestamp [5 15]))
; java.lang.ClassCastException:
;   clojure.lang.PersistentList cannot be cast to java.lang.Number
</pre>
<p>It's not obvious from the error message, but what's happening is our
original un-mocked <tt class="docutils literal"><span class="pre">send-request</span></tt> is getting called.  This is because
<tt class="docutils literal"><span class="pre">binding</span></tt> only has an effect on the current thread, but <tt class="docutils literal"><span class="pre">pmap</span></tt> causes
<tt class="docutils literal"><span class="pre">send-request</span></tt> to be called in other threads.</p>
<p>The solution is simple enough in Clojure 1.0 -- you simply mock out
<tt class="docutils literal"><span class="pre">pmap</span></tt> as well, and since the API is identical to <tt class="docutils literal"><span class="pre">map</span></tt>, it's quite
easy to do.  But as you can see, this does us no good at all in recent
versions of Clojure:</p>
<pre class="literal-block">
(binding [send-request mock-send-request
          pmap map]
  (average-timestamp [5 15]))
; java.lang.ClassCastException:
;   clojure.lang.PersistentList cannot be cast to java.lang.Number
</pre>
<p>The reason is that starting with Clojure 1.1, most clojure.core Vars
are linked directly into code that uses them.  This means that our
definition of <tt class="docutils literal"><span class="pre">average-timestamp</span></tt> above links directly to the actual
definition of <tt class="docutils literal"><span class="pre">clojure.core/pmap</span></tt>, not just the Var that points to it,
thus attempts to rebind the Var with <tt class="docutils literal"><span class="pre">binding</span></tt> are futile.</p>
<p>But do not despair, there is a solution even for this.  All you need
to do is tell Clojure not to directly link <tt class="docutils literal"><span class="pre">pmap</span></tt> when it compiles
<tt class="docutils literal"><span class="pre">average-timestamp</span></tt>.  This is done by adjusting <tt class="docutils literal"><span class="pre">pmap</span></tt>'s metadata
before <tt class="docutils literal"><span class="pre">average-timestamp</span></tt> is compiled, like so:</p>
<pre class="literal-block">
; Set pmap to be dynamically linked
(alter-meta! #'pmap assoc :dynamic true)

; Must now re-define the function that uses pmap
(defn average-timestamp [time-servers]
  (/ (apply + (pmap #(send-request :get-timestamp %)
                    time-servers))
     (count time-servers)))

; Finally, our mocking out of pmap works
(binding [send-request mock-send-request
          pmap map]
  (average-timestamp [5 15]))
;=&gt; 10
</pre>
<p>The best place to put the <tt class="docutils literal"><span class="pre">alter-meta!</span></tt> depends on your particular use
case.  You might want to figure out how to do the <tt class="docutils literal"><span class="pre">alter-meta!</span></tt> only
when in testing and not in production.  Remember that the metadata on
<tt class="docutils literal"><span class="pre">pmap</span></tt> is global -- you're changing the only metadata that
<tt class="docutils literal"><span class="pre">clojure.core/pmap</span></tt> has, so the namespace you're in when you do it
makes no difference at all.</p>
<p>In our case at work however, the performance impact of leaving pmap
dynamic all the time was not enough to worry about.  Dynamic linking
is still pretty fast and is fine even for our production uses of
<tt class="docutils literal"><span class="pre">pmap</span></tt> in this particular code base.  So we simply put the
<tt class="docutils literal"><span class="pre">alter-meta!</span></tt> at the top of the file that used <tt class="docutils literal"><span class="pre">pmap</span></tt> and got on with
our unit testing.</p>
<a class="reference image-reference" href="http://joyofclojure.com/"><img align="left" alt="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" class="align-left" src="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" /></a>
<dl class="docutils">
<dt><strong>The Joy of Clojure</strong></dt>
<dd>Thinking the Clojure Way</dd>
</dl>
<p><em>by Michael Fogus and Chris Houser</em></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>clock trick</title>
		<link>http://blog.n01se.net/?p=125</link>
		<comments>http://blog.n01se.net/?p=125#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:01:41 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=125</guid>
		<description><![CDATA[I bought a Sony &#34;Dream Machine&#34; Clock Radio about a year ago and have liked it except for one problem: even when the brightness is set to &#34;low&#34;, it's still too bright for my taste. Each night I have to rotate the clock away from me on the nightstand so I can fall asleep. This [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>I bought a <a class="reference" href="http://www.sonystyle.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10551&amp;storeId=10151&amp;productId=11033593&amp;langId=-1">Sony &quot;Dream Machine&quot; Clock Radio</a>
about a year ago and have liked it except for one problem: even when the
brightness is set to &quot;low&quot;, it's still too bright for my taste. Each night
I have to rotate the clock away from me on the nightstand so I can fall asleep.</p>
<p>This morning I applied <a class="reference" href="http://www.amazon.com/Insta-Cling-Windshield-Strip-Professional-Tint/dp/B000EBICN2">Insta-Cling Windshield Strip Professional Tint Film</a>
to the front and I think it's not bad for $4.88 and a few minutes with an x-acto
knife!</p>
<p>Here's the before/after (&quot;before&quot; courtesy of Amazon since I didn't think of
taking a photo):</p>
<img alt="http://agriffis.n01se.net/blog-images/clock-before-after.jpg" src="http://agriffis.n01se.net/blog-images/clock-before-after.jpg" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=125</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>weechat, nopaste and tagver</title>
		<link>http://blog.n01se.net/?p=116</link>
		<comments>http://blog.n01se.net/?p=116#comments</comments>
		<pubDate>Mon, 22 Feb 2010 22:01:51 +0000</pubDate>
		<dc:creator>agriffis</dc:creator>
				<category><![CDATA[ramble]]></category>
		<category><![CDATA[bitlbee]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[irssi]]></category>
		<category><![CDATA[nopaste]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tagver]]></category>
		<category><![CDATA[weechat]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=116</guid>
		<description><![CDATA[This weekend I switched from irssi to weechat. The main reason I switched away from irssi was to gain support for protocols other than IRC. On the way to weechat, I tried Pidgin but I was immediately frustrated by two things. First, I really love running my IM client in screen. I move regularly between [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>This weekend I switched from <a class="reference" href="http://irssi.org">irssi</a> to <a class="reference" href="http://weechat.org">weechat</a>. The main reason I switched away from irssi was to gain
support for protocols other than IRC. On the way to weechat, I tried <a class="reference" href="http://pidgin.im">Pidgin</a> but I was immediately frustrated by two things.</p>
<p>First, I really love running my IM client in <a class="reference" href="http://www.gnu.org/software/screen/">screen</a>. I move regularly between three machines
and I want persistent connectivity despite changing work context. Screen has
provided that beautifully over the years and I don't know of any truly
comparable technology for graphical programs.</p>
<p>Second, Pidgin seems to be barely customizable. For example, how would you like
your timestamps? You have three choices:</p>
<ul class="simple">
<li>(HH:MM:SS)</li>
<li>occasional iChat-style interruptions</li>
<li>no timestamps</li>
</ul>
<p>The Pidgin FAQ <a class="reference" href="http://developer.pidgin.im/wiki/Using%20Pidgin#WhathappenedtomytimestampsCanIchangethem">calls out plugins</a>
to customize timestamps but they're woefully underpowered. What I want
is to supply a strftime-style format string: %H:%M. It seems
preposterous to me that Pidgin wouldn't provide this capability, so maybe I'm
just missing it?</p>
<p>In any case, irssi and weechat both make this and other customizations easy. It
took about one minute to find and change the setting in weechat:</p>
<pre class="literal-block">
/set weechat.look.buffer_time_format &quot;%H:%M&quot;
</pre>
<p>Once I got weechat running, I found to my chagrin that I'd imagined weechat's
support for other protocols. The front page mentions Jabber but it's still
a work in progress; there's no stable support for anything other than IRC.</p>
<p>I was saved by <a class="reference" href="http://www.bitlbee.org/main.php/news.r.html">bitlbee</a>, a standalone server that
gateways IM protocols (XMPP/Jabber, MSN Messenger, Yahoo! Messenger, AIM and
ICQ) to IRC.  Installing and configuring bitlbee took all of five minutes
since <a class="reference" href="http://packages.ubuntu.com/bitlbee">it's in Ubuntu</a> and there's
a super-easy <a class="reference" href="http://princessleia.com/bitlbee.php">quickstart guide</a>.</p>
<p>Of course this means that I could have stayed on
irssi! But weechat seems to be a worthy replacement.  It
has a built in nicklist which has always been missing from irssi. It
handles filtering better than irssi; whereas irssi's /ignore discards
information, weechat's /filter simply hides it and you can <a class="reference" href="http://weechat.org/files/doc/stable/weechat_user.en.html#key_bindings_other">toggle
filtered text with alt+=</a>.
That means I can filter <em>more</em> aggressively because I don't have to worry about
irretrievably missing something important.</p>
<p>We are, after all, searching for signal. (And good luck finding it in this
post.)</p>
<p>One thing I liked from my brief experience with pidgin was libnotify alerts. You
know, that little box that pops up so you don't need to keep your IM client on
the screen at all times:</p>
<img alt="http://agriffis.n01se.net/blog-images/libnotify-chuck.png" src="http://agriffis.n01se.net/blog-images/libnotify-chuck.png" />
<p>There's a <a class="reference" href="http://weechat.org/files/scripts/notify.py">weechat notify script</a> that provides this
functionality but it had some bugs. No problem, fixed them, then tried
to <a class="reference" href="http://weechat.org/scripts/update/">submit my update to the site</a>. The upload form suggests using
pastebin, so I broke out my own <a class="reference" href="http://agriffis.n01se.net/nopaste">nopaste tool</a> and...</p>
<p>It failed. Where I expected to get a link, I got nothing! It seems
<a class="reference" href="http://pastebin.com">Pastebin.com</a> <a class="reference" href="http://twitter.com/pastebincom/status/9345479627">recently switched</a> to a custom
httpd:</p>
<pre class="literal-block">
$ curl -I http://pastebin.com/
HTTP/1.1 200 OK
Content-Type: text/html; charset=iso-8859-1
Date: Mon, 22 Feb 2010 20:37:36 GMT
Server: TorrentFly.org Custom Httpd
</pre>
<p>Curl sees &quot;HTTP/1.1&quot; and tries to be polite by using the
<a class="reference" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3">100-continue Expect request-header field</a>.
Unfortunately the TorrentFly.org Custom Httpd doesn't grok the request
and halts the transaction with <a class="reference" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.20">417 (Expectation Failed)</a>.</p>
<p>Fine, it's an easy fix to force HTTP/1.0 and work around the broken server:</p>
<pre class="literal-block">
--- a/nopaste
+++ b/nopaste
&#64;&#64; -52,7 +52,7 &#64;&#64; main() {

 docurl() {
     declare u
-    u=$(curl --silent --show-error -o /dev/null -w &quot;%{redirect_url}\n&quot; \
+    u=$(curl -0 --silent --show-error -o /dev/null -w &quot;%{redirect_url}\n&quot; \
         --form-string &quot;poster=$opt_nick&quot; --form-string &quot;format=$opt_language&quot; \
         --form-string &quot;expiry=$expire&quot; \
         ${opt_parent:+--form-string &quot;parent_pid=$opt_parent&quot;} \
</pre>
<p>This reminded me that nopaste should be in externally-available source
control so I created a <a class="reference" href="http://github.com/agriffis/nopaste">github project</a> for it. This is the first time
I've used github to publish a project of my own and I can only say:
Wow, that was easy.</p>
<p>I thought it would also be nice to publish proper releases of nopaste.
In the past I've simply provided the individual file with a version
number appended. Since I'm using git, I should be able to do something
nifty with tags, right?</p>
<p>Enter <a class="reference" href="http://github.com/agriffis/tagver">tagver</a>, a script to
generate a &quot;meaningful&quot; version number based on tags, revisions and
dirt. I've re-invented this wheel a few times, for example <a class="reference" href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3dce174cfcba11026b028d33bed0438b80e37124;hp=2f4b489b77c68b9cba1bd9dec5a1bbf0ab3c47f8">adding
mercurial support to setlocalversion</a>,
but this is the first time I've made it a project in its own right.</p>
<p>Using tagver I released tarballs and an
rpm for nopaste version 2.3 containing this trivial fix. You can find them both
at <a class="reference" href="http://agriffis.n01se.net/nopaste">http://agriffis.n01se.net/nopaste</a>. I'm
not really satisfied with the <a class="reference" href="http://github.com/agriffis/nopaste/blob/master/Makefile">Makefile</a> that calls tagver,
but it'll do for now, at least until I look into integrating tagver into an
autotools-driven distribution. Or <a class="reference" href="http://cmake.org">cmake</a> or <a class="reference" href="http://scons.org">scons</a> or <a class="reference" href="http://www.dsmit.com/cons/">cons</a> or whatever...</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure: Controlling run-away trains, onions, and exercise bikes.</title>
		<link>http://blog.n01se.net/?p=85</link>
		<comments>http://blog.n01se.net/?p=85#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:35:20 +0000</pubDate>
		<dc:creator>Chouser</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=85</guid>
		<description><![CDATA[A normal Clojure REPL (or prompt) in a terminal window is by default a bit touchy about infinite seqs, deeply nested structures, and long-running operations. Any of these can cause your REPL to wander off into the weeds, busy spinning, perhaps printing pages of useless data, with the only apparent remedy being to press CTRL-C, [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>A normal Clojure REPL (or prompt) in a terminal window is by default a bit
touchy about infinite seqs, deeply nested structures, and long-running
operations.  Any of these can cause your REPL to wander off into the weeds, busy
spinning, perhaps printing pages of useless data, with the only apparent remedy
being to press CTRL-C, which generally kills the entire JVM, Clojure and all,
and dumps you back at your operating system prompt.</p>
<p>It's unfortunate that this is the default, but Clojure's youth shows
particularly when it come to tools and settings like this.  Happily it's
sufficiently mature to provide several solutions that are not difficult to
apply.</p>
<div class="section" id="run-away-trains">
<h3>Run-away trains</h3>
<p>The most common of the problems listed above is the infinite seq.  Such a seq
is easy to create, easy to print, and can result in an run-away REPL.  The
solution: setting your <tt class="docutils literal"><span class="pre">*print-length*</span></tt> to something short of infinity.
I recommend 103:</p>
<pre class="literal-block">
(set! *print-length* 103)
</pre>
<p>Now it's safe to print infinite sequences:</p>
<pre class="literal-block">
(iterate inc 0)
;=&gt; (0 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 83 84 85 86
    87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...)
</pre>
<p>Note the <tt class="docutils literal"><span class="pre">...</span></tt> at the end of the list which indicates there was more to print, but
Clojure is respecting our requested limit and giving up after 103 items.  I've
been mocked upon occasion for choosing 103, as if 102 is insufficient and 104
dangerous.  Of course it's not so important exactly what you pick, so I'm happy
to keep my rationale to myself.</p>
</div>
<div class="section" id="run-away-onions">
<h3>Run-away onions</h3>
<p>But <tt class="docutils literal"><span class="pre">*print-length*</span></tt> won't help you in the case of infinitely recursive
structures, data nested inside data like layers of an onion.  While less common,
such nesting can be deep enough that it can still be a problem.  To limit
printing of recursive structures, use <tt class="docutils literal"><span class="pre">*print-level*</span></tt>.  Usually 15 is about
right for me:</p>
<pre class="literal-block">
(set! *print-level* 15)
</pre>
<p>Now it's safe to print infinitely recursive structures:</p>
<pre class="literal-block">
(let [x (atom 0)] (reset! x {:deeper x}))
;=&gt; {:deeper #&lt;Atom&#64;4cb533b8: {:deeper #&lt;Atom&#64;4cb533b8:
    {:deeper #&lt;Atom&#64;4cb533b8: {:deeper #&lt;Atom&#64;4cb533b8:
    {:deeper #&lt;Atom&#64;4cb533b8: {:deeper #&lt;Atom&#64;4cb533b8:
    {:deeper #&lt;Atom&#64;4cb533b8: {:deeper #}&gt;}&gt;}&gt;}&gt;}&gt;}&gt;}&gt;}
</pre>
<p>Again you get a little textual indicator that print is giving up, in this case
it's just the <tt class="docutils literal"><span class="pre">#</span></tt> at the deepest level.</p>
</div>
<div class="section" id="run-away-exercise-bikes">
<h3>Run-away exercise bikes</h3>
<p>But these settings only help take control of run-away printing.  Sometimes the
REPL gets hung up doing something other than printing, sitting there spinning
away like a stationary bike, and neither of these settings will help you.  My
final advice is to use <tt class="docutils literal"><span class="pre">repl-utils</span></tt> to register your REPL thread as killable
by CTRL-C:</p>
<pre class="literal-block">
(require 'clojure.contrib.repl-utils)
(clojure.contrib.repl-utils/add-break-thread!)
</pre>
<p>Now when you press CTRL-C, instead of shutting down the whole JVM, an exception
will be thrown within the REPL thread, which is usually exactly what you need to
halt run-away computation.  Note that <tt class="docutils literal"><span class="pre">repl-utils</span></tt> does this using
a deprecated Java API that is described as <a class="reference" href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#stop()">unsafe</a>.  And yet
it remains useful for just such circumstances.  For example:</p>
<pre class="literal-block">
(deref (promise))
</pre>
<p>Look at that -- instant deadlock!  Now press CTRL-C, and you get:</p>
<pre class="literal-block">
java.lang.Exception: SIGINT (NO_SOURCE_FILE:0)
</pre>
<p>...and you're back to REPL prompt.  But now you've violated Java, so I'd
recommend saving what you need to save and then restart your JVM anyway.  If you
don't, weird things can happen.  For example if you run the above deref-promise
example again immediately, it may fail with a slightly different exception, even
before you press CTRL-C.  Similar strangeness can occur if you press CTRL-C at
the REPL when no operation is running, though in that case it usually just kills
your next expression, whatever it is.</p>
<p>Hopefully by setting your <tt class="docutils literal"><span class="pre">*print-length*</span></tt>, <tt class="docutils literal"><span class="pre">*print-level*</span></tt>, and
break-thread, you can feel more comfortable at the REPL with less fear of
getting stuck.</p>
<a class="reference image-reference" href="http://joyofclojure.com/"><img align="left" alt="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" class="align-left" src="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" /></a>
<dl class="docutils">
<dt><strong>The Joy of Clojure</strong></dt>
<dd>Thinking the Clojure Way</dd>
</dl>
<p><em>by Michael Fogus and Chris Houser</em></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Joy of Clojure, my perspective.</title>
		<link>http://blog.n01se.net/?p=80</link>
		<comments>http://blog.n01se.net/?p=80#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:40:04 +0000</pubDate>
		<dc:creator>Chouser</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://blog.n01se.net/?p=80</guid>
		<description><![CDATA[There are a few books about Clojure in the works now. But despite the variety in authorship and publisher, they all seem to be primarily in the vein of a language tutorial, starting from a basis of &#34;common knowledge&#34; among most programmers and taking the reader to a level of basic familiarity with Clojure. Michael [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>There are a few books about <a class="reference" href="http://clojure.org/">Clojure</a> in the works now.
But despite the variety in authorship and publisher, they all seem to be
primarily in the vein of a language tutorial, starting from a basis of &quot;common
knowledge&quot; among most programmers and taking the reader to a level of basic
familiarity with Clojure.</p>
<p>Michael Fogus and I think there is more to Clojure that has yet to be addressed
by any of the books currently being written.  So we've started writing <a class="reference" href="http://joyofclojure.com/">&quot;The Joy
of Clojure&quot;</a>.  Our vision for this book is to impart
not just what Clojure <em>is</em>, but <em>why</em> it's the way it is; not just <em>how</em> to use it,
but how to <em>choose well</em> from among the wide variety of options Clojure provides.
And along the way we hope you'll experience the wonder, amazement, and, yes <em>joy</em> that
Clojure can bring to programming tasks that often feel like nothing more than
chores in other environments.</p>
<p>I also wanted to take this opportunity to brag a little on <a class="reference" href="http://blog.fogus.me/about/">Fogus</a>.  He's been a fantastic partner throughout this
process -- I wouldn't even be involved if it weren't for him.  He has put into
our book many references to papers and books that I've never heard of, but that
illuminate much of Clojure's design -- clearly he has read a good deal more than
I have.  Once we're done writing, I intend to use the Bibliography as a reading
list -- I'm sure it will be enlightening.  He is dedicated to producing the best
book we can, and he's the only reason we're meeting any of our deadlines.  I'm
looking forward to the next few months as we finish this book together.</p>
<a class="reference image-reference" href="http://joyofclojure.com/"><img align="left" alt="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" class="align-left" src="http://blog.n01se.net/wp-content/uploads/2010/01/joy.png" /></a>
<dl class="docutils">
<dt><strong>The Joy of Clojure</strong></dt>
<dd>Thinking the Clojure Way</dd>
</dl>
<p><em>by Michael Fogus and Chris Houser</em></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.n01se.net/?feed=rss2&amp;p=80</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.080 seconds -->
<!-- Cached page served by WP-Cache -->
