Simply Top Ad

Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

Thursday, September 1, 2011

Perldoc down

perldoc.perl.org was down recently. This prompted me to dust off an old idea I'd had to create a Perl documentation site closer to home.

So I have set up perldoc.co.uk. This is UK-based and UK-administered, and just works, without going down for a week at a time because of mysterious router problems.

If you're wondering why this post is so similar to the previous one, the answer is that a popular web searching system, whose name begins with a G, did not seem to want to index that page over the phrase "perldoc down", which is where I would like to get listed. Hence this page, which is titled "Perldoc down", so there should now be no excuse for them not to index it.

Friday, August 26, 2011

UK hosted Perl documentation site

Recently had a problem accessing perldoc.perl.org and decided it was time to dust off my idea for creating a Perl documentation site a little closer to home.

So I have now set up perldoc.co.uk, which is similar to perldoc.perl.org, but hosted on a UK-based server. So for UK and other European users, this should result in lower round trip times.

It's currently a work in progress, with various things not quite right. For example it currently shows the documentation only for the distro Perl (currently Perl 5.10.1 from Ubuntu 10.04 LTS).

IPv6 heads will be pleased to hear that the site is enabled for IPv6.

Keywords: perldoc down, perldoc mirror,
perldoc UK mirror, perldoc Europe mirror, perldoc European mirror, perldoc.perl.org down, perldoc.perl.org mirror, perldoc.perl.org UK mirror, perldoc.perl.org Europe mirror, perldoc.perl.org European mirror, Perl documentation mirror, Perl documentation UK mirror, Perl documentation Europe mirror, Perl documentation European mirror


Tuesday, March 9, 2010

Dell Service Tags to Express Service Codes in Perl

It seems that Dell Tech Support have replaced a layer of people with a layer of machines and as such whereas you could previously give your machine ID using the (alphanumeric) Service Tag to a person, you now need to give your machine ID to a machine, which means it needs to be the (numeric) Express Service Code.

This is no problem if you have the machine in question because the service tag sticker has both the (alphanumeric) Service Tag and the (numeric) Express Service Code.

However, if you had been noting only Service Tags from machines and storing those in your records, you might not have the (numeric) Express Service Code to hand and this may cause a problem.

It turns out that there is a relatively straightforward relationship between the Service Tag and the Express Service Code.

It seems that if you take the Service Tag and treat it as a base 36 number, then express that quantity as a base 10 number, and add hyphens in the right places, you get the Express Service Code.

The hyphens aren't crucial because you don't dial them, but if you want to match the existing codes exactly, it seems you need to add hyphens every three digits, but with the proviso that if we would otherwise end up with a single digit on its own, then we start with two digits instead of three.

Wanting to convert an existing file of service tags en masse, I came up with a little Perl program which would do it as a pipe filter:

perl -e 'while(<>){chomp; if(/^[0-9A-Z]{1,7}$/so){@a = split //; my %e; @e{"0".."9","A".."Z"} = (0..35); my $r = 0; while(@a){ $r = ($r * 36) + $e{shift @a}; }; @r = split //, $r; my @s; push @s, join "", splice @r,0,2 if ((@r % 3) == 1); push @s, join "", splice @r,0,3 while @r; $_ = join "-", @s; } print"$_\n";}'