[30528] in Perl-Users-Digest
Perl-Users Digest, Issue: 1771 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 5 21:09:47 2008
Date: Tue, 5 Aug 2008 18:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 5 Aug 2008 Volume: 11 Number: 1771
Today's topics:
.gz and .bz2 files on the Perl command line <tzz@lifelogs.com>
Re: .gz and .bz2 files on the Perl command line (Jens Thoms Toerring)
Re: .gz and .bz2 files on the Perl command line <ben@morrow.me.uk>
Re: bidding advice for a contract <cwilbur@chromatico.net>
Re: bidding advice for a contract <cwilbur@chromatico.net>
Re: bidding advice for a contract <willem@stack.nl>
Re: bidding advice for a contract <cwilbur@chromatico.net>
Re: bidding advice for a contract <cartercc@gmail.com>
Re: bidding advice for a contract <cartercc@gmail.com>
Re: CLPM - a help group? <worrall+unet@cs.bris.ac.uk>
Re: CLPM - a help group? <john@castleamber.com>
Re: CLPM - a help group? <mjcarman@mchsi.com>
nested strings sausenet@gmail.com
Re: nested strings <ben@morrow.me.uk>
PPM - scripting <slick.users@gmail.com>
Re: <LeoFranks08042008@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 05 Aug 2008 16:11:42 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: .gz and .bz2 files on the Perl command line
Message-Id: <867iavkvzl.fsf@lifelogs.com>
Say I have this program call
go.pl A B C.gz D.bz2
I'd like to just use <> in go.pl and have the compressed files
automatically extracted. Is there a way to do that without writing my
own logic, as a module I can bring in? This is a read-only task. I
couldn't find anything on CPAN.
Thanks
Ted
------------------------------
Date: 5 Aug 2008 21:35:50 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: .gz and .bz2 files on the Perl command line
Message-Id: <6frvdmFct3kcU1@mid.uni-berlin.de>
Ted Zlatanov <tzz@lifelogs.com> wrote:
> Say I have this program call
> go.pl A B C.gz D.bz2
> I'd like to just use <> in go.pl and have the compressed files
> automatically extracted. Is there a way to do that without writing my
> own logic, as a module I can bring in? This is a read-only task. I
> couldn't find anything on CPAN.
There's the PerlIO:gzip module, to be used like this:
use PerlIO::gzip;
open FOO, "<:gzip", "file.gz" or die $!;
print while <FOO>;
And there's PerlIO::via::Bzip2, to be used like this
use PerlIO::via::Bzip2;
open my $fh, "<:via(Bzip2)", "file.bz2" or die $!;
print while <$f>;
Not that I would have used them, just found them on CPAN by
searching for 'gzip' and 'bzip'.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Tue, 5 Aug 2008 22:41:47 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: .gz and .bz2 files on the Perl command line
Message-Id: <r1umm5-pih.ln1@osiris.mauzo.dyndns.org>
Quoth Ted Zlatanov <tzz@lifelogs.com>:
> Say I have this program call
>
> go.pl A B C.gz D.bz2
>
> I'd like to just use <> in go.pl and have the compressed files
> automatically extracted. Is there a way to do that without writing my
> own logic, as a module I can bring in? This is a read-only task. I
> couldn't find anything on CPAN.
Heh :). See the recent thread on p5p... The logic is trivial, at least
if your files have sane names:
BEGIN {
for (@ARGV) {
/\.gz$/ and $_ = "gzip -dc $_ |";
/\.bz2$/ and $_ = "bzip2 -dc $_ |";
}
}
since <> uses 2-arg open.
Ben
--
Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read.
ben@morrow.me.uk Groucho Marx
------------------------------
Date: Tue, 05 Aug 2008 14:17:24 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: bidding advice for a contract
Message-Id: <86bq07s4wb.fsf@mithril.chromatico.net>
>>>>> "cc" == cartercc <cartercc@gmail.com> writes:
cc> I do this sort of thing for a living, already having a full time
cc> job, so I have a substantial code base already. It's not like
cc> I'll be writing this from scratch.
This sounds like an intellectual-property lawsuit waiting to happen.
Unless you have a contract saying otherwise or you're operating under a
very unusual legal code, the code you write as part of our employment is
considered work for hire, and you do not retain any rights to it.
Borrowing code from one employer to give to another employer is highly
inappropriate unless both employers know about it.
The more you argue in favor of this, the worse an idea it seems.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Tue, 05 Aug 2008 14:10:38 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: bidding advice for a contract
Message-Id: <86fxpjs57l.fsf@mithril.chromatico.net>
>>>>> "cc" == cartercc <cartercc@gmail.com> writes:
cc> I'm hoping to do a good job and be paid for it. You and I both
cc> know that the initial plans will change after the first week,
cc> but they are convinced that they can waterfall their way to
cc> success.
More relevantly: once they've got your signature on the contract, any
success they have is because of their smart choice in hiring a
contractor, but any failure is clearly the fault of the contractor they
hired.
You've got no clear requirements and no clear scope, but any estimate
you make is going to be treated as a solemn promise.
This is a disaster waiting to happen, and when it does, every indication
will be that it is your fault, because you were dumb enough to sign a
conract saying you could do what they needed without knowing what they
needed done.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Tue, 5 Aug 2008 18:39:29 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: bidding advice for a contract
Message-Id: <slrng9h7j1.1knm.willem@snail.stack.nl>
Charlton Wilbur wrote:
)>>>>> "cc" == cartercc <cartercc@gmail.com> writes:
)
) cc> I do this sort of thing for a living, already having a full time
) cc> job, so I have a substantial code base already. It's not like
) cc> I'll be writing this from scratch.
)
) This sounds like an intellectual-property lawsuit waiting to happen.
)
) Unless you have a contract saying otherwise or you're operating under a
) very unusual legal code, the code you write as part of our employment is
) considered work for hire, and you do not retain any rights to it.
And if the code is written beforehand, and then used in the contract for
your company ? As in, I write a nice codebase/library in my free time,
tweak it until it suits me, and then I fullfill contracts by putting
together pieces from my codebase that fit the specs.
Just a legal question that came to me when reading your comment.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
------------------------------
Date: Tue, 05 Aug 2008 16:05:53 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: bidding advice for a contract
Message-Id: <86wsivqlb2.fsf@mithril.chromatico.net>
>>>>> "W" == Willem <willem@stack.nl> writes:
I'm not a lawyer, and I'm especially not a lawyer in the Netherlands,
but here's my take.
W> And if the code is written beforehand, and then used in the
W> contract for your company ? As in, I write a nice
W> codebase/library in my free time, tweak it until it suits me, and
W> then I fullfill contracts by putting together pieces from my
W> codebase that fit the specs.
As long as everyone knows what's happening and agrees to it, there's no
problem. This would probably involve you, the original author,
licensing the code you wrote to the company you're working for somehow.
The qualitative difference there, though, is that the code you're
talking about belongs to you -- you wrote it outside of an employment
relationship, or you had a contract that said you retained the rights,
so you're free to license it to anyone you want, or put it in the public
domain, or release it under an open source license. If you're doing
something that your employer thinks requires a competitive advantage,
your employer may not care for this relationship, but you're still
within your rights to offer it.
The situation cartercc was describing was different: unless he has a
contract saying otherwise, the code he writes as part of working for his
current employer belongs to his employer and not to him. Thus, he can't
take it and use it for another employer without the first employer
giving consent.
In cartercc's case, if everyone knew what was going on and was okay with
it, it would likewise be perfectly fine. But in his case, that likely
involves both employers knowing about the situation, and odds are good
that at least one won't be perfectly fine with it.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Tue, 5 Aug 2008 13:56:02 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: bidding advice for a contract
Message-Id: <e72fc574-e305-45b4-8da9-58abb7adb227@m3g2000hsc.googlegroups.com>
On Aug 5, 2:17 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> >>>>> "cc" == cartercc <carte...@gmail.com> writes:
>
> cc> I do this sort of thing for a living, already having a full time
> cc> job, so I have a substantial code base already. It's not like
> cc> I'll be writing this from scratch.
>
> This sounds like an intellectual-property lawsuit waiting to happen.
I doubt that this would be the case. I work for a large public
university in my day job, and the code I have written specfically for
work assignments is no inextricably combined with code that I have
written for pleasure and outside work that I don't see how it could be
traced. I have developed the habit of creating modules to do different
things, like create layouts for web pages and connect and query
databases, which I carry with me on a USB drive. I don't claim a
copyright in my work and I don't have any kind of written contract
that covers IP issues.
> Unless you have a contract saying otherwise or you're operating under a
> very unusual legal code, the code you write as part of our employment is
> considered work for hire, and you do not retain any rights to it.
> Borrowing code from one employer to give to another employer is highly
> inappropriate unless both employers know about it.
What if my employer 'borrowed' it from me? What if I took an
application that I had written years earlier and adapted it to a
current project at work? With all respect, I think this sort of
concern is arrant nonsense, at least given the employers and the
personalities that I work for.
> The more you argue in favor of this, the worse an idea it seems.
I'm not 'arguing' either way. It's a job that's up for grabs and I
have an incentive to grab at it. I agree that it's certainly not an
ideal situation, but looking at the sunny side, (1) it's an
oppurtunity to augment my income, (2) it's an opportunity to help out
a local company, (3) it's an opportunity to increase my potential for
like projects, and (4) it would be something that I enjoy. Not to
mention that I do databases, database applications, and database GUIs
for a living on LAMP and WAMP stacks, and everything, and I do mean
~everything~ they have mentioned to me pertains to a problem that I
have already faced and solved.
It might turn out bad, but I've spent some time with these folks and I
have a good feeling about this.
CC
------------------------------
Date: Tue, 5 Aug 2008 14:12:55 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: bidding advice for a contract
Message-Id: <3d183969-98e7-4785-93d6-e45da4c42898@m36g2000hse.googlegroups.com>
On Aug 5, 2:10 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> You've got no clear requirements and no clear scope, but any estimate
> you make is going to be treated as a solemn promise.
This thread got me to print out a copy of IEEE Std 830 and read
through it again. Yeah, IEEE says that requirements specifications
should be detailed enough to directly code from it, but how often do
we get detailed specifications in a small shop?
Do you think that sending a copy of IEEE Std 830 to the client would
be a good idea? Probably not.
CC
------------------------------
Date: Tue, 05 Aug 2008 11:57:19 -0700
From: Adam Worrall <worrall+unet@cs.bris.ac.uk>
Subject: Re: CLPM - a help group?
Message-Id: <on1mk.3368$zv7.1210@flpi143.ffdc.sbc.com>
brian d foy wrote:
> In article <%9Hlk.17313$mh5.1803@nlpi067.nbdc.sbc.com>, Adam Worrall
> <worrall+unet@cs.bris.ac.uk> wrote:
>
>
>>> I've never seen an official charter for this group, but it certainly
>>> isn't a help desk. It's for general discussion of Perl. That might be
>>> questions, answers, essays, or whatever else people decide to post.
>>
>> Please explain, who actually decides that it isn't a help?
>
> I think you mean "isn't a help desk". A help desk is a formally
> established service where customers walk up and someone helps them.
Yes I meant 'help desk', but you are wrong in assuming that a 'help
desk' always has to be a formal service for customers. There are, in
fact, many volunteer-run help desk, and this newsgroup, like many
others, functions as exactly that. People volunteer their time to _help_
others.
> No one here is obligated to do anything, and there aren't office hours,
> shifts, or responsilibities. That people do answer questions here
> doesn't mean it's purpose is to answer questions.
There's also not anything that states that it isn't it's purpose either,
but reality (as well as the charters) speaks quite well for it self;
people ask questions, and other people freely answer them in effort to
help those asking the questions. Sounds like a volunteer help desk to me.
> Help desks aren't lunch rooms, football fields, or street corners.
Who made this assertion? It certainly wasn't made in this thread, and
I'd be darned to find a post by anyone else making such a claim.
> This newsgroup, however, can be whatever it decides to be, and even that can
> change.
I agree but the problem is there are many who disagree and push their
own version of "what's right" and expect everyone to abide or else
you're "not part of the community."
- Adam
------------------------------
Date: 5 Aug 2008 21:49:37 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: CLPM - a help group?
Message-Id: <Xns9AF1AB2BBE4C0castleamber@130.133.1.4>
bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> cartercc wrote:
>> On Aug 2, 7:09 pm, brian d foy <brian.d....@gmail.com> wrote:
>>> People post the thoughtful stuff in blogs now, so you don't see much
>>> of that in usenet anymore.
>>
>> I've had the bad experience several times now of seeing news groups
>> trashed and driving people away. It seems like a good idea to have a
>> general discussion area for topics, but there seems to be a Gresham's
>> law for usenet -- over time the bad posters kill the group.
>>
>> The reason I don't like blogs is because I haven't found a way to do
>> a centralized search. You can find a blog anywhere, or not.
>
> Indeed; and if there are (e.g.) 5 wise people
> you need to search 5 blogs.
Or let Google do the work, e.g. 2 sites:
<http://www.google.com/search?q=site%3Acastleamber.com%20OR%20site%
3Ajohnbokma.com%20zelazny>
If you use Firefox, make a keymark [1], and you can do something like
keyword query
with keyword the keyword associated with the bookmark, and query the
query to search for over all 5 sites.
[1] See: http://johnbokma.com/firefox/keymarks-explained.html
--
John
http://johnbokma.com/perl/
------------------------------
Date: Tue, 05 Aug 2008 23:59:33 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: CLPM - a help group?
Message-Id: <FP5mk.230842$TT4.13227@attbi_s22>
Adam Worrall wrote:
> Yes I meant 'help desk', but you are wrong in assuming that a 'help
> desk' always has to be a formal service for customers. There are, in
> fact, many volunteer-run help desk, and this newsgroup, like many
> others, functions as exactly that. People volunteer their time to _help_
> others.
I believe that the aversion to calling c.l.p.misc a "help desk" is
because that term carries a connotation that the purpose of the group is
to provide a service where someone will solve your problem for you. The
regular contributors to this group are, on the whole, very resistant to
that idea. "RTFM. What have you tried? Show us your code."
nobull phrased it very well:
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens
to answer a question you've asked, that's incidental."
The purpose of the group is to discuss Perl: it's strengths, weaknesses,
idioms, quirks, dusty corners, etc. The asking and answering of
questions are merely a mechanism by which discussion topics are identified.
-mjc
------------------------------
Date: Tue, 5 Aug 2008 14:51:27 -0700 (PDT)
From: sausenet@gmail.com
Subject: nested strings
Message-Id: <ea83a408-4f1b-46ce-8eb6-dc8961b7cc96@i20g2000prf.googlegroups.com>
Could anyone suggest a nice way of nesting strings, as follows?
Given: a list of words sorted first in length order, then
alphabetically:
FORMATION
FORMATIVE
FORMATTER
DEFORMATION
DEFORMATIVE
FORMATIVELY
INFORMATICS
INFORMATION
INFORMATIVE
INFORMATORY
CONFORMATION
MALFORMATION
DEFORMATIONAL
INFORMATIONAL
INFORMATIVELY
UNINFORMATIVE
Desired output: the same set of words showing nested substrings
FORMATION [DEFORMATION [DEFORMATIONAL] INFORMATION [INFORMATIONAL]
CONFORMATION MALFORMATION]
FORMATIVE [DEFORMATIVE FORMATIVELY [INFORMATIVELY] INFORMATIVE
PERFORMATIVE UNINFORMATIVE]
FORMATTER
INFORMATICS
INFORMATORY
Note as to form: they'll probably start as a concatenation of the
strings separated by blanks.
Note as to ambiguous case: yes, if the starting list has
AAAB
CAAA
CAAAB
then CAAAB could be deemed a child of AAAB or CAAA or both. Any of
these ways of treating CAAAB would be fine.
As a compromise, sacrificing the sub-nesting feature would be fine.
I.e.,
AAAB
AAABC
AAABCC
becomes
AAAB [AAABC AAABCC]
Thanks for any help or pointers.
Steven Alexander
------------------------------
Date: Wed, 6 Aug 2008 00:42:24 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: nested strings
Message-Id: <045nm5-8fl.ln1@osiris.mauzo.dyndns.org>
Quoth sausenet@gmail.com:
> Could anyone suggest a nice way of nesting strings, as follows?
>
> Given: a list of words sorted first in length order, then
> alphabetically:
> FORMATION
> FORMATIVE
> FORMATTER
> DEFORMATION
> DEFORMATIVE
> FORMATIVELY
> INFORMATICS
> INFORMATION
> INFORMATIVE
> INFORMATORY
> CONFORMATION
> MALFORMATION
> DEFORMATIONAL
> INFORMATIONAL
> INFORMATIVELY
> UNINFORMATIVE
>
> Desired output: the same set of words showing nested substrings
> FORMATION [DEFORMATION [DEFORMATIONAL] INFORMATION [INFORMATIONAL]
> CONFORMATION MALFORMATION]
> FORMATIVE [DEFORMATIVE FORMATIVELY [INFORMATIVELY] INFORMATIVE
> PERFORMATIVE UNINFORMATIVE]
> FORMATTER
> INFORMATICS
> INFORMATORY
>
> Note as to form: they'll probably start as a concatenation of the
> strings separated by blanks.
I would start by maintaining a hash mapping strings to arrayrefs of
'children', using logic something like
use List::Util qw/first/;
if (my $parent = first { $nextword =~ /\Q$_/ } keys %children) {
$children{$first}{$nextword} = undef;
}
elsif (my $child = first { /\Q$nextword/ } keys %children) {
$children{$nextword}{$child} = $children{$child};
}
I haven't tested that, and I don't think it's right, but the idea is to
end up with a structure like
my %children;
%children = (
FORMATION => {
DEFORMATION => $children{DEFORMATION},
INFORMATION => $children{INFORMATION},
},
DEFORMATION => { DEFORMATIONAL => undef },
INFORMATION => { INFORMATIONAL => undef },
);
...nah, that isn't right. I think you need two hashes: one flat, with an
entry for each word, mapping word to parent (if any)
my %parents = (
FORMATION => undef,
DEFORMATION => 'FORMATION',
INFORMATION => 'FORMATION',
DEFORMATIONAL => 'DEFORMATION',
INFORMATIONAL => 'INFORMATION',
);
and one structured as a tree
my %children = (
FORMATION => {
DEFORMATION => {
DEFORMATIONAL => {},
},
INFORMATION => {
INFORMATIONAL => {},
},
},
);
You can then see if a word matches something in the %parents hash; if it
does, walk up the chain until you find the top, and then walk down the
%children hash until you find the point where it fits. For instance, if
you'd sorted 'FORMATION' and 'DEFORMATIONAL' and you read 'DEFORMATION'
you would
* Find that 'FORMATION' was a substring of 'DEFORMATION', and since
'FORMATION' has no parent, start there in %children;
* Find that 'DEFORMATIONAL', one of the children of 'FORMATION', has
a substring 'DEFORMATION', so 'DEFORMATIONAL' (and all it's
children) become a child of 'DEFORMATION', which becomes a child
of 'DEFORMATIONAL's (former) parent.
Try coding something like that, and post if you get stuck.
Ben
--
Raise your hand if you're invulnerable.
[ben@morrow.me.uk]
------------------------------
Date: Tue, 5 Aug 2008 17:05:19 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: PPM - scripting
Message-Id: <678c2249-b47e-4de2-be86-9935648fd54c@i24g2000prf.googlegroups.com>
Hey guys,
I would like to a create PPM that compile on Windows. I am planning to
buy Perl Dev Kit Pro which can turn my Perl script into executable.
Before that, I want to make sure if this could be achieve on Perl and
is there any example out there.
For example, it will look like this:
game.ppm
So I want "game" command to be executable on Windows prompt.
> game start
> game display -name "Slickuser"
> game stop
> game exit
"game" will be overall script
"display" will be a sub function
"-name" will be the option follow by arguments
Any help would be great. Thanks.
------------------------------
Date: Tue, 5 Aug 2008 22:03:01 +0000 (UTC)
From: Leo Franks <LeoFranks08042008@gmail.com>
Subject: Re:
Message-Id: <g7aimk$e47$1@registered.motzarella.org>
--
LeoFranks08042008.com
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1771
***************************************