<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>dren.ch</title>
    <link href="http://dren.ch/atom.xml" rel="self"/>
    <link href="http://dren.ch/"/>
    <updated>2010-07-04T16:46:42-05:00</updated>
    <id>http://dren.ch/</id>
    <author>
        <name>Daniel Rench</name>
        <email>citric@cubicone.tmetic.com</email>
    </author>

    <entry>
        <title>Shebang: What?</title>
        <link href="http://dren.ch/shebang-override/"/>
        <updated>2009-11-04T00:00:00-06:00</updated>
        <id>http://dren.ch/shebang-override/</id>
        <content type="html">&lt;pre class=&quot;highlight&quot;&gt;

% /usr/local/php5/bin/php --version
PHP &lt;b&gt;5.2.6&lt;/b&gt; (cli) (built: May 11 2008 13:09:39) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

% echo '&amp;lt;?= phpversion() ?&amp;gt;' | /usr/local/php5/bin/php
&lt;b&gt;5.2.6&lt;/b&gt;

% printf '#!/usr/local/php5/bin/php\n&amp;lt;?= phpversion() ?&amp;gt;' &amp;gt; version
% chmod +x version
% ./version
&lt;b&gt;5.2.6&lt;/b&gt;

% mv version x.php
% ./x.php
&lt;b&gt;4.4.9&lt;/b&gt;

&lt;/pre&gt;

&lt;p&gt;In case you're wondering, this machine is running Linux, not Windows.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;November 6, 2009 update:&lt;/b&gt;
I asked and got a quick answer &lt;a href=&quot;http://serverfault.com/questions/82296/when-do-file-extensions-override-shebang-lines-on-linux&quot;&gt;on serverfault&lt;/a&gt;:
somebody changed &lt;tt&gt;/proc/sys/fs/binfmt_misc/php&lt;/tt&gt;.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>modiff: The Perl Module Differ</title>
        <link href="http://dren.ch/perl-module-diff/"/>
        <updated>2009-01-08T00:00:00-06:00</updated>
        <id>http://dren.ch/perl-module-diff/</id>
        <content type="html">&lt;p&gt;
Here's something else I wrote (like
&lt;tt&gt;&lt;a href=&quot;/apache-config-finder/&quot;&gt;acuff&lt;/a&gt;&lt;/tt&gt;) for
working on Apache/Perl installations, particularly unfamiliar ones:
&lt;tt&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/tt&gt;, the Perl module differ.
&lt;/p&gt;

&lt;p&gt;
Say you need to update a certain Perl module.
You check out the latest version, make your edits, &amp;quot;make install&amp;quot;,
and everything's great. Usually. Only this time you've just overwritten
a hack that guy who got laid off never committed 6 months ago,
and now everything's broken.
Even rolling back to the previous svn revision can't save you now.
&lt;/p&gt;

&lt;p&gt;You should have run &lt;tt&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/tt&gt; first:&lt;/p&gt;

&lt;pre class=&quot;highlight&quot;&gt;
% cd ~/project/Really-Important-Module &amp;amp;&amp;amp; svn update &amp;amp;&amp;amp; &lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;
U    lib/Really/Important/Module.pm
Updated to revision 32767.
*** /usr/local/lib/perl5/site_perl/5.8.7/Really/Important/Module.pm   Tue Apr  1 16:59:59 2008
--- lib/Really/Important/Module.pm    Wed Jan  7 20:35:37 2009
***************
*** 2,9 ****

  sub init {
        my $self = shift;
!       # $self-&amp;gt;{conf} = parse_config('/etc/x.conf');
!       # This always bombs. Comment out until I figure out why
        return 1;
  }

--- 2,8 ----

  sub init {
        my $self = shift;
!       $self-&amp;gt;{conf} = parse_config('/etc/x.conf');
        return 1;
  }
&lt;/pre&gt;

&lt;p&gt;
I first wrote &lt;tt&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/tt&gt;
in Ruby but I eventually needed to use it on a server that did not have Ruby,
and you probably will too.
The version here is the sensible Perl rewrite.
&lt;/p&gt;

&lt;p&gt;
Note that &lt;tt&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/tt&gt;
works only if your module's source is in CPAN-style where *.pm files
are under &lt;tt&gt;lib/&lt;/tt&gt;.
For nonstandard directory layouts or detecting changes to other files like
*.pod or anything XS-related, you're on your own.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;October 5, 2009 update:&lt;/b&gt; modiff is now part of my &lt;a href=&quot;http://github.com/drench/futilities&quot;&gt;&amp;quot;futilities&amp;quot; collection on github&lt;/a&gt;.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>acuff: Apache Configuration File Finder</title>
        <link href="http://dren.ch/apache-config-finder/"/>
        <updated>2008-07-16T00:00:00-05:00</updated>
        <id>http://dren.ch/apache-config-finder/</id>
        <content type="html">&lt;p&gt;
If you've ever worked on an unfamiliar Apache installation
you know how it is trying to follow all the
includes (which may in turn include more files) to track down
the source of a mysterious rewrite rule or LocationMatch. So I wrote
&lt;tt&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/acuff&quot;&gt;acuff&lt;/a&gt;&lt;/tt&gt;. It searches for an Apache executable
in your &lt;tt&gt;$PATH&lt;/tt&gt; and typical locations like
&lt;tt&gt;/usr/local/apache2/bin&lt;/tt&gt; and spits out its config filenames (with full
paths) to standard output. My typical usage goes something like this:
&lt;/p&gt;

&lt;pre class=&quot;highlight&quot;&gt;
% &lt;a href=&quot;http://github.com/drench/futilities/blob/master/acuff&quot;&gt;acuff&lt;/a&gt; | xargs grep -il '&amp;lt;location /logout'
/usr/local/etc/apache22/conf/app.conf
&lt;/pre&gt;

