<?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>2011-11-07T19:40:04-06:00</updated>
    <id>http://dren.ch/</id>
    <author>
        <name>Daniel Rench</name>
        <email>citric@cubicone.tmetic.com</email>
    </author>

    <entry>
        <title>Git on GoDaddy</title>
        <link href="http://dren.ch/git-on-godaddy/"/>
        <updated>2011-11-05T00:00:00-05:00</updated>
        <id>http://dren.ch/git-on-godaddy/</id>
        <content type="html">&lt;blockquote&gt;
    &amp;quot;Could you help me with my web site?&amp;quot;
&lt;/blockquote&gt;
&lt;blockquote&gt;
    &amp;quot;Where's it hosted?&amp;quot;
&lt;/blockquote&gt;
&lt;blockquote&gt;
    &amp;quot;GoDaddy! Here's the FTP login.&amp;quot;
&lt;/blockquote&gt;

&lt;p&gt;
Don't get depressed. It's possible to make even GoDaddy's entry-level
Linux shared hosting tolerable by enabling &lt;tt&gt;ssh&lt;/tt&gt; and installing &lt;tt&gt;git&lt;/tt&gt;,
even though they seem to go out of their way to make it difficult.
&lt;/p&gt;

&lt;p&gt;
The first thing to do is activate &lt;tt&gt;ssh&lt;/tt&gt; for the account.
It's not on by default, and you have to jump through some hoops to activate
it. Log in to the GoDaddy hosting control panel for the domain.
Currently, that means log in at the top of
&lt;a href=&quot;http://www.godaddy.com/&quot;&gt;GoDaddy's home page&lt;/a&gt;, and then click
&lt;em&gt;My Account&lt;/em&gt;. From this page, find the &lt;em&gt;My Products&lt;/em&gt; section
and click on &lt;em&gt;Web Hosting&lt;/em&gt;. You should soon see a list of hosted domains,
with a &lt;em&gt;LAUNCH&lt;/em&gt; button for each. Click the &lt;em&gt;LAUNCH&lt;/em&gt; button for
the domain you're working with and you will soon arrive at the
&amp;quot;Hosting Dashboard&amp;quot;. Locate the &amp;quot;Settings&amp;quot; tab and find
the section labeled &amp;quot;SSH&amp;quot;. Jump through the hoops to enable it
(I needed to provide a phone number) and wait.
&lt;/p&gt;

&lt;p&gt;
Take a break. It may be 10 minutes before &lt;tt&gt;ssh&lt;/tt&gt; is actually working.
&lt;/p&gt;

&lt;p&gt;
Remember that FTP login information? That username and password will work
for &lt;tt&gt;ssh&lt;/tt&gt; and &lt;tt&gt;sftp&lt;/tt&gt;. You'll need to use it once, when you
log in to put your ssh public key in &lt;tt&gt;~/.ssh/authorized_keys&lt;/tt&gt;.
I'm going to assume you're familiar with ssh keys and won't go into how to
generate them, manage them, work with &lt;tt&gt;~/.ssh/config&lt;/tt&gt;, &lt;tt&gt;ssh-agent&lt;/tt&gt;,
etc.
&lt;/p&gt;

&lt;p&gt;
There is one twist: you need to add a &lt;tt&gt;command=&lt;/tt&gt; section to the line
containing your public key so it looks something like this (all on one line):
&lt;/p&gt;

&lt;pre class=&quot;code&quot;&gt;
command=&amp;quot;if [[ \&amp;quot;x${SSH_ORIGINAL_COMMAND}x\&amp;quot; == \&amp;quot;xx\&amp;quot; ]]; then /bin/bash; else source ~/.bashrc; eval \&amp;quot;${SSH_ORIGINAL_COMMAND}\&amp;quot;; fi; &amp;quot; ssh-rsa AAAAAAA+YOUR+KEY+GOES+HERE...
&lt;/pre&gt;

&lt;p&gt;
You need this for your &lt;tt&gt;.bashrc&lt;/tt&gt; to have any effect on non-interactive shells
(as you do when using &lt;tt&gt;git&lt;/tt&gt; remotely).
Your account probably doesn't even have a &lt;tt&gt;.bashrc&lt;/tt&gt; yet, but it will soon.
&lt;/p&gt;

