[26015] in Perl-Users-Digest
Perl-Users Digest, Issue: 8231 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 8 16:21:09 2005
Date: Wed, 6 Jul 2005 15:05:10 -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 Wed, 6 Jul 2005 Volume: 10 Number: 8231
Today's topics:
Re: Gtk2 radio buttons problem <reply@newsgroup.invalid>
Re: How to take acton upon a pattern of nth occurrence? <a@cuhk.edu.hk>
Re: How to take acton upon a pattern of nth occurrence? <mddibern@uwaterloo.ca>
Re: How to take acton upon a pattern of nth occurrence? <mddibern@uwaterloo.ca>
Re: How to take acton upon a pattern of nth occurrence? <1usa@llenroc.ude.invalid>
Re: How to take acton upon a pattern of nth occurrence? <sherm@dot-app.org>
Re: How to take acton upon a pattern of nth occurrence? <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 6 Jul 2005 17:11:32 +0200
From: "Sylvie" <reply@newsgroup.invalid>
Subject: Re: Gtk2 radio buttons problem
Message-Id: <dagsbd$d9b$1@textnews.euro.net>
"zentara" <zentara@highstream.net> wrote:
> You can setup signal blockers. I did it manually here, but if you had
> alot of buttons, you could do it all by putting the buttons in a hash,
> and looping through the hash to set the blockers/unblockers:
<snip code>
Thank you, this works almost perfect. Only problem left: when I click on a
radio button and drag the mouse to another radio button (while mouse is
still clicked) the signals get blocked and cannot be unblocked. Do you have
any idea how to fix this?
Thank you so much, Sylvie.
------------------------------
Date: Wed, 6 Jul 2005 22:18:35 +0800
From: "Ross" <a@cuhk.edu.hk>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <dagp7h$gm1$1@justice.itsc.cuhk.edu.hk>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $s;
>
> while( <DATA> ) {
> chomp;
> $s .= $_;
> }
what is .= ?
It is most difficult to find explanation from Google as .= cannot be
searched. any suggestion for a novice? again, does __END__ declare the
beginning of DATA? index can't also be searched as web search engine
interprets as another meaning. anyway, thanks for all the responders'
replies. :)
>
> my $r = substr $s, 0, index $s, 'AAAAAAAAAA';
>
> print "$r\n";
>
>
> __END__
> TCCTCAGTGGGAATTCGGCATTACGGCCGGGGCACCACAATGAATGATCATTTTC
> TTCTTTGCTCTCCTTGCTATTGCTGCATGCAGCGCCTCTGCGCAGTTTGATGCTG
> TTACTCAAGTTTACAGGCAATATCAGCTGCAGCCGCATCTCATGCTGCAGCAACA
> GATGCTTAGCCCATGCGGTGAGTTCGTAAGGCAGCAGTGCAGCACAGTGGCAACC
> CCCTTCTTCCAATCACCCGTGTTTCAACTGAGAAACTGCCAAGTCATGCAGCAGC
> AGTGCTGCCAACAGCTCAGGATGATCGCGCAACAGTCTCACCGCCAGGCCATTAG
> TAGTGTTCAGGCGATTGTGCAGCAGCTACAGCTACAACAGTTTGCTGGCGTCTAC
> TTCGATCAGACTCAAGCTCAAGCCCAAGCTATGTTGGCCCTAAACTTGCTGTCAA
> TATGCGGTATCTACCCAAGCTACAACACTGCTCCCTGTAGCATTCCCACCGTCGG
> TGGTATCTGGTACTGAATTGTAGCAGTATAGTAGTACAGGAGAGAAAAATAAAGT
> CATGCATCATCGTGTGTGACAAGTTGAAACATCGGGGTGATACAAATCTGAATAA
> AAATGTCATGCAAGTTTAAACANNNNANANNNANNNNAAANAAAAAAAAAAAAAA
> AAAANANAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAANAAAAAAAAAAAAAA
> AAAAANNNNNNANANNNNNNAAAAAAAAAAAAAAAAANNNNNNNNNNGGGGGGGG
> GGGGGGGCGGGAAGAAAAAAAAAAA
>
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (reverse each component and remove .invalid for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 6 Jul 2005 10:14:21 -0400
From: Debo <mddibern@uwaterloo.ca>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <Pine.GSO.4.58.0507061010090.10302@cpu10.student.cs.uwaterloo.ca>
On Wed, 6 Jul 2005, Ross wrote:
R> Dear all,
<snip code>
R> to try to remove substring after 10 or more consecutive A's, perl seems to
R> recognize the last poly A's and leave the former ones intact. what can i do?
R> In general, How to take acton upon a pattern of nth occurrence?
Generally, if you're trying to do something that seems fairly common --
such as trimming a poly-A tail -- it has already been done in bioperl :)
This seems to be somewhat along the lines of what you're trying to do:
http://doc.bioperl.org/bioperl-run/Bio/Tools/Run/PiseApplication/trimest.html
If that's not helpful, let me know and I'll see if I can dig up something
better.
-Debo
------------------------------
Date: Wed, 6 Jul 2005 11:03:01 -0400
From: Debo <mddibern@uwaterloo.ca>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <Pine.GSO.4.58.0507061102080.14924@cpu10.student.cs.uwaterloo.ca>
On Wed, 6 Jul 2005, Ross wrote:
R> > #!/usr/bin/perl
R> >
R> > use strict;
R> > use warnings;
R> >
R> > my $s;
R> >
R> > while( <DATA> ) {
R> > chomp;
R> > $s .= $_;
R> > }
R>
R> what is .= ?
R>
R> It is most difficult to find explanation from Google as .= cannot be
R> searched.
If you have questions about perl's operators, 'perldoc perlop' should help
you out.
-Debo
------------------------------
Date: Wed, 06 Jul 2005 15:30:27 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <Xns968B75102F8EDasu1cornelledu@127.0.0.1>
"Ross" <a@cuhk.edu.hk> wrote in news:dagp7h$gm1$1
@justice.itsc.cuhk.edu.hk:
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> my $s;
>>
>> while( <DATA> ) {
>> chomp;
>> $s .= $_;
>> }
>
> what is .= ?
perldoc perlop
>> --
>> A. Sinan Unur <1usa@llenroc.ude.invalid>
>> (reverse each component and remove .invalid for email address)
>>
>> comp.lang.perl.misc guidelines on the WWW:
>> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
Please do not quote signatures unless you have something to say about
the signature itself. On the other hand, you would benefit from reading
the posting guidelines mentioned above. They contain invaluable
information on how you can help yourself, and help others help you.
With this message, you have given a strong signal that you are not
willing to do much work yourself. I hope, for your sake, that you will
send a strong signal in the opposite direction in your next post.
Sinan
------------------------------
Date: Wed, 06 Jul 2005 16:30:49 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <87u0j7fzie.fsf@dot-app.org>
"Ross" <a@cuhk.edu.hk> writes:
> what is .= ?
Other folks have mentioned perlop, which explains the "how" but doesn't say
much about the "why". I'd imagine that's because perlop is more of a reference
than a tutorial, and the "why" actually predates Perl anyway.
Many languages that relate to C in some way have operators like these, .=
-=, *=, |=, etc., because it's *very* common to write something like this:
$foo = $foo + $bar;
It's so common, in fact, that a shortcut operator was created just for that
purpose, combining the assignment and addition:
$foo += $bar;
Back in the day of straightforward, non-optimizing C compilers, the short form
was an optimization. The long form would generate instructions to perform the
addition, store the results, and immediately re-read that same memory location
to do the assignment. The C compilers of the day wouldn't optimize that into a
simpler set of instructions that would operate directly on the target, which is
what the abbreviated form would do.
Another, even shorter set of operators is ++ and --, which replaces this:
$foo += 1;
with this:
$foo++;
Again, at one time that was an optimization. Early C compilers would generate
the same addition instructions every time += was used. Many CPUs have a direct
"increment by one" instruction that would be generated instead, whenever ++
was used.
sherm--
--
Due to the amount of unreadable gibberish being posted from Google Groups,
I seldom read messages posted from there.
Cocoa/Perl: http://camelbones.sf.net Hire Me: http://www.dot-app.org
------------------------------
Date: Wed, 06 Jul 2005 21:46:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to take acton upon a pattern of nth occurrence?
Message-Id: <Xns968BB4BB61F94asu1cornelledu@127.0.0.1>
Sherm Pendley <sherm@dot-app.org> wrote in
news:87u0j7fzie.fsf@dot-app.org:
> "Ross" <a@cuhk.edu.hk> writes:
>
>> what is .= ?
>
> Other folks have mentioned perlop, which explains the "how" but
> doesn't say much about the "why". I'd imagine that's because perlop is
> more of a reference than a tutorial, and the "why" actually predates
> Perl anyway.
>
> Many languages that relate to C in some way have operators like these,
> .= -=, *=, |=, etc., because it's *very* common to write something
> like this:
>
> $foo = $foo + $bar;
>
> It's so common, in fact, that a shortcut operator was created just for
> that purpose, combining the assignment and addition:
>
> $foo += $bar;
>
> Back in the day of straightforward, non-optimizing C compilers, the
> short form was an optimization.
IMHO, it is a cognitive optimization for the programmer as well. Once
one gets used to the notation, the difference between "Add $bar to $foo
and store the result in $foo" and "add $bar to $foo, and store the
result somewhere else" becomes easier to see, helping (at least me) with
comprehension.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
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 V10 Issue 8231
***************************************