&lt;p&gt;
It's in Perl, and anything running Apache is bound to have Perl on it.
It uses no extra CPAN modules but it does need Perl 5 (this being 2008
it's completely reasonable to ignore Perl 4 and earlier, I hope).
Enjoy.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;October 5, 2009 update:&lt;/b&gt; acuff is now part of my &lt;a href=&quot;http://github.com/drench/futilities&quot;&gt;&amp;quot;futilities&amp;quot; collection on github&lt;/a&gt;.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>&lt;acronym title=&quot;Excitement Has A New Name&quot;&gt;EHANN&lt;/acronym&gt;: Javascript (and Perl and Ruby) Bloom Filters</title>
        <link href="http://dren.ch/js-bloom-filter/"/>
        <updated>2007-08-11T00:00:00-05:00</updated>
        <id>http://dren.ch/js-bloom-filter/</id>
        <content type="html">&lt;p&gt;
I've never seen a Javascript
&lt;a href=&quot;http://en.wikipedia.org/wiki/Bloom_filter&quot;&gt;Bloom filter&lt;/a&gt;
implementation &lt;a href=&quot;/rel/js-bloom-filter/bloomfilter.js&quot;&gt;so
I had to write one&lt;/a&gt;, and then had to port it to
&lt;a href=&quot;/rel/js-bloom-filter/bloomfilter.pl.txt&quot;&gt;Perl&lt;/a&gt; and
&lt;a href=&quot;/rel/js-bloom-filter/bloomfilter.rb.txt&quot;&gt;Ruby&lt;/a&gt;.
You'll understand why soon if you don't already.&lt;/p&gt;

&lt;p&gt;Quick aside: more than half of
&lt;a href=&quot;/rel/js-bloom-filter/bloomfilter.js&quot;&gt;&amp;quot;my&amp;quot;
bloomfilter.js&lt;/a&gt; is &lt;a href=&quot;http://pajhome.org.uk/crypt/md5&quot;&gt;somebody
else's BSD-licensed Javascript MD5 library&lt;/a&gt; but you could pretty
easily replace it with some other hash library if you felt the
compulsion.&lt;/p&gt;

&lt;p&gt;I don't think this one would be practical for really large input sets
(like a spell check dictionary built from /usr/dict/words), but I'm sure
you'll think of something if you work at it. Get moving on that.&lt;/p&gt;

&lt;p&gt;To get your brain in gear, here's a small demonstration.&lt;/p&gt;
&lt;p&gt;First, I put the text of a really excellent Wire song (I won't
say which), one word per line (minus punctuation) in a file.
Then using the Ruby version I ran the file through this:
&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;bloomfilter&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;bf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BloomFilter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;bits&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;salts&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w(z A)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;STDIN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each_line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chomp!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;downcase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Or maybe I used the Perl one and ran it through this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;perl&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;bloomfilter.pl&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# what is this, 1994?&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;BloomFilter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;salts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;qw(z A)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chomp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;lc&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;as_JSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Doesn't matter. Both give the same output (though I changed the formatting
to make it a little easier to read):&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;s2&quot;&gt;&amp;quot;buckets&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1509645767&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;990260715&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1062483727&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;150062916&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;551224088&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;354022058&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1818090233&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1463314593&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;110&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
 &lt;span class=&quot;s2&quot;&gt;&amp;quot;bucketsize&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
 &lt;span class=&quot;s2&quot;&gt;&amp;quot;bits&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
 &lt;span class=&quot;s2&quot;&gt;&amp;quot;salts&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;z&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;A&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Type some Wire lyrics into the box below and smell the magic:&lt;/p&gt;
&lt;textarea cols=&quot;80&quot; rows=&quot;10&quot; id=&quot;trywords&quot;&gt;&lt;/textarea&gt;
&lt;div id=&quot;bfoutput&quot;&gt;&amp;nbsp;&lt;/div&gt;

&lt;p&gt;The filter check code runs 'onchange' for that text box.
Just type (or paste in) some text, then click outside the box and
you should get some feedback.&lt;/p&gt;
&lt;p&gt;
I encourage you to view the source of this page to see what's really going on
but here's a quick example of the Javascript interface for the impatient:
&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// choose an appropriate number of bits and salts&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// (don&amp;#39;t ask me; you can figure it out)&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;BloomFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bits&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0xffff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;salts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;x&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;y&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;z&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;!&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;one&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;two&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;three&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;one&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will definitely return true&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;two&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will definitely return true&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;three&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will definitely return true&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;eins&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will probably return false&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;zwei&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will probably return false&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;drei&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// will probably return false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
If you find bugs in this, please let me know. Also I'd really like to
hear from anyone who finds other cool uses for this (aside from
Wire lyric guessing games). And just to get this
out of the way, I have no idea if this code can interoperate with
the &lt;a href=&quot;http://search.cpan.org/~mceglows/Bloom-Filter-1.0/Filter.pm&quot;&gt;Bloom::Filter module on the CPAN&lt;/a&gt; but I should probably find out.
&lt;/p&gt;

