[32038] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3302 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 28 06:09:29 2011

Date: Mon, 28 Feb 2011 03:09:11 -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           Mon, 28 Feb 2011     Volume: 11 Number: 3302

Today's topics:
        going from CPAN to RPM <agw@dsm.fordham.edu>
        Hash array with variable size? <ela@yantai.org>
    Re: Hash array with variable size? <jurgenex@hotmail.com>
        Introduction to Signal Processing by Sophocles J. Orfan (ronald2000)
    Re: Introduction to Signal Processing by Sophocles J. O <uri@StemSystems.com>
    Re: matching '?' in a string ending with digits <derykus@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 27 Feb 2011 19:05:40 -0500
From: Art Werschulz <agw@dsm.fordham.edu>
Subject: going from CPAN to RPM
Message-Id: <2m1v2thvl7.fsf@sobolev.dsm.fordham.edu>

Hi all.

Although we have used the CPAN shell to install Perl modules on our
Linux systems, we would like to use the RPM versions of same instead.
This means that we need to find out which Perl modules were installed
via the CPAN shell, nuke same, and then install the RPM versions (say,
via yum).

How can we find out which Perl modules were installed via the CPAN
shell? 

Thanks.

-- 
Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r- 
Net: agw@dsm.fordham.edu http://www.dsm.fordham.edu/~agw
Phone:   Fordham U. (212) 636-6325, Columbia U. (646) 775-6035


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

Date: Mon, 28 Feb 2011 13:37:38 -0800
From: "ela" <ela@yantai.org>
Subject: Hash array with variable size?
Message-Id: <ikfc8r$301$1@ijustice.itsc.cuhk.edu.hk>


I have a flatfile containing many rows (maybe up to 10 million) like the 
following lines, with each cell separated by the delimiter "\t",

2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794971 dnaN 
DNA polymerase III subunit beta
2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794972 gyrB 
DNA gyrase subunit B
2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794973 gyrA 
DNA gyrase subunit A

the first cell of each row is to look up, i.e. 2794438 in the above example, 
and to print something like:

dnaA-1 dnaN
dnaA-1 gyrB
dnaA-1 gyrA
 ....

how to make this lookup process more efficient? I don't know whether it is 
due to array size difference for each key, i.e. 2794438 here, it takes a 
long time (actually never finish) for a query file of about 100,000 rows. 
Any better implementation suggestions are highly welcomed.





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

Date: Mon, 28 Feb 2011 00:28:05 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Hash array with variable size?
Message-Id: <nolmm6h16tun1bvc1m494o4pfolfaiirsh@4ax.com>

"ela" <ela@yantai.org> wrote:
[Subject: Hash array with variable size?]

So what is it? A hash or an array? 
And yes, Perl hashes as well as arrays are variable size. Where is the
problem with that?

>I have a flatfile containing many rows (maybe up to 10 million) like the 
>following lines, with each cell separated by the delimiter "\t",
>
>2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794971 dnaN 
>DNA polymerase III subunit beta
>2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794972 gyrB 
>DNA gyrase subunit B
>2794438 dnaA-1  chromosomal replication initiator protein DnaA  2794973 gyrA 
>DNA gyrase subunit A
>
>the first cell of each row is to look up, i.e. 2794438 in the above example, 
>and to print something like:

So, it is what is commonly called a key, is it?

>dnaA-1 dnaN
>dnaA-1 gyrB
>dnaA-1 gyrA
>....
>
>how to make this lookup process more efficient?

More efficient than what? Show us your code, then we can try to optimize
it. 
As far as I can tell from your description it is a simple linear scan
through the file and the most time spent should be in reading the file
line by line:

	while ($line = <$F>) {
		($key, @others) = split ("\t", $line)
		if ($key eq $wanted) {
			print_from_data_whatever_you_want(@others)
		}
	}

>I don't know whether it is 
>due to array size difference for each key, i.e. 2794438 here, it takes a 

What do you mean by "array size difference for each key"? 

>long time (actually never finish) for a query file of about 100,000 rows.

10 million lines, each maybe 100 characters (based on your sample data
above), means at least 1GB of data in theory. In reality probably
several times this amount, maybe (but this is just a guess) poorly
designed code or poorly programmed so that data structures are copied
repeatedly, yeah, I can see how this could easily lead to swapping and a
thrashing system, even with several GB of RAM.
 
>Any better implementation suggestions are highly welcomed.

But you didn't show us any implemention. How could we possibly suggest
improvements to something that we have never seen?

In general: 
Use a database. Databases are designed to handle large amounts of data
and to provide fast queries.
Use a disk-based algorithm instead of a RAM based algorithm. Optimize
your code for RAM size instead of for programming convenience or speed
of operations. 
You may also benefit from reviewing old algorithms that were developed
decades ago specifically for problems where RAM-size was the restricting
factor.

