[28616] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9980 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 18 21:06:13 2006

Date: Sat, 18 Nov 2006 18:05:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 18 Nov 2006     Volume: 10 Number: 9980

Today's topics:
    Re: Do I *have* to use 'OOP' to use modules? <uri@stemsystems.com>
    Re: Do I *have* to use 'OOP' to use modules? <spamtrap@dot-app.org>
    Re: Do I *have* to use 'OOP' to use modules? <abigail@abigail.be>
    Re: Do I *have* to use 'OOP' to use modules? <abigail@abigail.be>
    Re: Do I *have* to use 'OOP' to use modules? <spamtrap@dot-app.org>
    Re: Do I *have* to use 'OOP' to use modules? <abigail@abigail.be>
    Re: FAQ 6.6 How can I make "\w" match national characte <brian.d.foy@gmail.com>
    Re: HoA bug? Size limit? <hpbenton@scripps.edu>
    Re: HoA bug? Size limit? <wahab@chemie.uni-halle.de>
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <rvtol+news@isolution.nl>
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <spamtrap@dot-app.org>
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <john@castleamber.com>
    Re: p-value calculation xhoster@gmail.com
    Re: Warning Re: is there a bash script to perl converte <tuet@bushgohome.com>
    Re: Warning Re: is there a bash script to perl converte <jurgenex@hotmail.com>
    Re: Warning Re: is there a bash script to perl converte <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 18 Nov 2006 13:12:15 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <x7odr4y680.fsf@mail.sysarch.com>

>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:

  SP> Abigail <abigail@abigail.be> writes:
  >> Merrilee Larson (merrile@telus.net) wrote on MMMMDCCCXXVI September
  >> MCMXCIII in <URL:news:KHl7h.6944$_Z2.6942@edtnps89>:
  >> {}  Hi...
  >> {}  
  >> {}  I'm not sure why, but I can't stand OOP. That's it!
  >> {}  
  >> {}  Sooo....is it possible to be fully productive using Perl5 in a non-OOP
  >> {}  fashion? Can I still use modules, etc? Or would I be severely restricting
  >> {}  myself?
  >> 
  >> That depends on how much you want to avoid OO. If all you want to avoid
  >> writing OO, you can be fully productive in Perl5. In fact, the native
  >> OO support you get from Perl is so limited, one wonder why people even
  >> bother writing OO Perl.

  SP> Speaking strictly for myself, it's because the "limitations" I
  SP> hear about are primarily a lack of formal OOP strictures. Perl
  SP> will let you access package (aka class) variables from any class,
  SP> there's no private object variables or methods, you're not
  SP> required to use accessors, $self is passed explicitly, and so
  SP> forth.

where did you learn all those myths? have you heard about inverted
object? or closure objects? perl can be stricter than many purist OO
langs if you use certain modules to manage your OO. but i suspect the OP
is not concerned with writing OO rather than the simple act of
using/calling OO modules vs calling procedural modules.

  SP> I'm talking about the core language here, btw - I'm well aware
  SP> that there are CPAN modules that attempt to address these
  SP> so-called "limitations", with varying degrees of success.

so? does anyone write any signifigant perl code without using any
modules? limiting yourself to core perl makes no sense in this
comparison. cpan is as much a part of perl as its syntax.

  SP> In short, OOP "purists" - the ones I've heard, that is - tend to
  SP> bemoan the fact that Perl doesn't *force* best OOP practice, but
  SP> merely allows it. But force is not the Perl Way - as it's often
  SP> been said, you should stay out of my living room because you
  SP> weren't invited, not because I'm holding a gun.