&lt;script src=&quot;/rel/js-bloom-filter/bloomfilter.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
(
	function () {

		var bf;

		var bfsetup = function () {

			bf = new BloomFilter({&quot;buckets&quot;:[1509645767,990260715,1062483727,150062916,551224088,354022058,1818090233,1463314593,110],&quot;bucketsize&quot;:31,&quot;bits&quot;:255,&quot;salts&quot;:[&quot;z&quot;,&quot;A&quot;]});

			var bfo = document.getElementById('bfoutput');
			var twb = document.getElementById('trywords');

			twb.onchange = function () {
				var ins = [], outs = [];
				var words = twb.value.split(/\s+/);
				for (var i=0; i &lt; words.length; ++i) {
					words[i] = words[i].replace(/^\W+/,'').replace(/\W+$/,'');
					if (! words[i].match(/\w/)) continue;
					if (bf.test(words[i].toLowerCase())) ins.push(words[i]);
					else outs.push(words[i]);
				}

				if (! ins.length) ins[0] = &quot;&lt;em&gt;(NONE OF THEM!)&lt;/em&gt;&quot;;
				if (! outs.length) outs[0] = &quot;&lt;em&gt;(NONE OF THEM!)&lt;/em&gt;&quot;;

				bfo.innerHTML = &quot;These words are very probably in &quot; +
					&quot;the Wire song: &lt;b&gt;&quot; + ins.join(&quot;, &quot;) + &quot;&lt;/b&gt;.&lt;br /&gt;&quot; +
					&quot;These words are &lt;em&gt;definitely not&lt;/em&gt; in it: &quot; +
					&quot;&lt;b&gt;&quot; + outs.join(&quot;, &quot;) + &quot;&lt;/b&gt;.&quot;;
			};

		};

		var ool = window.onload;
		if (document.getElementById) { // sorry, no NS/IE &lt; 5
			if (ool) window.onload = function () { ool(); bfsetup() };
			else window.onload = bfsetup;
		}
	}
)();

&lt;/script&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Hash::Server: a (mostly) memcached-compatible network interface to Perl hashes</title>
        <link href="http://dren.ch/perl-Hash-Server/"/>
        <updated>2007-06-01T00:00:00-05:00</updated>
        <id>http://dren.ch/perl-Hash-Server/</id>
        <content type="html">&lt;p&gt;You can
&lt;a href=&quot;/rel/perl-Hash-Server/Hash-Server.tar.gz&quot;&gt;download
Hash::Server here&lt;/a&gt; until I get it
on the &lt;a href=&quot;http://www.cpan.org/&quot;&gt;CPAN&lt;/a&gt; (after a decade with Perl
as my primary programming language I've finally signed up for a PAUSE account,
so it could happen). Maybe you'll find this useful.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;April 29, 2009 update:&lt;/b&gt; this code is now &lt;a href=&quot;http://github.com/drench/Hash-Server/tree/master&quot;&gt;on github&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;#synopsis&quot;&gt;SYNOPSIS&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#description&quot;&gt;DESCRIPTION&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#caveats&quot;&gt;CAVEATS&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#see_also&quot;&gt;SEE ALSO&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#author&quot;&gt;AUTHOR&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#copyright_and_license&quot;&gt;COPYRIGHT AND LICENSE&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;synopsis&quot;&gt;SYNOPSIS&lt;/a&gt;&lt;/h1&gt;
&lt;pre&gt;
        use Hash::Server ();
        use DB_File (); # for example&lt;/pre&gt;
&lt;pre&gt;
        tie(my %db, 'DB_File', './hash.db') or die $!;&lt;/pre&gt;
&lt;pre&gt;
        Hash::Server-&amp;gt;new({ hash =&amp;gt; \%db, localport =&amp;gt; 11211 })-&amp;gt;Bind();&lt;/pre&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;description&quot;&gt;DESCRIPTION&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;While memcached's original purpose was as a networked &lt;em&gt;Memoize&lt;/em&gt;,
it's also a simple way to distribute key/value hashes. But the
official memcached (as the name implies) stores its data in memory,
and is temporary. Given there are so many memcached clients for so many
languages, it seemed a shame that there were no other ``backing
stores'' available.&lt;/p&gt;
&lt;p&gt;This module allows you to distribute any Perl hash structure you like
with the memcached protocol. Typical use would probably involve a
tied hash (as in the &lt;em&gt;DB_File&lt;/em&gt; example above); if you want to serve
a straight untied hash, you might as well use the real memcached,
especially given the limitations of this module...&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;caveats&quot;&gt;CAVEATS&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;This module is not a complete implementation of the memcached protocol.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It ignores any expiration times you provide; values are always assumed
permanent.&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;
It ignores any incoming ``flag'' value you provide when storing,
and returns 0 by (default) when getting. Changing $Hash::Server::DEFAULT_FLAG
to another value may help you on the client-side to differentiate a
nonexistent key due to a server outage, or a nonexistent
key because the key just does not exist.
&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;
With standard memcached (flags field aside, which you can't get with the
Perl clients anyway), there is no difference between a nonexistent key and
a down server. For pure caching, that's fine, but your application may need
to know the difference. You can set $Hash::Server::UNDEFINED_KEY to
some value that makes sense to you, such as 0 or q{} (empty string) and
test for that, knowing that if your client returns 'undef',
it means it didn't get that answer from the server.
&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;
The ``stats'' command is unimplemented.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;see_also&quot;&gt;SEE ALSO&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href=&quot;http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt&quot;&gt;http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt&lt;/a&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;author&quot;&gt;AUTHOR&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Daniel Rench, &amp;lt;&lt;a href=&quot;mailto:citric@cubicone.tmetic.com&quot;&gt;citric@cubicone.tmetic.com&lt;/a&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;&lt;a name=&quot;copyright_and_license&quot;&gt;COPYRIGHT AND LICENSE&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Copyright (C) 2007 by Daniel Rench&lt;/p&gt;
&lt;p&gt;This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>It might help somebody: Flash 9 with Firefox on a Mac</title>
        <link href="http://dren.ch/flash9-firefox-and-osx/"/>
        <updated>2007-04-04T00:00:00-05:00</updated>
        <id>http://dren.ch/flash9-firefox-and-osx/</id>
        <content type="html">&lt;p&gt;When I install Firefox on a Mac, I always
