[26330] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8505 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 10 00:05:15 2005

Date: Sun, 9 Oct 2005 21:05:04 -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           Sun, 9 Oct 2005     Volume: 10 Number: 8505

Today's topics:
    Re: FAQ 4.46 How do I handle linked lists? xhoster@gmail.com
    Re: Jargons of Info Tech industry <steve@REMOVETHIScyber.com.au>
        Term::Visual <shane@weasel.is-a-geek.net>
        Whats the most complicate RegEX that can be done? robic0@yahoo.com
    Re: Whats the most complicate RegEX that can be done? <tim@vegeta.ath.cx>
    Re: Whats the most complicate RegEX that can be done? <matthew.garrish@sympatico.ca>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 09 Oct 2005 22:37:44 GMT
From: xhoster@gmail.com
Subject: Re: FAQ 4.46 How do I handle linked lists?
Message-Id: <20051009183744.722$Xc@newsreader.com>

PerlFAQ Server <comdog@panix.com> wrote:
> This message is one of several periodic postings to comp.lang.perl.misc
> intended to make it easier for perl programmers to find answers to
> common questions. The core of this message represents an excerpt
> from the documentation provided with Perl.
>
> --------------------------------------------------------------------
>
> 4.46: How do I handle linked lists?
>
>     In general, you usually don't need a linked list in Perl, since with
>     regular arrays, you can push and pop or shift and unshift at either
>     end, or you can use splice to add and/or remove arbitrary number of
>     elements at arbitrary points. Both pop and shift are both O(1)
>     operations on Perl's dynamic arrays. In the absence of shifts and
>     pops, push in general needs to reallocate on the order every log(N)
>     times, and unshift will need to copy pointers each time.

I find this last part very hard to believe.

unshift if only slightly slower than push.  There is no way that would be
the case if it were copying pointers each time.

$ time perl -le 'foreach (1..10_000_000){my $mid=int @x/2; \
        unshift @x,"foo"}; print scalar @x'
10000000
11.670u 0.840s 0:13.10 95.4%    0+0k 0+0io 325pf+0w

$ time perl -le 'foreach (1..10_000_000){my $mid=int @x/2; \
        push @x,"foo"}; print scalar @x'
10000000
11.480u 0.770s 0:13.04 93.9%    0+0k 0+0io 326pf+0w


Compare this to somethint that actually does copy pointers each time:

$ time perl -le 'foreach (1..10_000_000){my $mid=int @x/2; \
        splice @x,$mid,0,'foo'}; print scalar @x'

I didn't have the patience to wait for it, but it seems like it is
quadratic and would take over 200 minutes for this size.

Xho

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


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

Date: Mon, 10 Oct 2005 08:58:42 +1000
From: Steven D'Aprano <steve@REMOVETHIScyber.com.au>
Subject: Re: Jargons of Info Tech industry
Message-Id: <pan.2005.10.09.22.58.40.603766@REMOVETHIScyber.com.au>

On Sun, 09 Oct 2005 19:40:30 +0000, Roedy Green wrote:

> Imagine a main sending emailed floor tile samples to his wife on a
> business trip for her final veto and not being allowed to caption
> them.

I don't have to imagine it, I've done it, more or less something like this:

"Dear wifey,

here are five pictures of the tiles I like. My favourite is tile02.jpg.
They are all in the price range we can afford. You pick the one you think
suits best, then call Freddy at TileMart on blah blah blah and order them.
We'll need X square metres."

Sheesh Roedy, to listen to you go anyone would think that human
communication was impossible before HTML email was invented.


-- 
Steven.



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

Date: Mon, 10 Oct 2005 15:56:41 +1300
From: Shane <shane@weasel.is-a-geek.net>
Subject: Term::Visual
Message-Id: <pan.2005.10.10.02.56.40.672565@weasel.is-a-geek.net>

OK having _real_ trouble coming to grips with this module

This is the only documentation I can find on the net
http://cpan.uwinnipeg.ca/htdocs/Term-Visual/Term/Visual.html

Its exactly the same as the man page.. but its got me lost,
Is anyone aware of a tutorial, or slightly more straight forward
explanation of how to use the durn thing
simple_test.pl (included in the distribution(right word?)) works well, and
basically does what I want, but for the life of me I cant see how it
acheives that

The only other thing I can think of is roll my own ncurses display

TIA

-- 
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.



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

Date: Sun, 09 Oct 2005 16:10:56 -0700
From: robic0@yahoo.com
Subject: Whats the most complicate RegEX that can be done?
Message-Id: <ho8jk1pvmsoe960s49jb8fomehj6p5d9vq@4ax.com>

What is the most complicated Regular Expression possible?


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

Date: Sun, 09 Oct 2005 23:42:19 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Whats the most complicate RegEX that can be done?
Message-Id: <slrndkjamq.dqt.tim@vegeta.saiyix>

robic0@yahoo.com <robic0@yahoo.com> wrote:
> What is the most complicated Regular Expression possible?

Might as well ask Faulkner the maximum length
of an English sentence.

You're effectively limited by available memory and CPU time.

Tim Hammerquist
-- 
Show me something that beats a Natural Twenty,
and I'll show you hateful LIES!
    -- Red Mage, 8-Bit Theater <http://nuklearpower.com/>


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

Date: Sun, 9 Oct 2005 21:58:35 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Whats the most complicate RegEX that can be done?
Message-Id: <dVj2f.314$vD4.48610@news20.bellglobal.com>


<robic0@yahoo.com> wrote in message 
news:ho8jk1pvmsoe960s49jb8fomehj6p5d9vq@4ax.com...
> What is the most complicated Regular Expression possible?

The regular expression that will destroy us all. But if you write it, you'll 
destroy us all and so never know that you succeeded.

Matt 




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

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


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