jue


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

Date: Sun, 27 Feb 2011 21:07:40 +0000
From: ronaldmanualsea_at_gmail_dot_com@foo.com (ronald2000)
Subject: Introduction to Signal Processing by Sophocles J. Orfanidis
Message-Id: <532d7$4d6abd1c$cf3aab60$14678@news.flashnewsgroups.com>

I have solutions manuals to all problems and exercises in these textbooks.
To get one in an electronic format contact me at:
ronaldmanualsea(at)gmail(dot)com and let me know its title, author and
edition. Please this service is NOT free.

instructor's solutions manual for Mechanical Engineering Design, 7th Ed.
by Mischke, Shigley
instructor's solutions manual for Mechanical Measurements (6th Ed.,
Beckwith, Marangoni & Lienhard)
instructor's solutions manual for Mechanical Vibrations ( Vol.1) 4th Ed.,
Rao
instructor's solutions manual for Mechanical Vibrations (3rd Ed., Rao)
instructor's solutions manual for Mechanics of Aircraft Structures, 2nd Ed
by Sun
instructor's solutions manual for Mechanics of Fluids (8th Ed., Massey) 
instructor's solutions manual for Mechanics of Fluids 3rd ED Vol 1 by
Merle C. Potter
instructor's solutions manual for Mechanics of Materials  5 edition by
James M. Gere
instructor's solutions manual for Mechanics of Materials (6th Ed., Riley,
Sturges & Morris)
instructor's solutions manual for Mechanics Of Materials Beer Johnston 3rd
instructor's solutions manual for Mechanics of Materials, 6E, by Russell
C. Hibbeler
instructor's solutions manual for Mechanics of Materials, 6th Edition -
James M. Gere & Barry Goodno
instructor's solutions manual for Mechanics of Materials, 7E, by Russell
C. Hibbeler
instructor's solutions manual for Mechanics of Materials, 7th Edition -
James M. Gere & Barry Goodno
instructor's solutions manual for Mechanics of Solids, ross
instructor's solutions manual for Mechanism Design Analysis and Synthesis
(4th Edition) by  Erdman, Sandor, Kota
instructor's solutions manual for MEMS and Microsystems Design,
Manufacture and Nanoscale Engineering 2nd ED by Tai-Ran Hsu
instructor's solutions manual for Microeconomic Analysis, 3rd Ed., by H.
Varian
instructor's solutions manual for Microeconomic Theory Basic Principles
and Extensions 9E ( South-Western ) by Walter Nicholson
instructor's solutions manual for Microeconomic Theory by Segal Tadelis
Hara Chiaka Hara Steve Tadelis
instructor's solutions manual for Microeconomic Theory, by Mas-Colell,
Whinston, Green
instructor's solutions manual for Microeconomics, 6th Ed by Pyndick,
Rubinfeld
instructor's solutions manual for Microelectronic Circuit Analysis and
Design, 3rd Edition, by D. Neamen
instructor's solutions manual for Microelectronic Circuit Design (3rd Ed.,
Richard Jaeger & Travis Blalock)
instructor's solutions manual for Microelectronic Circuits By Adel Sedra
5th Edition 
instructor's solutions manual for Microelectronic Circuits, 4th Ed. by
Sedra and Smith
instructor's solutions manual for Microelectronic Circuits, 5th Ed. by
Sedra and Smith
instructor's solutions manual for Microelectronics Digital and Analog
Circuits and Systems by Millman
instructor's solutions manual for Microelectronics I & II by Dr.Chang
instructor's solutions manual for Microelectronics,Solution
MANUAL,5thEd,MAZ
instructor's solutions manual for Microprocessors and Interfacing, Revised
2nd Edition by Douglas V Hall
instructor's solutions manual for Microwave and Rf Design of Wireless
Systems, 1st Edition, by Pozar
instructor's solutions manual for Microwave Engineering, 2nd Ed., by David
M. Pozar
instructor's solutions manual for Microwave Engineering, 3rd Ed., by David
M. Pozar
instructor's solutions manual for Microwave Transistor Amplifiers Analysis
and Design, 2nd Ed., by Guillermo Gonzalez
instructor's solutions manual for Mobile Communications 2nd ed by Jochen
Schiller
instructor's solutions manual for Modern Control Engineering 3rd Ed. - K.
OGATA
instructor's solutions manual for Modern Control Engineering 4th Ed. - K.
OGATA
instructor's solutions manual for Modern Control Engineering 5 Ed. - K.
OGATA
instructor's solutions manual for Modern Control Systems 11E by Richard C
Dorf and Robert H. Bishop
instructor's solutions manual for Modern Control Systems 9 E by Richard C
Dorf and Robert H. Bishop
instructor's solutions manual for Modern Control Systems, 12th Ed by Dorf,
Bishop
instructor's solutions manual for Modern Digital and Analog Communication
Systems, 3rd Ed., by Lathi
instructor's solutions manual for Modern Digital Electronics 3 Ed by R P
Jain
instructor's solutions manual for Modern Digital Electronics,3E by R P JAIN
instructor's solutions manual for Modern Digital Signal Processing-Roberto
Cristi
instructor's solutions manual for MODERN OPERATING SYSTEMS 2nd ed 
A.S.TANENBAUM
instructor's solutions manual for Modern Organic Synthesis An Introduction
by George Zweifel, Michael Nantz
instructor's solutions manual for Modern Physics 2nd E by Randy Harris
instructor's solutions manual for Modern Physics 4th ed by Mark Llewellyn
instructor's solutions manual for Modern Physics for Scientists and
Engineers 3rd E by Thornton and  Rex
instructor's solutions manual for Modern Quantum Mechanics (Revised
Edition) by J. J. Sakurai
instructor's solutions manual for Modern Thermodynamics - From Heat
Engines to Dissipative Structures by Kondepudi, Prigogine
instructor's solutions manual for Modern Thermodynamics - From Heat
Engines to Dissipative Structures Vol 1 by Kondepudi, Prigogine
instructor's solutions manual for Molecular Symmetry and Group Theory by
Robert L. Carter  
instructor's solutions manual for Multinational Business Finance 10 E by
Stonehill, Moffett, Eiteman
instructor's solutions manual for Multivariable Calculus, 5th Edition,
JAMES STEWART
instructor's solutions manual for Multivariable Calculus, Applications and
Theory by Kenneth Kuttler
instructor's solutions manual for Nanoengineering of Structural,
Functional and Smart Materials, Mark J. Schulz, Ajit D. Kelkar
instructor's solutions manual for Network Flows: Theory, Algorithms, and
Applications by Ravindra K. Ahuja , Thomas L. Magnanti , James B. Orlin 
instructor's solutions manual for Networks and Grids - Technology and
Theory by Thomas G. Robertazzi
instructor's solutions manual for Neural networks and learning machines
3rd edition by Simon S. Haykin ( 2,3,7,14 missing )
instructor's solutions manual for Nonlinear Programming ,2ndEdition ,
Dimitri P.Bertsekas
instructor's solutions manual for Numerical Analysis 8th ED by BURDEN &
FAIRES
instructor's solutions manual for Numerical Computing with MATLAB by Moler
instructor's solutions manual for Numerical Methods for Engineers (3rd Ed.
Steven C. Chapra)
instructor's solutions manual for Numerical Methods for Engineers (5th Ed.
Steven C. Chapra)
instructor's solutions manual for Numerical Methods Using MATLAB (3rd
Edition)by John H. Mathews & Fink
instructor's solutions manual for Numerical Solution of Partial
Differential Equations- An Introduction (2nd Ed., K. W. Morton &D)
instructor's solutions manual for Operating System Concepts, 6E,
Silberschatz, Galvin, Gagne
instructor's solutions manual for Operating System Concepts, 7E,
Silberschatz, Galvin, Gagne
instructor's solutions manual for Operating systems Internals and Design
principles 4th Edition Stallings
instructor's solutions manual for Operating systems Internals and Design
principles 5th Edition Stallings
instructor's solutions manual for Operations Management 5th Ed by Nigel
Slack, Chambers, Johnston
instructor's solutions manual for Optical Fiber Communications 3rd E by
Gerd Keiser
instructor's solutions manual for Optics 4th Edition by Hecht E., Coffey
M., Dolan P
instructor's solutions manual for Optimal Control Theory An Introduction
By Donald E. Kirk
instructor's solutions manual for Optimal State Estimation Dan Simon
instructor's solutions manual for Options, Futures and Other Derivatives,
4E, by John Hull
instructor's solutions manual for Options, Futures and Other Derivatives,
5E, by John Hull
instructor's solutions manual for Options, Futures, and Other Derivatives
7th Ed by John C. Hull
instructor's solutions manual for Orbital Mechanics for Engineering
Students 2nd ED by Curtis
instructor's solutions manual for Orbital Mechanics for Engineering
Students by Curtis
instructor's solutions manual for ORDINARY DIFFERENTIAL EQUATIONS by
Adkins, Davidson
instructor's solutions manual for Organic Chemistry - Clayden et.al. 
instructor's solutions manual for Organic Chemistry 2nd Edition by Hornback
instructor's solutions manual for Organic Chemistry 7ed, McMurry
instructor's solutions manual for Organic Chemistry, 4E., by Carey, Atkins
instructor's solutions manual for Organic Chemistry, 5E., by Carey, Atkins
instructor's solutions manual for Organic Chemistry, 6 Ed by Wade, Jan
Simek
instructor's solutions manual for Parallel & Distributed Computation 
Numerical Methods by Bertsekas & Tsitsiklis
instructor's solutions manual for Parallel Programming: Techniques and
Applications Using Networked Workstations and Parallel Computers (2nd Ed.,
Barry Wilkinson & Michael Allen)
instructor's solutions manual for Physical Basis of Biochemistry 2nd Ed by
Bergethon, Hallock 
instructor's solutions manual for Physical Chemistry (7E, Peter Atkins &
Julio de Paula)
instructor's solutions manual for Physical Chemistry by Thomas Engel &
Philip Reid
instructor's solutions manual for Physics - Concept and Connections - Book
Two by Brian Heimbecker, Igor Nowikow, et al
instructor's solutions manual for Physics - Concept and Connections -by
Brian Heimbecker, Igor Nowikow, et al
instructor's solutions manual for Physics - Principles and Problems
instructor's solutions manual for Physics - Principles and Problems (
Glencoe )
instructor's solutions manual for Physics , Fifth Edition, Volume One
(Halliday, Resnick, Krane)
instructor's solutions manual for Physics 8 ED by Cutnell & Johnsen
instructor's solutions manual for Physics for Scientist and Engineers, 5E,
by Tipler, Mosca


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