&lt;tt&gt;sudo chown -R 0:0 /Applications/Firefox.app&lt;/tt&gt; after. What, you don't?
But when trying to install Flash 9, I got this:
&lt;pre class=&quot;highlight&quot;&gt;1008:5-5000 Access Denied Error
You do not have enough access privileges for this installation.&lt;/pre&gt;
So I tried running the Flash install as root. Same error.
Then I did this: &lt;tt&gt;sudo chown -R drench /Applications/Firefox.app&lt;/tt&gt;
and ran the install again, which worked, and it made me sad.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Element.getAttribute() doesn't get enough publicity</title>
        <link href="http://dren.ch/html_element_attributes/"/>
        <updated>2007-04-03T00:00:00-05:00</updated>
        <id>http://dren.ch/html_element_attributes/</id>
        <content type="html">&lt;p&gt;
For years I've been using hacks like overloading the &lt;tt&gt;title&lt;/tt&gt; and
&lt;tt&gt;class&lt;/tt&gt; attributes of HTML elements because I didn't know any better.
Now I know I can just make up attributes, like 'regex' here, which I
defined as a pattern that a form field must match:
&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;&lt;/span&gt;attributes&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;make_validator&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

		&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

			&lt;span class=&quot;nx&quot;&gt;pat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;regex&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

			&lt;span class=&quot;nx&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;RegExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;focus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
				&lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Bad value for &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

	&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onsubmit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;make_validator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
	Number: &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;number&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;regex=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;^\d+$&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
	Username: &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;username&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;regex=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;^\w{1,8}$&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>We are all bigots / So filled with hatred / We release our poisons</title>
        <link href="http://dren.ch/rock_bigotry/"/>
        <updated>2007-03-27T00:00:00-05:00</updated>
        <id>http://dren.ch/rock_bigotry/</id>
        <content type="html">&lt;p&gt;... like
&lt;a href=&quot;http://kree10.zoomshare.com/1.shtml&quot;&gt;the Bad R&amp;amp;R blog&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;More like &lt;cite&gt;Rock &amp;amp; Roll Bigot&lt;/cite&gt; if you ask me (who,
&amp;quot;full disclosure&amp;quot; is a contributor to the site).&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Yet another 'radical' idea in Unix file layout</title>
        <link href="http://dren.ch/unix-command-path-proposal/"/>
        <updated>2006-12-04T00:00:00-06:00</updated>
        <id>http://dren.ch/unix-command-path-proposal/</id>
        <content type="html">&lt;p&gt;
Long before &lt;a href=&quot;http://www.securityfocus.com/bid/21185/info&quot;&gt;this
ImageMagick overflow bug&lt;/a&gt; I've been wanting to ditch it completely
in favor of &lt;a href=&quot;http://www.graphicsmagick.org/&quot;&gt;GraphicsMagick&lt;/a&gt;
(still hasn't happened). Aside from the usual bugs, arbitrary API changes
and other endearing quirks, ImageMagick's greatest offense is how its
utility programs have incredibly generic names like &lt;tt&gt;display&lt;/tt&gt; and
&lt;tt&gt;identify&lt;/tt&gt;.
GraphicsMagick does away with those by running everything through the
&lt;tt&gt;gm&lt;/tt&gt; command, so there's less confusion about what happens when
you type &lt;tt&gt;gm identify somefile.jpg&lt;/tt&gt; as you so often do.
&lt;/p&gt;

&lt;p&gt;
This kind of thing is very common; cvs, svn and openssl (to name a
few that I use often) all fit this pattern.
&lt;a href=&quot;http://www.zsh.org/&quot;&gt;Decent shells&lt;/a&gt; are aware of these
programs' &amp;quot;subcommands&amp;quot; and will tab-complete them for you.
But the chances that your shell's tab completion is an exact match with
whatever version of, say, svn you're running are low. Maybe svn added a
new command, but your shell completion doesn't know about it yet. Or
maybe your shell completion has all the latest updates but you're
stuck running an old version of svn that doesn't have it, allowing your
tab completion to taunt you.
&lt;/p&gt;

&lt;p&gt;
Imagine then if your shell was smart enough to detect directories in
&lt;tt&gt;$PATH&lt;/tt&gt; entries and gave them special treatment, looking for
&amp;quot;subcommands&amp;quot; under them.
Then svn could install itself under a directory called
&lt;tt&gt;/usr/local/bin/svn/&lt;/tt&gt;, where you'd have
&lt;tt&gt;/usr/local/bin/svn/checkout&lt;/tt&gt;, 
&lt;tt&gt;/usr/local/bin/svn/commit&lt;/tt&gt;,
&lt;tt&gt;/usr/local/bin/svn/log&lt;/tt&gt;, etc.
Instead of &lt;tt&gt;svn checkout&lt;/tt&gt; you would run &lt;tt&gt;svn/checkout&lt;/tt&gt;.
And with a link from &lt;tt&gt;checkout&lt;/tt&gt; to &lt;tt&gt;co&lt;/tt&gt; you would still
have your &lt;tt&gt;svn co&lt;/tt&gt; shortcut.
The commands themselves wouldn't necessarily need to look different;
the shell could automatically translate &lt;tt&gt;svn co&lt;/tt&gt; to &lt;tt&gt;svn/co&lt;/tt&gt;
for you and you might not even realize anything changed.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Anonymous commentor made all kinds of good points
(particularly about just using something like &amp;quot;gm-&lt;i&gt;whatever&lt;/i&gt;&amp;quot;)
so this is a &amp;quot;nevermind&amp;quot;.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>The inexplicable popularity differences of two photos</title>
        <link href="http://dren.ch/inexplicably-popular/"/>
        <updated>2006-10-30T00:00:00-06:00</updated>
        <id>http://dren.ch/inexplicably-popular/</id>
        <content type="html">&lt;p style=&quot;text-align:center&quot;&gt;&lt;a href=&quot;http://flickr.com/photos/drench/270871302/&quot; title=&quot;The inexplicably popular photo&quot;&gt;&lt;img src=&quot;http://static.flickr.com/108/270871302_97bb7fa77e_m.jpg&quot; width=&quot;240&quot; height=&quot;180&quot; alt=&quot;Changing the diaper on the pretend baby&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I realize that by linking to this photo I'm only making things worse,
but why is the photo above among my top-viewed
&lt;a href=&quot;http://flickr.com/photos/drench&quot;&gt;flickr pictures&lt;/a&gt;?
And why is the one below one of the very least popular?
It's among my favorites, but not yours? What's your problem?&lt;/p&gt;
&lt;p style=&quot;text-align:center&quot;&gt;&lt;a href=&quot;http://flickr.com/photos/drench/89529425/&quot; title=&quot;The inexplicably unpopular photo&quot;&gt;&lt;img src=&quot;http://static.flickr.com/16/89529425_2ca48d6319_m.jpg&quot; width=&quot;180&quot; height=&quot;240&quot; alt=&quot;Lemon #17&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Excitement Has A New Name: Tmetic::Feed::Manager</title>
        <link href="http://dren.ch/rss-manager/"/>
        <updated>2006-10-25T00:00:00-05:00</updated>
        <id>http://dren.ch/rss-manager/</id>
        <content type="html">&lt;p&gt;
For a while I've been using the RSS reader built into the Thunderbird
mail client. I thought it was kind of cool how it made blog posts look
like e-mail messages. But why settle for &lt;i&gt;kind of&lt;/i&gt; like e-mail
when you can have the real thing?
&lt;/p&gt;
&lt;p&gt;
So I wrote a Perl module: &lt;a href=&quot;http://dren.ch/rel/rss-manager/Tmetic-Feed-Manager.tar.gz&quot;&gt;Tmetic::Feed::Manager&lt;/a&gt;.
Just &lt;a href=&quot;http://dren.ch/rel/rss-manager/Tmetic-Feed-Manager.tar.gz&quot;&gt;download it&lt;/a&gt;, untar it, then do the
usual &lt;tt&gt;perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make test &amp;amp;&amp;amp;
make install&lt;/tt&gt;. You may need to install some prerequisite modules
like DBD::SQLite, Text::Template, and XML::RSS::Parser; the build
process will let you know what you're missing. Except sendmail.
If you don't have a working sendmail in your $PATH (whether it's
actually qmail or postfix or the real thing) you will run
into trouble.
&lt;/p&gt;
&lt;p&gt;
This is an initial release and has some limitations, the biggest
being it can only deal with RSS 2.0 feeds; no RSS 0.9x or Atom yet.
Enjoy if possible and applicable, and
&lt;a href=&quot;mailto:vanillin@ecesis.tmetic.com&quot;&gt;send your thoughts&lt;/a&gt;
(all of them) to me.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Because nobody has ever put the phrase &amp;quot;print to STDERR in PHP&amp;quot; on a web page</title>
        <link href="http://dren.ch/php-print-to-stderr/"/>
        <updated>2006-10-06T00:00:00-05:00</updated>
        <id>http://dren.ch/php-print-to-stderr/</id>
        <content type="html">&lt;p&gt;I needed to know how to do this, and this particular phrase (quoted)
