<?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/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>David&apos;s Saga of Geekery</title>
  <link>http://geekery.livejournal.com/</link>
  <description>David&apos;s Saga of Geekery - LiveJournal.com</description>
  <lastBuildDate>Tue, 25 Nov 2008 05:12:33 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>geekery</lj:journal>
  <lj:journalid>1307277</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/14879.html</guid>
  <pubDate>Tue, 25 Nov 2008 05:12:33 GMT</pubDate>
  <title>Apache modules on Debian</title>
  <link>http://geekery.livejournal.com/14879.html</link>
  <description>I&apos;m thinking of installing &lt;a href=&quot;http://typosphere.org/&quot;&gt;Typo&lt;/a&gt;.  Among the various things it needs, Apache&apos;s mod_rewrite module must be turned on.&lt;br /&gt;&lt;br /&gt;Debian has its own means for managing apache modules:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; a2enmod&lt;br /&gt;&lt;li&gt; a2dismod&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Also, for virtual hosts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;a2ensite&lt;br /&gt;&lt;li&gt;a2dissite&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.debuntu.org/2006/06/15/66-how-to-enable-apache-modules-under-debian-based-system/2&quot;&gt;Instructions for enabling Apache modules under debian&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Also see &lt;a href=&quot;http://www.ducea.com/2006/05/30/managing-apache2-modules-the-debian-way/&quot;&gt;another, perhaps better-written version&lt;/a&gt;)</description>
  <comments>http://geekery.livejournal.com/14879.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/14774.html</guid>
  <pubDate>Sat, 29 Mar 2008 23:50:18 GMT</pubDate>
  <link>http://geekery.livejournal.com/14774.html</link>
  <description>I&apos;m dealing with a cloud of objects, where each object references a list of other objects.  Every reference is bidirectional.  Every reference has a type.  Starting with some object, I will need to be able to traverse the structure formed by references of some type to confirm that there is a path between provider-objects and consumer-objects.&lt;br /&gt;&lt;br /&gt;I&apos;ve googled about for some type of design pattern for this without finding anything even remotely appropriate.  Anyone have a suggestion?</description>
  <comments>http://geekery.livejournal.com/14774.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/14580.html</guid>
  <pubDate>Mon, 24 Mar 2008 05:36:07 GMT</pubDate>
  <title>Ruby #1</title>
  <link>http://geekery.livejournal.com/14580.html</link>
  <description>The PHP project having gotten down to a routine, I figured that I would add a similar project in some other language.  I had been planning on Java, and learning Eclipse while I was at it.  Looking for a more interesting project, I thought I would revisit something that I had been using to learn Ruby and rewriting it in Java.&lt;br /&gt;&lt;br /&gt;That was the plan on Wednesday.  What actually happened is that the project, in Ruby, reached out &amp; grabbed me.  It hadn&apos;t been left in a bad place, I just had other things that needed my attention, so it fell off of my radar about 20 months back.  So rather than a project with which I took one small step every day, I did nothing else for several days straight.&lt;br /&gt;&lt;br /&gt;I recall from back in 2006 that I was having problems wrapping my brain around the language.  I&apos;m not sure what changed in the interim, but it all felt very smooth to me this time around.  Of course I had forgotten all of the little details about syntax and libraries, but I had a program to start with - with unit tests, even!, &quot;Programming Ruby The Pragmatic Programmers&apos; Guide&quot;, and a variety of web sites to help me.  It might be that 20 months ago I had been working exclusively with C# for quite a while and so a scripting language was not how my brain was oriented while recently I&apos;ve been working with Perl &amp; PHP.  Or it might be that I&apos;m older &amp; smarter now.&lt;br /&gt;&lt;br /&gt;In the last few days, I&apos;ve relearned Ruby&apos;s language and libraries (not every detail, of course, but quite a bit of it) and extended and revamped the existing code.  I&apos;ve researched and implemented the &lt;a href=&quot;http://en.wikipedia.org/wiki/Flyweight_pattern&quot;&gt;Flyweight Pattern&lt;/a&gt;.  I didn&apos;t know the name of the pattern when I started off, but I knew I wanted to accomplish and it seemed obvious that there ought to be a pattern for it, so I started from the Singleton Pattern and looked from there.  I got a lot of help on the implementation of that from &lt;a href=&quot;http://debasishg.blogspot.com/2007/06/design-tip-localize-your-object.html&quot;&gt;this blog&lt;/a&gt; and learned about mixins in the process.&lt;br /&gt;&lt;br /&gt;My intention here is to reduce the time I allocate to this project to an hour or so a day.  It might be difficult, as this is software I want to make use of.&lt;br /&gt;&lt;br /&gt;More on this tomorrow.</description>
  <comments>http://geekery.livejournal.com/14580.html</comments>
  <category>ruby</category>
  <category>flyweight</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/14220.html</guid>
  <pubDate>Tue, 18 Mar 2008 02:52:06 GMT</pubDate>
  <title>PHP #13</title>
  <link>http://geekery.livejournal.com/14220.html</link>
  <description>&quot;Checklist instances should be able to be named.&quot;&lt;br /&gt;&lt;br /&gt;Test: Store a name to a checklist.&lt;br /&gt;Test: Store a name to a checklist and read it back.&lt;br /&gt;&lt;br /&gt;Wrote code to deal with this.  For the most part, everything I needed was known off the top of my head, or could be copied off of previous code where it had been implemented after consulting with manuals.&lt;br /&gt;&lt;br /&gt;I did find myself confirming with the manual that PHP has the typical &apos;default&apos; switch case.&lt;br /&gt;&lt;br /&gt;All tests pass except the one which says that the name is displayed correctly in XHTML.  That will be dealt with in the next bit of coding.</description>
  <comments>http://geekery.livejournal.com/14220.html</comments>
  <category>php</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/13694.html</guid>
  <pubDate>Mon, 03 Mar 2008 22:09:02 GMT</pubDate>
  <title>PHP #11</title>
  <link>http://geekery.livejournal.com/13694.html</link>
  <description>&lt;q&gt;Checklist should provide a means for storing the state of each item.&lt;/q&gt;&lt;br /&gt;&lt;br /&gt;Yup.  Same problem as yesterday, but now I have the &lt;code&gt;CheckItem&lt;/code&gt; class to build off of.&lt;br /&gt;&lt;br /&gt;I&apos;m starting by changing &lt;code&gt;Checklist::add()&lt;/code&gt; to store a CheckItem instead of a string.  This should make any tests that care fail obviously right from the start.  Fixed all the tests that complained about wrong data.  This led to fixing &lt;code&gt;ChecklistUI::displayChecklist()&lt;/code&gt; where PHP complained that an object is not a string, which allowed its tests to execute, which led to them being fixed.&lt;br /&gt;&lt;br /&gt;Added a test to assert that what Checklist::current() and Checklist::next() provide are CheckItem objects.&lt;br /&gt;&lt;br /&gt;... and now checked checkboxes persist.</description>
  <comments>http://geekery.livejournal.com/13694.html</comments>
  <category>php</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/13326.html</guid>
  <pubDate>Mon, 03 Mar 2008 13:29:18 GMT</pubDate>
  <title>EasyEclipse?</title>
  <link>http://geekery.livejournal.com/13326.html</link>
  <description>I want to dust off my ancient Java knowledge.  First question seems to be &quot;Which IDE?&quot;.  &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt; seems to be popular.  &lt;a href=&quot;http://easyeclipse.org/&quot;&gt;EasyEclipse&lt;/a&gt; seems to be the easiest way to get there.  However, the sheer volume of data about this is staggering.  Anyone want to comment either way on these choices?</description>
  <comments>http://geekery.livejournal.com/13326.html</comments>
  <category>easyeclipse</category>
  <category>java</category>
  <category>eclipse</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/13062.html</guid>
  <pubDate>Mon, 03 Mar 2008 05:44:10 GMT</pubDate>
  <title>PHP #10</title>
  <link>http://geekery.livejournal.com/13062.html</link>
  <description>&lt;blockquote&gt;Checklist should provide a means for storing the state of each item.&lt;/blockquote&gt;&lt;br /&gt;Now each checklist item is no longer just a name - now it is a name and a state.  I&apos;ll make a class to represent a checklist item.&lt;br /&gt;&lt;br /&gt;Tests: A CheckItem can be constructed, and will contain the name, and optionally the state specified.&lt;br /&gt;&lt;br /&gt;Wrote CheckItem class to satisfy the tests.  I suspect that I&apos;ll need to add setters for the status pretty soon.&lt;br /&gt;&lt;br /&gt;I wanted my constructor to work with multiple signatures.  (That violates the &quot;simplest solution&quot; principle, but hey, this is all about the learning experience anyhow.)  It turns out that PHP does not support function overloading, but it does have the &lt;a href=&quot;http://us.php.net/manual/en/function.func-num-args.php&quot;&gt;&lt;code&gt;func_num_args()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://us.php.net/manual/en/function.func-get-arg.php&quot;&gt;&lt;code&gt;func_get_arg()&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;http://us.php.net/manual/en/function.func-get-args.php&quot;&gt;&lt;code&gt;func_get_args()&lt;/code&gt;&lt;/a&gt; functions.</description>
  <comments>http://geekery.livejournal.com/13062.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/12924.html</guid>
  <pubDate>Sun, 02 Mar 2008 19:44:04 GMT</pubDate>
  <title>Remote Shell Annoyance</title>
  <link>http://geekery.livejournal.com/12924.html</link>
  <description>One result of a recent change in network connectivity from DSL to a cable modem is that my &lt;a href=&quot;http://www.openssh.com/&quot;&gt;ssh&lt;/a&gt; connections to remote systems time out if I don&apos;t interact with them for some absurdly small amount of time.  I note in the ssh manpage that there are a variety of keepalive options.  I&apos;ll have to explore them very soon.&lt;br /&gt;&lt;br /&gt;For today however, I&apos;ve spent more time on administrivia than I really had available, so I&apos;ll have to come back to this later.&lt;br /&gt;&lt;br /&gt;See the ssh_config(5) manpage and perhaps also &lt;a href=&quot;http://drupal.star.bnl.gov/STAR/comp/sofi/facility-access/ssh-stable-con&quot;&gt;SSH connection stability&lt;/a&gt;.</description>
  <comments>http://geekery.livejournal.com/12924.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/12589.html</guid>
  <pubDate>Sun, 02 Mar 2008 19:35:12 GMT</pubDate>
  <title>Data Storage</title>
  <link>http://geekery.livejournal.com/12589.html</link>
  <description>My backup strategy (such as it is) is to keep anything important in a &lt;a href=&quot;http://svnbook.red-bean.com/en/1.0/ch01.html#svn-ch-1-sect-1&quot;&gt;subversion&lt;/a&gt; repository, then replicate that so there is no single point of failure.&lt;br /&gt;&lt;br /&gt;Work projects go into a separate repository.&lt;br /&gt;&lt;br /&gt;The remotely located web server also gets its own repository.&lt;br /&gt;&lt;br /&gt;All of these get replicated (with &lt;a href=&quot;http://rsync.samba.org/&quot;&gt;rsync&lt;/a&gt;) to each computer (local and remote) and also to some external hard drives.&lt;br /&gt;&lt;br /&gt;Complicating things slightly is that my primary computer is a laptop.  My primary subversion repository resides on this laptop so that it is with me wherever I am.  Unfortunately I&apos;m running short of storage space.  I&apos;ve already upgraded the hard drive.  I might be able to get something with more capacity, but it would have to be slower, which I don&apos;t want.&lt;br /&gt;&lt;br /&gt;My largest use of storage space is for digital photographs.   I can&apos;t browse through them while they are in a subversion*, so I keep them all checked out.  This means that they are using up space twice on my laptop.  I&apos;m thinking of splitting out the photos from the subversion repository, and keeping their repository on an external drive.  (Of course, this repository would be replicated as well, just not to the laptop hard drive.)  I thought this would be a nightmare to manage because I had never heard of anyone splitting out a subversion repository, but apparently it is common enough that there is a tool (&apos;&lt;a href=&quot;http://svnbook.red-bean.com/en/1.0/ch05s03.html#svn-ch-5-sect-3.1.3&quot;&gt;svndumpfilter&lt;/a&gt;&apos;) whose documentation includes an example of exactly that use.&lt;br /&gt;&lt;br /&gt;* While writing the above, it occurred to me that one of the graphical Mac OS X subversion clients might just allow me to browse through photographs directly from the repository.  I&apos;ve found a few listed on the &lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;subversion project&lt;/a&gt;&apos;s &lt;a href=&quot;http://subversion.tigris.org/links.html#clients&quot;&gt;links page&lt;/a&gt;: &lt;a href=&quot;http://scplugin.tigris.org/&quot;&gt;SCPlugin&lt;/a&gt;, &lt;a href=&quot;http://www.lachoseinteractive.net/en/community/subversion/svnx/&quot;&gt;SvnX&lt;/a&gt;, and &lt;a href=&quot;http://zigversion.com/&quot;&gt;ZigVersion&lt;/a&gt;.  I&apos;ve looked at ZigVersion&apos;s introduction movie, and it does not appear to have this feature.  (ZigVersion is not open source, but does allow for free licenses for non-commercial users.)&lt;br /&gt;&lt;br /&gt;I&apos;ve just spent more time on this than I had hoped to.  This write-up should serve to allow me to pick up this issue later with minimal loss of context.</description>
  <comments>http://geekery.livejournal.com/12589.html</comments>
  <category>data</category>
  <category>subversion</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/12535.html</guid>
  <pubDate>Sat, 01 Mar 2008 22:26:23 GMT</pubDate>
  <title>PHP #9</title>
  <link>http://geekery.livejournal.com/12535.html</link>
  <description>Test: receive() should parse &apos;data_*&apos; items as well as &apos;newitems&apos;, so that they become one checklist.&lt;br /&gt;&lt;br /&gt;Wrote &lt;code&gt;ChecklistUITest::testReceiveHiddenData()&lt;/code&gt; and &lt;code&gt;ChecklistUITest::testReceiveHiddenDataAndTextarea()&lt;/code&gt; tests.  Also, in a fit of paranoia, wrote &lt;code&gt;ChecklistUITest::testReceiveBogusKeys()&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Modified &lt;code&gt;ChecklistUI::receive()&lt;/code&gt; to work correctly.  Had to research PHP&apos;s regular expression functions and ended up using &lt;code&gt;&lt;a href=&quot;http://www.php.net/manual/en/function.ereg.php&quot;&gt;ereg()&lt;/a&gt;&lt;/code&gt;.</description>
  <comments>http://geekery.livejournal.com/12535.html</comments>
  <category>regular expression</category>
  <category>php</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/12182.html</guid>
  <pubDate>Fri, 29 Feb 2008 20:21:57 GMT</pubDate>
  <title>Interlose</title>
  <link>http://geekery.livejournal.com/12182.html</link>
  <description>I go to check a file into my local &lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;subversion&lt;/a&gt; repository and discover that it is a mess.  It seems that when I reinstalled subversion after loading my OS onto my new drive I &apos;fixed&apos; where the repository lived.  This change was needed so that I could add other subversion repositories in parallel, but things are royally messed up.  The files copied from the old drive had .svn directories with the wrong location embedded in them.  And obviously, I&apos;ve not been keeping up with storing my files away properly.&lt;br /&gt;&lt;br /&gt;I guess I&apos;ve got my work cut out for me.</description>
  <comments>http://geekery.livejournal.com/12182.html</comments>
  <category>backup</category>
  <category>svn</category>
  <category>subversion</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/11800.html</guid>
  <pubDate>Fri, 29 Feb 2008 17:11:50 GMT</pubDate>
  <title>Interlude</title>
  <link>http://geekery.livejournal.com/11800.html</link>
  <description>NeoOffice lost its mind again, so I spent the morning fighting with software.&lt;br /&gt;&lt;br /&gt;While it had a spreadsheet document open, NeoOffice claimed it could not write it.  Then in trying to save the document under a new name, there were (unspecified) input/output errors, but a file was produced.  It then could not open the newer version of the document.&lt;br /&gt;&lt;br /&gt;I downloaded &amp; installed a newer version (2.2.2) of NeoOffice, but that could not open the file either.&lt;br /&gt;&lt;br /&gt;Then I downloaded and installed OpenOffice Aqua 2.4 (pre-release) and OpenOffice 2.3 (X11 version) in turn.  Neither of those were able to open the document.  I&amp;#127; tried the version of the document that NeoOffice originally claimed it could not write and was able to load in at least some version of it in to both varieties of OpenOffice.  The X11 version has the disadvantage of all X11 programs under Mac OS X, which is that Aqua treats everything running under X11 as a single program.  This makes switching between programs annoying, at the very least.  Also, the X11 version does not use the Mac OS X keystroke conventions, which is also annoying.  The Aqua version is so sssslllloooooowwww at to be unusable.&lt;br /&gt;&lt;br /&gt;I&apos;ll be dumping the NeoOffice and Aqua versions now.&lt;br /&gt;&lt;br /&gt;Oh, and I&apos;ll put a note in my &lt;a href=&quot;http://en.wikipedia.org/wiki/Tickler_file&quot;&gt;Tickler File&lt;/a&gt; to check out the current Aqua version in May.</description>
  <comments>http://geekery.livejournal.com/11800.html</comments>
  <category>neooffice</category>
  <category>openoffice aqua</category>
  <category>openoffice</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/11645.html</guid>
  <pubDate>Thu, 28 Feb 2008 18:50:35 GMT</pubDate>
  <title>PHP #8</title>
  <link>http://geekery.livejournal.com/11645.html</link>
  <description>Data in the form should persist from one display instance to the next.&lt;br /&gt;&lt;br /&gt;Because HTML checkboxes return nothing if they are not set, a full copy of the checklist data must be stored somewhere.  For now, I&apos;ll embed it into the form as hidden text fields in the form.  (Later, I&apos;m thinking I&apos;ll put it into a database and only carry around a reference to that data.  For now, there is just not so much data that I need to worry about it.)&lt;br /&gt;&lt;br /&gt;Each checkbox input tag must have a unique name.  First thought was to use the text of the checklist item, but that is prone to failure in two ways: multiple checklist items might be input with the same text; a checklist item&apos;s text might be the same as one of the (current or future) form field names.&lt;br /&gt;&lt;br /&gt;Answer is to generate a unique key for each checklist item, and use that key in the value of both the hidden input&apos;s name attribute and the checkbox input&apos;s name attribute.&lt;br /&gt;&lt;br /&gt;Test: Modify &lt;code&gt;ChecklistTest::testAddOne()&lt;/code&gt; and  &lt;code&gt;ChecklistTest::testAddTwo()&lt;/code&gt; to also check the return values from &lt;code&gt;Checklist::add()&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Resolution:  &lt;code&gt;Checklist::add()&lt;/code&gt; was modified to return the result of the &lt;code&gt;array_push()&lt;/code&gt; invocation used to add the item to the checklist array.  Should we start deleting things from the array, this will break.  At that point, &lt;code&gt;Checklist::add()&lt;/code&gt; would need to be modified to get the key of the last item in the array.  (Perhaps with &lt;code&gt;end()&lt;/code&gt; and &lt;code&gt;key()&lt;/code&gt;.)  In the meanwhile, that is only a projected need and I should focus on the known needs.&lt;br /&gt;&lt;br /&gt;Test: Modify &lt;code&gt;testDisplayChecklist()&lt;/code&gt; so that each checkbox&apos;s name will be set to the checklist item&apos;s text, rather than the value attribute.  Also, a hidden input tag should be provided to go with each checkbox input tag.&lt;br /&gt;&lt;br /&gt;Resolution: &lt;code&gt;displayChecklist()&lt;/code&gt; has been modified to comply.&lt;br /&gt;&lt;br /&gt;Tomorrow:&lt;br /&gt;&lt;br /&gt;Test: &lt;code&gt;receive()&lt;/code&gt; should parse &apos;data_*&apos; items as well as &apos;newitems&apos;, so that they become one checklist.&lt;br /&gt;&lt;br /&gt;Next day:&lt;br /&gt;&lt;br /&gt;Checklist should provide a means for storing the state of each item.&lt;br /&gt;&lt;br /&gt;Next day:&lt;br /&gt;&lt;br /&gt;Test: &lt;code&gt;receive()&lt;/code&gt; should parse &apos;box_*&apos; items and mark the checklist object appropriately.&lt;br /&gt;&lt;br /&gt;Next day:&lt;br /&gt;&lt;br /&gt;Test: &lt;code&gt;displayChecklist()&lt;/code&gt; should should display &apos;checked&apos; checklist items with the checkbox checked.</description>
  <comments>http://geekery.livejournal.com/11645.html</comments>
  <category>checklist</category>
  <category>php</category>
  <category>array</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/11452.html</guid>
  <pubDate>Thu, 28 Feb 2008 04:58:52 GMT</pubDate>
  <title>PHP #7</title>
  <link>http://geekery.livejournal.com/11452.html</link>
  <description>Getting back to this &apos;daily&apos; work after five days of dealing with personal business to the exclusion of this project...&lt;br /&gt;&lt;br /&gt;Checklist data needs to be persistent. Currently, it is parsed and displayed, but immediately forgotten.&lt;br /&gt;&lt;br /&gt;Before I start that, though...&lt;br /&gt;Looking at the generated XHTML, I notice that the value attributes of the checkbox input tags have newlines appended to them (except for the last one).  This ought to be stripped.&lt;br /&gt;&lt;br /&gt;Dealing with this is not the goal today, but niggling little details like this should be dealt with as they are found, or they just pile up.&lt;br /&gt;&lt;br /&gt;Test first.  It turns out that &lt;code&gt;ChecklistUITest::testReceiveTextareaTwoLines()&lt;/code&gt; was incorrect.  Fixed the test.  It failed.&lt;br /&gt;&lt;br /&gt;Guessing that there is a &lt;code&gt;chop()&lt;/code&gt; function turns out to be correct.  It is an alias for &lt;a href=&quot;http://docs.php.net/manual/en/function.rtrim.php&quot;&gt;&lt;code&gt;rtrim()&lt;/code&gt;&lt;/a&gt;.  Now test passes again.&lt;br /&gt;&lt;br /&gt;In the process of this, I was forcibly reminded of the difference between single &amp; double quotes.&lt;br /&gt;&lt;br /&gt;Now.  On to the task at hand.&lt;br /&gt;&lt;br /&gt;I think that I&apos;ll eventually want to persist data in a database of some kind.  That&apos;s way too big a step to take right now.  Until then, I&apos;ll put the data into hidden fields in the form.  I imagine that even once most data is persisted in a database, I&apos;ll still need to pass along some kind of session key, so the code to hide data in a form will not be a waste of time.&lt;br /&gt;&lt;br /&gt;I&apos;ll have to pick this up tomorrow.</description>
  <comments>http://geekery.livejournal.com/11452.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/11199.html</guid>
  <pubDate>Thu, 21 Feb 2008 05:41:57 GMT</pubDate>
  <title>PHP #6</title>
  <link>http://geekery.livejournal.com/11199.html</link>
  <description>Finally got all of the pieces in place to write (mostly) tested code to parse the incoming data, store it into a &lt;code&gt;Checklist&lt;/code&gt; object, and then redisplay it as a list of checkboxes.  The textarea is always there, as one might want to add items at any time.  When checklist items exist, they are displayed above the textarea.  All of the form XHTML has been moved into this new &lt;code&gt;ChecklistUI&lt;/code&gt; class.&lt;br /&gt;&lt;br /&gt;Things to work on next:&lt;br /&gt; - Preserve the checklist data, so that it is not lost when the form is submitted.  This could be done by encoding information into the form, or by storing the data somewhere.&lt;br /&gt; - Parse the checkbox state and store that setting with the item name that is already stored.&lt;br /&gt; - I found myself using &lt;code&gt;&amp;lt;br /&amp;gt;&lt;/code&gt; tags to make space between the textarea and the submit button.  That should really be done with CSS.</description>
  <comments>http://geekery.livejournal.com/11199.html</comments>
  <category>php</category>
  <lj:mood>accomplished</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/10840.html</guid>
  <pubDate>Tue, 19 Feb 2008 18:25:14 GMT</pubDate>
  <title>PHP #5</title>
  <link>http://geekery.livejournal.com/10840.html</link>
  <description>Today is the day to start implementing the code behind the Checklist web page.  Slow going is to be expected at first as I learn PHP5&apos;s class syntax and &lt;a href=&quot;http://www.phpunit.de/&quot;&gt;PHPUnit2&lt;/a&gt;&apos;s available assertions.  One annoyance is that PHPUnit2 requires that the test class extend &lt;code&gt;PHPUnit2_Framework_TestCase&lt;/code&gt;.  Since PHP5 has a single-inheritence model, that means that the test class cannot also extend the class under test and so I either have to reveal all of the class&apos;s internal data or test indirectly.&lt;br /&gt;&lt;br /&gt;At this point I have a tested class which keeps an array and should allow it to be iterated over.  Really, nothing more than is provided by the language for arrays, but now I have a framework on which to hang more functionality on.&lt;br /&gt;&lt;br /&gt;Tomorrow.  Only so many hours available today.</description>
  <comments>http://geekery.livejournal.com/10840.html</comments>
  <category>phpunit2</category>
  <category>php</category>
  <category>inheritence</category>
  <lj:mood>inching forward</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/10587.html</guid>
  <pubDate>Mon, 18 Feb 2008 23:23:27 GMT</pubDate>
  <title>PHP #4</title>
  <link>http://geekery.livejournal.com/10587.html</link>
  <description>Didn&apos;t really have time to correctly implement &quot;Parse Textarea Data&quot;, but I did hack in &lt;code&gt;echo()&lt;/code&gt; statements to make sure that I was able to find the data.  The &lt;a href=&quot;http://us2.php.net/manual/en/language.variables.external.php&quot;&gt;Variables from outside PHP&lt;/a&gt; page was an invaluable reference.  Also, I used &lt;a href=&quot;http://us2.php.net/manual/en/function.gettype.php&quot;&gt;&lt;code&gt;gettype()&lt;/code&gt;&lt;/a&gt; to figure out what format the data was in, then once I had determined that the results from a textarea were returned in a string, I guessed that a &lt;a href=&quot;http://us2.php.net/manual/en/function.split.php&quot;&gt;&lt;code&gt;split&lt;/code&gt;&lt;/a&gt; function existed and used that to turn the newline-delimited string into an array.</description>
  <comments>http://geekery.livejournal.com/10587.html</comments>
  <category>php</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/10250.html</guid>
  <pubDate>Sun, 17 Feb 2008 16:47:26 GMT</pubDate>
  <title>PHP #3</title>
  <link>http://geekery.livejournal.com/10250.html</link>
  <description>The CSS that I was using was convoluted beyond what is needed for this project, so I simplified it.&lt;br /&gt;&lt;br /&gt;A lot.&lt;br /&gt;&lt;br /&gt;The working example form that I had found online contained only a text input, while the form I&apos;m using needs a textarea.  I was concerned that this might be part of the cause of the problem interaction, so I swapped out the textarea for an input box.  When everything else was working, I swapped it back and determined that this did not cause my problems.&lt;br /&gt;&lt;br /&gt;I never did figure out exactly what in the old CSS was causing my problems.  It would be nice to know, but I would rather use my time to push forward on this project.&lt;br /&gt;&lt;br /&gt;In any event, the drastic simplification of the CSS and minor simplification of XHTML removed whe conflict.  Now I can move forward.  Sometimes simpler is better.&lt;br /&gt;&lt;br /&gt;Observant people will notice that I didn&apos;t post a Daily Tech yesterday.  I&apos;m hoping do fit in more programming later today, but I suspect that other geekery will take precedence.</description>
  <comments>http://geekery.livejournal.com/10250.html</comments>
  <category>css</category>
  <category>xhtml</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/10218.html</guid>
  <pubDate>Fri, 15 Feb 2008 16:49:58 GMT</pubDate>
  <title>PHP #2</title>
  <link>http://geekery.livejournal.com/10218.html</link>
  <description>What I didn&apos;t mention yesterday is that I hope to be able to put in an hour or three each day on one of the development projects, with each day having a specific goal.&lt;br /&gt;&lt;br /&gt;Today&apos;s goal was to parse the input into a PHP array.  As I got started, I noticed that the form was not allowing text to be typed in and the submit button was non-functional.  A small bit of playing around isolated the problem to be in the CSS.  Something to do with &lt;code&gt;float&lt;/code&gt; and &lt;code&gt;position: relative&lt;/code&gt;.  Several hours of searching the web and trying things leave me not too far advanced.  I do have an &lt;a href=&quot;http://www.webreference.com/authoring/style/sheets/layout/advanced/&quot;&gt;example that works&lt;/a&gt;, which I&apos;ll have to unravel tomorrow, as I&apos;m out of time for today.</description>
  <comments>http://geekery.livejournal.com/10218.html</comments>
  <category>css</category>
  <category>php</category>
  <lj:mood>stymied</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/9877.html</guid>
  <pubDate>Fri, 15 Feb 2008 14:19:28 GMT</pubDate>
  <title>PHP #1</title>
  <link>http://geekery.livejournal.com/9877.html</link>
  <description>While being unemployed and dealing with other facets of my life, I&apos;ve lost track of a whole lot of technologies.  To repair this situation, I&apos;ve started &lt;i&gt;two&lt;/i&gt; new software development projects.  The first is in C#.  I might eventually move development over to &lt;a href=&quot;http://www.mono-project.com/Main_Page&quot;&gt;mono&lt;/a&gt;, but for now that development requires access to a borrowed windows box.  The second is in &lt;a href=&quot;http://www.php.net/&quot;&gt;PHP5&lt;/a&gt;.  That is at &lt;a href=&quot;http://www.davidsilber.name/phpChecklist/&quot;&gt;http://www.davidsilber.name/phpChecklist/&lt;/a&gt; and can be worked on wherever I have Internet access.&lt;br /&gt;&lt;br /&gt;Yesterday, I made a base HTML page.  I swiped a lot of it from my &lt;a href=&quot;http://DavidSilber.name/&quot;&gt;online resume&lt;/a&gt;.  You might think that would make it easy, but there were a bunch of things to research.&lt;br /&gt;&lt;br /&gt;For the most part, a .php page can have just plain (X)HTML content in it, but it (not surprisingly) interferes with &lt;a href=&quot;http://httpd.apache.org/docs/2.0/howto/ssi.html&quot;&gt;server side includes&lt;/a&gt;.  The non-functional server side includes, of course, are replaced with snippets of PHP code.  In order to do that, I had to look into PHP&apos;s &lt;a href=&quot;http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server&quot;&gt;predefined variables&lt;/a&gt; and the &lt;a href=&quot;http://us2.php.net/manual/en/function.date.php&quot;&gt;&lt;code&gt;date()&lt;/code&gt;&lt;/a&gt; function.&lt;br /&gt;&lt;br /&gt;PHP also cannot cope with an &lt;a href=&quot;http://www.w3.org/TR/2004/REC-xml-20040204/#sec-prolog-dtd&quot;&gt;XML declaration&lt;/a&gt; (it gives a syntax error).  The solution to this is to send the XML declaration with the &lt;a href=&quot;http://us2.php.net/manual/en/function.header.php&quot;&gt;&lt;code&gt;header()&lt;/code&gt;&lt;/a&gt; function.&lt;br /&gt;&lt;br /&gt;I also spent a bit of time rearranging the swiped &lt;a href=&quot;http://www.w3.org/Style/CSS/&quot;&gt;CSS&lt;/a&gt;, warping it to my purposes.  I probably spent more time on it than I needed.  I was thinking that I would end up with a &lt;a href=&quot;http://www.w3schools.com/css/pr_class_position.asp&quot;&gt;fixed&lt;/a&gt; top menu bar under which all else would scroll, but after fighting it for a bit I realized that it was way beyond the scope for the day&apos;s work (I don&apos;t yet have any menu items) and put it aside.&lt;br /&gt;&lt;br /&gt;To get embarrassingly basic, I even had to read up on (X)HTML form syntax.&lt;br /&gt;&lt;br /&gt;There are no tests yet.  I suppose that I could check to see that I&apos;m displaying correct output, or have the correct date format.  Right now it is all one monolithic web page.  The non-trivial code for this will be implemented in separate class files and tested.  I expect that this will become multiple web pages fairly soon, at which point the wrapper text will be factored out into units that can be tested.</description>
  <comments>http://geekery.livejournal.com/9877.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/9402.html</guid>
  <pubDate>Tue, 11 Dec 2007 01:42:19 GMT</pubDate>
  <title>NUnit 2.4.5</title>
  <link>http://geekery.livejournal.com/9402.html</link>
  <description>I figured that I would try to compile the current version of NUnit.  Cleverly enough, the default target for NUnit&apos;s top-level .build file is &apos;help&apos;, which suggests targets that one might need to specify when building the package.&lt;br /&gt;&lt;br /&gt;Building proceeds just fine until NAnt runs in to the need for &apos;log4net&apos;.  This is used, but not provided by the NUnit code.  A bit of googling finds the &lt;a href=&quot;http://logging.apache.org/log4net/&quot;&gt;Apache log4net&lt;/a&gt; web site.&lt;br /&gt;&lt;br /&gt;Downloaded log4net &amp; built with &apos;nant compile-mono-2.0&apos;.&lt;br /&gt;&lt;br /&gt;The NUnit .build files want to copy log4net from a lib directory off of the main NUnit directory, so I made such a directory and copied .../log4net-1.2.10/bin/mono/2.0/debug/log4net.dll into it.&lt;br /&gt;&lt;br /&gt;Then, building NUnit with &apos;nant mono-2.0 build&apos; worked just fine.&lt;br /&gt;&lt;br /&gt;But I couldn&apos;t put the new NUnit anywhere where it could be linked to without it conflicting with the existing, older version.  I spent a while fighting with it, then reinstalled Mono &amp; gave up on having a new NUnit.  I suppose I should bother the mailing list about it.  If I do, I&apos;ll need to try again and capture error messages so that I can write intelligibly about it.</description>
  <comments>http://geekery.livejournal.com/9402.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/9211.html</guid>
  <pubDate>Mon, 10 Dec 2007 16:59:42 GMT</pubDate>
  <title>NAnt</title>
  <link>http://geekery.livejournal.com/9211.html</link>
  <description>The project builder of choice in the open-source .NET world seems to be NAnt.  I&apos;ve gotten the trivial bits of code that I have so far to build with it.  I&apos;ve not seen a good tutorial yet, but reading through the extensive set of .build files that NUnit uses is a good education on the subject.  My .build files are not nearly so complicated, of course.&lt;br /&gt;&lt;br /&gt;The default for NAnt is to build using the Mono 2.0 framework.  Because I want to be able to run unit tests, and Mono only provides a 1.0 version of NUnit, I had to figure out how to specify the target runtime.  Again, I cheated off the NUnit .build files.</description>
  <comments>http://geekery.livejournal.com/9211.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/8850.html</guid>
  <pubDate>Sun, 09 Dec 2007 20:26:27 GMT</pubDate>
  <title>C# Compiler Notes</title>
  <link>http://geekery.livejournal.com/8850.html</link>
  <description>It turns out that the mcs compiler targets the 1.1 runtime. &apos;gmcs&apos; targets the 2.0 runtime.  (There is also &apos;smcs&apos; which targets the 2.1 runtime, but it doesn&apos;t seem to function on my system.)&lt;br /&gt;&lt;br /&gt;Apparently, the nunit.framework.dll provided with Mono 1.2.5.1 is compiled for the 1.1 runtime, because gmcs cannot find an appropriate version in the GAC.&lt;br /&gt;&lt;br /&gt;To enable the C# 3.0 features, use the -langversion:linq option.  LINQ stands for &quot;Language Integrated Query&quot;, which looks like some cool functionality, but the option apparently does turns on all of the 3.0 features that have been implemented, not just the LINQ stuff.&lt;br /&gt;&lt;br /&gt;If I want the C# 3.0 features &amp; NUnit 2.4 features, I&apos;m going to have to build my own copy of NUnit.  I think I&apos;ll bother people on the mono mailing list about it first.  Perhaps there is some reason why a more recent NUnit was not built for the newer runtimes.</description>
  <comments>http://geekery.livejournal.com/8850.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/8523.html</guid>
  <pubDate>Sun, 09 Dec 2007 17:07:21 GMT</pubDate>
  <link>http://geekery.livejournal.com/8523.html</link>
  <description>For my trivial tests of yesterday, all of my files were in one directory.  Today I&apos;m attempting to set up a real development area, which means in part that I set up separate hierarchies for the program and its tests.  Compiling a library of program code is the same.  Compiling a test that references the program dll requires that I provide a relative path to that program dll.  Running the test gives me an error complaining that it can&apos;t load the program assembly:&lt;br /&gt;&quot;The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly&quot;&lt;br /&gt;&lt;br /&gt;I wonder how to add to the Global Assembly Cache...&lt;br /&gt;&lt;br /&gt;According to &lt;a href=&quot;http://www.mono-project.com/Assemblies_and_the_GAC&quot;&gt;Assemblies and the GAC&lt;/a&gt;, I shouldn&apos;t throw things into the GAC if its API is likely to change in a non-backwards-compatible way, so my answer is to add the path of the program code directory to $MONO_PATH.  Then I don&apos;t need to specify the path for the reference when compiling the test and nunit-console2 can find the program assembly.&lt;br /&gt;&lt;br /&gt;Don&apos;t forget to export the revised $MONO_PATH!</description>
  <comments>http://geekery.livejournal.com/8523.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://geekery.livejournal.com/8330.html</guid>
  <pubDate>Sun, 09 Dec 2007 02:22:34 GMT</pubDate>
  <link>http://geekery.livejournal.com/8330.html</link>
  <description>A month after installing Mono, I finally get around to try to write software for it.*  I want NUnit, so I start to install it, only to find that NUnit is included in the Mono distribution.  That&apos;s cool - all I need to do is use it.  Using it is not entirely obvious.&lt;br /&gt;&lt;br /&gt;I need to compile to a .dll instead of to a .exe, as the &quot;Hello, world&quot; example does.  The trivial code I wrote is:&lt;br /&gt;&lt;pre&gt;	namespace Try {
	  public class Storage {
	    public int Number = 17;

	    public void Setter( int value )
	    {
	      Number = value;
	    }
	  }
	}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;... and the command-line for the compiler to generate a library is:&lt;br /&gt;&lt;pre&gt;	mcs -target:library try.cs&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code I wrote to test it is:&lt;br /&gt;&lt;pre&gt;        using System;
        using NUnit.Framework;

        [TestFixture]
        public class Attempt
        {
          [Test]
            public void TrySetter()
            {
              int number = 9;

              Try.Storage victim = new Try.Storage();

              victim.Setter( number );
              Assert.AreEqual( number, victim.Number, &quot;Same?&quot; );
            }

          [Test]
            public void TrySetterFail()
            {
              int number = 9;

              Try.Storage victim = new Try.Storage();

              victim.Setter( number );
              Assert.AreEqual( number + 10, victim.Number, &quot;Not Same?&quot; );
            }
        }
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The command-line for the compiler to generate a library and reference the pre-existing NUnit and Try libraries is:&lt;br /&gt;&lt;pre&gt;	mcs -target:library -reference:nunit.framework.dll -reference:try.dll attempt.cs&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To run nunit-console:&lt;br /&gt;&lt;pre&gt;	nunit-console2 attempt.dll&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And of course, one test passes and the other test fails, as expected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Blind alleys that I stumbled down on the way to this were:&lt;br /&gt;- Not realizing that NUnit was installed as part of Mono.&lt;br /&gt;- Not knowing the syntax to tell mcs that I wanted it to produce a library.  (What does -target:module produce?)&lt;br /&gt;- Not knowing the name of the &lt;i&gt;nunit.framework.dll&lt;/i&gt; assembly.&lt;br /&gt;- Forgetting to make the &lt;i&gt;Storage&lt;/i&gt; class public.&lt;br /&gt;&lt;br /&gt;Instead of a .dll, nunit-console can be started with a .nunit project file which presumably will allow multiple test .dlls to be run.  I have not been able to find out the format of this file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* This is perhaps not entirely fair to myself.  In the interim, I did waste a bunch of time trying to find an IDE to use.  I think I want MonoDevelop, but I keep running into roadblocks to installing it under Mac OS X.</description>
  <comments>http://geekery.livejournal.com/8330.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
