Monthly Archive for January, 2005

An Unlikely Alliance

This gem was posted to Slashdot on Friday, but I’m still catching up after a weekend away. It’s an article by Gary Wolf for Wired Magazine, on what the future might hold if the unthinkable happened, and Linus Torvalds was hired by Microsoft.

It’s 2008, and Windows is now a Desktop Environment running on top of a stable open source base, rather than (as currently) an OS in its own right. Read The Microsoft Memo.

Back to reality, I don’t think it would ever happen, but perhaps a hybrid solution could be a way forward. Windows is a lot more stable than it used to be, by the way. I use Windows XP on my home workstation, because it works better than anything else for me. It’s not perfect, but it doesn’t crash anywhere near as much as 95/98 used to, and there’s software available for pretty much everything I need to be able to do with my computer.

But I use Debian GNU/Linux on my home server, becase I don’t need to download music or play games on that machine, and stability is more important than application support for that machine, given that it’s only generally used as a file/web server.

Windows has maybe 99% application support, but is only about 90% reliable, in my experience. Linux is more like 99% reliable, but has maybe only 90% of the application support it needs. What if the two really could be combined?

My JAPH Deciphered

An annotated translation, into regular Perl, and layman’s terms, of the nugget of (apparent) nonsense I sometimes drop into my email signature.

For the uninitiated, JAPH stands for “Just Another Perl Hacker,” – it’s a tradition, amongst Perl programmers, to create tiny programs to output those four words in the most outlandish and esoteric of ways.

I chose to use the Lingua::Romana::Perligata module, which allows you to write your code in Latin, instead of the normal Perl syntax.

The original:

use Lingua::Romana::Perligata; # Barry Price - http://www.barryprice.co.uk/
da xis Just tum another tum Perl tum hacker. dum xis decapitamentum damentum
xo fac sic xum scribe egresso. nisi yum tum tres aequalitam fac sic lacunam
scribe egresso. cis. yo preincresce. cis. XLIV indementum scribe egresso.

Pretty nasty, even if you know Perl and Latin.

Now let’s format it, BSD/Allman style, still in Latin:

use Lingua::Romana::Perligata; # Barry Price - http://www.barryprice.co.uk/
da xis Just tum another tum Perl tum hacker.
dum xis decapitamentum damentum xo fac
sic
    xum scribe egresso.
    nisi yum tum tres aequalitam fac
    sic
        lacunam scribe egresso.
    cis.
    yo preincresce.
cis.
XLIV indementum scribe egresso.

Okay, that almost looks like a computer program. And it still compiles (at least, it does here, in Perl v5.8.4 on Debian). Now let’s see what it would look like in regular Perl – without the Latin insanity:

# Barry Price - http://www.barryprice.co.uk/
@x = ('Just', 'another', 'Perl', 'hacker');
while($x = shift @x)
{
    print $x;
    unless ($y == 3)
    {
        print ' ';
    }
    $y++;
}
print chr(44);

Calm down, I never claimed it was good code. The object of the exercise was to produce four lines of text with the ability to both bewilder, and compile!

The documentation is pretty good, but the key points to understanding it are:

  • The three variables @x, $x and $y are translated as xis, xo/xum (depending on case) and yo/yum (again, depending on case). The -um suffix indicates the accusative case, -o is the dative. Ah, high school Latin…
  • And yes, it’s a particularly evil feature of Perl which allows me to have two completely unrelated variables called @x and $x. And yes, the elements of @x would be referred to as $x[$_], which would still be nothing to do with $x. Anyway, back to the Latin:
  • da xis Just tum another tum Perl tum hacker translates as “give Just and then another and then Perl and then hacker to @x”. da is approximately the same as the equals (=) assignment, and tum in this context is the equivalent of a comma.
  • dum .. fac is the while() loop, and sic .. cis are the equivalents to braces in regular Perl. xis decapitamentum damentum xo translates as “behead @x and give it to $x”. Nice.
  • Within the while loop, xum scribe egresso is “write $x to an exit”. We then “write a hole to an exit, unless $y is equal to 3″.
  • $y? Where did that come from? How could it be equal to 3? Ah, well Perl will magically declare it for us at this point, with a value of null. So it can’t be three yet…
  • yo preincresce. “Increase $y”. Aha. On the first iteration, it will add 1 to null, which in this case makes 1. So on the fourth iteration, we print ‘hacker’ (the 4th array element), but not the space afterwards, since $y is 3.
  • This ends the while() loop, and now we just XLIV indementum scribe egresso. Or “give a name to 44 , and write it to an exit”. 44 is the ASCII code for a comma.
  • Oh, and why did I have to use chr() just to print a comma? Simply because the module didn’t seem to provide a “clean” way of doing it.

Phew. No more Perl for at least a week, I promise!

Premature Migration

This site was originally written from scratch in PHP, a language I hadn’t used for years (I’m a Perl programmer). The blog was a tiny addition, and so I used Blosxom, a tiny Perl script.

Anyway, I’ve become involved in writing Wordpress plugins recently, so I thought it could be advantageous to use that here instead. So I just migrated the meagre few articles I’d already written through Blosxom, and the rest of the content will follow shortly.

I’m not even listed on Google yet, and I’m already doing the first site redesign. This is ridiculous…

Web Crawling

This domain had been dormant for years until I recently resurrected it. One of the first things I had to do was to resubmit it to the various search engines. Actually, I just had to resubmit it to Google. Does anyone actually use any other search engines? I don’t know anyone who does.

Anyway, looking at my access logs through the excellent Webalizer, I see that Yahoo! Slurp, Alexa ia_archiver and ZyBorg have already found me, but no Googlebots have made it yet. Typical…

Still, on the subject of Googlebots, I was reminded of an old Paul Ford story about the Google of the future. A good read.

A lot of traffic as well

I don’t know what’s more incredible – the fact that someone placed this ad on Rent A Coder, or the fact that it’s already had two bids…

I would like someone to build me a good website that will make me around $1000 a week or more. The website should be useful and not have any popups. I would like you to design the whole entire website. The content as well. Would like the website to have a lot of traffic as well.

Like Paul said: “Somebody have an idea, implement it, make a web site, collect the money, and send it to me.”

See the ad in full here.