<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/'>
<channel>
  <title>Jp Calderone</title>
  <link>http://jcalderone.livejournal.com/</link>
  <description>Jp Calderone - LiveJournal.com</description>
  <lastBuildDate>Thu, 04 Jun 2009 13:52:42 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>jcalderone</lj:journal>
  <lj:journalid>1389557</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/45509.html</guid>
  <pubDate>Thu, 04 Jun 2009 13:52:42 GMT</pubDate>
  <title>April - May Reading List</title>
  <link>http://jcalderone.livejournal.com/45509.html</link>
  <description>&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Green Mars&lt;/u&gt;. Kim Stanley Robinson.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Blue Mars&lt;/u&gt;. Kim Stanley Robinson.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/45509.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/45295.html</guid>
  <pubDate>Tue, 26 May 2009 22:38:02 GMT</pubDate>
  <title>Note To Self: co_filename vs __file__</title>
  <link>http://jcalderone.livejournal.com/45295.html</link>
  <description>Python&apos;s traceback formatting code uses the co_filename attribute of code objects.  However tempting the __file__ attribute may seem, don&apos;t use it if you want to get results that agree with the built-in traceback formatting code.</description>
  <comments>http://jcalderone.livejournal.com/45295.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/44910.html</guid>
  <pubDate>Thu, 02 Apr 2009 14:16:25 GMT</pubDate>
  <title>January through March Reading List</title>
  <link>http://jcalderone.livejournal.com/44910.html</link>
  <description>&lt;ul&gt;
  &lt;li&gt;&lt;u&gt;House of Leaves&lt;/u&gt;.  Mark Danielewski.&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Jhegaala&lt;/u&gt;.  Steven Brust.&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Red Mars&lt;/u&gt;.  Kim Stanley Robinson.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/44910.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/44783.html</guid>
  <pubDate>Wed, 11 Feb 2009 22:29:08 GMT</pubDate>
  <title>Three Software Failures</title>
  <link>http://jcalderone.livejournal.com/44783.html</link>
  <description>I ran out of space on / on my desktop today.  As a result of this three obviously wrong things happened.  &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/joe/+bug/328285&quot;&gt;First, joe truncated a file to zero bytes and then segfaulted.&lt;/a&gt;  &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/emacs22/+bug/328287&quot;&gt;Second, emacs truncated a file I was working on to zero bytes.&lt;/a&gt;  &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/gnome-applets/+bug/61570&quot;&gt;Third, sticky notes lost all of my notes.&lt;/a&gt;  If you write and release software that behaves like this, you need to be embarrassed.</description>
  <comments>http://jcalderone.livejournal.com/44783.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/43867.html</guid>
  <pubDate>Thu, 08 Jan 2009 03:03:33 GMT</pubDate>
  <title>September through December reading list</title>
  <link>http://jcalderone.livejournal.com/43867.html</link>
  <description>&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Dogs of God: Columbus, the Inquisition, and the Defeat of the Moors&lt;/u&gt;.  James Reston Jr.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Zero: The Biography of a Dangerous Idea&lt;/u&gt;.  Charles Seife.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Best Of H.P. Lovecraft&lt;/u&gt;.  H.P. Lovecraft.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Given Day&lt;/u&gt;.  Dennis Lehane.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Sun Kings&lt;/u&gt;.  Stuart Clark.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;1453: The Holy War for Constantinople and the Clash of Islam and the West&lt;/u&gt;.  Roger Crowley.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/43867.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/43735.html</guid>
  <pubDate>Wed, 10 Dec 2008 17:15:18 GMT</pubDate>
  <title>What is the SigQ field of /proc/PID/status in Linux?</title>
  <link>http://jcalderone.livejournal.com/43735.html</link>
  <description>I had to read kernel source to figure this out, and when I did I learned the value isn&apos;t at all what I thought, so I thought I&apos;d let everyone else know.&lt;br /&gt;&lt;br /&gt;From fs/proc/array.c:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
    qsize = atomic_read(&amp;p-&amp;gt;user-&amp;gt;sigpending);
    ...
    buffer += sprintf(buffer, &quot;SigQ:\t%lu/%lu\n&quot;, qsize, qlim);
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;where &lt;code&gt;p&lt;/code&gt; is a &lt;code&gt;struct task_struct p&lt;/code&gt;.  From include/linux/sched.h:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
struct task_struct {
    ...
    /* process credentials */
    ...
    struct user_struct *user;
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
/*
 * Some day this will be a full-fledged user tracking system..
 */
struct user_struct {
    ...
    atomic_t sigpending;    /* How many pending signals does this user have? */
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So the &lt;code&gt;SigQ&lt;/code&gt; value in each process&apos;s status file is the total number of signals pending delivery across all processes owned by the UID of the process (or maybe the UID which started the process, I don&apos;t know how the user field of task_structs interacts with setuid).&lt;br /&gt;&lt;br /&gt;Pretty far from what I&apos;ve been assuming it meant, the number of signals pending delivery for each individual process. :/</description>
  <comments>http://jcalderone.livejournal.com/43735.html</comments>
  <lj:mood>indifferent</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/43317.html</guid>
  <pubDate>Tue, 09 Dec 2008 17:45:06 GMT</pubDate>
  <title>ioctl TIOCSTTY EIO</title>
  <link>http://jcalderone.livejournal.com/43317.html</link>
  <description>What does it mean if a TIOCSTTY ioctl fails with EIO (errno 5) on Linux?</description>
  <comments>http://jcalderone.livejournal.com/43317.html</comments>
  <lj:mood>enraged</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>9</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/42829.html</guid>
  <pubDate>Mon, 15 Sep 2008 00:17:47 GMT</pubDate>
  <title>August reading list</title>
  <link>http://jcalderone.livejournal.com/42829.html</link>
  <description>&lt;ul&gt;
  &lt;li&gt;&lt;u&gt;Singularity Sky&lt;/u&gt;.  Charles Stross.&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Anvil of Stars&lt;/u&gt;.  Greg Bear.&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Dune&lt;/u&gt;.  Frank Herbert.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/42829.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/42688.html</guid>
  <pubDate>Wed, 06 Aug 2008 23:42:08 GMT</pubDate>
  <title>Python and XPath</title>
  <link>http://jcalderone.livejournal.com/42688.html</link>
  <description>Quite some while ago, I decided to experiment with writing unit tests for some Nevow-based application code using XPath instead of DOM.  DOM-based assertions in unit tests tend to be quite verbose compared to the XPath equivalent.  Beyond that, though, the XPath seems to be able to express the intent of the test more accurately.  It doesn&apos;t rely on as many irrelevant details (like how many TextElements some CDATA is broken up into) - or at least that&apos;s the idea I wanted to try out.&lt;br /&gt;&lt;br /&gt;Unfortunately I only wrote a few tests like this and shortly afterwards I started focusing on non-XML tasks.  As far as the experiment went, I think it went well, but it&apos;s basically incomplete at this time.&lt;br /&gt;&lt;br /&gt;That&apos;s not what this post is about.&lt;br /&gt;&lt;br /&gt;A while ago, Ubuntu&apos;s Hardy Heron was released.  In Hardy, the Python package xml.xpath has vanished.  Apparently the package was unmaintained for some time and either Ubuntu or Debian or some combination of the two decided that it would no longer be supported.  Sad for me, because now all my XPath-based tests are broken on Ubuntu, which happens to be my primary platform.  It seems there are some other XPath libraries for Python available in Hardy, so today I tried to update my tests so that they will work on systems which still have xml.xpath but can also try to use a newer XPath library if xml.xpath is unavailable.&lt;br /&gt;&lt;br /&gt;Unfortunately (again) this turned out to be more difficult than I expected.  The fall-back library I selected is lxml.etree.  The first problem I encountered is that the Python API for processing XPath in lxml.etree is incompatible with the API in xml.xpath.  So instead of just changing a couple imports as I had hoped I would be able to do, I wrote a couple thin wrappers to expose both APIs in the same way.  The second problem I encountered is that the result objects returned by lxml.etree have a different API than the result objects returned by xml.xpath.  So I changed my thin wrappers to be more specific, extracting the exact data my unit tests required, rather than being somewhat more general and letting each test grab what it needed.  This meant widening the API to two wrappers from one.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
try:
    from xml.xpath import Evaluate
except ImportError:
    from lxml.etree import XPath, fromstring
    def evaluateXPath(path, document):
        return XPath(path).evaluate(fromstring(document))
    def evaluateTextXPath(path, document):
        return evaluateXPath(path, document)[0]
else:
    def evaluateXPath(path, document):
        return Evaluate(path, minidom.parseString(document))
    def evaluateTextXPath(path, document):
        return evaluateXPath(path, document)[0].wholeText
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After solving these two problems, I had two unit tests passing on my Hardy system.  Not a complete failure.  I have more than two unit tests that use XPath, though.  As it turns out, the next set of tests I looked at need to examine the values of attributes of nodes.  This is another area where xml.xpath and lxml.etree present different APIs.  If I want to make these tests pass, I need to write another wrapper function to expose attributes in a uniform manner.  Here&apos;s where I give up on fixing this for the moment.  It seems it&apos;s not reasonable to expect to transparently switch between xml.xpath and lxml.etree.&lt;br /&gt;&lt;br /&gt;Perhaps there&apos;s another XPath library out there I can use instead of lxml.etree.  Anyone have any tips they&apos;d like to share?</description>
  <comments>http://jcalderone.livejournal.com/42688.html</comments>
  <lj:music>The Lovin&apos; Spoonful - Bes&apos; Friends</lj:music>
  <media:title type="plain">The Lovin&apos; Spoonful - Bes&apos; Friends</media:title>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/42338.html</guid>
  <pubDate>Sun, 27 Jul 2008 21:19:28 GMT</pubDate>
  <title>May through July Reading List</title>
  <link>http://jcalderone.livejournal.com/42338.html</link>
  <description>&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;Against The Day&lt;/u&gt;.  Thomas Pynchon.
&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Nature Girl&lt;/u&gt;. Carl Hiaasen.
&lt;li&gt;
&lt;u&gt;HaltinG StatE&lt;/u&gt;.  Charles Stross.
&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/42338.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/42060.html</guid>
  <pubDate>Tue, 01 Jul 2008 14:12:49 GMT</pubDate>
  <title>TCP in the browser?</title>
  <link>http://jcalderone.livejournal.com/42060.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://washort.twistedmatrix.com/&quot;&gt;Allen&lt;/a&gt; brought to my attention a &lt;a href=&quot;http://cometdaily.com/2008/07/01/sockets-in-the-browser/&quot;&gt;blog post&lt;/a&gt; by Michael Carter about how Orbited now offers a JavaScript API for making TCP connections.  I&apos;m not sure how useful this is right now (and I actually mean that I&apos;m not sure, not that I think it&apos;s useless and am trying to avoid saying so), though I can see how if, at some future date it&apos;s possible to make TCP connections without going through a proxy, apps written this way will suddenly make a lot of sense &lt;b&gt;and&lt;/b&gt; be easy to port from apps already based on an API like this.&lt;/p&gt;

&lt;p&gt;Anyhow, I thought this would be simple to implement with &lt;a href=&quot;http://divmod.org/trac/wiki/DivmodNevow/Athena&quot;&gt;Athena&lt;/a&gt;, but I wanted to see how simple.  Five minutes later I had this untested code:&lt;/p&gt;

&lt;pre&gt;
# athenatcp.py
from twisted.internet.protocol import ClientCreator, Protocol
from twisted.internet import reactor

from nevow.athena import LiveElement, expose

class TCPElement(LiveElement):
    jsClass = &apos;Network.TCP&apos;

