Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ron Savage (5224)

Ron Savage
  (email not shown publicly)

Journal of Ron Savage (5224)

Thursday June 12, 2008
01:17 AM

RT no longer finds any distros

I went to CPAN and clicked on View Bugs, for Config::IniFiles and CGI::Session.

In both cases RT claimed 'No distribution specified'.

Lets hope /someone/ is working on this...

Sunday June 08, 2008
11:25 PM

Non-graphical overlapping rectangles test

I'm looking at the problem of drawing labels on a graph, e.g street names, which might overlap.

What I want, so I don't have to write it myself, is a module which takes 2 rectangles defined by their corners, and gives me a Boolean result as to whether or not the 2 rectangles overlap.

I don't want to be tied to any particular image processing software, e.g. Image::Magick, and I don't need the result to be the polygon defined by the overlap.

I can see an algorithm: Take the 2 end lines [*] of one rectangle, determine their equations, and see if they intersect any of the sides of the other rectangle. Then reverse the roles of the 2 rectangles to check the opposite case.

[*] For 2 lines meeting at the corner, it doesn't matter which of the 2 lines is used. So 2 bounding lines of a rectangle which don't meet ought to be sufficient.

Has this been done?

Are there any modules which do part of it?

I searched CPAN for Math::*, but did not see anything obviously relevant.

Wednesday May 14, 2008
07:58 PM

Finally - machine-readable Changelog.ini with hand-holding

I've uploaded Module::Metadata::Changes V 1.00 to CPAN.

Docs:

http://savage.net.au/Perl-modules/html/Module/Metadata/Changes.html

Just as importantly, docs for ini.report.pl:

http://savage.net.au/Perl-modules/html/Module/Metadata/ini.report.html

Monday May 05, 2008
02:19 AM

Progress with Module::Metadata::Changes

You'll be delighted to know that after an investigation I've abandoned the idea of using YAML, although I suspect the number of people who are relieved is far greater than the number of people who are surprised.

I've had a look at 31 config file parsers, and I think I'll go with Config::IniFiles, since it allows here docs, which are suitable for the extended comments we see in CHANGES files.

I'll standardize on the file name Changes.conf, which after an incomplete analysis (using Archive::Extract), I can see is not in use:

Frequencies:
CHANGE.LOG => 3.
CHANGELIST => 1.
CHANGELOG => 112.
CHANGES => 792.
CHANGES-1.0 => 1.
CHANGES-2.20 => 1.
CHANGES-2.22 => 1.
CHANGES-2.23 => 1.
CHANGES-3.00 => 3.
CHANGES-cp1251.txt => 1.
CHANGES.OLD => 1.
CHANGES.TXT => 1.
CHANGES.etext => 1.
CHANGES.html => 2.
CHANGES.mogilefsd => 1.
CHANGES.mogstored => 1.
CHANGES.old => 1.
CHANGES.pod => 3.
CHANGES.txt => 14.
CHANGE_LOG => 1.
Change.log => 3.
ChangeLog => 752.
ChangeLog-1-00-02 => 1.
ChangeLog-Perl-1-00-01 => 1.
ChangeLog.0 => 2.
ChangeLog.1 => 3.
ChangeLog.1x => 1.
ChangeLog.2 => 1.
ChangeLog.20 => 1.
ChangeLog.21 => 1.
ChangeLog.3 => 1.
ChangeLog.4 => 1.
ChangeLog.5 => 1.
ChangeLog.6 => 1.
ChangeLog.CVS => 1.
ChangeLog.CVS.delta => 1.
ChangeLog.SPOON => 2.
ChangeLog.d => 1.
ChangeLog.detailed => 2.
ChangeLog.old => 1.
ChangeLog.owen => 2.
ChangeLog.svn => 2.
ChangeLog.txt => 1.
ChangeLog.xml => 5.
ChangeLog~ => 1.
Changelog => 52.
Changes => 11503.
Changes-2.64 => 1.
Changes-darcs => 1.
Changes.0.46 => 1.
Changes.1 => 1.
Changes.Checker => 1.
Changes.DOM => 1.
Changes.XQL => 1.
Changes.bak => 1.
Changes.html => 3.
Changes.i18n => 1.
Changes.ja => 1.
Changes.old => 3.
Changes.pod => 10.
Changes.src => 2.
Changes.ttl => 4.
Changes.txt => 62.
Changes.ver0X => 1.
Changes.yml => 2.
Changes1.6 => 1.
Changes~ => 5.
changelog => 2.
changelog.html => 1.
changelog.txt => 1.
changes => 4.
changes.dat => 1.
changes.pod => 1.
changes.txt => 2.
changesrus.txt => 1.
changesrus_koi8.txt => 1.

As for the format, I'm thinking of:

[Killer::App]
1.02=2008-01-25T10:08:00
1.01=2008-01-25T10:08:00
1.00=2007-07-27T18:30:45

so the version numbers can be sorted by date to get the latest version, followed by one section per version:

[1.02]
lapsang suchong...

[1.01]
Lorem ipsum...

etc.

Sunday May 04, 2008
10:53 PM

Massive failure of Archive::Extract

I'm currently scanning my local CPAN for a survey of CHANGES files, and am getting dozens of errors on Archive::Extract via Module::Extract. A sample:

Invalid header block at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Read error on tarfile (missing data) 'Logfile-Radius-1.14/Radius.pm' at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Could not open file '/tmp/e0hrZzpCtR/Logfile-Radius-1.14/t/radius.t': Permission denied at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 724
Could not extract 'Logfile-Radius-1.14/t/radius.t' at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 724
Unable to extract '/home/ron/.cpan/sources/authors/id/P/PA/PAULG/Logfile-Radius-1.14.tar.gz': Could not extract 'Logfile-Radius-1.14/t/radius.t' at /usr/local/share/perl/5.8.8/Module/Extract.pm line 146
Invalid header block at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Couldn't read chunk at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Invalid header block at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Invalid header block at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
Read error on tarfile (missing data) 'ptkFAQ-0_03/qna9.2.html' at offset unknown at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 702
error: Unsupported compression combination: read 6, write 0
  at /usr/local/share/perl/5.8.8/Module/Extract.pm line 146
