Re: 25 Years of Perl

2012-11-21 Thread Roger Burton West
On Wed, Nov 21, 2012 at 11:40:26AM +, Dirk Koopman wrote:
>On 21/11/12 09:45, David H. Adler wrote:
>>And here's one from 8 years ago.
>>http://www.panix.com/~dha/test/pix/IMG_2749.JPG
>It is important and/or enlightening to wonder why most of you are
>wearing pixie style tinfoil hats? Are the points more or less likely
>to attract the very emanations that you are trying to protect
>yourselves from? Or are you really secret Damian fans after all?

I see no hats. Are you sure you're on the right pills?


Re: [ANNOUNCE] London Perl Mongers Technical Meeting 2012-10-30

2012-10-23 Thread Roger Burton West
On Mon, Oct 22, 2012 at 07:27:08PM +0100, Leon Brocard wrote:
>and we will have a bonus talk:
>Pedro Figueiredo: "The problem with Perl".

What next, Mere Perlianity?

(Sounds great, pity I can't make it.)

R


Re: Brainbench perl test?

2012-09-04 Thread Roger Burton West
On Tue, Sep 04, 2012 at 05:18:20PM +0100, David Hodgkinson wrote:

>When was the last time you recursed in day to day web type code?

Within the last month.


Re: Brainbench perl test?

2012-09-04 Thread Roger Burton West
On Tue, Sep 04, 2012 at 01:26:46PM +0100, Mr I wrote:

>Again your assumptions are on knowing about the fibonacci sequence. So a
>candidate that does not know the fibonacci sequence but identifies a
>possible flaw in the question can only be a maintenance programmer?

The question contains a specification of a function which, while
technically complete, raises some questions. Someone who doesn't ask
those questions isn't much use if he's going to be doing anything for
himself rather than just executing someone else's instructions.

If this is a non-interactive test, I want annotations on the code, and
either of these broad classes would do:

(1) "I'm assuming from the name that this is a Fibonnaci sequence
generator, and therefore fib(0)=1 and fib(1)=1."

(2) "This recursion will never terminate, so I'm assuming that fib(0)=0
in order that it produce a result."

Note that the latter requires no knowledge of anything except
programming. If you're going to claim programmers don't need to know how
to spot a non-terminating recursion, I'm afraid I'm not going to agree.


Re: Brainbench perl test?

2012-09-04 Thread Roger Burton West
On Tue, Sep 04, 2012 at 01:03:22PM +0100, Mr I wrote:
>You're not testing the candidates knowledge of maths you're testing their
>knowledge of programming.

If the candidate doesn't ask "what happens when n is less than 2", he
may be a passable maintenance programmer but he's not someone I'd hire
to have any sort of responsibility.

>It's equivalent to asking you to write a function ved(n, m) that implements
>the 16 sutras* and uses them to return the result. A task that maybe easily
>done by many an Indian programmer yet many in this group would struggle
>with.

Similarly, I'd expect the candidate to ask for more information.

R


Re: Who made the law?

2012-08-31 Thread Roger Burton West
On Fri, Aug 31, 2012 at 11:16:17AM +0100, Adrian Howard wrote:

>They're a virtual sign on the door that says "This place aims to be
>asshole free". Which makes things easier for folk who've had too many
>bad experiences to want to bother with places that aren't.

The short version does that. The long version invites people to argue
that _their_ particular behaviour isn't assholish.



Re: Who made the law?

2012-08-31 Thread Roger Burton West
On Thu, Aug 30, 2012 at 04:28:27PM -0400, Mark Fowler wrote:

>Here's my longer drawn out version, stolen from YAPC::NA's code of conduct.  
>Comments on this are genuinely welcome, and I'll leave it to the current 
>London.pm leader to make a call on what exactly we should adopt (if anything)
>
>Code of Conduct

My feeling is that this is far too long and offputting. "If they have to
specify all this in nitpicking detail, it's because they've got people
who are trying to game the system and they don't have the guts to throw
them out." I'd much rather have a mostly-benevolent dictatorship which
is able to treat cases as individual matters than a huge set of rules
which still won't cover all eventualities.

R


Re: Odd problem with SSL under OSX

2012-08-28 Thread Roger Burton West
On Mon, Aug 27, 2012 at 10:39:18PM -0500, Avleen Vig wrote:
>I'm wondering if something is trying to resolve "www.apache.org:443", and
>the resolvers you're using are returning an IP you can't route to?

Trying IPv6 perhaps?



Re: How to retrieve a row, biased by populatity?

2012-08-21 Thread Roger Burton West
On Tue, Aug 21, 2012 at 09:22:42PM +0100, Dave Hodgkinson wrote:
>Given a set of data, say bands, with each having a ranking, either a
>review metric or a sales ranking, how would you retrieve a random
>row, but biased towards the higher ranking?

Broadly: convert each ranking into a weight (larger number = "better"
item), then index randomly into the weight space.

@itemid=(...);
%weight={id1 => weight1,...};
@weightspace=map {($_) x $weight{$_}} @itemid;
$chosenid=$weightspace[int(rand()*scalar @weightspace)];


Re: OT? Perl Question, iCal

2012-05-22 Thread Roger Burton West
On Tue, May 22, 2012 at 03:35:51PM +0200, Nic Gibson wrote:
>search.cpan.org gives me far too many results for iCal. I need to parse 
>iCalendar (rfc 5545) files and then write them out as xCal (rfc 6321) files. 
>Does anyone have a particular recommendation for a module? Writing the XML 
>isn't the issue for me - it's more the parsing iCalendar files. Suggestions?

Date::ICal seems to get the basic job done. Data::ICal::DateTime is
great but dog-slow (or perhaps it's my programming). Other opinions are
probably at least as valid as mine.

Roger


Re: Confused by sysread()

2012-04-10 Thread Roger Burton West
On Mon, Apr 09, 2012 at 10:32:09PM +0100, Roger Burton West wrote:
>Under Linux amd64 and Perl 5.10.1, I'm trying to read from a pair of
>devices which will produce data in 16-byte blocks. (I can cat the device
>files - as the same user - and verify that they do this.)
>Under Perl 5.8 (and an earlier i386 Linux), this worked. Now sysread()
>is failing with an "Invalid argument".

The answer appears to be that the structure returned by evdev_read() is
larger for 64-bit processes - changing from a 16- to a 24-byte read has
solved the problem. Thanks for the suggestions here.

R


Re: Confused by sysread()

2012-04-10 Thread Roger Burton West
On Tue, Apr 10, 2012 at 10:51:27AM +0100, Dave Mitchell wrote:

>Unlikely to be the issue, but have you tested doing a single 16-byte read,
>e.g.
>dd if=/dev/foo of=/dev/null bs=16 count=1

dd: reading `/dev/input/event8': Invalid argument

...but open() doesn't fail, and cat still works.

OK, so it's not something Perl-specific? This is running off the end of
the Unix I know, but there are people I can ask... thanks.

>Try running it with strace, to see what underlying system calls are being
>performed on the file handle.

[...]
select(8, [3 4], NULL, NULL, {0, 50}) = 0 (Timeout)
select(8, [3 4], NULL, NULL, {0, 50}) = 0 (Timeout)
select(8, [3 4], NULL, NULL, {0, 50}) = 1 (in [4], left {0, 490567})
read(4, 0xa2a5e0, 16)   = -1 EINVAL (Invalid argument)
write(2, "Invalid argument at ./tmp line 5"..., 35) = 35
close(3)= 0
close(4)= 0
[...]

>If its not obvious from that, then strace
>the working 5.8.x version too to see what's different. 

That would be the version from before the system upgrade; I don't have
any 5.8.x boxes left.

On Tue, Apr 10, 2012 at 11:02:31AM +0100, Dirk Koopman wrote:
> my $y=sysread $fh,$data,16,0;

Makes no difference.

R


Re: Confused by sysread()

2012-04-09 Thread Roger Burton West
On Mon, Apr 09, 2012 at 02:52:10PM -0700, Yitzchak Scott-Thoennes wrote:

>You've probably switched from perl using stdio to using perlio.

The perl I have certainly has USE_PERLIO set.

>You
>could compile 5.10.1 with usestdio to see if that makes a difference.
>Or you could try a newer perl and see if this is a bug that perhaps
>has been fixed?

Oh dear. I could, but it's rather a slog.

>Which strikes a vague bell...does it help to say: my $data = '';

No. Nor to initialise it to the size of the buffer.

R


Confused by sysread()

2012-04-09 Thread Roger Burton West
Under Linux amd64 and Perl 5.10.1, I'm trying to read from a pair of
devices which will produce data in 16-byte blocks. (I can cat the device
files - as the same user - and verify that they do this.)

Under Perl 5.8 (and an earlier i386 Linux), this worked. Now sysread()
is failing with an "Invalid argument".

I'm using an IO::Select thus, where @dev contains the device filenames:

my $s=IO::Select->new;
my @fh;
foreach my $device (@dev) {
  my $fh;
  open $fh,'<',$device;
  binmode $fh;
  $s->add(\*$fh);
  push @fh,$fh;
}

while (1) {
  my @ready=$s->can_read(0.5);
  foreach my $fh (@ready) {
my $data;
my $y=sysread $fh,$data,16;
die $! unless defined $y;
# do stuff with $data
  }
}

I can change the open to

sysopen $fh,$device,O_RDONLY;

with no change in the result; if I add O_DIRECT, the @ready list never
gets filled at all.

Have I missed something important somewhere?

Roger


Re: Programming Heresy

2012-03-30 Thread Roger Burton West
On Fri, Mar 30, 2012 at 11:29:46AM +0100, Will Crawford wrote:
>On 30 March 2012 11:23, Dirk Koopman  wrote:
>> Get yourself a decent man shed with some decent windows that you can open.
>What kind of colour is "man"?

Pick one:

Whatever colour you want it to be.
The colour it was when it came from the shop.
The colour of all this left-over paint I had lying around.
Pink. Because I felt like it.


Re: Programming Heresy

2012-03-30 Thread Roger Burton West
On Fri, Mar 30, 2012 at 10:24:24AM +0100, Steve Mynott wrote:
>Has anyone tried programming outside?

For the last couple of years I've been working from home, and from the
gazebo in the garden whenever it's warm enough. This gives me both shade
and protection from rain. (Since there's power plumbed in, I use a
full-size keyboard and monitor with the laptop.)

R


Re: The proper way to open()

2012-01-30 Thread Roger Burton West
On Mon, Jan 30, 2012 at 04:56:53PM +, Dominic Thoreau wrote:

>open IN, '<', $cfg || handle_that_error_sub;

OK, that's the same error I was making, so I'll point out that this will
not fail as desired, but

open (IN, '<', $cfg) || handle_that_error_sub;

will.

R


Re: The proper way to open()

2012-01-30 Thread Roger Burton West
Bah. Thanks to Abigail. I'd done it as

open ... || die ...

and that hadn't worked, but that was because the || was binding more
tightly than the open; open (...) || die works perfectly well.

I really must get that faster brain...


The proper way to open()

2012-01-30 Thread Roger Burton West
What's a good way of opening a file as read-only, and failing if it
doesn't exist? open() just returns a handle that's not obviously
invalid, which strikes me as odd behaviour. At the moment I'm doing
something like:

  open IN,"<$cfg";
  if (eof IN) {
die "bad config file $cfg\n";
  }

R


Re: OT: HTTP server that binds tcp6

2012-01-23 Thread Roger Burton West
On Fri, Jan 20, 2012 at 03:51:17PM -0800, Jesse Vincent wrote:

>I _believe_ there's a subclass of HTTP::Server::Simple that supports v6 well 
>up on CPAN. There are also patches to HTTP::Server::Simple in a ticket in 
>rt.cpan.org.

The patches on CPAN don't work with the current Debian/stable version,
but the ones on the Debian bugtracker do. Thanks! (Yeah, I could in
theory bugfix, but I'm using the module because I want someone else to
do the heavy socket programming in the first place...)

In case anyone's interested, it's a BitTorrent tracker:

http://firedrake.org/cgi-bin/gitweb.cgi?p=nobraketracker.git
git://firedrake.org/nobraketracker.git/
https://github.com/Firedrake/nobraketracker

Roger


OT: HTTP server that binds tcp6

2012-01-18 Thread Roger Burton West
I have a handy short program which is built on top of
HTTP::Server::Simple. That's fine, but now people want IPv6 support.

Is there a convenient server backend which offers this? I've just been
looking at POE::Component::Server::HTTP and
POE::Component::Server::SimpleHTTP with no joy. Any recommendations? (Or
a way of getting IPv6 out of HTTP::Server::Simple would be even better.)

Roger


Re: Parsing MySQL dump files

2011-12-13 Thread Roger Burton West
On Tue, Dec 13, 2011 at 12:47:11PM +, Fahad Khan wrote:
>This will do the DDL for you.
>https://metacpan.org/module/SQL::Translator::Manual

Would work better if it didn't run out of memory.

Looks as though my hand-hacked line-by-line version is doing the job,
though.

R


Re: Parsing MySQL dump files

2011-12-13 Thread Roger Burton West
On Tue, Dec 13, 2011 at 04:41:56PM +0400, Pavel Vlasov wrote:
>What kind of parse do you want?

Recreating the full table structure would be fine.

So would a set of fieldname=>value maps.

Not really fussy.

R


Parsing MySQL dump files

2011-12-13 Thread Roger Burton West
Help me, lazyweb.

I have a large chunk of data that will only be supplied as a MySQL dump.
(About 200M.) I want to get them out in a more reasonable format. I
don't want to install MySQL, because it smells.

Has anyone done this in Perl? Either a full parse, or a hack to get it
into a form acceptable to SQLite...

Roger


Re: Telecommuting

2011-12-12 Thread Roger Burton West
On Mon, Dec 12, 2011 at 01:04:56PM +, Simon Wilcox wrote:

>That and the fact that many new graduate recruits don't use email
>much any more.

If they've only ever used the crippled-but-flashy version that Microsoft
provides, this is hardly surprising - why would they want to? It has
nothing to offer over IM or Twitter.


Re: Perl Skills Test

2011-11-06 Thread Roger Burton West
On Sun, Nov 06, 2011 at 07:36:28AM +, Piers Cawley wrote:
>On Saturday, November 5, 2011, Zbigniew ??ukasiak  wrote:
>> For a full disclosure - I know the founder personally and I envy his
>> business idea.
>While I just wonder how good his sandbox is.

spoj.pl seems to have managed reasonably well so far. (Recommended, by
the way.)

R


Re: Fwd: [newtech-141] CloudCamp London 5th October 6.30pm onwards

2011-09-27 Thread Roger Burton West
On Tue, Sep 27, 2011 at 04:12:48PM +0100, Dave Hodgkinson wrote:
>Anyone care?

This is the first message I've had with "Cloud" in the subject line that
wasn't blatant spam.

Roger


Re: mutt

2011-07-27 Thread Roger Burton West
On Wed, Jul 27, 2011 at 02:56:14PM +0200, Mallory van Achterberg wrote:
>Any hints on where in the mutt docs this magic key is?

break-thread

R


Re: mutt

2011-07-24 Thread Roger Burton West
On Sun, Jul 24, 2011 at 10:36:08PM +0100, David Cantrell wrote:

>Why change headers at all? Just don't hit reply to start a new message
>that isn't a reply.

But copying email addresses is _hard_.

So I'm told, by people who are stuck with hateful mail clients. I.e. the
ones who would benefit from a better interface for new threads are just
the ones who won't get it.

R


Re: Google +

2011-07-04 Thread Roger Burton West
On Mon, Jul 04, 2011 at 12:27:20PM +0200, Joel Bernstein wrote:

>In case anybody is reading this and is still mystified, never ever
>ever begin a new mailing list thread by replying to an old one and
>deleting bits of it

Is there a reference page to show people what threading looks like when
it's done right? Plenty of Microsoft and mobile-device users seem never
to have encountered the concept.

R


Re: Cool/useful short examples of Perl?

2011-06-08 Thread Roger Burton West
On Wed, Jun 08, 2011 at 01:41:29PM +0100, Paul Makepeace wrote:

>$ perl -le 'print "$_ == !!$_ ? ", $_ == !!$_ ? "yes" : "no" for (-1,
>0, 1, 2, undef)'
>-1 == !!-1 ? no
>0 == !!0 ? yes
>1 == !!1 ? yes
>2 == !!2 ? no
> == !! ? yes

Might as well add lua, since I'm trying to learn it at the moment (and
therefore this is unlikely to be idiomatic). Having explicit boolean
types makes it all a bit more predictable, I feel.

$ lua -e 'function process(x) y=not not x;print(x,"==",y,"?",(y==x)) end for 
x=-1,2 do process(x) end process(nil) process(true) process(false)'
-1  ==  true?   false
0   ==  true?   false
1   ==  true?   false
2   ==  true?   false
nil ==  false   ?   false
true==  true?   true
false   ==  false   ?   true

Roger


Re: Security of HTTP based authentication

2011-01-13 Thread Roger Burton West
On Thu, Jan 13, 2011 at 02:09:16PM +, Andrew Black wrote:

>I have often wondered about that - what is the risk in mixing HTTP
>images and HTTPS text?

Leakage of Referer: header?


Re: Server side chart/graph library?

2011-01-06 Thread Roger Burton West
On Thu, Jan 06, 2011 at 11:54:39AM +, J??r??me Et??v?? wrote:

>I've got experience with gd but I remember struggling with unicode and
>antialiasing and there's been no new version since 2007.
>I'm wondering if anything more modern is around.

Imager does many of the same things as GD but more niftily.

R


Hash to disc: what's good and fast these days?

2010-12-16 Thread Roger Burton West
There are lots of modules that let me tie a hash to some sort of
database: BerkeleyDB, TokyoCabinet, CDB, and so on. Is there anything
that's aware of Perl data structures and will let me tie a _multi-level_
hash to a disc file? If so, what's the best option? (I was thinking of
YAML, but it's too slow for big data sets...)


Re: London.pm leader election

2010-09-24 Thread Roger Burton West
On Fri, Sep 24, 2010 at 03:45:11PM +0100, Denny wrote:

>Seriously then, I propose that we consider being an autonomous
>self-organising collective instead of having a leader.

In the event that "none of the above" wins the final vote, what is to be
done: a leaderless year as Denny proposes, or a new election?

Roger


signature.asc
Description: Digital signature


Re: Best practice for variables shared between processes?

2010-09-21 Thread Roger Burton West
On Tue, Sep 21, 2010 at 01:20:08PM +0100, David Cantrell wrote:

>My first choice would be to just use the filesystem.  Have the
>producer(s) write its files somewhere and then mv them to a directory
>that the consumer knows about once it's completely written.

OK, a bit more detail. This is a pretty lightweight thing; the idea is
for the producer to generate and cache sound files from a text-to-speech
system, while the consumer plays them over VoIP. (This is all happening
inside an AGI script.) That way there should be a delay while it's
generating the first file, but by the time that has been played the
second file ought to be ready.

So the consumer should not delete the files once it's played them,
because they might be useful later. Of course there would be no
difficulty in creating a second set of files which contained pointers to
the first, and _those_ could be deleted once used.

R


Re: Best practice for variables shared between processes?

2010-09-20 Thread Roger Burton West
On Mon, Sep 20, 2010 at 10:15:58PM +0100, Mark Fowler wrote:
>I had a better thought after my last post. Have one process create
>files and, when it's done with each file, atomically move them into a
>known directory for the second process to, um, process and delete then
>when done.

Threads may well be a better option for this particular role, but this
is the #2 choice.

Thanks to all who've answered.

R


Best practice for variables shared between processes?

2010-09-20 Thread Roger Burton West
I wish to have two processes, a "producer" (which will create files) and
a "consumer" (which will do something with them), running
simultaneously. Ideally the producer would push filenames to a list as
it finishes producing them, while the consumer would shift them off the
same list (or loop-wait, if the list is empty).

What is the accepted best practice for achieving this effect in modern
idiomatic Perl?

(Doesn't have to work on non-Unixlike platforms. Or even non-Linux ones,
probably.)

(Also, this is all going to get spawned in response to something else;
it won't be conveniently daemoniseable.)

Roger


Re: Preferred RTF parser module?

2010-05-13 Thread Roger Burton West
On Sat, May 08, 2010 at 09:37:52AM +0100, Roger Burton West wrote:
>There seem to be several different RTF parsers on CPAN (RTF::Tokenizer,
>RTF::Parser, RTF::Lexer, RTF::Reader at the very least). I've looked at
>RTF internals and I certainly don't want to write my own.

On the vague off-chance anyone is interested...

Tokenizer didn't need me to install yet another shiny test harness to
get it to build, and gets the job done relatively painlessly. So that's
what I'm using.

Roger


Preferred RTF parser module?

2010-05-08 Thread Roger Burton West
ObBeer: the new batch of Black Flag Mild is maturing nicely.

There seem to be several different RTF parsers on CPAN (RTF::Tokenizer,
RTF::Parser, RTF::Lexer, RTF::Reader at the very least). I've looked at
RTF internals and I certainly don't want to write my own.

What I want to do is extract the text from an RTF file, and to be able
to know which named style each paragraph uses. Any recommendations?

R


Re: Advice on HTML editting

2010-04-29 Thread Roger Burton West
On Thu, Apr 29, 2010 at 11:14:40AM +0100, Victoria Conlan wrote:

> My first thought was a simple RE, then I decided that was silly and started
> looking at modules.  HTML::Parser and HTML::TreeBuilder are what I've looked
> at so far.

What I tend to do in this sort of situation is use HTML::TokeParser
(which is just an alternative interface to HTML::Parser that matches
better with the way I work) and re-emit everything except the tokens
that I want to fiddle with. Not claiming this is the best way to go, but
most of what I do is parsing HTML rather than modifying it, and I
already use HTML::TokeParser a lot.

R


Re: Solid state drives

2010-04-20 Thread Roger Burton West
On Tue, Apr 20, 2010 at 11:03:49AM +0100, David Precious wrote:

>(Yeah, ideally you'd be running a dual-PSU box with each PSU connected to a 
>different supply, so you should never lose both, of course.)

And ideally the PSU failure doesn't blow a fuse further into the system.

And ideally the triple-PSU box can actually run on just one PSU.

In short, plan for power failure.

R


Anyone fancy a 1U server?

2010-03-05 Thread Roger Burton West
I have a spare 1U server - 3GHz Pentium 4, a gig of RAM. The IDE
controller is naffed (it's pre-SATA), but there's a PCI riser into which
you could drop the controller of your choice; there are two hard drive
mounting points. Anyone interested?

Roger


Re: Nice traffic RSS feed

2010-03-05 Thread Roger Burton West
On Fri, Mar 05, 2010 at 10:15:54AM +, Michael Lush wrote:

> http://www.highways.gov.uk/rssfeed/rss.xml
>
> Thought someone else may find it useful (I like it, it even has the  
> lat/lon of the incident so I can limit the search to bits of the A14 I  
> actually use)

Which makes it remarkably easy to convert into .kml...

R


Re: No more IP for you

2010-01-20 Thread Roger Burton West
On Wed, Jan 20, 2010 at 03:46:04PM +, Dominic Thoreau wrote:

>Which will be just fine until we want to correspond with the camels in
>the bio-dome on Mars.

That's OK, TCP timeouts aren't long enough for the lightspeed delay.

R


Re: No more IP for you

2010-01-20 Thread Roger Burton West
On Wed, Jan 20, 2010 at 02:48:28PM +, David Cantrell wrote:

>There are of the order of 10 billion IPv6 addresses available for every
>atom in the earth.

But what is the allocation policy? (Does the University of Cambridge
still get more than 1% of them? Or some other organisation that seems
terribly important now?)

R


Re: SHA question

2010-01-15 Thread Roger Burton West
On Fri, Jan 15, 2010 at 08:16:09PM +, Andy Wardley wrote:

> My understanding[*] is that it computes a checksum for each block of a file
> and only transmits blocks that have different checksums.

And to calculate the checksum on each block of the file, it has to, um,
read each block of the file... yes?

R


Re: SHA question

2010-01-14 Thread Roger Burton West
On Thu, Jan 14, 2010 at 01:59:22PM +, David Cantrell wrote:

>Shame that "local" includes "at the other end of a really slow NFS
>connection to the other side of the world". Mind you, absent running the
>rsync daemon at the other end and using that instead of NFS, I'm not
>sure if there's a better way of doing it.

Possibly I'm missing something, but: ssh?

R


Re: SHA question

2010-01-13 Thread Roger Burton West
On Wed, Jan 13, 2010 at 02:25:58PM +, Alexander Clouter wrote:

>The following gives the duplicated hashes (you might prefer '-D' instead
>of '-d'):

But does not take account of hardlinks, and again hashes every file
rather than just the ones that might be duplicates.

R


Re: SHA question

2010-01-13 Thread Roger Burton West
On Wed, Jan 13, 2010 at 01:12:28PM +, Dermot wrote:

>Unfortunately the size varies quite a bit. There are a few 11Mb pdfs
>but the majority are under 1mb.

No, that's _good_.

>I am using it in a perl class

So I won't point out the implications, but there's an obvious one which
will make your life easier.

R


Re: SHA question

2010-01-13 Thread Roger Burton West
On Wed, Jan 13, 2010 at 12:44:47PM +, Dermot wrote:

>I have a lots of PDFs that I need to catalogue and I want to ensure
>the uniqueness of each PDF.  At LWP, Jonathan Rockway mentioned
>something similar with SHA1 and binary files.  Am I right in thinking
>that the code below is only taking the SHA on the name of the file and
>if I want to ensure uniqueness of the content I need to do something
>similar but as a file blob?

Yes.

You may want to be slightly cleverer about it - taking a SHAsum is
computationally expensive, and it's only worth doing if the files have
the same size.

If you don't require a pure-Perl solution, bear in mind that all this
has been done for you in the "fdupes" program, already in Debian or at
http://netdial.caribe.net/~adrian2/programs/ .

Roger


Re: Perl Christmas Quiz 2009

2009-11-30 Thread Roger Burton West
On Mon, Nov 30, 2009 at 10:43:19PM +, Dave Hodgkinson wrote:

>How many people will be mildly irritated by starting a new thread
>with a Reply-to: to an existing one?

Meh, judging by the headers he's probably never used a threaded email
client so has no reason to know any better. No point in mocking the
afflicted. Just hit #...

Roger


Re: Help me become a Londoner!

2009-11-24 Thread Roger Burton West
On Tue, Nov 24, 2009 at 02:54:22PM +, Mike Woods wrote:

> Mind you outside of greater london it's often purley down to the cost,  
> last time I took a bus from wakefield to leeds it cost ?2.50!!*

Much the same here in Darkest Wycombe. Basically if there are two or
more people going between my place and the station it's cheaper to share
a cab (which run after 10pm at weekends, too).

> * However if you look to your right for most of the trip, you'll  
> eventually see the chap with a tank in his front garden, which is  
> frankly awesome :D

All we have is a 2" deck gun in the yard of a hire shop.

R


Re: domain registrars

2009-10-24 Thread Roger Burton West
On Sat, Oct 24, 2009 at 02:40:16PM +0100, James Laver wrote:
>Today, namecheap had some scheduled site downtime (dns still
>operational) without notifying their customers (at least neither
>myself nor my flatmate were informed) but customer service insists an
>email was sent out to everybody. They also can't tell me even roughly
>when it will be back up.

Do you want a registrar or a nameserver host? Unless you wanted to buy a
bunch of new domains today, I don't see why registrar downtime should
affect you.

R


Re: Credit Cards

2009-10-13 Thread Roger Burton West
On Tue, Oct 13, 2009 at 01:27:54PM +0100, Robert Shiels wrote:

>I dislike giving online retailers any more information than I have to - 
>do they really need this? Will other companies be following suit and so 
>refusing is just me playing Canute? Will the CC company verify these 
>details (not sure if I've even given them my phone number.) - I'm of the 
>opinion that play.com are just data mining.

I have never given a valid telephone number to my CC company or to any
on-line retailer. I see no reason to change now.

While it's no good if they're actually planning to telephone it, there's
always: http://www.ofcom.org.uk/telecoms/ioi/numbers/num_drama?a=87101

R


Re: Sending $US to the US

2009-10-06 Thread Roger Burton West
On Tue, Oct 06, 2009 at 06:45:19AM -0700, Ovid wrote:

>Anyone happen to know a less expensive way to send, via mail, US
>dollars to the US, short of sending cash?

Get a US$-denominated bank account, with a cheque book. I believe
Citibank do them.


Re: Last Straw. Camel's Back. Etc.

2009-10-01 Thread Roger Burton West
On Thu, Oct 01, 2009 at 11:30:10AM +0100, Peter Corlett wrote:
>The only thing that WebTapestry lacks that Zen has is a Usenet  
>service. This has done wonders for my productivity :)

Leaving Demon meant I lost their USENET feed. Now I'm running my own
node. Such is the way of the world...


Re: Last Straw. Camel's Back. Etc.

2009-10-01 Thread Roger Burton West
On Thu, Oct 01, 2009 at 10:54:55AM +0100, Bob MacCallum wrote:

>(albeit a canned one: "we don't block ports because that would be bad
>for business" - traffic shaping is another thing, I assume.)

As far as I know, no ISP admits to traffic-shaping.

(Demon was working for me, but when I moved house last year they
couldn't cope with the idea of "I'd like to keep the same IP addresses
at the new location" - even though it was a "business" account - so
they'd effectively removed any incentive for staying with them.)

R


Re: Anyone hiring at the moment?

2009-09-29 Thread Roger Burton West
On Tue, Sep 29, 2009 at 07:32:19PM +0100, Dirk Koopman wrote:

>What is it about the good stuff that seems to put most people (a 
>category which probably excludes nearly everyone on this list) off 
>drinking it.

Tastes take training. Bitter tastes in particular are something that
need to be acquired. If you've grown up on hypersweetened everything,
that's harder. If you don't know other people who are drinking bitter
things, and indeed if drinking bitter things will get you looked on as a
weirdo, why bother?

R


Re: Anyone hiring at the moment?

2009-09-25 Thread Roger Burton West
On Fri, Sep 25, 2009 at 11:28:12AM +0100, Peter Corlett wrote:

>I can't say that Stoke appeals, but I really do want to visit Glasgow  
>one day to see if people really do eat deep-fried Mars bars, or  
>whether they were invented to wind up the English.

Both. They were invented as a joke to sell to tourists, but now they
sell to the more-easily-led locals too.


Re: Anyone hiring at the moment?

2009-09-23 Thread Roger Burton West
On Tue, Sep 22, 2009 at 09:50:58PM +0100, Peter Corlett wrote:

>I still reckon the People's Republic of Yorkshire produce the best  
>beer. Shame it's mostly undrinkable by the time it's travelled to  
>London.

Why not brew your own?

R (last time I was in Amsterdam involved jonge genever (sp?) and gets a
bit hazy)


Re: Anyone hiring at the moment?

2009-09-21 Thread Roger Burton West
On Mon, Sep 21, 2009 at 08:48:31AM -0700, Ovid wrote:

>Frustrating, really. There's plenty of evidence (there's a William Whyte study 
>that I can't find a link to right now) that large-scale moves like this fail 
>dramatically.

Unless the objective is to sack everyone and hire cheaper people in the
new place, of course. (Which it probably isn't in this case, but it
certainly has been with other companies.)

R


Re: More camels

2009-08-19 Thread Roger Burton West
On Wed, Aug 19, 2009 at 09:46:44AM +0100, Chris Jack wrote:
>I've eaten camel in Holland. It was quite leathery. I wouldn't recommend it.

Stew.

It could reasonably be argued that a good pie is essentially a thick
stew wrapped in pastry anyway.

R


Re: Decent OS X audio rip software

2009-07-29 Thread Roger Burton West
On Wed, Jul 29, 2009 at 11:18:21AM +0100, Robert Shiels wrote:
>Wow, so much legwork for such a small job.
>
>I've converted many hundreds of CDs to MP3 on Windows with iTunes, and 
>have never had any problems with quality, and only minor issues with 
>tagging.

Depends on what you want to do. My objective is "I will never have to
rely on being able to read this rotting piece of mylar again".

R


Re: Decent OS X audio rip software

2009-07-29 Thread Roger Burton West
On Wed, Jul 29, 2009 at 10:41:52AM +0100, Damon Allen Davison wrote:
>OS X is a bit of a problem in this regard. cdparanoia via Max is the best
>GUI solution, as far as I'm concerned, but the metadata goes missing. Using
>Max in combination with MusicBrainz' Picard tagger would probably work fine.
>I actually use cdparanoia on the command line to do my ripping.

It's fairly trivial to code up a small chunk of code to convert, rename
and tag the files one has ripped with CDParanoia. One might even use, oh
I don't know, Perl.

(Please archive in FLAC if you have the storage space; it will cause the
least trouble in the long run, as it is the most widely-supported and
least legally-encumbered lossless compression format. Which is not to
say you shouldn't also transcode to something lossy for devices with
limited storage...)

R


Re: The 12th ICFP Programming Contest

2009-06-26 Thread Roger Burton West
On Fri, Jun 26, 2009 at 01:15:59AM -0700, Ask Bj?rn Hansen wrote:

>Actually, per the FAQ it looks like they won't have to even be able to  
>run the program on their systems.

"...it works on my infinite Turing machine; implementation on bounded
hardware is merely an engineering problem."

R


Re: Big Geek Day Out: Bletchley Park 18th July

2009-06-15 Thread Roger Burton West
On Mon, Jun 15, 2009 at 10:47:31AM +0100, Joel Bernstein wrote:

>Does it have good pubs too??

Heh.

If you look on Beer in the Evening, it'll point you here:

http://www.beerintheevening.com/pubs/s/25/25505/Old_Swan/Bletchley

but that was really pretty unimpressive a few weeks back - big-screen
televisions showing loud sports all over the place, no scope for
conversation, Greene King. Instead we ended up here:

http://www.beerintheevening.com/pubs/s/26/26133/Bull_and_Butcher/Fenny_Stratford

which was very much better, though it's a bit of a hike away.

Roger


Re: Big Geek Day Out: Bletchley Park 18th July

2009-06-15 Thread Roger Burton West
On Mon, Jun 15, 2009 at 10:01:16AM +0100, David Dorward wrote:

>In a happy bit of coincidence, a former colleague of mine has started
>(independently) organising a Big Geek Day Out ... to Bletchley Park ... on
>the 18th of July.

Don't miss the National Museum of Computing.

R


Re: Fwd: June Social, Gunmakers EC1R, Clerkenwell. Thurs 4th June.

2009-06-04 Thread Roger Burton West
On Thu, Jun 04, 2009 at 03:20:58PM +0100, Martin A. Brooks wrote:

>--Martin, who has deliberately bought James many pints of foul-tasting 
>effluent.

Oh, you've been to a Wetherspoons then?

R, stirring


Re: "London" airports Re: Italian Perl Workshop 2009

2009-05-29 Thread Roger Burton West
On Fri, May 29, 2009 at 04:09:54PM +0100, Hakim Cassimally wrote:

>Ah!  To be honest, the "hahahaha" was because I used to live near
>Luton, and the "London" name for it still makes me chuckle.

Not quite as silly as London Southend, though.

R


Re: Best practice for releasing Perl modules to staging and live

2009-05-18 Thread Roger Burton West
On Mon, May 18, 2009 at 04:03:19PM +0100, ian wrote:

>Are you advising to (re)build CPAN Perl modules this way, or are you 
>just describing what to do with our own Perl modules?
>
>One company I worked at did just this for CPAN modules, but it was a 
>many-day exercise to work out all the dependencies of (for example) 
>Catalyst and to build them all into Debian packages.

Whether it's worth it depends on how many servers you have. Certainly at
my current employer (about ten servers, modules with minimal dependency
trees) we find it well worth doing for the modules (both CPAN and
homegrown) that aren't already in Debian.

Roger


Re: How we see CVs

2009-04-02 Thread Roger Burton West
On Wed, Apr 01, 2009 at 05:00:38PM +0100, Paul Makepeace wrote:
>This is great, http://www.hanovsolutions.com/resume_comic.png

A good start, though "has facebook page" is curiously missing from the
negative side...


Re: Fwd: (Planned) Emergency Social - Friday 20th March, 6pm, Wenlock Arms

2009-03-20 Thread Roger Burton West
On Fri, Mar 20, 2009 at 01:38:52PM +, Peter Corlett wrote:

>A Cask Marque plaque merely shows that it was a good pub some time in its
>history. Looking for a sticker stating the place is in this year's Good Beer
>Guide is a much better bet.

Though in some areas you'll then miss places that don't choose to give
the local committee free pints after closing time. Which is why I tend
to end up drinking at places I know.

R


Handy Perl 6 reference

2009-02-18 Thread Roger Burton West
http://www.ozonehouse.com/mark/periodic/

R


Re: [REVIEW] Drobo

2009-01-30 Thread Roger Burton West
On Thu, Jan 29, 2009 at 09:14:43PM +, Simon Wistow wrote:

>My alternative was either a hardware RAID controller of some kind or a 
>small, low profile box running *nix and software RAID. The former gives 
>me the willies - one too many stories of hardware RAID controllers 
>dying and otherwise servicable data being unrecoverable due to not being 
>able to get the exact make, model and rev of controller again. The 
>latter violates my zero-effort policy. In my experience no matter how 
>simplisticly I've set up a *nix box it still requires more admin and 
>more fiddling than a black box that I just plug into the wall.

Seems fair enough. I'd always go for the generic hardware approach; I've
been bitten too often by having to keep kit running past its useful date
just to support some obscure interface card that isn't made any more.

(Getting my "CD elimination server" up and running was a bog-standard PC
build, plus about ten minutes of reading mdadm documentation. I like
mdadm. Even when it tickled an obscure kernel bug that made it look as
though all the drives were failing at once, it managed to avoid losing
any data.)

Roger


Re: My New Job (Was: Social Thurs 8 Jan 2009)

2009-01-29 Thread Roger Burton West
On Thu, Jan 29, 2009 at 02:28:15PM +, Joel Bernstein wrote:
>>From LU's website
>There are many reasons why signals fail.

In the case of the eastern end of the Jubilee Line, because the
constructors were told to take their budget for signalling and spend it
on getting the line open in time to carry the millions of people who
were going to visit the Millennium Dome. (The powers that be having
wisely decided that allowing people to get there by car, coach, bus or
boat would be Evil.)

Which is why the signalling was done on the Very Cheap, and still breaks
down frequently.

R


Re: My New Job (Was: Social Thurs 8 Jan 2009)

2009-01-06 Thread Roger Burton West
On Tue, Jan 06, 2009 at 03:17:02PM +, Peter Corlett wrote:

>Cycle lanes are occasionally actively dangerous, so I tend to ignore  
>them unless there is an obvious benefit of using a particular one.  

Cycle lanes are _usually_ actively dangerous, so says pretty much all
the research. (Unless they're as wide as a normal traffic lane, and they
never are.) It's simply safer to cycle as a vehicle, on the road with
other traffic (most crucially, _where the other drivers expect a vehicle
to be_).

R


Re: My New Job (Was: Social Thurs 8 Jan 2009)

2009-01-05 Thread Roger Burton West
On Mon, Jan 05, 2009 at 02:13:48PM +, Paul Makepeace wrote:

>Get a bicycle or a scooter. Do your level best in the meantime to ignore any
>commentary from anyone who hasn't actually ridden in London.

Seconded. Advice from a relatively new cyclist on request, or distilled
at http://firedrake.org/roger/cycling/ .

Roger


Re: Introduction to Perl for non-programming Mac folk

2008-12-23 Thread Roger Burton West
On Tue, Dec 23, 2008 at 12:43:18PM +, Christopher Jones wrote:

>And more to the point, "RTFM" is just plain rude.

The US military has been known to use RFTMA:
Read the friendly manual, _sir_.

R


Re: Perl Christmas Quiz

2008-12-16 Thread Roger Burton West
On Tue, Dec 16, 2008 at 07:26:50PM +, Greg McCarroll wrote:

>I think the OTT Perl example would have tied 'hello' and 'world'  
>supply variables, would use autoloader to create the method, use a  
>couple of Acme modules, a regex to correct the capitalisation and just  
>to be really silly, it would use Catalyst and Moose ;-)

Whereas the Web2.0 version displays whatever the previous user typed in
(with a round-cornered logo)?

R


Re: Perl 5.8.8 segfaulting on comments! How can this be?

2008-12-12 Thread Roger Burton West
On Fri, Dec 12, 2008 at 04:38:07PM +, Andy Wardley wrote:

>Before I go digging deeper (having already lost most of the afternoon to
>this), can someone confirm the problem for me?

Not manifest on my 5.8.8.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
osname=linux, osvers=2.6.18-6-k7, archname=i486-linux-gnu-thread-multi
uname='linux rebekka 2.6.18-6-k7 #1 smp mon aug 18 09:20:26 utc 2008 i686 
gnulinux '

Linux radiant 2.6.22-3-686 #1 SMP Sun Feb 10 20:20:49 UTC 2008 i686 GNU/Linux

Roger


Re: Is Perl alive ?

2008-12-11 Thread Roger Burton West
On Thu, Dec 11, 2008 at 06:59:33PM +, Nigel Rantor wrote:
>Simon Wilcox wrote:
>>http://isperlalive.com
>>http://isperldead.com
>I really think that they should both say the same thing.

mu?

R


Re: Doing a non-standard ioctl in Perl

2008-11-13 Thread Roger Burton West
On Fri, Nov 07, 2008 at 10:43:27AM +, Jonathan Stowe wrote:

>Is there a linux/input.ph or is it possible to generate one from the
>linux/input.h using h2ph ?

Apparently. Maybe.

cd /usr/include && h2ph -a linux/input.h produces lots and lots of
output. Whoopee.

Running the program with

require 'linux/input.ph';

produces a big pile of warnings (below), and while the ioctl doesn't
actually fail it doesn't appear to have any effect either.

(I'm invoking it with ioctl (HANDLE,&EVIOCGRAB,1); )

R


Constant subroutine __USE_POSIX undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 8.
Constant subroutine __USE_POSIX2 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 9.
Constant subroutine __USE_POSIX199309 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 10.
Constant subroutine __USE_POSIX199506 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 11.
Constant subroutine __USE_XOPEN undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 12.
Constant subroutine __USE_XOPEN_EXTENDED undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 13.
Constant subroutine __USE_UNIX98 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 14.
Constant subroutine __USE_LARGEFILE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 16.
Constant subroutine __USE_LARGEFILE64 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 17.
Constant subroutine __USE_FILE_OFFSET64 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 18.
Constant subroutine __USE_BSD undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 19.
Constant subroutine __USE_SVID undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 20.
Constant subroutine __USE_MISC undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 21.
Constant subroutine __USE_GNU undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 22.
Constant subroutine __USE_REENTRANT undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 23.
Constant subroutine _POSIX_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 48.
Constant subroutine _POSIX_C_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 50.
Constant subroutine _XOPEN_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 52.
Constant subroutine _XOPEN_SOURCE_EXTENDED undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 54.
Constant subroutine _LARGEFILE64_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 56.
Constant subroutine _LARGEFILE_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 98.
Constant subroutine __USE_ISOC99 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 102.
Constant subroutine __GNU_LIBRARY__ undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 146.
Constant subroutine __need_size_t undefined at 
/usr/local/lib/perl/5.8.8/stddef.ph line 148.
Scalar found where operator expected at (eval 304) line 1, near "'int'  $__val"
(Missing operator before   $__val?)
Unquoted string "typedef" may clash with future reserved word at (eval 307) 
[EMAIL PROTECTED]:~/projects/cyberlink-pertelian/v2$ 
./cyberlink-pertelian-remote radiant.ini 
Constant subroutine __USE_POSIX undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 8.
Constant subroutine __USE_POSIX2 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 9.
Constant subroutine __USE_POSIX199309 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 10.
Constant subroutine __USE_POSIX199506 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 11.
Constant subroutine __USE_XOPEN undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 12.
Constant subroutine __USE_XOPEN_EXTENDED undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 13.
Constant subroutine __USE_UNIX98 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 14.
Constant subroutine __USE_LARGEFILE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 16.
Constant subroutine __USE_LARGEFILE64 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 17.
Constant subroutine __USE_FILE_OFFSET64 undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 18.
Constant subroutine __USE_BSD undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 19.
Constant subroutine __USE_SVID undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 20.
Constant subroutine __USE_MISC undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 21.
Constant subroutine __USE_GNU undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 22.
Constant subroutine __USE_REENTRANT undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 23.
Constant subroutine _POSIX_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 48.
Constant subroutine _POSIX_C_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 50.
Constant subroutine _XOPEN_SOURCE undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 52.
Constant subroutine _XOPEN_SOURCE_EXTENDED undefined at 
/usr/local/lib/perl/5.8.8/features.ph line 54.
Constant subroutine _LARGEFILE64_SOURCE undefined at 
/usr/l

Doing a non-standard ioctl in Perl

2008-11-06 Thread Roger Burton West
For various reasons, I want to do an EVIOCGRAB ioctl.

perldoc -f ioctl tells me "require sys/ioctl.ph", and gives all sorts of
scary warnings. But EVIOCGRAB isn't in sys/ioctl.ph. What's the approved
way of doing this? That's the only ioctl I'm likely to want to use in
this program, so I don't particularly fancy converting a whole bunch of
others that I'm not going to need.

If it helps:

linux/input.h:#define EVIOCGRAB _IOW('E', 0x90, int)

Roger


Re: Unlimited?

2008-10-31 Thread Roger Burton West
On Fri, Oct 31, 2008 at 12:15:17PM +, Matt Jones wrote:
>On Fri, Oct 31, 2008 at 11:51 AM, Paul Makepeace <[EMAIL PROTECTED]> wrote:
>> This sounds more appropriate with the Advertising Standards Agency, which I
>> suspect already has this covered.
>Yeah. They decided it was just fine to use unlimited to describe a
>limited service:
>http://www.macuser.co.uk/news/87161/asa-provides-new-definition-of-unlimited-broadband.html

Remember this from July.

http://www.thinkbroadband.com/news/3605-asa-upholds-complaint-about-virgin-media-advert.html

Though the ASA is still mostly clueless:

http://weblogs.jupiterresearch.com/analysts/fogg/archives/2008/02/uk_advertising.html

R


Re: Invitation to connect on LinkedIn

2008-10-15 Thread Roger Burton West
On Wed, Oct 15, 2008 at 06:13:09AM -0700, a bot claiming to be Ot??vio 
Fernandes wrote:

>I'd like to add you to my professional network on LinkedIn.

Ah well, I suppose it was useful to some people while it lasted. Now
I guess it's gone the way of Plaxo.


Re: [OT] American Heretics Elections

2008-08-27 Thread Roger Burton West
On Wed, Aug 27, 2008 at 11:07:42PM +0100, Alistair McGlinchy wrote:
>Its not just the London Perl M[ou]ngers who have confusing rules about when
>to have gatherings.

I only codified "the Thursday after the first Wednesday" because the
formulation in use at the time ("the first Thursday, unless it's the
first of the month, in which case the second Thursday") seemed too
verbose and confusing.

iCal can handle it trivially:

RRULE:FREQ=MONTHLY;BYMONTHDAY=2,3,4,5,6,7,8;BYDAY=TH

Roger


Re: __DATA__ and scalars

2003-09-24 Thread Roger Burton West
On Wed, Sep 24, 2003 at 02:41:15PM +, Martin Bower wrote:
>Roger..I'd like to keep the SQL in the same script, so how would the 
>templating systems help ? don't they tend to use external templates ?  
>(scuse my ignorance if not)

Other people can tell you about other templating systems. HTML::Template
can quite happily read from a __DATA__ section:

my $t=HTML::Template->new(arrayref => []);

Roger



Re: __DATA__ and scalars

2003-09-24 Thread Roger Burton West
On Wed, Sep 24, 2003 at 12:32:24PM +, Martin Bower wrote:
>Can anyone point me inthe right direction, on how to get variable names 
>stored in __DATA__ to be evaluated ?

No, but have you considered using a lightweight templating system
instead?

Roger



Re: Database setup

2003-09-17 Thread Roger Burton West
On Wed, Sep 17, 2003 at 02:46:16PM +0100, Jonathan Peterson wrote:
>[Kake]
>> So you write the following module:
>Really? I just write the SQL in text files and run them through the 
>database's built in client.

I write the table definitions in a different format and run them through
a converter to get drop/create statements for SQLite, MySQL and Postgres
(Oracle if I ever bother to install it and work out how to make it
DTRT).

That way the table definitions also form part of the documentation.

R



Re: [ot] doubtless silly perl question

2003-09-16 Thread Roger Burton West
On Tue, Sep 16, 2003 at 01:39:26AM +0100, Joel Bernstein wrote:

>what do you understand by the line: 
>   my $foo=( split ',' => $line )[7];
>?
>
>i'm trying to get the split to return an array, of which I then get the
>7th element (and assign to $foo).

That's what it does for me (well, the 8th element, of course), even if
I use ',' rather than the more useful /,/. What's the problem?

R



Re: Partitioning?

2003-09-10 Thread Roger Burton West
On or about Wed, Sep 10, 2003 at 10:28:19PM +0100, Paul Makepeace typed:

>(Different /usr & /usr/local seems pointless to me. YMMV.)

On or about Wed, Sep 10, 2003 at 10:40:32PM +0100, Shevek typed:

>> /usr/local  1gig   reiserfs
>Why bother having this separate? I used to have a lot of stuff in local 
>but now that I use portage, I have nothing in it.

The reason for separating /usr and /usr/local is so that you can mount
/usr read-only while still allowing users to write to /usr/local. In a
modern environment this obviously makes patching a bit harder...

Roger



Re: Ob-buffy

2003-09-03 Thread Roger Burton West
On Wed, Sep 03, 2003 at 12:55:14PM -0400, David H. Adler wrote:
>On Wed, Sep 03, 2003 at 05:28:34PM +0100, Jonathan Peterson wrote:
>> Anyway if we are ruling out comedies, then Northern Exposure was the best 
>> TV series ever made. Or Dr Who minus all the crap ones.
>What?  Crap DW?? Never!

Timelash.

R



Re: DOS/WIN archivers of the mid 1990s (was Re: gzipping your websites WINRAR 40 days trial)

2003-09-03 Thread Roger Burton West
On Wed, Sep 03, 2003 at 09:49:28AM +, Dominic Mitchell wrote:

>You can get unrar as source code.  I posted the link yesterday.

Yes, but not the compressor. Ditto for ACE and ARJ. So there's no way to
originate a RAR file under Linux without using binary-only software, and
any other Unix will have to use Linux or Windows emulation to run even
that. That makes quite a lot of people look for something else.

Roger



Re: DOS/WIN archivers of the mid 1990s (was Re: gzipping your websites WINRAR 40 days trial)

2003-09-03 Thread Roger Burton West
On Tue, Sep 02, 2003 at 10:05:02PM +0100, Barbie [home] wrote:
>On 02 September 2003 09:43 Roger Burton West wrote:
>> (All of this
>> only applies to the Windows world, obviously; I think the parallels in
>> Unix, or at least Linux, would be .tar.bz2, .tar.gz, and dodgy
>> commercial software with auto-extracting installers like the JRE.)
>Why obviously? RAR, ACE, ZIP, GZIP, BZIP formats are all available on both
>Windows and many Unix variants.

On Unix, RAR and ACE are only available as binaries, which puts off a
lot of people; and neither those nor ZIP preserves file ownership or
permission information. So while I'm able to extract most files under
Unix, I wouldn't choose those formats for something that I'm originating
and plan to share primarily with other Unix users.

Roger



Re: DOS/WIN archivers of the mid 1990s

2003-09-02 Thread Roger Burton West
On or about Tue, Sep 02, 2003 at 08:02:10AM -0700, Toby Corkindale typed:

>I remember (and used) UC2 and, I think, HA..

Want a Debian package for HA? (Privately maintained while I wait to have
time to do the become-a-developer dance.)

>What happened to UC2?

I think the company went under. They certainly stopped answering email
all of a sudden - I was corresponding with them for quite a while.

Roger



Re: HTTP header voodoo

2003-09-02 Thread Roger Burton West
On Tue, Sep 02, 2003 at 02:41:39PM +0100, David Cantrell wrote:
>Can someone remind me, what's the header voodoo that tells a browser
>that regardless of what it sent in the GET request, it should offer to
>save the file as $filename?

Content-Disposition: attachment; filename=$filename

Roger



Re: DOS/WIN archivers of the mid 1990s

2003-09-02 Thread Roger Burton West
On Tue, Sep 02, 2003 at 09:19:37AM -0400, Chris Devers wrote:

>JAR? No relation to the Java archive format, is there?

None whatsoever - it predated it somewhat as well.

>I thought that Java's JAR files were just Java-tARballs.

Mostly they're Zip-files, actually..

Roger



Re: DOS/WIN archivers of the mid 1990s

2003-09-02 Thread Roger Burton West
On Tue, Sep 02, 2003 at 10:55:13AM +0200, Philip Newton wrote:

>I can well imagine that the availability of Info-ZIP may have been part 
>of this; another part is probably the advent of Win95 and WinZIP, which 
>brought compression to the pointy-clicky masses. (ARJ and PKZIP had 
>both been 16-bit command-line DOS programs, though there was third-pary 
>software called ARJMENU which gave you a text-mode full-screen 
>interface to ARJ, and I think PKZIP later came up with a 32-bit 
>graphical version of their software.)

Yup, but it was more expensive than WinZIP (which of course was based on
Info-ZIP) and nagged the user more about registration. ARJ never went
graphical at all AFAIK, and neither did JAR.

>I think it stood a decent chance at "featureful" if not "universal"; it 
>certainly had a ton of features, which got more and more with each 
>version.

It won on "featureful", but that wasn't enough to get it used.

>Compression was roughly the same, but ARJ was the first of the two to 
>have multi-volume archives, for example, or "backup" archives storing 
>multiple versions of the same file (it retrieved the latest version by 
>default but you could ask for any older version as well). I think that 
>by count of features, ARJ was probably more successful.

And of course it was tested a bit more thoroughly before it was
released. Anyone remember PKZip 2.04e? The (plain-text) bug list was
longer than the executable...

>No idea what ARJ is doing these days. They still seem to be around as a 
>company (and have a better format called JAR, apparently), but I 
>haven't seen an ARJ archive in many a day. I doubt they have many 
>sales.

JAR was available in 1996 or so, I think. I still have copies of most of
the archivers and compressors I was playing with in those days... anyone
remember UC2? HA? SAR? ACB?

Roger



DOS/WIN archivers of the mid 1990s (was Re: gzipping your websites WINRAR 40 days trial)

2003-09-02 Thread Roger Burton West
On Tue, Sep 02, 2003 at 09:24:11AM +0200, Philip Newton wrote:

[re RAR]

>I'm told it's fairly popular in (some?) Usenet binary newsgroups as a 
>standard way of distributing warez and moviez.

ACE is another format that I understand is used in that context.

>>From what I gather, it supports multi-volume archives natively (which 
>are a bit of a hack with the ZIP format); there also exists a PAR 
>scheme which gives parity information so if you miss up to 'n' segments 
>of a multi-segment file, you can recreate them from the parity data.

Both correct, though I've never seen PAR actually produce a result.

Actually, I've probably known about RAR for longer than most people; in 
1994 I translated the documentation for RAR 1.40 from Russian to 
English, and uploaded it to Garbo. (Three weeks later, Yevgeniy Roshal 
brought out a new version with his own English translation, which was 
rather less comprehensible than mine, and didn't bother to answer my 
email.)

>Compression is also sometimes better than with ZIP, possibly because of 
>one or both of (a) it's said to have a special "multimedia" mode that 
>is tuned to compressing audio and/or video (no idea how that works, 
>though) and (b) it can create "solid" archives (things .tar.gz - 
>compress the files as one rather than compressing each file 
>individually as in .zip, hence you can take advantage of redundancy 
>across files).

Also both correct. Multimedia mode, AFAIR, looks for shorter repeated
sequences than in text, because there's already been some compression
done.

RAR used to be practically guaranteed to be smaller than ZIP, but the 
format has got a bit bulky of late. Basically, it started as 
state-of-the-art compression code of 1994 and has been updated somewhat 
since, whereas ZIP is state-of-the-art for early 1992 and basically 
hasn't changed at all (RAR has now had four or five changes to the file
format).

In my experience, people who really care about compressed file size and 
are moderately technically savvy tend to use RAR or ACE; people who 
want their files to be readable by everybody use ZIP; people who are 
catering for virus-prone fools use self-installing EXE. (All of this
only applies to the Windows world, obviously; I think the parallels in
Unix, or at least Linux, would be .tar.bz2, .tar.gz, and dodgy
commercial software with auto-extracting installers like the JRE.)

Incidentally, I can highly recommend PowerArchiver, even though it's now
gone shareware. It's the only archive extractor I use on Windows.

>I've very rarely come across a file I wanted that was in .RAR format, 
>though. When I started computing in the 90's on PCs, it was LZH at the 
>beginning, replaced by ARJ shortly after I started; now it's ZIP. (And, 
>of course, the perennial .tar.Z / .tar.gz in the *nix world, though 
>.tar.bz2 are starting to show up in a couple of places.)

For a while, ARJ was looking set to displace ZIP v2; it was producing
consistently smaller files, and had just grown a solid mode (which
originated with HPack, but that's another story entirely). But Rob Jung
insisted on keeping the source entirely closed, which meant that instead
of competing with ZIP as the "universal and featureful" format it was
competing with RAR as the "small" format, at which it failed.

>This is probably not relevant 
>for whoever started the thread, though.

Neither is anything I've said here.

R



  1   2   3   4   >