-- 
+-----------------------[ SERVER SIGNATURE ]--------+
| Article posted via Web Developer's USENET Archive |
|          http://www.1-script.com/forums/          |
| Web and RSS gateway to your favorite newsgroup -  |
|                comp.lang.perl.misc                |
+---------------------------------------------------+



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

Date: Sun, 27 Feb 2011 17:28:54 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Introduction to Signal Processing by Sophocles J. Orfanidis
Message-Id: <87fwr9gli1.fsf@quad.sysarch.com>

>>>>> "r" == ronald2000  <ronaldmanualsea_at_gmail_dot_com@foo.com> writes:

  r> edition. Please this service is NOT free.

you are just a stupid spammer. that IS free advice.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 26 Feb 2011 12:11:13 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: matching '?' in a string ending with digits
Message-Id: <434e5fcf-7201-447c-aa40-63e3f9c7cabe@o30g2000pra.googlegroups.com>

On Feb 26, 12:42=A0am, "ReMo..." <ram...@gmail.com> wrote:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @arr =3D ('third1000', 'third1000', 'third?1000', '1000third?', 'third=
{}1000');
> for my $item (@arr) {
> =A0 =A0 my $targ =3D $item;
> =A0 =A0 print "$targ and $item ";
> =A0 =A0 print "do not " if ($item !~ /$targ/);
> =A0 =A0 print "match\n"
>
> }
>
> The output is:
> third1000 and third1000 match
> third1000 and third1000 match
> third?1000 and third?1000 do not match << I don't understand this
> 1000third? and 1000third? match
> third{}1000 and third{}1000 match
>
> In the above, the nondigits represent arbitrary text that digits are
> added to for a multi-array sort in a module I'm making, because there
> may be otherwise-identical text items.
>
> /\Q...\E/ seems to make it go away, but then two characters ('$' and '@')
> would apparently need to be accounted for.
>
> So my question is, what other characters will fail to match in a string
> ending with digits? =A0I assume there are more clues in perlre and perlop=
s,
> but I can't find them. =A0I've got to be missing something really element=
ary
> here.
>


See perldoc perlretut for a quick intro about meta-
characters. Various metacharacters will cause the
regex to fail as mentioned.

One problem is that there must be a literal '?' in
the regex in order to match the '?' in the string
being matched. Since '?' is a regex metacharacter
with special meaning to the regex compilation and
not a literal '?', the match would fail.

The 're' pragma can be helpful in seeing what
happens:

  perl -Mre=3Ddebug -wle "print 'not'
      if 'third?1000' !~    /third?1000/"

  Compiling REx "third?1000"
  Final program:
   1: EXACT <thir> (3)
   3: CURLY {0,1} (7)
   5:   EXACT <d> (0)
   7: EXACT <1000> (9)
   9: END (0)
  anchored "thir" at 0 floating "1000" at 4..5 (checking
  floating) minlen 8
  Guessing start of match in sv for REx "third?1000"
  against "third?1000"
  Found floating substr "1000" at offset 6...
  Contradicts anchored substr "thir", giving up...
  Match rejected by optimizer

As it turns out though, the debug looks to me as
if the compilation fails for another reason when
the optimizer determines "1000" will occurs at
offset 4 or 5 in the pattern which won't match its
position at offset 6 in the string being matched.

--
Charles DeRykus


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 3302
***************************************


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