that point i agree with. but then most other OO purist also bemoan the
fact that perl always has better regexes (pcre doesn't cut it).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Sat, 18 Nov 2006 15:42:51 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <m2k61sv644.fsf@Sherm-Pendleys-Computer.local>

Uri Guttman <uri@stemsystems.com> writes:

>>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:
>
>   SP> Speaking strictly for myself, it's because the "limitations" I
>   SP> hear about are primarily a lack of formal OOP strictures. Perl
>   SP> will let you access package (aka class) variables from any class,
>   SP> there's no private object variables or methods, you're not
>   SP> required to use accessors, $self is passed explicitly, and so
>   SP> forth.
>
> where did you learn all those myths? have you heard about inverted
> object? or closure objects? perl can be stricter than many purist OO
> langs if you use certain modules to manage your OO.

Exactly my point - the purists complain because you need to use a module
to achieve what they view as "pure" OO. That's why you hear complaints
about Perl's OO support being an "afterthought" or "bolted on" - because
quite a lot of what the complainers want to see is found in a module
instead of being part of the core language.

Keep in mind that I'm not saying I agree with them. Quite the opposite,
I think it's a tempest in a teapot. Sure, Perl doesn't force me to write
"pure" OOP - but I don't need to be forced to do so in the first place,
so I'm not the slightest bit bothered by that.

> but i suspect the OP
> is not concerned with writing OO rather than the simple act of
> using/calling OO modules vs calling procedural modules.

I agree, but that point had been pretty well covered already.

>   SP> I'm talking about the core language here, btw - I'm well aware
>   SP> that there are CPAN modules that attempt to address these
>   SP> so-called "limitations", with varying degrees of success.
>
> so? does anyone write any signifigant perl code without using any
> modules? limiting yourself to core perl makes no sense in this
> comparison.

I agree - and yet, it doesn't stop the purists from doing precisely that
in order to rationalize their complaints.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: 18 Nov 2006 21:28:21 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <slrneluumh.bt.abigail@alexandra.abigail.be>

Arved Sandstrom (asandstrom@accesswave.ca) wrote on MMMMDCCCXXVII
September MCMXCIII in <URL:news:w6D7h.11870$gy2.6058@edtnps90>:
()  
()  I'd be interested to hear why you think OO Perl is not worth bothering with.


OOP doesn't have object attributes natively. The programmer has to
build this him/herself.

And that's the root of evilness in Perls OO.



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


------------------------------

Date: 18 Nov 2006 21:33:58 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <slrneluv13.bt.abigail@alexandra.abigail.be>

Sherm Pendley (spamtrap@dot-app.org) wrote on MMMMDCCCXXVII September
MCMXCIII in <URL:news:m24pswwycy.fsf@Sherm-Pendleys-Computer.local>:
 ..  
 ..  In short, OOP "purists" - the ones I've heard, that is - tend to bemoan the
 ..  fact that Perl doesn't *force* best OOP practice, but merely allows it. But
 ..  force is not the Perl Way - as it's often been said, you should stay out of
 ..  my living room because you weren't invited, not because I'm holding a gun.


That's a stupid argument. If you take this argument seriously, you ought
to complain Perl has references instead of pointers. References is all 
about keeping people out of the living room because you have a gun - while
with pointers it's because you aren't invited.

However, the argument isn't only stupid, it's wrong as well. Perl's OO is
rotten because it doesn't have native support for object attributes. Which
means that every class in an inheritance tree sticks his/her attributes 
in the same hashref. You don't even *have the choice* of staying out of
someone elses livingroom: there's only one livingroom to use.


Abigail
-- 
END   {print "Hacker\n"}
CHECK {print "another "}
BEGIN {print "Just "   }
INIT  {print "Perl "   }


------------------------------

Date: Sat, 18 Nov 2006 17:42:04 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <m2fycgv0lf.fsf@Sherm-Pendleys-Computer.local>

Abigail <abigail@abigail.be> writes:

> Sherm Pendley (spamtrap@dot-app.org) wrote on MMMMDCCCXXVII September
> MCMXCIII in <URL:news:m24pswwycy.fsf@Sherm-Pendleys-Computer.local>:
> ..  
> ..  In short, OOP "purists" - the ones I've heard, that is - tend to bemoan the
> ..  fact that Perl doesn't *force* best OOP practice, but merely allows it. But
> ..  force is not the Perl Way - as it's often been said, you should stay out of
> ..  my living room because you weren't invited, not because I'm holding a gun.
>
>
> That's a stupid argument. If you take this argument seriously, you ought
> to complain Perl has references instead of pointers. References is all 
> about keeping people out of the living room because you have a gun - while
> with pointers it's because you aren't invited.

*Any* analogy becomes stupid when you stretch it far enough.

> However, the argument isn't only stupid, it's wrong as well. Perl's OO is
> rotten because it doesn't have native support for object attributes. Which
> means that every class in an inheritance tree sticks his/her attributes 
> in the same hashref. You don't even *have the choice* of staying out of
> someone elses livingroom: there's only one livingroom to use.

I do agree with you somewhat - Object::InsideOut was long overdue. It should
have been written and made core years ago.

Look, I'm not trying to pretend that Perl is the Ultimate All-Time OOP Champ
of the World. That title belongs to Smalltalk. :-) All I'm saying is that
it's not the hopeless basket case a lot of people try to make it out to be.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: 19 Nov 2006 00:33:47 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <slrnelv9i7.bt.abigail@alexandra.abigail.be>