returns zero documents on well-known search engines. See, PHP does define
STDERR (and STDOUT and STDIN) for use in print() statements, but (this is
funny) &lt;em&gt;not when running under a web server&lt;/em&gt;. So in order
to print debugging information to your server's error log, you have to
open it yourself and use fwrite():&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;x&quot;&gt;	$STDERR = fopen(&amp;#39;php://stderr&amp;#39;, &amp;#39;w+&amp;#39;);&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;	fwrite($STDERR, &amp;quot;some debug info\n&amp;quot;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Printing to standard error is the #1 most common debug aid
in the universe of all time (almost 6000 years).
Yet PHP goes out of its way to take it away from you.
It may be there for PHP scripts not run under a web server, but that's
almost the same as saying it's not there at all.&lt;/p&gt;

&lt;p&gt;It also sounds like maybe at one time
&lt;a href=&quot;http://bugs.php.net/bug.php?id=34759&quot;&gt;STDERR, etc. worked as
programmers would expect&lt;/a&gt;
but the last word on that was
&lt;a href=&quot;http://bugs.php.net/bug.php?id=34759#c103781&quot;&gt;&amp;quot;Not PHP
problem -&amp;gt; bogus.&amp;quot;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Dec 11, 2006 update:&lt;/b&gt; Thanks to reader
&lt;a href=&quot;http://thwartedefforts.org/&quot;&gt;Andy Bakun&lt;/a&gt; I now know about PHP's
&lt;a href=&quot;http://php.net/manual/en/function.error-log.php&quot;&gt;error_log()&lt;/a&gt;
function. When called with one argument (a message string), it sends
the string to the web server's error log (when running under a web
server), or to STDERR (when running from the command line). So I think
it's safe to say error_log() is PHP's do-what-I-mean equivalent of
writing to STDERR in any other language. And now it's documented somewhere.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Excitement Has a New Name: Excessively Strong Typing in Perl</title>
        <link href="http://dren.ch/perl-strong-typing-with-tie/"/>
        <updated>2006-10-02T00:00:00-05:00</updated>
        <id>http://dren.ch/perl-strong-typing-with-tie/</id>
        <content type="html">&lt;p&gt;I haven't used this in &amp;quot;serious&amp;quot; code but that's only because