&lt;p&gt;
So yes, you'll be using &lt;tt&gt;bash&lt;/tt&gt;, the MSIE of shells, and probably a
fairly old version as well. Considering the crippled environment (they even
took &lt;tt&gt;which&lt;/tt&gt; away from you, to make it even more difficult to know
what you're missing) you're going to want to spend as little time
in this shell as possible anyway.
&lt;/p&gt;

&lt;p&gt;
Now let's get &lt;tt&gt;git&lt;/tt&gt;.
&lt;/p&gt;

&lt;p&gt;
Find out what Linux distribution GoDaddy gave you.
&lt;tt&gt;uname -a&lt;/tt&gt; says I'm on an i386 machine, and
&lt;tt&gt;/etc/redhat-release&lt;/tt&gt; says I'm on CentOS 5.5.
If you're on something else (like a Debian derivative), you're on your own.
Sorry!
&lt;/p&gt;

&lt;p&gt;
Point your browser at &lt;a href=&quot;http://pkgs.repoforge.org/git/&quot;&gt;RepoForge's
collection of git RPMs&lt;/a&gt; and download the most up-to-date version of git
available for your account's OS version and architecture. In my case, that was
&lt;tt&gt;git-1.7.6.4-1.el5.rf.i386.rpm&lt;/tt&gt;. GoDaddy may have given you &lt;tt&gt;wget&lt;/tt&gt;
so either use that to grab it, or fetch the package some other way and &lt;tt&gt;sftp&lt;/tt&gt;
it to your &lt;tt&gt;$HOME&lt;/tt&gt; directory on the GoDaddy server.
&lt;/p&gt;

&lt;p&gt;
Time to unpack. Fortunately, GoDaddy gives us &lt;tt&gt;rpm2cpio&lt;/tt&gt; and &lt;tt&gt;cpio&lt;/tt&gt;.
I'm going to put things under &lt;tt&gt;~/opt/&lt;/tt&gt;:
&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;% mkdir ~/opt &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/opt
% rpm2cpio ~/git-1.7.6.4-1.el5.rf.i386.rpm | cpio -id
% ~/opt/usr/bin/git --version
git version 1.7.6.4
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Hooray. We're almost there. Add this to your &lt;tt&gt;~/.bashrc&lt;/tt&gt;
(or create one; this account I used didn't have one):
&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/opt/usr/bin
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;PATH

&lt;span class=&quot;nv&quot;&gt;GIT_EXEC_PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/opt/usr/libexec/git-core
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;GIT_EXEC_PATH
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We need to set &lt;tt&gt;GIT_EXEC_PATH&lt;/tt&gt;, otherwise git (the version I installed,
anyway) will expect to find its 'core programs' under &lt;tt&gt;/usr/libexec/git-core&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Log back in with &lt;tt&gt;ssh&lt;/tt&gt; to verify that git is working:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;% mkdir ~/testrepo
% &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/testrepo
% &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;This is a test&amp;#39;&lt;/span&gt; &amp;gt; README.txt
% git init
warning: templates not found /usr/share/git-core/templates
Initialized empty Git repository in /home/content/XX/YYYYYYY/testrepo/.git/
% git add README.txt
% git commit -m &lt;span class=&quot;s1&quot;&gt;&amp;#39;initial version&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;master &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;root-commit&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 5214f3b&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; initial version
 1 files changed, 1 insertions&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 0 deletions&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;-&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 create mode 100644 README.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Ignore the warning about templates not being found.
Git should work fine without them, and if you want them, they're
under &lt;tt&gt;~/opt/usr/share/git-core/templates&lt;/tt&gt;.
&lt;/p&gt;

&lt;p&gt;Open a new shell locally and verify that you can work with
&lt;tt&gt;git&lt;/tt&gt; remotely over &lt;tt&gt;ssh&lt;/tt&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;% git clone godaddy-host.example.com:~/testrepo
Cloning into testrepo...
remote: Counting objects: 3, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
remote: Total 3 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, reused 0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Receiving objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;3/3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Don't you feel relieved now?
If you're like me, you're going to want to use the &lt;tt&gt;rpm2cpio&lt;/tt&gt; technique to
install other missing essentials like &lt;tt&gt;rsync&lt;/tt&gt; and &lt;tt&gt;make&lt;/tt&gt;
(to install CPAN modules, which could be, and may become, a whole new posting).
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>phemca, a JavaScript-to-PHP5 compiler (written in Ruby)</title>
        <link href="http://dren.ch/phecma-js-php-compliler/"/>
        <updated>2010-08-10T00:00:00-05:00</updated>
        <id>http://dren.ch/phecma-js-php-compliler/</id>
        <content type="html">&lt;p&gt;Why am I writing a JavaScript-to-PHP5 compliler (in Ruby)?&lt;/p&gt;

&lt;p&gt;
PHP is everywhere and is inescapable these days.
&lt;/p&gt;

&lt;p&gt;A typical hosting plan includes PHP. Maybe not PHP 5.3 yet, but
definitely some version.
And &amp;quot;regular people&amp;quot; like PHP, or more accurately,
they like stuff written in PHP: Wordpress, Drupal, Magento, SugarCRM,
and just about every other common CMS, shopping cart, and
bulletin board system.
&lt;/p&gt;

&lt;p&gt;Irregular people (programmers) typically aren't as keen on PHP.
Programmers may not agree on many things, but they do tend to think
JavaScript is not too bad, and that's high praise.
It's everybody's 2nd favorite language.&lt;/p&gt;

&lt;p&gt;I don't know about you, but when given a task to, say, write a plugin for
some PHP app, I would love to write it in a language I enjoy using.
Sure, I could always throw out the entire codebase and start over in
&lt;a href=&quot;http://nodejs.org/&quot;&gt;node.js&lt;/a&gt; or something,
but I don't have time for that.&lt;/p&gt;

&lt;p&gt;Or maybe I do, but I doubt my clients would pay me to do that.
And even if they did, they won't necessarily be happy clients when they
find out that their &amp;quot;Wordpress&amp;quot; site won't let them use any
Wordpress plugins, because they're not actually running Wordpress anymore,
but some incompatible custom blog engine running on a strange new platform.
&lt;/p&gt;

&lt;p&gt;Ideally, this compiler I'm calling
&lt;a href=&quot;http://github.com/drench/phecma&quot;&gt;phecma&lt;/a&gt;
could be part of a piecemeal transition to a better place.
No need to throw out the entire codebase and platform.
Boil that PHP frog slowly. Eventually, it's all ECMAScript.
When that happens, this is like the Wordpress Singularity or something.
&lt;/p&gt;

&lt;p&gt;
Intrigued?
&lt;a href=&quot;http://github.com/drench/phecma&quot;&gt;Phecma&lt;/a&gt; is on Github.
&lt;/p&gt;


</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>Backing up MySQL: The Last Resort Method</title>
        <link href="http://dren.ch/phpmyadmin-backup/"/>
        <updated>2010-02-20T00:00:00-06:00</updated>
        <id>http://dren.ch/phpmyadmin-backup/</id>
        <content type="html">&lt;p&gt;
One of the first things I do when taking on maintenance for a
web site is to do my own backups. This usually means database
snapshots, and that database is usually MySQL.
Unfortunately I am rarely allowed a shell login to the server,
and sometimes not allowed to connect to MySQL from outside the
host's network either. But one thing I can always expect is access
to &lt;a href=&quot;http://www.phpmyadmin.net/&quot;&gt;PhpMyAdmin&lt;/a&gt;,
the virtually-standard web frontend for MySQL administration.
&lt;/p&gt;
&lt;p&gt;
That's fine, but I need my backups automated. I found
a Python program that screen-scraped PhpMyAdmin, but
I ran into a big problem: the PhpMyAdmin installation for one site
had a robots.txt file at its root that excluded everything.
Python's urllib2 honored the robots.txt rules and I was not finding
anything in its documentation on how to override it. It was time to
fall back to something that would bend to my will: Perl 5 with
&lt;a href=&quot;http://search.cpan.org/dist/WWW-Mechanize/&quot;&gt;WWW::Mechanize&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I gave it the imaginative name
&lt;a href=&quot;http://github.com/drench/futilities/blob/master/phpmyadmin-backup&quot;&gt;phpmyadmin-backup&lt;/a&gt;
and added it to
&lt;a href=&quot;http://github.com/drench/futilities&quot;&gt;my 'futilities' collection&lt;/a&gt;
on github. It works like this:
&lt;/p&gt;

&lt;pre class=&quot;highlight&quot;&gt;

% phpmyadmin-backup \
    --url=http://URL_of_your_PhpMyAdmin/ \
    --dbname=database \
    --username=username \
    --password=password   &amp;gt; BACKUP.sql.gz

&lt;/pre&gt;

&lt;p&gt;
If you're backing up a Wordpress site, point phpmyadmin-backup at
a copy of the site's wp-config.php file and it will derive the
dbname, username, and password from it:
&lt;/p&gt;

&lt;pre class=&quot;highlight&quot;&gt;

% phpmyadmin-backup \
    --url=http://URL_of_your_PhpMyAdmin/ \
    --wp_conf=/path/to/wp-config.php       &amp;gt; BACKUP.sql.gz

&lt;/pre&gt;

&lt;p&gt;
Your prerequisites (system requirements, if you will) are
just Perl 5 with
&lt;a href=&quot;http://search.cpan.org/dist/WWW-Mechanize/&quot;&gt;WWW::Mechanize&lt;/a&gt;.
Also, php must be in your $PATH if you want to use the --wp_conf option.
&lt;/p&gt;

&lt;p&gt;
Enjoy, but remember: this is a last resort for cases where
&lt;a href=&quot;http://docforge.com/wiki/Mysqldump&quot;&gt;mysqldump&lt;/a&gt;
isn't an option. I genuinely hope you never have to use this program.
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <entry>
        <title>coordinate.js adds interesting properties to boring HTML tables</title>
        <link href="http://dren.ch/js-table-coordinates/"/>
        <updated>2009-12-20T00:00:00-06:00</updated>
        <id>http://dren.ch/js-table-coordinates/</id>
        <content type="html">&lt;p&gt;
Did you ever wish you could address HTML table cells by X and Y coordinates?
&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;table&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;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;table&amp;#39;&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;nx&quot;&gt;coordinate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// The origin (0,0) is the top, leftmost cell&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;coordinates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;(3,2)&amp;#39;&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;
Did you ever wish you could, given a table cell, easily address its neighbors?
&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;table&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;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;table&amp;#39;&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;nx&quot;&gt;coordinate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;table&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;cell&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;coordinates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// &amp;#39;edge&amp;#39; cells have 1 undefined direction&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// corner cells have 2 undefined directions&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// a cell in a 1x1 table would have all 4 directions undefined&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// (but why would you do that?)&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;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;north&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;north&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;up&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;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;south&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;south&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;down&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;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;west&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;west&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;left&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;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;east&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;east&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;right&amp;#39;&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;
Did you wish you could, given a table cell, know its X and Y coordinates?
&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;table&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;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;table&amp;#39;&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;nx&quot;&gt;coordinate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;table&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;cells&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;td&amp;#39;&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;td&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cells&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;td&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onclick&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;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;You just clicked on the cell at &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&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;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;y&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;script src=&quot;/js/coordinate.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/js/coordinate-snakes.js&quot;&gt;&lt;/script&gt;
&lt;style&gt;
td.surroundcell {
    border: thin solid #aaa;
    padding: 0;
    height: 20px;
    width: 20px;
    cursor: pointer;
    text-align: center;
    text-size: 4pt;
}
&lt;/style&gt;
&lt;div id=&quot;playfield&quot;&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;javascript://&quot; onclick=&quot;this.style.visibility='hidden';open_snake_demo();&quot;&gt;Try the demo!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://github.com/drench/coordinate.js&quot;&gt;Of course it's on github&lt;/a&gt;
&lt;/p&gt;
</content>
        <author>
            <name>Daniel Rench</name>
            <uri>http://dren.ch/</uri>
        </author>
    </entry>

    <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;kbd&gt;/proc/sys/fs/binfmt_misc/php&lt;/kbd&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;kbd&gt;&lt;a href=&quot;/apache-config-finder/&quot;&gt;acuff&lt;/a&gt;&lt;/kbd&gt;) for
working on Apache/Perl installations, particularly unfamiliar ones:
&lt;kbd&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/kbd&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;kbd&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/kbd&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;kbd&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/kbd&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;kbd&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/modiff&quot;&gt;modiff&lt;/a&gt;&lt;/kbd&gt;
works only if your module's source is in CPAN-style where *.pm files
are under &lt;kbd&gt;lib/&lt;/kbd&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;kbd&gt;&lt;a href=&quot;http://github.com/drench/futilities/blob/master/acuff&quot;&gt;acuff&lt;/a&gt;&lt;/kbd&gt;. It searches for an Apache executable
in your &lt;kbd&gt;$PATH&lt;/kbd&gt; and typical locations like
&lt;kbd&gt;/usr/local/apache2/bin&lt;/kbd&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>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;SYNOPSIS&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;DESCRIPTION&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;CAVEATS&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;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;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;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;SEE ALSO&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;AUTHOR&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;COPYRIGHT AND LICENSE&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">When I install Firefox on a Mac, I always
&lt;kbd&gt;sudo chown -R 0:0 /Applications/Firefox.app&lt;/kbd&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;kbd&gt;sudo chown -R drench /Applications/Firefox.app&lt;/kbd&gt;
and ran the install again, which worked, and it made me sad.
</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;kbd&gt;title&lt;/kbd&gt; and
&lt;kbd&gt;class&lt;/kbd&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;kbd&gt;display&lt;/kbd&gt; and
&lt;kbd&gt;identify&lt;/kbd&gt;.
GraphicsMagick does away with those by running everything through the
&lt;kbd&gt;gm&lt;/kbd&gt; command, so there's less confusion about what happens when
you type &lt;kbd&gt;gm identify somefile.jpg&lt;/kbd&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;kbd&gt;$PATH&lt;/kbd&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;kbd&gt;/usr/local/bin/svn/&lt;/kbd&gt;, where you'd have
&lt;kbd&gt;/usr/local/bin/svn/checkout&lt;/kbd&gt;, 
&lt;kbd&gt;/usr/local/bin/svn/commit&lt;/kbd&gt;,
&lt;kbd&gt;/usr/local/bin/svn/log&lt;/kbd&gt;, etc.
Instead of &lt;kbd&gt;svn checkout&lt;/kbd&gt; you would run &lt;kbd&gt;svn/checkout&lt;/kbd&gt;.
And with a link from &lt;kbd&gt;checkout&lt;/kbd&gt; to &lt;kbd&gt;co&lt;/kbd&gt; you would still
have your &lt;kbd&gt;svn co&lt;/kbd&gt; shortcut.
The commands themselves wouldn't necessarily need to look different;
the shell could automatically translate &lt;kbd&gt;svn co&lt;/kbd&gt; to &lt;kbd&gt;svn/co&lt;/kbd&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;kbd&gt;perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make test &amp;amp;&amp;amp;
make install&lt;/kbd&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 once thought I needed to write to STDERR in some PHP code.
This particular phrase (quoted) returned zero documents on well-known
search engines, so I felt compelled to do something about it.&lt;/p&gt;

&lt;p&gt;PHP &lt;a href=&quot;http://php.net/manual/en/features.commandline.io-streams.php&quot;&gt;provides STDERR (and STDOUT and STDIN)&lt;/a&gt; but not when running under
a web server. Since that's the environment virtually all PHP code runs,
they may as well not be there at all.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://thwartedefforts.org/&quot;&gt;Andy Bakun&lt;/a&gt;, I learned
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. Usually.
&lt;/p&gt;

&lt;p&gt;Depending on your
&lt;a href=&quot;http://us3.php.net/manual/en/errorfunc.configuration.php&quot;&gt;php.ini
settings&lt;/a&gt;, error_log() may be going to your syslog, or some log file,
which has thrown me a few times. While debugging a
&lt;a href=&quot;http://roundcube.net/&quot;&gt;Roundcube&lt;/a&gt; plugin, I was wondering why
none of my error_log() output was making it to the web server's log. 
Then I noticed this:&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;    ini_set(&amp;#39;error_log&amp;#39;, $this-&amp;gt;prop[&amp;#39;log_dir&amp;#39;].&amp;#39;/errors&amp;#39;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;It looks 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;

So if you're really, really determined to print to STDERR no matter what
the environment or the ini settings, you have to open it yourself:&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;
</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>

</feed>