Sherm Pendley (spamtrap@dot-app.org) wrote on MMMMDCCCXXVII September
MCMXCIII in <URL:news:m2fycgv0lf.fsf@Sherm-Pendleys-Computer.local>:
:}  Abigail <abigail@abigail.be> writes:
:}  
:} > Sherm Pendley (spamtrap@dot-app.org) wrote on MMMMDCCCXXVII September
:} > MCMXCIII in <URL:news:m24pswwycy.fsf@Sherm-Pendleys-Computer.local>:
:} > ..  
:} > ..  In short, OOP "purists" - the ones I've heard, that is - tend to bemoan the
:} > ..  fact that Perl doesn't *force* best OOP practice, but merely allows it. But
:} > ..  force is not the Perl Way - as it's often been said, you should stay out of
:} > ..  my living room because you weren't invited, not because I'm holding a gun.
:} >
:} >
:} > That's a stupid argument. If you take this argument seriously, you ought
:} > to complain Perl has references instead of pointers. References is all 
:} > about keeping people out of the living room because you have a gun - while
:} > with pointers it's because you aren't invited.
:}  
:}  *Any* analogy becomes stupid when you stretch it far enough.

I didn't say the analogy was stupid. In fact, I think the analogy is
great. 

The analogy however doesn't provide an argument in favour of Perls
implementation of OO.

:} > However, the argument isn't only stupid, it's wrong as well. Perl's OO is
:} > rotten because it doesn't have native support for object attributes. Which
:} > means that every class in an inheritance tree sticks his/her attributes 
:} > in the same hashref. You don't even *have the choice* of staying out of
:} > someone elses livingroom: there's only one livingroom to use.
:}  
:}  I do agree with you somewhat - Object::InsideOut was long overdue. It should
:}  have been written and made core years ago.

Inside Out Objects are just a patch. It still means the programmer has
to do extra work to get something very basic: object attributes.

Having the programmer do work for a basic necessity is very unPerlish.
One might as well use C, there the programmer has to do lots of work
to do basic stuff as well. Sure, giving the programmer a billion ways
to implement something, all bad and incompatible is a great selling 
point, but if that's so great, why aren't we using C where the programmer
gets a billion ways of implementing regular expressions, hashes and
data management?

:}  Look, I'm not trying to pretend that Perl is the Ultimate All-Time OOP Champ
:}  of the World. That title belongs to Smalltalk. :-) All I'm saying is that
:}  it's not the hopeless basket case a lot of people try to make it out to be.

Of all the languages I know, the only languages that have less native 
support to do OO programming are, are the languages that don't make any
claims that they actually support OO programming.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


------------------------------

Date: Sat, 18 Nov 2006 12:12:38 -0600
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.6 How can I make "\w" match national character sets?
Message-Id: <181120061212381712%brian.d.foy@gmail.com>

In article <ejnboi.1hk.1@news.isolution.nl>, Dr.Ruud
<rvtol+news@isolution.nl> wrote:

> PerlFAQ Server schreef:
> 
> > 6.6: How can I make "\w" match national character sets?
> > 
> > 
> >     Put "use locale;" in your script. The \w character class is taken
> >     from the current locale.
> > 
> >     See perllocale for details.
> 
> See also:
> 
>   http://www.xs4all.nl/~rvtol/perl/unicount.pl 

Ah, very cool.

I think that should be part of perllocale though :)

-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: 18 Nov 2006 15:17:05 -0800
From: "PB0711" <hpbenton@scripps.edu>
Subject: Re: HoA bug? Size limit?
Message-Id: <1163891825.717917.243720@h54g2000cwb.googlegroups.com>

