[18724] in Perl-Users-Digest
Perl-Users Digest, Issue: 892 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 14 00:10:30 2001
Date: Sun, 13 May 2001 21:10:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989813409-v10-i892@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 13 May 2001 Volume: 10 Number: 892
Today's topics:
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <godzilla@stomp.stomp.tokyo>
Re: Req. for help: need biometric guniea pigs (Alan Barclay)
Re: Req. for help: need biometric guniea pigs <wyzelli@yahoo.com>
Re: Req. for help: need biometric guniea pigs (Logan Shaw)
Re: Simple Oracle Perl Question <kennylim@techie.com>
Sorting a variable <pswordkirk@msn.com>
Re: Sorting a variable (Logan Shaw)
What is wrong with my Regular Expression? <megrimes@flash.net>
Re: What is wrong with my Regular Expression? (Logan Shaw)
Re: What is wrong with my Regular Expression? <wyzelli@yahoo.com>
Re: What is wrong with my Regular Expression? <wyzelli@yahoo.com>
Re: What is wrong with my Regular Expression? <wyzelli@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 13 May 2001 16:57:05 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3AFF1F51.161D33EE@stomp.stomp.tokyo>
"Tad" wrote:
> Outline
(snipped)
A correctly formatted Table Of Contents should be provided
which references clearly labeled sections and sub-sections,
following this Table Of Contents.
> Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
> The comp.lang.perl.misc (clpmisc) Usenet newsgroup is for the discussion
> of using the Perl programming language.
A topic heading should be followed by a blank line:
Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
The comp.lang.perl.misc (clpmisc) Usenet newsgroup is for the discussion
of using the Perl programming language.
> The comp.lang.perl.misc (clpmisc) Usenet newsgroup is for the discussion
> of using the Perl programming language.
Use of clpmisc is incorrect. This group is most often
referred to as clpm shown by a majority of articles.
This group is not "for" anything:
"...newsgroup is provided to discuss usage of Perl programming...."
Use correct English at all times. This document should reflect
professionalism, not incorrect grammar.
> Since clpmisc is such a high-traffic....useful for everyone.
Irrelevant. A reader is not interested in posting statistics.
This should be removed; it is unwarranted clutter.
> This article describes things that you should, and should not, do to
> increase your chances of getting an answer to your Perl question....
Highly insulting, condescending attitude. Readers are to be treated
with respect and due courtesy, not treated like imbeciles. This
is not an article, it is a charter or FAQ.
"This FAQ provides information to assist you in obtaining the best use
of this newsgroup."
> ...I am just the secretary that writes down the consensus of the group.
This is an outright lie. There is no concensus; there has been no request
for comments, no voting and, this document has been constructed solely
by you and no other.
"This FAQ is not an official FAQ. It is not a sanctioned FAQ for this
newsgroup. I wrote this FAQ and my viewpoints do not reflect the
viewpoints of any other participants within this newsgroup nor
the viewpoint of this newsgroup as an entity."
> Before posting to comp.lang.perl.misc
> Must
This section describes things that you *must* do before posting to
clpmisc.
My response and an average response will be, "Kiss My Butt."
Your use of "must" is extremely insulting and a reflection
of both your lack of maturity and your lack of professionalism.
I personally am indignant to be addressed in such a crass and
rude manner. I personally will say, "Kiss My Butt You Bozo."
**
In closing, the overall tone of this document is an assumption
readers are imbeciles and unworthy of any common courtesy.
This document is riddled with serious grammatical errors,
awkward sentences, punctuations errors, gross misuse
of parenthectical enclosures and, reflects a writing
skill level typical of an early highschool grade level.
This is unacceptable for a document which should be written
in a professional manner.
There are no enclosures regarding inappropriate activities
such as flame articles, use of vulgarity to insult, including
degrading and insulting signature file remarks targeting a
specific person as is a common practice here. There are no
guidelines about initiating inane arguments for sport as is
customary for those few involved in this document.
Most important, there is no welcoming statement indicating
this newsgroup is open for all to use, no statement indicating
no one person or persons are in charge of this group and,
no statement indicating all are welcome to use this newsgroup,
although exhibited behavior here by those who should set
good examples, indicates otherwise.
I will remind you of something.
> ...I am just the secretary that writes down the consensus of the group.
This quote is an outright black lie. Are you clear on this? It is a lie.
I will comment further on this document in the future when
the fancy strikes me. For now, I am insulted by this document,
am indignant about its tone and, would be embarrassed to see
this document posted to this newsgroup.
Godzilla!
------------------------------
Date: 14 May 2001 00:39:06 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Req. for help: need biometric guniea pigs
Message-Id: <989800746.751029@elaine.furryape.com>
In article <Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu>,
Mike Schiraldi <mgs21@columbia.edu> wrote:
>I'm playing around with some simple biometrics - measuring the time
>between keystrokes for a standard phrase, like "The quick brown fox" or
This sounds to me like a very unreliable method. My typing speed varies
according to my posture, my general tiredness, my concentration on the task
and other factors. Also, if I have to type a phrase repeatadly, eg passwords,
then I get better at it as time goes on.
------------------------------
Date: Mon, 14 May 2001 11:03:32 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Req. for help: need biometric guniea pigs
Message-Id: <CAGL6.7$F21.2158@vic.nntp.telstra.net>
"Mike Schiraldi" <mgs21@columbia.edu> wrote in message
news:Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu...
>
> my $PHRASE = "The quick brown fox";
Shouldn't you use the full phrase "The quick brown fox jumped over the lazy
dog"? It is generally used since it contains each letter of the alphabet at
least once.
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: 13 May 2001 21:42:51 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Req. for help: need biometric guniea pigs
Message-Id: <9dngnb$jk8$1@ahab.cs.utexas.edu>
In article <CAGL6.7$F21.2158@vic.nntp.telstra.net>,
Wyzelli <wyzelli@yahoo.com> wrote:
>"Mike Schiraldi" <mgs21@columbia.edu> wrote in message
>news:Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu...
>>
>> my $PHRASE = "The quick brown fox";
>
>Shouldn't you use the full phrase "The quick brown fox jumped over the lazy
>dog"? It is generally used since it contains each letter of the alphabet at
>least once.
Except "s", which is why the sentence actually used is "The quick brown
fox jumps over the lazy dog."
:-)
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Sun, 13 May 2001 16:39:24 -0700
From: "Student" <kennylim@techie.com>
Subject: Re: Simple Oracle Perl Question
Message-Id: <9dn5mn$rga$1@slb5.atl.mindspring.net>
Hi All,
I am a student doing a simple experimentation and had stumbled
into a problem when an analyze compute or estimate
stats and flush shared pool statement is being used,
the explain plan for my select statement in the *.trc
will not be generated.
The explain plan is generated if I manually construct an
iteration of inserts statement followed up by commit,
analyze, flush shared pool statement.
I am wondering if this is a bug or is there a step that
I had missed. I had checked the perl docs for both
dbd and dbi but so far to no availability.
Any pointers would be greatly appreciated if someone
whom had happen to come across this problem.
Please do let me know if need more information.
dbd::oracle 1.06
dbi 1.15
Thanks You All and you have a pleasant sunday.
Student-
================================
snippets of my perl code:
===================
for ( $j = 0; $j < ($N_Loops+1); ++$j)
{
emp1_loop_counter();
emp1_insert();
emp1_commit();
emp1_update_stats();
print "\n>>>>>Transaction Is Commited!<<<<<\n";
sleep 1;
emp1_select();
print
"\n\n***********************************************************************
\n";
}
sub emp1_update_stats
{
$sth3 = $dbh->prepare ("analyze table emp1 compute statistics");
$sth3->execute( );
print ">>>>>Table Statistics Is Updated!<<<<<\n";
$sth4 = $dbh->prepare ("alter system flush shared_pool");
$sth4->execute( );
print ">>>>>Shared Pool Is Flushed!<<<<<\n\n";
}
snippets of my trace file based on the query:
===================
PARSING IN CURSOR #8 len=71 dep=0 uid=41 oct=3 lid=41 tim=443249
hv=2794230381 ad='56f1a80'
select /*+ Record: 1000 Rows */ * from emp1 where last_name = 'Horton'
END OF STMT
PARSE #8:c=4,e=4,p=0,cr=41,cu=0,mis=1,r=0,dep=0,og=4,tim=443249
XCTEND rlbk=0, rd_only=1
EXEC #8:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=443249
FETCH #8:c=0,e=0,p=0,cr=1,cu=4,mis=0,r=0,dep=0,og=4,tim=443249
------------------------------
Date: Mon, 14 May 2001 03:52:30 GMT
From: "KapTin KiRk" <pswordkirk@msn.com>
Subject: Sorting a variable
Message-Id: <2EIL6.59544$Ce4.5272266@news1.rdc1.ct.home.com>
I'm accessing a DBM database, searching it for a specific value, then
printing the keys that contain that value. However I want the output to be
sorted alphabetically.... but not sorted by the keys, but by the value
(actually, a part of the value, which is split with a delimiter).
Here is the code I have now.
#______
Movies->DBMConnect();
while (($Movies::key, $Movies::value) = each %Movies::dbmdata) {
($Movies::Title, $Movies::PreviewURL, $Movies::ReviewURL, $Movies::Rating,
$Movies::Release, $Movies::Genre) = split(/$Movies::DELIM/, $Movies::value);
if ($Movies::Genre =~ /$Movies::ID/) {
print "$Movies::Title";
if ($Movies::PreviewURL ne "") {
print " <a href=\"/movies/previews.cgi?id=$Movies::key\">[Preview]</a>"; }
if ($Movies::ReviewURL ne "") {
print " <a href=\"/movies/reviews.cgi?id=$Movies::key\">[Review]</a>"; }
print "<br>\n";
}
}
Movies->DBMDisconnect();
#______
Now, I need the output to be sorted by '$Movies::Title' .... and of course
have the key be able to match up with it in the output. I've tried sorting
the hash, putting the title in an array and sorting that, and a bunch of
other stuff but nothing works.
Truth be told, it would do the same thing I need it to do if it were sorted
by $Movies::key, but I would much rather it sort by the title. Any help is
appreciated, I've been at this for about 3 days now. And if you notice any
problems with the code, feel free to shout at me for being an idiot.
- KapTin KiRk
------------------------------
Date: 13 May 2001 23:02:46 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Sorting a variable
Message-Id: <9dnld6$k6l$1@ahab.cs.utexas.edu>
In article <2EIL6.59544$Ce4.5272266@news1.rdc1.ct.home.com>,
KapTin KiRk <pswordkirk@msn.com> wrote:
>I'm accessing a DBM database, searching it for a specific value, then
>printing the keys that contain that value. However I want the output to be
>sorted alphabetically.... but not sorted by the keys, but by the value
>(actually, a part of the value, which is split with a delimiter).
>
>Here is the code I have now.
>
>#______
>Movies->DBMConnect();
> while (($Movies::key, $Movies::value) = each %Movies::dbmdata) {
> ($Movies::Title, $Movies::PreviewURL, $Movies::ReviewURL, $Movies::Rating,
>$Movies::Release, $Movies::Genre) = split(/$Movies::DELIM/, $Movies::value);
If I were doing this, I would first grab all the data:
@my_movies = values %Movies::dbmdata;
Then, change each delimited string into a (reference to a) list of
fields:
@my_movies = map ([ split (/$Movies::DELIM/, $_) ], @my_movies);
And then sort it by some field (the first one? I forgot):
@my_movies = sort { $a->[0] cmp $b->[0] } @my_movies
Then, do whatever you want with each entry with a foreach loop:
foreach my $movie (@my_movies)
{
print
"Title: ", $movie->[$field_nums{title}], "\n",
"Genre: ", $movie->[$field_nums{genre}], "\n",
"Rating: ", $movie->[$field_nums{rating}], "\n",
"\n";
}
If you want, you could combine the first three steps:
@my_movies = sort { $a->[0] cmp $b->[0] }
map ([ split (/$Movies::DELIM/, $_) ],
values %Movies::dbmdata);
Note that all this code is untested.
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Mon, 14 May 2001 03:25:43 GMT
From: "Mike Grimes" <megrimes@flash.net>
Subject: What is wrong with my Regular Expression?
Message-Id: <XeIL6.703$Hh5.209090649@newssvr16.news.prodigy.com>
Hi All,
I am writing a script where I need to bracket some days of the month. I have
written something like this,
if ($day =~ /[1-3][0-9]/) { do something }
and although I receive no syntax error, I do not achieving the desired
results either. I am sure my regular expression is incorrect. What I am
looking for the expression to return TRUE for days between the 10th and
31st.
Why won't this work?
P.S. I just realized that what I have above does not fit my own
requirements. Maybe I should have something like:
if ($day =~ /[1-2][0-9]|3[0-1]/) { do something }
I would appreciate a hand.
Thanks,
Mike
------------------------------
Date: 13 May 2001 22:33:12 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: What is wrong with my Regular Expression?
Message-Id: <9dnjlo$jvu$1@ahab.cs.utexas.edu>
In article <XeIL6.703$Hh5.209090649@newssvr16.news.prodigy.com>,
Mike Grimes <megrimes@flash.net> wrote:
>I am writing a script where I need to bracket some days of the month. I have
>written something like this,
>
>P.S. I just realized that what I have above does not fit my own
>requirements. Maybe I should have something like:
>
>if ($day =~ /[1-2][0-9]|3[0-1]/) { do something }
It would be a lot easier to do this:
if ($day >= 10 and $day <= 31) { do something }
This should work because even if a variable is a string, Perl will
automatically convert it to a number if you use it as a number.
Alternatively, a regular expression like this might work:
/^[1-2][0-9]|3[01]$/
Note the anchors for beginning and end of string; if you don't have
these, the regular expression will match things like "10031" as well.
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Mon, 14 May 2001 13:08:30 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: What is wrong with my Regular Expression?
Message-Id: <NpIL6.2$181.571@vic.nntp.telstra.net>
"Mike Grimes" <megrimes@flash.net> wrote in message
news:XeIL6.703$Hh5.209090649@newssvr16.news.prodigy.com...
> Hi All,
>
> I am writing a script where I need to bracket some days of the month. I
have
> written something like this,
>
> if ($day =~ /[1-3][0-9]/) { do something }
>
> and although I receive no syntax error, I do not achieving the desired
> results either. I am sure my regular expression is incorrect. What I am
> looking for the expression to return TRUE for days between the 10th and
> 31st.
>
> Why won't this work?
>
>
> P.S. I just realized that what I have above does not fit my own
> requirements. Maybe I should have something like:
>
> if ($day =~ /[1-2][0-9]|3[0-1]/) { do something }
>
The second is certainly better. What do you mean by not working?
Maybe you could anchor your regex and that might help
/^([12][0-9]|3[01])$/
But otherwise, since you aren't clear on what your input data could be, and
what 'not working' means, I am out of ideas.
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
$d='$_$a$s$b$w';$e='$_$a$s$b';sub d{$h=shift;$h=~s/\$(\w+)/${$1}/g;return$h}
sub
e{return(shift!=1)?'s':''}for(reverse(1..100)){$s=e($_);$f=d($d);$g=d($e);
$c.="$f\n$g\n$t\n";$_--;$s=e($_);$e=d($d);$c.="$e\n\n";}print"$c*hic*";
------------------------------
Date: Mon, 14 May 2001 13:11:09 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: What is wrong with my Regular Expression?
Message-Id: <jsIL6.4$181.562@vic.nntp.telstra.net>
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9dnjlo$jvu$1@ahab.cs.utexas.edu...
> In article <XeIL6.703$Hh5.209090649@newssvr16.news.prodigy.com>,
> Mike Grimes <megrimes@flash.net> wrote:
> >I am writing a script where I need to bracket some days of the month. I
have
> >written something like this,
> >
> >P.S. I just realized that what I have above does not fit my own
> >requirements. Maybe I should have something like:
> >
> >if ($day =~ /[1-2][0-9]|3[0-1]/) { do something }
>
> It would be a lot easier to do this:
>
> if ($day >= 10 and $day <= 31) { do something }
>
> This should work because even if a variable is a string, Perl will
> automatically convert it to a number if you use it as a number.
>
> Alternatively, a regular expression like this might work:
>
> /^[1-2][0-9]|3[01]$/
>
> Note the anchors for beginning and end of string; if you don't have
> these, the regular expression will match things like "10031" as well.
>
You need to bracket the | there or you still match things like 131.
/^([12][0-9]|3[01])$/
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Mon, 14 May 2001 13:21:47 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: What is wrong with my Regular Expression?
Message-Id: <dCIL6.5$181.712@vic.nntp.telstra.net>
"Wyzelli" <wyzelli@yahoo.com> wrote in message
news:NpIL6.2$181.571@vic.nntp.telstra.net...
>
> /^([12][0-9]|3[01])$/
'Course that can also be written as:
/^([12]\d|3[01])$/
Wyzelli
--
@x='074117115116032097110111116104101114032080101114108032104097099107101114
'=~/(...)/g;
print chr for @x;
------------------------------
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.
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 V10 Issue 892
**************************************