473,772 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Computing Industry shams

Let me expose one another fucking incompetent part of Python doc, in
illustration of the Info Tech industry's masturbation and ignorant
nature.

The official Python doc on regex syntax (
http://python.org/doc/2.4/lib/re-syntax.html ) says:

--begin quote--

"|"
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.

“never greedy”? What is greedy anyway?

“Greedy”, when used in the context of computing, describes a
certain characteristics of algorithms. When a algorithm for a
minimizing/maximizing problem is such that, whenever it faced a choice
it simply chose the shortest path, without considering whether that
choice actually results in a optimal solution.

The rub is that such stratedgy will often not obtain optimal result in
most problems. If you go from New York to San Francisco and always
choose the road most directly facing your destination, you'll never get
on.

For a algorithm to be greedy, it is implied that it faces choices. In
the case of alternatives in regex "regex1|regex2| regex3", there is
really no selection involved, but following a given sequence.

What the writer were thinking when he latched on about greediness, is
that the result may not be from the pattern that matches the most
substring, therefore it is not “greedy”. It's not greedy Python
docer's ass.

Such blind jargon throwing, as found everywhere in tech docs, is a
significant reason why the computing industry is filled with shams the
likes of unix, Perl, Programing Patterns, eXtreme Programing,
“Universal Modeling Language”, fucking shits.

----
A better writen doc for the complete regex module is at:
http://xahlee.org/perl-python/python...module-re.html

See also: Responsible Software Licensing
http://xahlee.org/UnixResource_dir/w...e_license.html

Xah
xa*@xahlee.org
http://xahlee.org/

Nov 14 '05 #1
15 1436
"Xah Lee" <xa*@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"her e 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.
Nov 14 '05 #2
Xah Lee wrote:
Let me expose one another fucking incompetent part of Python doc, in
illustration of the Info Tech industry's masturbation and ignorant
nature.


Dude, see a doctor, get some medication, and calm down!

Stan
Nov 14 '05 #3
vermicule <ra****@bigpond .net.au> writes:
"Xah Lee" <xa*@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.

--
Mns Rullgrd
mr*@inprovide.c om
Nov 14 '05 #4
"Xah Lee" <xa*@xahlee.org > writes:
[snip]

There's probably no point in asking Xah Lee not to cross-post his
rants, but if you feel the need to post a followup, *please* post only
to appropriate newsgroups. I read this in comp.lang.c, where neither
the original post nor any of the followups are even vaguely topical.

If you must post a followup, limit it to newsgroups where it's
appropriate. If there are none, just don't post.

I've directed followups on this article to /dev/null.

--
Keith Thompson (The_Other_Keit h) ks***@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.
Nov 14 '05 #5
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.

Nov 14 '05 #6

alex goldman <he***@spamm.er > writes:
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.


No, you're just confused 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

Nov 14 '05 #7
Sean Burke wrote:

alex goldman <he***@spamm.er > writes:
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.


No, you're just confused 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.
Nov 14 '05 #8
On Tue, 10 May 2005 04:58:48 -0700, alex goldman wrote:
Sean Burke wrote:


....
No, you're just confused 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.


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
Nov 14 '05 #9
Lawrence Kirby wrote:
On Tue, 10 May 2005 04:58:48 -0700, alex goldman wrote:
Sean Burke wrote:


...
No, you're just confused 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.


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.
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

198
7722
by: Sridhar R | last post by:
>From technical point of view, I could not understand the the reasoning behind using Java in major companies. Sure that Python, is used in some, but still Java is considered as a sure-job language. After being a python programmer for long time, I consider it painful to learn/use Java now (well, like many I will be forced to do that in my job). What makes such companies to choose Java over dynamic, productive languages like Python? ...
0
1536
by: Andy | last post by:
First of all, can I reassure you that this posting is NOT spam and not market research. Please feel free to email me at the address below to check/validate this message prior to doing the survey if you wish. I'm doing a piece of research looking at industry perceptions of computing graduates. The motivation behind this work is that I know a lots of academics who claim to know what industry wants, and lots of people in the industry who...
0
1613
by: Andy | last post by:
First of all, can I reassure you that this posting is NOT spam and not market research. Please feel free to email me at the address below to check/validate this message prior to doing the survey if you wish. I'm doing a piece of research looking at industry perceptions of computing graduates. The motivation behind this work is that I know a lots of academics who claim to know what industry wants, and lots of people in the industry who...
0
1857
by: natty2006 | last post by:
Submission Deadline extended: 13 November 2006 ************************************************************* IADIS INTERNATIONAL CONFERENCE APPLIED COMPUTING 2007 February 17-20, 2007 - SALAMANCA, SPAIN (http://www.computing-conf.org/)
13
1620
by: Xah Lee | last post by:
Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp ) kicked banned me. Here's the few relevant excerpt. (full, unedited excerpt will be published if there is a public interest) Begin excerpt: <xahleek, here is a simple problem but rather tedious to do it correctly. ....
14
2704
by: Aaron Watters | last post by:
So, in between skiing runs I noticed a Business Week cover story on "cloud computing". The article had lots of interesting information in it like about how somebody's mom used to be an airline stewardess and the interior decor of various office spaces. It was a truly excellent piece of journalism.
3
6706
by: Ty Oft | last post by:
Hello Bytes! Maybe my question seems a bit silly (as one could simply answer it "Well, what are you more passionate about?" or stuff like that - please don't answer like this), but I am in a bit of a dilemma and time is short at the moment and I need to make a decision before it's too late. I have just begun my second year in a UK uni for a BSc Hons Web Systems Development but I am not that happy about the course. Very diluted in my opinion....
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.