Ok, WoW. Yes still relativitly new to perl. I'm teaching myself as I go
and run into different problems. I was happy that I could get the AoA
working and supprised with myself that the HoA works. Thank you for
pointing out my mistake. I wrote a quick two loop program and then
added the 3rd loop later.
I'll look over the code and make sure I understand it before I
impliment it and if it's ok, I'll ask questions to you guys about it. I
have to say Thank you to both Bob and micro.

Cheers,

PB

Mirco Wahab wrote:
> Thus spoke PB0711 (on 2006-11-18 02:20):
>
> > I have just finished a script with 3 for loops, at the end of which it
> > generates an HoA. I've printed out that it goes throught all expected
> > 8000 loops but there are only a unique 1599 keys. However, if I print
> > the keys out before I put them into the HoA I can see that it does all
> > combinations that I expect. Is this a bug or a size limit on the number
> > of keys for an HoA??
>
> I see you are into Protein stuff, this is nice, Hey, I did
> these things in the past (when I didn't know Perl).
>
> > #making dipeptides - a nasty way V2 will do a sub
> > for (my $i=0; $i < $#AoA+1; $i++){
> > 	for (my $j=0; $j < $#AoA+1; $j++){
> > 		for (my $n=0; $n < $#AoA+1; $n++) {
>
> Others have pointed out several problems already.
>
> Because I guess you are new into Perl and new into
> Protein/amino acids stuff, I'd like to make a recommendation
> regarding general program structure and amino acid handling
> here.
>
> Basically, I straightened up your code a bit and tried
> to make it readable and extensible (what I think what it
> would be then ;-).
>
> Part one - Data:
> --- 8< ---
>
> use strict;
> use warnings;
>
> use constant TLC  => 1;  # use some readable indices
> use constant MASS => 3;  # into the data array below
> use constant C_ID => 4;  # TLC -> 'three letter code'
> use constant O_ID => 5;
> use constant N_ID => 6;
> use constant H_ID => 7;
> use constant S_ID => 8;
>                          # define some element related data
> my @elems;
>    $elems[C_ID] = 'C', $elems[O_ID] = 'O', $elems[N_ID] = 'N',
>    $elems[H_ID] = 'H', $elems[S_ID] = 'S';
>
> # this is the whole story (always use single character codes!):
> my @acids = qw'A C D E F G H I K L M N P Q R S T V W Y';
>
> # now compile your data into the appropriate form,
> # use a hash to organize the amino acid data records ...
> my %table = (
> 	A => [qw'A Ala Alanine        71.08  3  2  1  7  0'],
> 	C => [qw'C Cys Cysteine      103.14  3  2  1  7  1'],
> 	D => [qw'D Asp Aspartate     115.09  4  4  1  7  0'],
> 	E => [qw'E Glu Glutamate     129.11  5  4  1  9  0'],
> 	F => [qw'F Phe Phenylalanine 147.18  9  2  1 11  0'],
> 	G => [qw'G Gly Glycine        57.05  2  2  1  5  0'],
> 	H => [qw'H His Histidine     137.14  6  2  3  9  0'],
> 	I => [qw'I Ile Isoleucine    113.16  6  2  1 13  0'],
> 	K => [qw'K Lys Lysine        128.17  6  2  2 14  0'],
> 	L => [qw'L Leu Leucine       113.16  6  2  1 13  0'],
> 	M => [qw'L Met Methionine    131.20  5  2  1 11  1'],
> 	N => [qw'N Asn Asparagine    114.10  4  3  2  8  0'],
> 	P => [qw'P Pro Proline        97.12  5  2  1  9  0'],
> 	Q => [qw'Q Gln Glutamine     128.13  5  3  2 10  0'],
> 	R => [qw'R Arg Arginine      156.19  6  2  4 14  0'],
> 	S => [qw'S Ser Serine         87.08  3  3  1  7  0'],
> 	T => [qw'T Thr Threonine     101.10  4  3  1  9  0'],
> 	V => [qw'V Val Valine         99.13  5  2  1 11  0'],
> 	W => [qw'W Trp Trytophan     186.21 11  2  2 12  0'],
> 	Y => [qw'Y Tyr Tryosine      163.17  9  3  1 11  0']  );
>
> --- 8< ---
>
> From the definitions and declarations above,
> data handling gets relatively easy now:
>
> Part two - workflow:
>
> --- 8< ---
>
> my @triplets;
> for my $i (@acids) {
>    for my $j (@acids) {
>       for my $k (@acids) {
>          push @triplets, [ $i, $j, $k ];
>       }
>    }
> }
>
> --- 8< ---
>
> After you generated the triplets, you can
> do some operations on them:
>
> --- 8< ---
>
> for my $triplet (@triplets) {			# handle tripeptides in any way you want
>   # 1) calculate masses
>   my $mass = 0;
>   $mass += $table{$_}[MASS] for @$triplet;
>
>   # 2) generate elementary composition
>   my %compos;
>   for my $acid (@$triplet) {
>      $compos{$_} += $table{$acid}[$_] for C_ID .. S_ID;
>   }
>
>   # 3) make some kind of a 'formula'
>   my $formula = join '',
>          map $elems[$_] . $compos{$_} x ($compos{$_} > 1),
>             grep $compos{$_}, C_ID .. S_ID;
>
>   # 4) print the results
>   print +(map "$_", @$triplet), "\t",           # print one letter codes
>          (map "$table{$_}[TLC] ", @$triplet),   # print three letter codes
>          "\t$formula\tM=$mass\n";
> }
> __END__
>
> --- 8< ---
>
> This is how I'd have tried to play with
> amino acid sequences in the olden times,
> maybe it's somehow instructive - if not,
> whatever ... ;-)
>
> Iteration over data contained in the records (C_ID .. S_ID)
> implies that this specific order is reitained, otherwise
> you have to explicitly state the indices in question.
> 
> 
> Regards
> 
> Mirco



------------------------------

Date: Sun, 19 Nov 2006 03:00:49 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: HoA bug? Size limit?
Message-Id: <ejodms$773$1@mlucom4.urz.uni-halle.de>

Thus spoke PB0711 (on 2006-11-19 00:17):

> Ok, WoW. Yes still relativitly new to perl. I'm teaching myself as I go
> and run into different problems. I was happy that I could get the AoA
> working and supprised with myself that the HoA works. Thank you for
> pointing out my mistake. I wrote a quick two loop program and then
> added the 3rd loop later.

OK, I think there are some glitches in the biochemical part too,
usually AA weights are tabulated from their constituting elements
(undissociated).

Each peptide (amide) bond then slays of a water (H, OH) from
the ends of the peptides involved, so N peptides loose N-1
water from their structure. One should consider this in
the mass calculations.

> I'll look over the code and make sure I understand it before I
> implement it and if it's ok, I'll ask questions to you guys about it. 

Cool, maybe people here can help you to get things started.

I reconsidered your program in view of the problem stated above
and made it capable to process any normal (amide-linked) polypeptide.

Maybe you can improve from here and put the stuff into subroutines
or packages?

Regards

Mirco

--- 8< -----

use strict;
use warnings;

my %Elem = (
# aa_idx  symb  name  radius  mass. 'key' is index into AA table
   7 => [qw'H Hydrogen  0    1.0079'],
   4 => [qw'C Carbon    0   12.0110'],
   5 => [qw'O Oxygen    0   15.9949'],
   6 => [qw'N Nitrogen  0   14.0037'],
   8 => [qw'S Sulphur   0   31.9721']
);
my $WaterMass = $Elem{7}[MASS] * 2 + $Elem{5}[MASS]; # H2O

use constant SYMB  => 0;  # id #0 is element symbol
use constant MASS  => 3;  # 'mass' is #3 in all(!) tables
use constant TLC   => 1;  # three letter code (AA table)

my %Aminoacids = (
# key   1Ltr 3Ltr  Name        mass   C  O  N  H  S
 A => [qw'A Ala Alanine        ?     3  2  1  7  0'],
 C => [qw'C Cys Cysteine       ?     3  2  1  7  1'],
 D => [qw'D Asp Aspartate      ?     4  4  1  7  0'],
 E => [qw'E Glu Glutamate      ?     5  4  1  9  0'],
 F => [qw'F Phe Phenylalanine  ?     9  2  1 11  0'],
 G => [qw'G Gly Glycine        ?     2  2  1  5  0'],
 H => [qw'H His Histidine      ?     6  2  3  9  0'],
 I => [qw'I Ile Isoleucine     ?     6  2  1 13  0'],
 K => [qw'K Lys Lysine         ?     6  2  2 14  0'],
 L => [qw'L Leu Leucine        ?     6  2  1 13  0'],
 M => [qw'L Met Methionine     ?     5  2  1 11  1'],
 N => [qw'N Asn Asparagine     ?     4  3  2  8  0'],
 P => [qw'P Pro Proline        ?     5  2  1  9  0'],
 Q => [qw'Q Gln Glutamine      ?     5  3  2 10  0'],
 R => [qw'R Arg Arginine       ?     6  2  4 14  0'],
 S => [qw'S Ser Serine         ?     3  3  1  7  0'],
 T => [qw'T Thr Threonine      ?     4  3  1  9  0'],
 V => [qw'V Val Valine         ?     5  2  1 11  0'],
 W => [qw'W Trp Trytophane     ?    11  2  2 12  0'],
 Y => [qw'Y Tyr Tryosine       ?     9  3  1 11  0']
);
# calculate (full) AA masses (above) in advance
for my $aa (values %Aminoacids) {
   $aa->[MASS] = 0; # start undissociated structure -->
   $aa->[MASS] += $Elem{$_}[MASS] * $aa->[ $_ ] for keys %Elem;
}

# always work on array of one-letter codes
my @Aminos = sort keys %Aminoacids;

# generate desired peptide chains
my @Peptides;
for my $i (@Aminos) {
   for my $j (@Aminos) {
      for my $k (@Aminos) {
         push @Peptides, [ $i, $j, $k ];
      }
   }
}

# handle the peptide chains
for my $peptide (@Peptides) {
  my $mass = 0;                       # 1) calculate masses on the fly
  $mass += $Aminoacids{$_}[MASS] for @$peptide; # add up N full masses
  $mass -= $WaterMass for @$peptide-1;    # reduce by N-1 dumped water

  my %compos = ();                    # 2) generate elementary composition
  for my $aa (@$peptide) {
     $compos{ $_ } += $Aminoacids{$aa}[ $_ ] for keys %Elem
  }

  my $formula = join '',              # 3) make some kind of a 'formula'
      map $Elem{$_}[SYMB] . $compos{$_} x ($compos{$_} > 1),
          grep $compos{$_}, sort keys %Elem;

  print @$peptide, "\t",              # 4) print results, one letter codes
        (map "$Aminoacids{$_}[TLC] ", @$peptide),  # three letter codes (TLC)
         "\t$formula\tm=$mass\n";                  # and more
}

--- 8< -----


------------------------------

Date: Sat, 18 Nov 2006 17:34:09 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <ejngse.1p4.1@news.isolution.nl>

Sherm Pendley schreef:

> I'm not saying that piracy wasn't a factor, Randal, just that I doubt
> it was the *only* reason for the decision.

It doesn't have to be the only reason to be reason enough.

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: Sat, 18 Nov 2006 12:58:52 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <m2odr4vdpf.fsf@Sherm-Pendleys-Computer.local>

"Dr.Ruud" <rvtol+news@isolution.nl> writes:

> Sherm Pendley schreef:
>
>> I'm not saying that piracy wasn't a factor, Randal, just that I doubt
>> it was the *only* reason for the decision.
>
> It doesn't have to be the only reason to be reason enough.

Quite the opposite, in fact. By itself, the elimination of piracy would not
justify the decision, for the simple reason that the lack of a convenient
CD Bookshelf would not have (and has not had) any real effect on piracy. I
very much doubt that someone as in-touch with the online world as Randal S.
or Tim O'Reilly honestly expected that it would.

Occam's Razor applies, and the simplest explanation by far is that most of
the target audience for the CD Bookshelves have moved to Safari, just like
many people are moving away from music CDs to online vendors like iTunes.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: 18 Nov 2006 21:29:37 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <Xns987F9D9B42A31castleamber@130.133.1.4>

Sherm Pendley <spamtrap@dot-app.org> wrote:

> Occam's Razor applies, and the simplest explanation by far is that
> most of the target audience for the CD Bookshelves have moved to
> Safari, just like many people are moving away from music CDs to online
> vendors like iTunes. 

Yup, but the pirates did it sounds much more cool, or at least a few 
hundred years ago. And since "we all" have probably something we shouldn't 
have, "we all" are guilty. Much easier then looking into the real issue or 
even wondering if there is an issue at all.

I think my explanation based on personal experience: in the past I bought 
books for a single chapter, or even a page of information, which has now 
been replaced by using Google, was not that bad. Probably closer to the 
real thing then Jack Sparrow and his mates. Most people I know who have 
20G or so of "e-books" just burn them on DVD and never use them. They just 
moved the library and their network of friends from whom they borrowed 
books in the past to a DVD.

What's next? Photo development shops blaming P2P and pirates for losing 
business?

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: 18 Nov 2006 23:15:31 GMT
From: xhoster@gmail.com
Subject: Re: p-value calculation
Message-Id: <20061118181622.372$r6@newsreader.com>

"rahulthathoo" <rahul.thathoo@gmail.com> wrote:

> I can do that easily in Excel using the TDist function.

Statistics::Distributions::tprob

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Sat, 18 Nov 2006 19:32:40 +0100
From: Richard <tuet@bushgohome.com>
Subject: Re: Warning Re: is there a bash script to perl converter?
Message-Id: <ejnjon$ua7$1@online.de>

Tad McClellan schrieb:
> Richard <fake@fake.com> wrote:
>> Tad McClellan schrieb:
>>> Tintin <tintin@invalid.invalid> wrote:
>>>> <ToddAndMargo@gbis.com> wrote in message 
>>>> news:1163825339.671311.207020@m73g2000cwd.googlegroups.com...
>>>>> Hi All,
>>>>>
>>>>>   Is there a such thing as a bash script to perl converter?
>>>> Yes.  It's called a programmer. 
>>>
>>> ...because shell scripts don't really do much themselves, most of their
>>> "heavy lifting" is done by calling other programs.
>>>
>>> So to make a shell script converter, you would need all of those
>>> other programs in Perl as well.
>>>
>>>
>> Tad, he just grabbed your email to spam you, didn't you notice, that
>> this question was autogenerated, 
> 
> 
> What did you observe that led you to conclude that it was autogenerated?
> 
> 
>> just like one before with the
>> decompiler question.
> 
> 
> Message-ID please, else I dunno what you're referring to.
> 
> 
>> This is very edffective technique, you send general question to dozens
>> of mailingslists and you get lots of replies and bingo lots of valid
>> emailadresses.
> 
> 
> Spammers don't generally follow the threads that they start. This
> poster has replied to many threads here in the past.
> 
> I think you have a mistaken identity thing going here...
> 
> 
> 
> [ In fact, _you_ look more like a spammer than the OP does, by
>   virtue of masquerading as someone else's domain.
>   (unless you really do have something to do with fake plants)
>   It is an abuse to use a domain that you don't have rights to,
>   please don't abuse folks like that.
> ]
> 
At least I don't attach personal ads to each of my messages, right taddy?

"    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas"


------------------------------

Date: Sat, 18 Nov 2006 19:33:37 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Warning Re: is there a bash script to perl converter?
Message-Id: <leJ7h.2592$IW2.1595@trndny03>

Richard wrote:
> At least I don't attach personal ads to each of my messages, right
> taddy?

[ ] You know what a signature is

jue 




------------------------------

Date: Sat, 18 Nov 2006 19:21:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Warning Re: is there a bash script to perl converter?
Message-Id: <slrnelvccv.3hl.tadmc@tadmc30.august.net>

Richard <tuet@bushgohome.com> wrote:
> Tad McClellan schrieb:


>> [ In fact, _you_ look more like a spammer than the OP does, by
>>   virtue of masquerading as someone else's domain.
>>   (unless you really do have something to do with fake plants)
>>   It is an abuse to use a domain that you don't have rights to,
>>   please don't abuse folks like that.
>> ]
>> 
> At least I don't attach personal ads to each of my messages, right taddy?


At least I don't drive spam to other people's inbox, right Dicky?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

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 9980
***************************************


home help back first fref pref prev next nref lref last post