I'm not a freak about strong typing. Don't you worry, it works fine.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;perl&quot;&gt;&lt;span class=&quot;nb&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Typed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;TIESCALAR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$test_function&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;undef&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$test_function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;FETCH&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;STORE&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$v&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$v&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;#39;$v&amp;#39; is an illegal value for &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Typed::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;our&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;@ISA&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;TIESCALAR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nn&quot;&gt;Typed::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TIESCALAR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt; /^[\+-]?\d+$/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Typed::Number::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Natural&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;our&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;@ISA&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# could say &amp;#39;Typed::Integer&amp;#39; but it makes no difference here&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;TIESCALAR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nn&quot;&gt;Typed::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TIESCALAR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/\D/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Typed::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VarChar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;our&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;@ISA&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;TIESCALAR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;tie&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed::Number::Natural&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$r&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Typed::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TIESCALAR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;nb&quot;&gt;defined&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# &amp;quot;where the action is&amp;quot;&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;tie&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed::Integer&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# OK&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# OK&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# dies, uh I mean &amp;quot;throws an exception&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;stuff&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# dies&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;tie&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Typed::VarChar&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;chars&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# OK&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# OK&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Fairly long string&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# dies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Since the Knockoff Project seems dead</title>
        <link href="http://dren.ch/knock-offs/"/>
        <updated>2006-09-22T00:00:00-05:00</updated>
        <id>http://dren.ch/knock-offs/</id>
        <content type="html">&lt;img src=&quot;http://image.allmusic.com/00/amg/cov200/drh400/h451/h45109z3kre.jpg&quot; width=&quot;200&quot; height=&quot;198&quot; /&gt;