    @expose
    def connect(self, host, port):
        def connected(proto):
            self.proto = proto
            self.proto.dataReceived = self.dataReceived
            self.proto.connectionLost = self.connectionLost
        cc = ClientCreator(reactor, Protocol)
        d = cc.connectTCP(host, port)
        d.addCallback(connected)
        return d

    @expose
    def write(self, bytes):
        self.proto.transport.write(bytes)

    def dataReceived(self, data):
        self.callRemote(&apos;dataReceived&apos;, data)

    def connectionLost(self, reason):
        self.callRemote(&apos;connectionLost&apos;, reason.getErrorMessage())
&lt;/pre&gt;

&lt;pre&gt;
// athenatcp.js

// import Nevow.Athena

Network.TCP = Nevow.Athena.Widget.subclass(&apos;Network.TCP&apos;);
Network.TCP.methods(
    function connect(self, host, port) {
        return self.callRemote(&apos;connect&apos;, host, port);
    },

    function dataReceived(self, bytes) {
        // override this
    },

    function connectionLost(self, reason) {
        // override this
    });
&lt;/pre&gt;

&lt;p&gt;It&apos;d probably be better if &lt;code&gt;connect&lt;/code&gt; were actually a factory function returning &lt;code&gt;TCP&lt;/code&gt; instances, but the general idea would be the same.  Anyone think this is a really great idea?  Anyone want to turn this spike into a real library for Athena?&lt;/p&gt;</description>
  <comments>http://jcalderone.livejournal.com/42060.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/41916.html</guid>
  <pubDate>Sat, 28 Jun 2008 22:42:58 GMT</pubDate>
  <title>re: inventory meme</title>
  <link>http://jcalderone.livejournal.com/41916.html</link>
  <description>&lt;a href=&quot;http://glyph.twistedmatrix.com/&quot;&gt;Glyph&lt;/a&gt; tagged me in his &lt;a href=&quot;http://glyph.twistedmatrix.com/2008/06/memeventory-inventomeme-uh-how-about.html&quot;&gt;Inventory meme&lt;/a&gt; several weeks back.  At first, I didn&apos;t respond because I was too busy.  Then, because I forgot.  Then, because I decided it would be cheating to wait until I had the maximum number of items possible and then post.  Just now I happen to have been reminded of the meme, and I think I can spare the three minutes total this post is going to take, and I&apos;m totally unprepared.  So, here it is.

&lt;pre&gt;
Your hands are empty.  You are completely naked.
&lt;/pre&gt;</description>
  <comments>http://jcalderone.livejournal.com/41916.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/41647.html</guid>
  <pubDate>Sat, 26 Apr 2008 17:32:26 GMT</pubDate>
  <title>February through April Reading List</title>
  <link>http://jcalderone.livejournal.com/41647.html</link>
  <description>&lt;ul&gt;&lt;li&gt;&lt;u&gt;Something Wicked This Way Comes&lt;/u&gt;.&amp;nbsp; Ray Bradbury.&lt;/li&gt;&lt;li&gt;&lt;u&gt;The Eyre Affair&lt;/u&gt;.&amp;nbsp; Jasper Fforde.&lt;/li&gt;&lt;li&gt;&lt;u&gt;The Star Rover&lt;/u&gt;.&amp;nbsp; Jack London.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Travels With Herodotus&lt;/u&gt;.&amp;nbsp; Ryszard Kapuściński.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Omnivore&apos;s Dilemma&lt;/u&gt;.&amp;nbsp; Michael Pollan.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Lankhmar&lt;/u&gt;.&amp;nbsp; Fritz Leiber.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Suite Française&lt;/u&gt;.&amp;nbsp; Irène Némirovsky.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Persepolis: The Story of a Childhood&lt;/u&gt;.&amp;nbsp; Marjane Satrapi.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Persepolis 2: The Story of a Return&lt;/u&gt;.&amp;nbsp; Marjane Satrapi.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Maus 1: My Father Bleeds History&lt;/u&gt;.&amp;nbsp; Art Spiegelman.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Maus 2: And Here My Troubles Began&lt;/u&gt;.&amp;nbsp; Art Spiegelman.&lt;/li&gt;&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/41647.html</comments>
  <lj:music>The Velvet Underground - Some Kinda Love</lj:music>
  <media:title type="plain">The Velvet Underground - Some Kinda Love</media:title>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/41291.html</guid>
  <pubDate>Fri, 11 Apr 2008 16:32:09 GMT</pubDate>
  <title>pyOpenSSL 0.7 final released</title>
  <link>http://jcalderone.livejournal.com/41291.html</link>
  <description>Alright, it&apos;s done.  Here are the highlights since 0.6:&lt;br /&gt;&lt;br /&gt;Bug fixes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Memory leak in X509.get_pubkey eliminated&lt;/li&gt;&lt;li&gt;Memory leaks in X509Name.__getattr__ and X509Name.__setattr__ eliminated&lt;/li&gt;&lt;li&gt;RuntimeWarning from X509Name comparison eliminated&lt;/li&gt;&lt;li&gt;X509Name reference counting issues resulting in memory corruption eliminated&lt;/li&gt;&lt;li&gt;Uninitialized PKeys are now rejected by X509Req signature APIs&lt;/li&gt;&lt;li&gt;Memory leaks in X509Name.__getattr__ and X509Name.__setattr__ eliminated&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;New features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SSL_get_shutdown and SSL_set_shutdown exposed as Connection.get_shutdown and Connection.set_shutdown&lt;/li&gt;&lt;li&gt;SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN exposed as SSL.SENT_SHUTDOWN and SSL.RECEIVED_SHUTDOWN&lt;/li&gt;&lt;li&gt;X509_verify_cert_error_string exposed as OpenSSL.crypto.X509_verify_cert_error_string&lt;/li&gt;&lt;li&gt;X509.get_serial_number and X509.set_serial_number now accept long integers&lt;/li&gt;&lt;li&gt;Expose notBefore and notAfter on X509 certificates for inspection and mutation&lt;/li&gt;&lt;li&gt;Expose low-level X509Name state with X509Name.get_components&lt;/li&gt;&lt;li&gt;Expose hashing and DER access on X509Names&lt;/li&gt;&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/41291.html</comments>
  <lj:music>Kings Of Leon - Velvet Snow</lj:music>
  <media:title type="plain">Kings Of Leon - Velvet Snow</media:title>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/41131.html</guid>
  <pubDate>Sat, 22 Mar 2008 18:25:31 GMT</pubDate>
  <title>pyOpenSSL 0.7a1</title>
  <link>http://jcalderone.livejournal.com/41131.html</link>
  <description>&lt;a href=&quot;http://sourceforge.net/project/showfiles.php?group_id=31249&quot;&gt;Hot off the presses&lt;/a&gt;, &lt;a href=&quot;http://sourceforge.net/mailarchive/forum.php?thread_name=20080322181158.6859.691484542.divmod.quotient.21755%40ohm&amp;amp;forum_name=pyopenssl-list&quot;&gt;pyOpenSSL 0.7a1 released&lt;/a&gt;.  Give it a spin and let me know how it goes.</description>
  <comments>http://jcalderone.livejournal.com/41131.html</comments>
  <lj:music>Grateful Dead - Not Fade Away</lj:music>
  <media:title type="plain">Grateful Dead - Not Fade Away</media:title>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/40668.html</guid>
  <pubDate>Wed, 06 Feb 2008 19:19:05 GMT</pubDate>
  <title>Ever relevant</title>
  <link>http://jcalderone.livejournal.com/40668.html</link>
  <description>It is good to re-read &lt;a href=&quot;http://www.cs.yale.edu/quotes.html&quot;&gt;Alan Perlis&apos; epigrams in programming&lt;/a&gt; from time to time.&lt;br /&gt;&lt;br /&gt;Some which stand out to me today:&lt;br /&gt;&lt;br /&gt;32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.&lt;br /&gt;41. Some programming languages manage to absorb change, but withstand progress.&lt;br /&gt;64. Often it is the means that justify the ends: Goals advance technique and technique survives even when goal structures crumble.&lt;br /&gt;94. Interfaces keep things tidy, but don&apos;t accelerate growth: Functions do.&lt;br /&gt;&lt;br /&gt;One which I don&apos;t think has ever stood out to me before:&lt;br /&gt;&lt;br /&gt;20. Wherever there is modularity there is the potential for misunderstanding: Hiding information implies a need to check communication.&lt;br /&gt;&lt;br /&gt;And of course, there are the old favorites:&lt;br /&gt;&lt;br /&gt;11. If you have a procedure with ten parameters, you probably missed some.&lt;br /&gt;95. Don&apos;t have good ideas if you aren&apos;t willing to be responsible for them.&lt;br /&gt;101. Dealing with failure is easy: Work hard to improve. Success is also easy to handle: You&apos;ve solved the wrong problem. Work hard to improve.&lt;br /&gt;117. It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?</description>
  <comments>http://jcalderone.livejournal.com/40668.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/40230.html</guid>
  <pubDate>Fri, 04 Jan 2008 13:53:14 GMT</pubDate>
  <title>notes on netgear support website</title>
  <link>http://jcalderone.livejournal.com/40230.html</link>
  <description>&lt;ul&gt;
&lt;li&gt;
comments are mangled incorrectly, doubling single quotes, presumably in a confused attempt to prevent SQL injection attacks.
&lt;/li&gt;
&lt;li&gt;
page caching behavior is wrong, so after a ticket is updated by netgear support staff, the update will not appear unless the browser is made to disregard its cache.
&lt;/li&gt;
&lt;li&gt;
timestamps on comments are wrong, perhaps by roughly (UTC - PST) hours.
&lt;/li&gt;
&lt;li&gt;
netgear support staff can&apos;t actually fix any problem you have.
&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/40230.html</comments>
  <lj:music>Fallible, Blues Traveler</lj:music>
  <media:title type="plain">Fallible, Blues Traveler</media:title>
  <lj:mood>pissed off</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/40021.html</guid>
  <pubDate>Fri, 04 Jan 2008 02:25:10 GMT</pubDate>
  <title>One in twenty eight and falling...</title>
  <link>http://jcalderone.livejournal.com/40021.html</link>
  <description>&lt;p&gt;
&lt;a href=&quot;http://www.space.com/php/multimedia/imagedisplay/img_display.php?pic=080103-wd5-marscourse-02.jpg&quot;&gt;
Asteroid on near-miss course with Mars&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
No one taught these guys to label their plots, unfortunately (nice of them to put &quot;mars&quot; and &quot;sun&quot; on there though).  To make it clearer, the cyan line is the probable trajectory of 2007 WD5.  White dots indicate a possible position at the time it would intercept mars&apos; orbital, if it does.
&lt;/p&gt;

&lt;p&gt;
Will there be a collision?  Probably not.  One in twenty eight odds, though?  Those are most certainly &lt;strong&gt;not&lt;/strong&gt; astronomical odds.
&lt;/p&gt;</description>
  <comments>http://jcalderone.livejournal.com/40021.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/39794.html</guid>
  <pubDate>Fri, 21 Dec 2007 22:41:11 GMT</pubDate>
  <title>Filesystem structure of a Python project</title>
  <link>http://jcalderone.livejournal.com/39794.html</link>
  <description>Do:

&lt;ul&gt;
&lt;li&gt;
name the directory something related to your project.  For example, if your project is named &quot;Twisted&quot;, name the top-level directory for its source files &lt;code&gt;Twisted&lt;/code&gt;.  When you do releases, you should include a version number suffix: &lt;code&gt;Twisted-2.5&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
create a directory &lt;code&gt;Twisted/bin&lt;/code&gt; and put your executables there, if you have any.  Don&apos;t give them a &lt;code&gt;.py&lt;/code&gt; extension, even if they are Python source files.  Don&apos;t put any code in them except an import of and call to a main function defined somewhere else in your projects.
&lt;/li&gt;
&lt;li&gt;
If your project is expressable as a single Python source file, then put it into the directory and name it something related to your project.  For example, &lt;code&gt;Twisted/twisted.py&lt;/code&gt;.  If you need multiple source files, create a package instead (&lt;code&gt;Twisted/twisted/&lt;/code&gt;, with an empty &lt;code&gt;Twisted/twisted/__init__.py&lt;/code&gt;) and place your source files in it.  For example, &lt;code&gt;Twisted/twisted/internet.py&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
put your unit tests in a sub-package of your package (note - this means that the &lt;em&gt;single Python source file&lt;/em&gt; option above was a trick - you &lt;strong&gt;always&lt;/strong&gt; need at least one other file for your unit tests).  For example, &lt;code&gt;Twisted/twisted/test/&lt;/code&gt;.  Of course, make it a package with &lt;code&gt;Twisted/twisted/test/__init__.py&lt;/code&gt;.  Place tests in files like &lt;code&gt;Twisted/twisted/test/test_internet.py&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
add &lt;code&gt;Twisted/README&lt;/code&gt; and &lt;code&gt;Twisted/setup.py&lt;/code&gt; to explain and install your software, respectively, if you&apos;re feeling nice.
&lt;/li&gt;
&lt;/ul&gt;

Don&apos;t:

&lt;ul&gt;
&lt;li&gt;
put your source in a directory called &lt;code&gt;src&lt;/code&gt; or &lt;code&gt;lib&lt;/code&gt;.  This makes it hard to run without installing.
&lt;li&gt;
&lt;li&gt;
put your tests outside of your Python package.  This makes it hard to run the tests against an installed version.
&lt;/li&gt;
&lt;li&gt;
create a package that &lt;strong&gt;only&lt;/strong&gt; has a &lt;code&gt;__init__.py&lt;/code&gt; and then put all your code into &lt;code&gt;__init__.py&lt;/code&gt;.  Just make a module instead of a package, it&apos;s simpler.
&lt;/li&gt;
&lt;li&gt;
try to come up with magical hacks to make Python able to import your module or package without having the user add the directory containing it to their import path (either via &lt;code&gt;PYTHONPATH&lt;/code&gt; or some other mechanism).  You will &lt;strong&gt;not&lt;/strong&gt; correctly handle all cases and users will get angry at you when your software doesn&apos;t work in their environment.
&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/39794.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/39678.html</guid>
  <pubDate>Mon, 03 Dec 2007 20:08:07 GMT</pubDate>
  <title>Incompatabilities between classic and new-style Python classes</title>
  <link>http://jcalderone.livejournal.com/39678.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://radix.twistedmatrix.com/&quot;&gt;radix&lt;/a&gt; asked me if I had a blog post about why changing a class from classic to new-style is a bad idea.  After I told him that I didn&apos;t he insisted that I should write one.  Since doing so will take less work than finding something else to distract his attention, here it is:&lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;
attribute lookup
&lt;p&gt;
Attributes on instances of classic classes override attributes of the same name on their class.  For example:
&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; class SimpleDescriptor(object):
...     def __get__(self, instance, type):
...             print &apos;getting&apos;
...             return instance.__dict__[&apos;simple&apos;]
...     def __set__(self, instance, value):
...             print &apos;setting&apos;
...             instance.__dict__[&apos;simple&apos;] = value
...
&amp;gt;&amp;gt;&amp;gt; class classic:
...     simple = SimpleDescriptor()
...
&amp;gt;&amp;gt;&amp;gt; x = classic()
&amp;gt;&amp;gt;&amp;gt; x.simple = 10
&amp;gt;&amp;gt;&amp;gt; x.simple
10
&amp;gt;&amp;gt;&amp;gt; class newstyle(object):
...     simple = SimpleDescriptor()
...
&amp;gt;&amp;gt;&amp;gt; x = newstyle()
&amp;gt;&amp;gt;&amp;gt; x.simple
getting
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in ?
  File &quot;&lt;stdin&gt;&quot;, line 4, in __get__
KeyError: &apos;simple&apos;
&amp;gt;&amp;gt;&amp;gt; x.simple = 10
setting
&amp;gt;&amp;gt;&amp;gt; x.simple
getting
10
&lt;/pre&gt;
As you can see, the descriptor on the new-style class can both handle the setattr and continue to operate after shadowing itself with an instance variable.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
Special methods
&lt;p&gt;
A particularly interesting consequence of the previous point is that the behavior of special methods changes in some cases:
&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; class x:
...     def __init__(self):
...             self.__eq__ = lambda other: True
...
&amp;gt;&amp;gt;&amp;gt; x() == 10
True
&amp;gt;&amp;gt;&amp;gt; class x(object):
...     def __init__(self):
...             self.__eq__ = lambda other: True
...
&amp;gt;&amp;gt;&amp;gt; x() == 10
False
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
MRO
&lt;p&gt;
Rules for determining the method resolution forbid new-style classes in places where classic classes are acceptable.  Consider:
&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; class x: pass
...
&amp;gt;&amp;gt;&amp;gt; class y(object, x): pass
...
&amp;gt;&amp;gt;&amp;gt; class x(object): pass
...
&amp;gt;&amp;gt;&amp;gt; class y(object, x): pass
...
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in ?
TypeError: Error when calling the metaclass bases
    Cannot create a consistent method resolution
order (MRO) for bases object, x
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;
Hopefully that&apos;s enough to satisfy radix.  Know of other incompatibilities?  Please comment.
&lt;/p&gt;</description>
  <comments>http://jcalderone.livejournal.com/39678.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/39258.html</guid>
  <pubDate>Sat, 10 Nov 2007 18:19:31 GMT</pubDate>
  <link>http://jcalderone.livejournal.com/39258.html</link>
  <description>3.7V li-poly:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.all-battery.com/browseproducts/Polymer-Li-Ion-Battery--3.7V-1300mAh-(503566).HTML&quot;&gt;$7, 1300mAh, 25 grams, 2.5A max&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.all-battery.com/browseproducts/Polymer-Li-Ion-Battery--3.7V-875mAh-(383562).HTML&quot;&gt;$6, 850mAh, 20 grams, 1.75A max&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.maxamps.com/Lipo-430-Loose-Cell.htm&quot;&gt;$8, 430mAh, 12 grams, 6.5A max&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.all-battery.com/browseproducts/Polymer-Li-Ion-Battery-3.7V-230mAh-(501638)-With-PCB-and-Bare-Leads.html&quot;&gt;$10, 220mAh, 5.4 grams, .44A max&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.maxamps.com/Lipo-160-37-Cell.htm&quot;&gt;$5, 160mAh, 5 grams, 2A max&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://stevensaero.com/shop/product.php?productid=16334&amp;amp;cat=475&amp;amp;page=1#tabs&quot;&gt;$7, 130mAh, 3.4 grams, 4.6A max&lt;/a&gt;</description>
  <comments>http://jcalderone.livejournal.com/39258.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/39091.html</guid>
  <pubDate>Sat, 20 Oct 2007 00:15:09 GMT</pubDate>
  <title>October through January Reading List</title>
  <link>http://jcalderone.livejournal.com/39091.html</link>
  <description>&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Smoke and Mirrors.&lt;/u&gt;  Neil Gaiman.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Long Tomorrow.&lt;/u&gt;  Leigh Brackett.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Norstrillia.&lt;/u&gt;  Cordwainer Smith.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Nova.&lt;/u&gt;  Samuel R. Delany.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Iron Sunrise.&lt;/u&gt;  Charles Stross.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Lies of Locke Lamora.&lt;/u&gt;  Scott Lynch.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;The Road.&lt;/u&gt;  Cormac McCarthy.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Paradise Lost.&lt;/u&gt;  John Milton.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Lord of Light.&lt;/u&gt;  Roger Zelazny.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://jcalderone.livejournal.com/39091.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/38877.html</guid>
  <pubDate>Tue, 02 Oct 2007 23:57:28 GMT</pubDate>
  <title>Hair today...</title>
  <link>http://jcalderone.livejournal.com/38877.html</link>
  <description>&lt;a href=&quot;http://flickr.com/photos/jcalderone/1440022803/&quot;&gt;Some pictures&lt;/a&gt; &lt;a href=&quot;http://flickr.com/photos/jcalderone/1440883368/&quot;&gt;of&lt;/a&gt; &lt;a href=&quot;http://flickr.com/photos/jcalderone/1440021983/&quot;&gt;Quechee Gorge&lt;/a&gt; &lt;a href=&quot;http://flickr.com/photos/jcalderone/1440882616/&quot;&gt;up&lt;/a&gt;.  Including a &lt;a href=&quot;http://flickr.com/photos/jcalderone/1445438282/&quot;&gt;360° panorama&lt;/a&gt; I assembled.  Which took forever with stupid gimp.  And it didn&apos;t come out very well anyway.  Stupid parallax, I&apos;ll get you next time.&lt;br /&gt;&lt;br /&gt;Off to San Antonio tomorrow, back next week.  If there&apos;s anything worth taking pictures of (other than my brother) maybe those&apos;ll show up in a week or so.</description>
  <comments>http://jcalderone.livejournal.com/38877.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/38527.html</guid>
  <pubDate>Mon, 01 Oct 2007 00:21:28 GMT</pubDate>
  <title>September Reading List</title>
  <link>http://jcalderone.livejournal.com/38527.html</link>
  <description>By way of &lt;u&gt;The Book of Jhereg&lt;/u&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Jhereg&lt;/u&gt;  Steven Brust.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Yendi&lt;/u&gt;  Steven Brust.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Teckla&lt;/u&gt;  Steven Brust.&lt;/li&gt;
&lt;/ul&gt;

Also some Milton, for class: On the Morning of Christ&apos;s Nativity, At a Solemn Music, L&apos;Allegro, Il Penseroso, Lycidas, On the New Forcers of Conscience, To Mr. Cyriack Skinner Upon His Blindness, and sonnets 11, 12, 15, 16, 19.</description>
  <comments>http://jcalderone.livejournal.com/38527.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://jcalderone.livejournal.com/37881.html</guid>
  <pubDate>Wed, 12 Sep 2007 02:39:12 GMT</pubDate>
  <link>http://jcalderone.livejournal.com/37881.html</link>
  <description>chevre, pine nut, raisin, onion, garlic, bacon, duck pizza</description>
  <comments>http://jcalderone.livejournal.com/37881.html</comments>
  <lj:mood>rejuvenated</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
</channel>
</rss>