Extraction of 'ERG-1.13/Changes' from '/home/ron/.cpan/sources/authors/id/P/PH/PHOENIXL/extensible_report_generator_1. 13.zip' failed at /usr/local/share/perl/5.8.8/Module/Extract.pm line 146
Could not update timestamp at /usr/local/share/perl/5.8.8/Archive/Extract.pm line 724

Anyone seen this? And even better: What to do?

And worse, by default it often won't tell you the name of offending file :-((.

I've just manually run tar xvzf on a failed module, DBIx-Perform-0.694.tar.gz, and it worked perfectly. Strange. Let's hope it's not telling me something about my hard disk.

09:05 PM

Calling all Adam Kennedys...

A lot of your modules refer to a non-existent public repository http://svn.phase-n.com/...
Where to the modules live these days, if, for some mad reason, one should want to apply patches :-)?

Thursday May 01, 2008
05:51 AM

Prepare for Module::Metadata::Changes

Yep, I'm going to write a module called Module::Metadata::Changes, starting tomorrow.

I installed Module::Changes, but was so distressed by the cascade of dependencies that I resolved to try myself.

This namespace allows Module::Metadata::SomethingElse, so that's a plus.

I will adopt the nice suggestion of Marcel Grünauer as regards a typical content for a Perl module's Changes file. See his POD for details, or my POD-to-be.

And yes, I'll default to YAML, even though my reservations about YAML are even more soundly based than yours. See my FAQ-to-be for details.

I will be adding something like:
Upgrade:
        Deploy: Yes
        Reason: Security
or
        Deploy: No need
        Reason: Doc or test changes only.

This allows you to Do The Right Thing with:
        Deploy: No
        Reason: Development version.

After all, we don't want another Data::Dumper fiasco, do we :-(? Remember the uncountable millions of warning messages issued about 'Not Numeric' because V 1.21_01 I think it was, was released?

If use of YAML upsets you, please feel free to write a module with a name like XML2YAML2XML::Tiny, using YAML::Tiny and XML::Tiny. That'll allow us to ship all of:
o CHANGES
o Changes.yml
o Changes.xml

Saturday January 12, 2008
11:56 PM

Dell Does Debian

In the middle of last year I bought a Dell Latitude C400 2nd hand, after using it for about 10 months. It ran WinXFP (sic). And it had a superb screen. So far so good.

Being a small lappie it has no CD drive, and there's only 7 Gb free on the hard disk.

And I want Debian on it, to match my dual-boot home PC.

Well, now I've converted it to dual-boot, but it took a few steps:
o Get into BIOS. Oops. Kbd is locked up
o Upgrade hard disk from 20 Gb to 80 Gb.
o Upgrade BIOS
o Get into BIOS. Oops. There's no option to boot from a USB device. How to install Debian?
o Swap drive into friend's IBM lappie
o He boots from a Ubuntu V 6 disk because he likes the partition editor
o Resize 1 partition to be 3:
-- WinXFP 30 Gb
-- Debian 48 Gb
-- Swap 2 Gb (for a 1 Gb RAM machine)
o Now boot Debian (etch) disk and install
o Reinstall hard disk in Dell
o Boot to command line since X is confused
o Run dpkg-config and friend reconfigs X with great skill
o Reboot into GUI. Yay!
o Spend hours installing desired software:
-- gcc
-- Apache + mod_perl + mod_fastcgi
-- Postgres
-- TrueCrypt
-- Firefox
-- FileZilla
-- CPAN and friends (copied ~/.cpan from desktop)
-- PgAdmin
-- Emacs
-- Open Flash Chart. Yay!
-- Expat
-- A few directories from the desktop
(This makes me think someone ported The Neverending Story to Debian).
o I love flash drives

Almost finished - Time for a swim,

Sunday September 02, 2007
10:48 PM

PPPoE is dead - Long live PPPoA

During a recent phone company problem, my ISP (kept un-informed by the phone company) got me to switch to PPPoE LLC in a pointless attempt to fix the lack-of-connection issue.

Eventually the service was restored, after being off-line for 3.5 days out of 6.

But FTP had a problem. No matter what GUI client I used, I could only see the root directory of my own web site. Any attempt to move into a sub-directory resulted in a time-out error. Weird.

Eventually, my ISP's help desk happened to suggest switching to PPPoA VC-MUX, saying "I don't know why anybody bothers to use PPPoE".

Well, FTP sprang back to life! And all was good...

If anyone knows what this gobbeldy-gook actually means, and why PPPoE screws FTP, please reply.

Monday July 23, 2007
04:35 AM

Knee Reconstruction - With Pix!

Errr - Make that Canine Knee Reconstruction.

(1) The knee with stitches. The scar is the same length as my middle finger:
http://savage.net.au/Pictures/zephyr.2007.07.23.1.jpg
He's 7.3 Kg. The other stitches on his chest are where biopsy samples were taken. He has many hematomas on the stomach from sunbaking.

(2) The shaved rump, which they do even to short-haired dogs:
http://savage.net.au/Pictures/zephyr.2007.07.23.2.jpg

So, I'm taking 2 weeks off work, sleeping on the floor, to stop him jumping on the bed or the couch. He's not allowed to run, jump or play for 12 weeks :-(.

And, yes, I carry him outside at night as often as he gets restless. And it's been 2 deg C here recently. Brrrrr.