Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Language documentation ( was Re: Computing Industry shams)
"Xah Lee" <xah@xahlee.org> writes:

> A|B, where A and B can be arbitrary REs, creates a regular expression
> that will match either A or B. An arbitrary number of REs can be
> separated by the "|" in this way. This can be used inside groups (see
> below) as well. As the target string is scanned, REs separated by "|"
> are tried from left to right. When one pattern completely matches, that
> branch is accepted. This means that once A matches, B will not be
> tested further, even if it would produce a longer overall match. In
> other words, the "|" operator is never greedy. To match a literal "|",
> use \|, or enclose it inside a character class, as in [|].
>
> --end quote--
>
> Note: In other words, the "|" operator is never greedy.
>
> Note the need to inject the high-brow jargon "greedy"here as a
> latch on sentence.

What is so hard to understand ?
Should be perfectly clear even to a first year undergraduate.

As for "greedy" even a minimal exposure to Djikstra's shortest path
algorithm would have made the concept intuitive. And from memory,
that is the sort of thing done in Computing 101 and in  Data Structures and
Algorithms 101

It seems to me that you want the Python doc to be written for morons.
And that is not a valid complaint.

Report this thread to moderator Post Follow-up to this message
Old Post
vermicule
05-08-05 08:58 AM


Re: Language documentation ( was Re: Computing Industry shams)
vermicule <rambam@bigpond.net.au> writes:

> "Xah Lee" <xah@xahlee.org> writes:

[...]

>
> It seems to me that you want the Python doc to be written for morons.

Not for morons, but for trolls.  Don't feed them.

--
Måns Rullgård
mru@inprovide.com

Report this thread to moderator Post Follow-up to this message
Old Post
Måns Rullgård
05-08-05 08:58 AM


Re: Language documentation ( was Re: Computing Industry shams)
vermicule wrote:

>
> What is so hard to understand ?
> Should be perfectly clear even to a first year undergraduate.
>
> As for "greedy" even a minimal exposure to Djikstra's shortest path
> algorithm would have made the concept intuitive. And from memory,
> that is the sort of thing done in Computing 101 and in  Data Structures
> and Algorithms 101
>
> It seems to me that you want the Python doc to be written for morons.
> And that is not a valid complaint.

He's right actually. If we understand the term "greedy" as it's used in
graph search and optimization algorithms, Python's RE matching actually IS
greedy.


Report this thread to moderator Post Follow-up to this message
Old Post
alex goldman
05-09-05 01:57 AM


Re: Language documentation ( was Re: Computing Industry shams)
alex goldman <hello@spamm.er> writes:

> vermicule wrote:
> 
>
> He's right actually. If we understand the term "greedy" as it's used in
> graph search and optimization algorithms, Python's RE matching actually IS
> greedy.

No, you're just  about the optimization metric.
In regexes, "greedy" match optimizes for the longest match,
not the fastest.

And this is common regex terminology - man perlre and you will
find discussion of "greedy" vs. "stingy" matching.

-SEan


Report this thread to moderator Post Follow-up to this message
Old Post
Sean Burke
05-10-05 01:59 AM


Re: Language documentation ( was Re: Computing Industry shams)
Sean Burke wrote:

>
> alex goldman <hello@spamm.er> writes:
> 
>
> No, you're just  about the optimization metric.
> In regexes, "greedy" match optimizes for the longest match,
> not the fastest.
>
> And this is common regex terminology - man perlre and you will
> find discussion of "greedy" vs. "stingy" matching.

Read what you quoted again. Everyone (Xah, vermicule, myself) was talking
about "greedy" as it's used in graph search and optimization algorithms.

Report this thread to moderator Post Follow-up to this message
Old Post
alex goldman
05-10-05 09:00 PM


Re: Language documentation ( was Re: Computing Industry shams)
On Tue, 10 May 2005 04:58:48 -0700, alex goldman wrote:

> Sean Burke wrote:

...
 
>
> Read what you quoted again. Everyone (Xah, vermicule, myself) was talking
> about "greedy" as it's used in graph search and optimization algorithms.

However the original quote was in the context of regular expressions, so
discussion of the terminology used in regular expressions is far more
relevant than the terminology used in graph search and optimisation
algorithms.

Lawrence

Report this thread to moderator Post Follow-up to this message
Old Post
Lawrence Kirby
05-10-05 09:00 PM


Re: Language documentation ( was Re: Computing Industry shams)
Lawrence Kirby wrote:

> On Tue, 10 May 2005 04:58:48 -0700, alex goldman wrote:
> 
>
> ...
> 
>
> However the original quote was in the context of regular expressions, so
> discussion of the terminology used in regular expressions is far more
> relevant than the terminology used in graph search and optimisation
> algorithms.

I replied to "And from memory, that is the sort of thing done in Computing
101 and in  Data Structures and Algorithms 101", and I fully explained what
I meant by "greedy" as well. There was no ambiguity.

Report this thread to moderator Post Follow-up to this message
Old Post
alex goldman
05-10-05 09:00 PM


Re: Language documentation ( was Re: Computing Industry shams)
On Tue, 10 May 2005 06:52:18 -0700, alex goldman wrote:

> Lawrence Kirby wrote:

...
 
>
> I replied to "And from memory, that is the sort of thing done in Computing
> 101 and in  Data Structures and Algorithms 101", and I fully explained wha
t
> I meant by "greedy" as well. There was no ambiguity.

My response talks about relevance, not ambiguity.

Lawrence


Report this thread to moderator Post Follow-up to this message
Old Post
Lawrence Kirby
05-10-05 09:00 PM


Re: Language documentation ( was Re: Computing Industry shams)
Lawrence Kirby wrote:

> On Tue, 10 May 2005 06:52:18 -0700, alex goldman wrote:
> 
>
> ...
> 
>
> My response talks about relevance, not ambiguity.

Well, your response was irrelevant.

Report this thread to moderator Post Follow-up to this message
Old Post
alex goldman
05-10-05 09:00 PM


Re: Language documentation ( was Re: Computing Industry shams)
alex goldman <hello@spamm.er> writes:
> Lawrence Kirby wrote:
[snip] 
>
> Well, your response was irrelevant.

This entire discussion is irrelevant to most, if not all, of the
newsgroups to which it's being posted.  comp.lang.c, where I'm reading
this, is for discussion of the C programming language; I see nothing
about C.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.

Report this thread to moderator Post Follow-up to this message
Old Post
Keith Thompson
05-11-05 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:34 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.