&lt;img src=&quot;http://image.allmusic.com/00/amg/cov200/drc500/c542/c54263pfl2o.jpg&quot; alt=&quot;Starship album cover&quot; title=&quot;Starship: Knee Deep in the Hoopla&quot; width=&quot;200&quot; height=&quot;195&quot;&gt;
&lt;p&gt;[ref: &lt;a href=&quot;http://www.knockoffproject.com/&quot;&gt;The Knockoff Project&lt;/a&gt;]&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Agitating for green shopping bags</title>
        <link href="http://dren.ch/macys_chicago/"/>
        <updated>2006-09-11T00:00:00-05:00</updated>
        <id>http://dren.ch/macys_chicago/</id>
        <content type="html">&lt;p&gt;
&lt;img src=&quot;http://static.flickr.com/87/238566536_0596642108_m_d.jpg&quot;
width=&quot;180&quot; height=&quot;240&quot; title=&quot;Marshall Field's 'Dead-enders'&quot;
alt=&quot;a picture of angry Macy's protesters&quot;&gt;
&lt;a href=&quot;http://flickr.com/photos/daviddalka/238566545&quot;&gt;The shirts are
cute&lt;/a&gt; and I suppose it's sad to see a &amp;quot;beloved institution&amp;quot;
go, but what sort of person gets emotional over corporate name
changes I ask rhetorically?
I thought it was lame when International Harvester changed its name and
&lt;a href=&quot;http://en.wikipedia.org/wiki/Image:IH_Logo.gif&quot;&gt;clever logo&lt;/a&gt;
but I got over it. It's not like when &lt;a
href=&quot;http://www.chicagobarproject.com/Memoriam/LoungeAx/LoungeAx.htm&quot;&gt;Lounge
Ax&lt;/a&gt; closed or anything.
&lt;span style=&quot;text-size: x-small&quot;&gt;Actually even that event was probably
less culturally significant than the Kots and Derogatises made it out to be.
By the time Lounge Ax closed in 2000, the
&lt;a href=&quot;http://emptybottle.com/&quot;&gt;Empty Bottle&lt;/a&gt; had held
the Cool Underground Chicago Rock Saloon torch at least 4 years and still
does for all I know.&lt;/span&gt;
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>arguments.callee: A dren.ch Endorsement</title>
        <link href="http://dren.ch/arguments.callee/"/>
        <updated>2006-09-11T00:00:00-05:00</updated>
        <id>http://dren.ch/arguments.callee/</id>
        <content type="html">&lt;p&gt;
I mostly agree with
&lt;a href=&quot;http://www.crockford.com/javascript/recommend.html&quot;&gt;Mr. JSON's
ECMAScript recommendations&lt;/a&gt; but not this:
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;The following features should be depreciated.&lt;/p&gt;
	&lt;p&gt;[...]&lt;/p&gt;
    &lt;p&gt;&lt;b&gt;arguments.callee&lt;/b&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
It might have a goofy name but arguments.callee is way too useful
(inside a Javascript function, this is a reference to the function
itself). I don't mean anonymous recursive functions, though that's
still kind of cool. Say you wanted a &amp;quot;sequence&amp;quot; function.
With arguments.callee:
&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sequence&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;callee&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Without:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sequence&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You can argue that the &amp;quot;without&amp;quot; version is better but
I'm not going to agree with you.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;9/12/2006 update:&lt;/b&gt; This works and is probably clearer than
either of the above:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sequence&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sequence&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;sequence&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It manages to avoid arguments.callee and function-within-a-function
closure. It also fixes the (for me) biggest problem with the arguments.callee
version: the test for undefined n on every call.
But there are a couple minor downsides: the function needs to know
its name, and it's not self-contained. Maybe you don't care.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;8/15/2007 update:&lt;/b&gt;
&lt;a href=&quot;http://peter.michaux.ca/article/3556&quot;&gt;A Canadian named Peter&lt;/a&gt;
discusses similar problems though he's into using the term &amp;quot;pattern&amp;quot;.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Transmutable (?) Objects in Perl and Ruby</title>
        <link href="http://dren.ch/transmutable_objects/"/>
        <updated>2006-09-01T00:00:00-05:00</updated>
        <id>http://dren.ch/transmutable_objects/</id>
        <content type="html">&lt;p&gt;I have no idea if &amp;quot;transmutable&amp;quot; is the right word to describe
this concept but I'm using it anyway.&lt;/p&gt;
&lt;p&gt;In Perl, I sometimes find it useful to &amp;quot;transmute&amp;quot; objects.
For example:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;perl&quot;&gt;&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Grape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::new {&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{},&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Grape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::dehydrate {&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Raisin&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Raisin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::new {&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{},&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Grape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# prints &amp;quot;Grape&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dehydrate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;# it&amp;#39;s not a Grape anymore&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# prints &amp;quot;Raisin&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dehydrate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;# Raisin doesn&amp;#39;t have a dehydrate() method, so it dies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
To do this in Ruby, I first tried something like this:
&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Grape&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;dehydrate&lt;/span&gt;
		&lt;span class=&quot;nb&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Raisin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
But Ruby complains &amp;quot;Can't change the value of self&amp;quot;.
I ended up trying something with Ruby's version of AUTOLOAD, method_missing:
&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Grape&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;initialize&lt;/span&gt;
		&lt;span class=&quot;vi&quot;&gt;@me&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Hidden&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Grape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;method_missing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;vi&quot;&gt;@me&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;vi&quot;&gt;@me&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt; /^Hidden::/&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;class&lt;/span&gt;
		&lt;span class=&quot;vi&quot;&gt;@me&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/^Hidden::/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;methods&lt;/span&gt;
		&lt;span class=&quot;vi&quot;&gt;@me&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;methods&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Hidden&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Grape&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;dehydrate&lt;/span&gt;
			&lt;span class=&quot;no&quot;&gt;Raisin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Raisin&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Grape&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# prints &amp;quot;Grape&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dehydrate&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# prints &amp;quot;Raisin&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dehydrate&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;# NameError: undefined method `dehydrate&amp;#39; for class `Hidden::Raisin&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Various things seem wrong about it (especially overriding class() and
methods()), but it pretty much does what I want.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;11/15/2006 update:&lt;/b&gt;
I no longer think the above seems &amp;quot;wrong&amp;quot;.
If anything it's probably considered
&lt;a href=&quot;http://www.oreillynet.com/ruby/blog/2006/06/wild_and_crazy_metaprogramming.html&quot;&gt;insufficiently weird in Ruby circles&lt;/a&gt;.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>The Cookie Hack: using mod_perl to make IE7 think you're not using Basic Auth (even though you are)</title>
        <link href="http://dren.ch/msie_basic_auth_workaround/"/>
        <updated>2006-08-16T00:00:00-05:00</updated>
        <id>http://dren.ch/msie_basic_auth_workaround/</id>
        <content type="html">&lt;p&gt;You may have heard that the forthcoming MSIE 7 web browser &lt;a
href=&quot;http://blogs.msdn.com/ie/archive/2006/03/15/552246.aspx&quot;&gt;made some
&amp;quot;enhancements&amp;quot; for Basic Authentication&lt;/a&gt; (warning or
optionally disallowing it unless used over SSL). You could buy a certificate
or try converting to digest auth or you could implement a cookie hack.
It goes something like this (assuming you're running Apache 1.3 with mod_perl):
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an ErrorDocument 401 with an external redirect to an HTML
page with a login form. Normally it's a bad idea to put external
redirects on your 401 documents (because it turns them into 302s
[or is it 301s?]). Anyway, it's still a bad idea but that's OK because
this whole thing is a bad idea.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a &amp;quot;login form&amp;quot; page that looks something like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;F&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;login&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onsubmit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cookie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
     &lt;span class=&quot;s2&quot;&gt;&amp;quot;auth=&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;btoa&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;username&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;:&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;password&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;http://example.net/URL/THAT/REQUIRES/LOGIN&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// probably not necessary&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;login&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;username&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;password&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;password&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;log in&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The above uses the little-known btoa() function. It encodes to base64.
Too bad MSIE doesn't support it. You'll need to find or write your own
base64 encoder. But then you've just screwed all the browsers that aren't
running javascript. So then you write yourself some server-side
CGI/PHP/ASP/JSP code that sets the cookie instead. Whatever you do, the
result is a cookie called &amp;quot;auth&amp;quot; with a value that should look
just like the right side of a typical &amp;quot;Authorization: Basic&amp;quot;
HTTP header.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here's the fun hack part. Write a mod_perl HeaderParserHandler that
does something like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;perl&quot;&gt;&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Apache::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Constants&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;DECLINED&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;handler&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$r&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$r&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers_in&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DECLINED&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$h&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$h&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Cookie&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/\s*,\s*/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;m{\bauth=([a-zA-Z\d\+/]+)}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;nv&quot;&gt;$h&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Authorization&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Basic $1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;DECLINED&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now when Apache sees one of our &amp;quot;auth&amp;quot; cookies coming in,
we make it think that you actually sent an &amp;quot;Authorization&amp;quot;
header. If it's correct, it lets you in. If it's wrong, you get a 401
and get redirected back to your login page.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
It's just as &amp;quot;secure&amp;quot; as always (that is, not at all) but it
does have some advantages over basic auth:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Delete the cookie, and you're logged out. No need for a browser shutdown
as in basic&lt;/li&gt;
&lt;li&gt;Add an expiration date to the cookie, and your login &amp;quot;session&amp;quot;
can survive a browser shutdown&lt;/li&gt;
&lt;li&gt;Set the domain of the cookie to .example.com and suddenly you don't have
to maintain separate logins for http://www.example.com/ and
http://example.com/ perhaps even https://www.example.com/&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you really want to run with this, you could work around the
insecurity by &lt;a href=&quot;/js_blowfish/&quot;&gt;encrypting&lt;/a&gt; the the username and
password on the client side and expanding the mod_perl handler to decrypt
before setting up the fake auth header. You'll have to figure out how
to pass the key securely.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>August 2006 Chicago-area Community Calendar</title>
        <link href="http://dren.ch/community_calendar-aug_2006/"/>
        <updated>2006-08-07T00:00:00-05:00</updated>
        <id>http://dren.ch/community_calendar-aug_2006/</id>
        <content type="html">&lt;ul&gt;
	&lt;li&gt;
		&lt;p&gt;&lt;b&gt;August 10, 8:30 PM:
		&lt;a href=&quot;http://northbrook.info/cal_event.php?id=7212&quot;&gt;Free
		screening of &lt;cite&gt;Ferris Buehler's Day Off&lt;/cite&gt;&lt;/a&gt;
		at the base of the Northbrook (nee Shermerville)
		&amp;quot;Save Ferris&amp;quot; water tower.&lt;/b&gt;&lt;/p&gt;
		&lt;p&gt;Today, this tower plays a crucial role in providing water
		pressure to the dren.ch household.&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;p&gt;&lt;b&gt;August 13, 8:00 PM: The final performance of &lt;a
		href=&quot;http://secondcity.com/?id=theatres/chicago/donny/schedule&quot;&gt;Pizza
		Xtreme!&lt;/a&gt;, a show that made me laugh.&lt;/b&gt;&lt;/p&gt;
		&lt;p&gt;Two of my former
		&lt;a href=&quot;http://secondcity.com/?id=training-education/training/chicago&quot;&gt;Second City Training Center&lt;/a&gt; classmates
		(&lt;a href=&quot;http://www.myspace.com/rhs31&quot;&gt;Robert H.  Slaughter&lt;/a&gt;
		and &lt;a href=&quot;http://www.myspace.com/johnsteeno&quot;&gt;John Steeno&lt;/a&gt;
		if you must know) wrote and perform.&lt;/p&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>The Minutemen and their back catalog</title>
        <link href="http://dren.ch/minutemen_reissues/"/>
        <updated>2006-07-19T00:00:00-05:00</updated>
        <id>http://dren.ch/minutemen_reissues/</id>
        <content type="html">&lt;p&gt;Seeing &lt;a href=&quot;http://theminutemen.com/&quot;&gt;We Jam Econo&lt;/a&gt; reminds
me that the Minutemen need a reissue program. Here's how it should go:&lt;/p&gt;

&lt;img
alt=&quot;Front cover of the My First Bells cassette&quot;
title=&quot;water damaged&quot;
style=&quot;float: right; margin-left: 5px&quot;
src=&quot;/rel/minutemen_reissues/my_first_bells-front.jpg&quot;
width=&quot;254&quot; height=&quot;398&quot; /&gt;

&lt;ol&gt;
	&lt;li&gt;
&lt;h3&gt;A double CD reissue of the previously cassette-only
&lt;cite&gt;&lt;a href=&quot;http://idiot-dog.com/music/minutemen/indexm.html#b2&quot;&gt;My
First Bells&lt;/a&gt;&lt;/cite&gt;&lt;/h3&gt;
&lt;p&gt;Though the original cassette sounds terrible, this compilation of their
releases from 1980 to 1983 (mostly) in order, works as an album much better
than any of the &lt;cite&gt;Post-Mersh&lt;/cite&gt; CDs that came later.
Side (or in this case, disc) 2 is especially good,
starting with &amp;quot;Bob Dylan Wrote Propaganda Songs&amp;quot;
and ending with &amp;quot;Little Man With a Gun in His Hand&amp;quot;.
Both songs' impact is blunted coming halfway through their respective CD
compilations.&lt;/p&gt;
&lt;p&gt;If you have the three &lt;cite&gt;Post-Mersh&lt;/cite&gt; CDs
and download some
&lt;a href=&quot;http://www.corndogs.org/corndogs_misc.html&quot;&gt;stray compilation
tracks&lt;/a&gt;, you can nearly recreate &lt;cite&gt;My First Bells&lt;/cite&gt; in
your own home (you'll still be missing &amp;quot;Clocks&amp;quot; from the
&lt;cite&gt;Chunks&lt;/cite&gt; compilation). Try it and you too will consider this
to be the finest Minutemen collection, with the possible exception of...&lt;/p&gt;
&lt;/li&gt;

	&lt;li&gt;&lt;h3&gt;A (double, if necessary) CD reissue of the complete, original
&lt;cite&gt;Double Nickels on the Dime&lt;/cite&gt;&lt;/h3&gt;
&lt;p&gt;
All of the previous CD editions of this album are missing songs.
Again, let
&lt;a href=&quot;http://www.corndogs.org/corndogs_misc.html&quot;&gt;the corndogs&lt;/a&gt;
help you reproduce the experience (though you will still be missing
most of the side ending and beginning &amp;quot;car jams&amp;quot;).
&lt;/p&gt;
&lt;/li&gt;

	&lt;li&gt;&lt;h3&gt;&lt;cite&gt;1985&lt;/cite&gt;&lt;/h3&gt;
&lt;p&gt;Put both of their &amp;quot;commercial&amp;quot; records from 1985 together:
&lt;cite&gt;Project: Mersh&lt;/cite&gt; and &lt;cite&gt;3-Way Tie (For Last)&lt;/cite&gt;,
in that order on a single CD.
&lt;/p&gt;
	&lt;/li&gt;

	&lt;li&gt;
&lt;h3&gt;A double &amp;quot;deluxe&amp;quot; CD reissue of &lt;cite&gt;Ballot Result&lt;/cite&gt;&lt;/h3&gt;
&lt;p&gt;This would include all the tracks from the original double LP, the
cassette bonus tracks, and then pile on all the other odds &amp;amp; ends
(possibly expanding to 3 discs): &lt;cite&gt;The Politics of Time&lt;/cite&gt; LP,
the &lt;cite&gt;Tour-Spiel&lt;/cite&gt; EP, the &lt;cite&gt;Georgeless&lt;/cite&gt; EP,
and more Reactionaries material.
&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;p&gt;All four will come with full-color reproductions of all the original
jacket art, obligatory Byron Coley liner notes, and won't
be on SST.&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

</feed>
