[12845] in Perl-Users-Digest
Perl-Users Digest, Issue: 255 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 25 23:07:21 1999
Date: Sun, 25 Jul 1999 20:05:07 -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, 25 Jul 1999 Volume: 9 Number: 255
Today's topics:
"use strict" for HTML (Tramm Hudson)
Re: Extracting plain text from email (Michael Rubenstein)
Re: Extracting plain text from email <tchrist@mox.perl.com>
Re: Extracting plain text from email (Michael Rubenstein)
Re: Extracting plain text from email <tchrist@mox.perl.com>
Re: Extracting plain text from email (Michael Rubenstein)
Re: Extracting plain text from email (Abigail)
Re: Extracting plain text from email <tchrist@mox.perl.com>
Re: Extracting plain text from email <tchrist@mox.perl.com>
Re: Geekspeak Programming Contest (Abigail)
Re: Geekspeak Programming Contest <tchrist@mox.perl.com>
Getting page title <jcarrio@imagelink.com.br>
Re: Getting page title <NOSPAMebin111@yahoo.com>
Re: Getting page title (Abigail)
Re: newlines et al, was Re: remove records from databas (Abigail)
Re: perl and java <jcarrio@imagelink.com.br>
Re: random (Abigail)
Re: random (Tony Greenwood)
Re: random (elephant)
Re: reg expression (Abigail)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Jul 1999 20:27:49 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: "use strict" for HTML
Message-Id: <7ngh35$4jo@llama.swcp.com>
{Posted and cc'd to cited author}
Hi, again jason.
> ... as a developer I'd like there to be a '-w' and 'use
> strict' option for IE - you're right .. Navigator currently is my 'use
> strict' option *8^) .. view source is my '-w' .. there aint no 'use
> diagnostics' equivalent
Sure there is -- use an HTML validator such as the freely avaialble
one at w3.org. On all of my HTML documents I have the footer:
<A HREF="http://validator.w3.org/check?weblint;pw;ss;uri=http://www.swcp.com/~hudson/index.html">
<IMG BORDER=0 SRC="http://validator.w3.org/images/vh40.gif"
ALT="Valid HTML 4.0!" HEIGHT=31 WIDTH=88 ALIGN=middle></A>
which will alerts the user that I care about legal HTMl and being
interoperable with all clients. If you write valid HTML you do
not need to worry about incompatabilities with the "parsers" in
Netscape, Exploder or other "products".
But no one else seems to care about this sort of thing. Except
maybe Abigail, who complains about the lack of parsing in HTML::Parse.
Followups set since this is off topic already.
Tramm
--
o hudson@swcp.com tbhudso@cs.sandia.gov O___|
/|\ http://www.swcp.com/~hudson/ H 505.323.38.81 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: Mon, 26 Jul 1999 01:13:01 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Extracting plain text from email
Message-Id: <37acb0d6.107002551@nntp.ix.netcom.com>
On 25 Jul 1999 18:21:37 -0700, Tom Christiansen
<tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc,
> miker3@ix.netcom.com (Michael Rubenstein) writes:
>:It's also difficult to miss that some posters do otherwise and,
>:except on this newsgroup, are not insulted for it.
>
>Immigrants need to learn the ways of their adopted land, not force their
>foreign ways on the their new neighbors. And when someone points out
>that they're driving on the wrong side of the street, they should be
>happy to learn the custom the easy way.
Immigrants (and, more to the point, visitors) need to learn the
RULES of their adopted land ... We expect immigrants to follow
our laws. We do not expect them to eat the same foods, adopt our
religions (at least not in the United States), and agree with our
views.
It is resonable to expect posters to follow the guidelines in the
articles in news.announce.newusers and to follow guidelines in
the FAQ or other newsgropu documents. Expecting them to guess
customs from what is most common is not. Expecting them to
figure out and adopt the customs of each neighborhood is not.
Insulting them because they do not share ones views is not.
I have seen no document saying that putting the response after
the quote is a rule of this, or any other, newsgroup. What
posters see is a few other posters who claim that they should do
so and insult them if they do not.
None of the other newsgroups I read show the intolerance that I
see in this one. I object strongly to the inability of too many
here to respect differing opinions.
------------------------------
Date: 25 Jul 1999 19:31:26 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Extracting plain text from email
Message-Id: <379bba6e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
miker3@ix.netcom.com (Michael Rubenstein) writes:
:On 25 Jul 1999 18:21:37 -0700, Tom Christiansen
:<tchrist@mox.perl.com> wrote:
:
:> [courtesy cc of this posting mailed to cited author]
:>
:>In comp.lang.perl.misc,
:> miker3@ix.netcom.com (Michael Rubenstein) writes:
:>:It's also difficult to miss that some posters do otherwise and,
:>:except on this newsgroup, are not insulted for it.
:>
:>Immigrants need to learn the ways of their adopted land, not force their
:>foreign ways on the their new neighbors. And when someone points out
:>that they're driving on the wrong side of the street, they should be
:>happy to learn the custom the easy way.
:
:Immigrants (and, more to the point, visitors) need to learn the
:RULES of their adopted land ... We expect immigrants to follow
:our laws. We do not expect them to eat the same foods, adopt our
:religions (at least not in the United States), and agree with our
:views.
:
:It is resonable to expect posters to follow the guidelines in the
:articles in news.announce.newusers and to follow guidelines in
:the FAQ or other newsgropu documents. Expecting them to guess
:customs from what is most common is not. Expecting them to
:figure out and adopt the customs of each neighborhood is not.
:Insulting them because they do not share ones views is not.
:
:I have seen no document saying that putting the response after
:the quote is a rule of this, or any other, newsgroup. What
:posters see is a few other posters who claim that they should do
:so and insult them if they do not.
:
:None of the other newsgroups I read show the intolerance that I
:see in this one. I object strongly to the inability of too many
:here to respect differing opinions.
My opinion is that you should read that again:
:On 25 Jul 1999 18:21:37 -0700, Tom Christiansen
:<tchrist@mox.perl.com> wrote:
:
:> [courtesy cc of this posting mailed to cited author]
:>
:>In comp.lang.perl.misc,
:> miker3@ix.netcom.com (Michael Rubenstein) writes:
:>:It's also difficult to miss that some posters do otherwise and,
:>:except on this newsgroup, are not insulted for it.
:>
:>Immigrants need to learn the ways of their adopted land, not force their
:>foreign ways on the their new neighbors. And when someone points out
:>that they're driving on the wrong side of the street, they should be
:>happy to learn the custom the easy way.
:
:Immigrants (and, more to the point, visitors) need to learn the
:RULES of their adopted land ... We expect immigrants to follow
:our laws. We do not expect them to eat the same foods, adopt our
:religions (at least not in the United States), and agree with our
:views.
:
:It is resonable to expect posters to follow the guidelines in the
:articles in news.announce.newusers and to follow guidelines in
:the FAQ or other newsgropu documents. Expecting them to guess
:customs from what is most common is not. Expecting them to
:figure out and adopt the customs of each neighborhood is not.
:Insulting them because they do not share ones views is not.
:
:I have seen no document saying that putting the response after
:the quote is a rule of this, or any other, newsgroup. What
:posters see is a few other posters who claim that they should do
:so and insult them if they do not.
:
:None of the other newsgroups I read show the intolerance that I
:see in this one. I object strongly to the inability of too many
:here to respect differing opinions.
There, was that useful?
Good.
Now listen. The right way to post it 200% reversed from what
I am demo'ing here. Do *not* quote the whole thing. Do *not*
forget to trim. Do *not* forget to interleave.
--tom
--
"I never met a chocolate I didn't like."
--Deanna Troi, ST:TNG
------------------------------
Date: Mon, 26 Jul 1999 01:53:23 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Extracting plain text from email
Message-Id: <37aebcbe.110050624@nntp.ix.netcom.com>
On Mon, 26 Jul 1999 02:27:23 +0200, "Alan J. Flavell"
<flavell@mail.cern.ch> wrote:
>On Mon, 26 Jul 1999, Michael Rubenstein wrote:
>
>> It's also difficult to miss that some posters do otherwise and,
>> except on this newsgroup, are not insulted for it.
>
>You seem to have a remarkably sheltered experience of usenet, and
>an over-sensitive standard of "insult".
>
>If there's any "insult" going on here, it's people striding into a forum
>they haven't bothered to understand, and immediately stating their
>intention of setting their own rules. No wonder the existing
>participants occasionally get crabby.
I repeat. Where is the rule that says responses must follow
quotes? All I see is a few people complaining about it. None
You don't think your response is insulting? What I see is people
posting on a forum, following the guidelines in news. They are
not setting their own rules; at least I've never seen any of them
claim that theire method is the way everyone should post. What I
see is you, and others, making up rules that do not seem to
appear in any document.
Your post is a good example of what I mean by insulting. You
characterise them as not understanding rather than accepting the
fact they they have an opinion and are just as entitled to their
opinion as you are to yours.
------------------------------
Date: 25 Jul 1999 20:11:23 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Extracting plain text from email
Message-Id: <379bc3cb@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, miker3@ix.netcom.com (Michael Rubenstein) writes:
:I repeat. Where is the rule that says responses must follow
:quotes?
Subject: FREQUENTLY IGNORED ADVICE: your quoting strategy
Message-ID: <379bbaf8@cs.colorado.edu>
Date: 25 Jul 1999 19:33:44 -0700
The following message will be posted daily until posters get a clue.
Enjoy.
--tom
==================================================================
EXECUTIVE SUMMARY:
To send better messages, please trim and summarize what you're
replying to, and integrate your quoted text with the body of your
message. Don't just put everything at the end.
LONG STORY:
Wouldn't you like to make your messages easier for others to read and
understand? If so, I have some news posting tips for you. If not,
just ignore this. (Of course, if you don't want your messages
easier to read and understand, it's not clear why to bother to
send them in the first place. :-) I'm going to take a bit of
time to explain this, because newcomers to Usenet often lack the
cultural background were I to send a superbrief message.
Here's the issue: you appear to have quoted the entire message to which
you were replying. Worst of all, you have done so by merely appending
the complete message at the bottom. Folks are used to reading the
original material first, then the follow-up. That's why it's called a
"follow-up", you know. :-)
If all you want to do is forward a copy of the message, that's one thing,
but here you seem to have just blindly pasted the complete old message at
the end without providing any content. This is neither a proper public
followup nor even a decent private reply. Here's why.
First of all, this is massive overkill -- you're supposed to trim your
quoted text to only what you're replying to. Otherwise you'll probably
violate the netiquette target quoting percentage of 50%. See below.
This isn't really an issue of space (I know that a few bytes here and
there mean less today than 20 years go), so much as it is of integrating
your comments with the old material for continuity.
Second, putting everything at the bottom does little good. It doesn't
provide the proper context. It's far too late. When you reply to
someone's content, the reason you quote the previous message is so that
you can provide some degree of contextual continuity. The best way to
do this is to interleave what you're quoting with your responses to that
particular piece. That means that you should provide a quoted portion,
then address what the points therein, then another quoted section, etc.
For example, here's how followup replies *should* look if you'd
like them to be more effective.
> Joe said we should eat noodles.
But I don't like noodles. They are a pain to prepare -- remember
that what started this thread was how to cook using only a microwave,
not real cooking -- and they provide you with very little sustenance
in the long run. It's like eating cardboard, nutritionally speaking.
> He also suggests adding anchovies.
What is this fish fetish? Not all of us like the little minnows
with the lingering briny taste swimming around our mouths for the
next few hours or days. Can you imagine this on a date? Iccccch!
Notice how in the text above, alternate quoted passages are interleaved
with new response text. Notice also that the new text far exceeds the
old text. This is the way it should be.
If you are receiving this message in response to a news posting, please
understand that all modern newsreaders provide a mechanism to fetch
the parent article, so it is seldom necessary to quote the whole thing.
Sometimes even mail readers provide this, depending on the mail headers
and the list archival mechanism on your own system.
Here's a section from the essential netiquette guide, "A Primer
on How to Work With the Usenet Community", which is available in
news.announce.newusers. Perhaps your service provider neglected to point
you at this newsgroup before you got swallowed up by all of Usenet.
It's not only a good read; it's critical to understanding the culture
you're now moving in.
Summarize What You are Following Up.
When you are following up someone's article, please summarize the
parts of the article to which you are responding. This allows readers
to appreciate your comments rather than trying to remember what the
original article said. It is also possible for your response to get
to some sites before the original article.
Summarization is best done by including appropriate quotes from
the original article. Do not include the entire article since it
will irritate the people who have already seen it. Even if you are
responding to the entire article, summarize only the major points you
are discussing.
I've already given a good example of how you should be quoting followup
responses, and told you why this is a much better approach then what
you've done. Now, by way of demonstration, I'll show you the bad way.
At the end of this message, I include a forwarding of your complete
original, unaltered save for its quoted material. Please note how
completely useless this is, because at no point in the real message do
I pull in summarized portions of your original. In fact, I'm not even
using the data in your message. See how clumsy and unneeded this is?
It's very annoying, too.
It's even more annoying when people needlessly quote the original's
automatic trailing matter, like signatures, adverts, or disclaimers.
Please don't do that.
I'm honestly not trying to annoy you! I'm just trying to give tips
about what works well in electronic messages, and what doesn't. This
used to be standard fare before one got a Usenet account, but now
something seems to be lost.
--
I don't believe it's written in Perl, though it probably
ought to have been. :-)
--Larry Wall in <1995Feb21.180249.25507@netlabs.com>
------------------------------
Date: Mon, 26 Jul 1999 02:16:09 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Extracting plain text from email
Message-Id: <37afbfb9.110813731@nntp.ix.netcom.com>
On 25 Jul 1999 19:31:26 -0700, Tom Christiansen
<tchrist@mox.perl.com> wrote:
[quotes elided]
>Now listen. The right way to post it 200% reversed from what
>I am demo'ing here. Do *not* quote the whole thing. Do *not*
>forget to trim. Do *not* forget to interleave.
Do not forget to recognize that others have as much right to
their opinions as you have to yours.
Your example clearly overquoted and that certainly is contrary to
ghe guidelines in news.announce.newuser. We certainly should
expect everyone to follow that guideline. Where is the guideline
that says responses must come after quotes?
There's nothing wrong with letting people know that you find
their posting style difficult to follow. There's nothing wrong
with trying to convince them that yours is superior. But look at
it from the point of view of the other person. He sees an
opinion. He has the right to disagree with it. When you start
simply asserting that your method is right, you've lost all point
to the discussion.
This post is a good example of what I mean. You aren't trying to
reason. You are simply asserting that you are right. Your
example is obviously outrageous, but has nothing to do with the
post that started this.
You don't have to convince me that this is a better way to post.
I always put the quote before the response or interleave and
prefer it in messages I read. The difference is that I recognize
that others who are intelligent and well meaning may hold
different opinions.
------------------------------
Date: 25 Jul 1999 21:22:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Extracting plain text from email
Message-Id: <slrn7pnhi1.f12.abigail@alexandra.delanet.com>
Michael Rubenstein (miker3@ix.netcom.com) wrote on MMCLV September
MCMXCIII in <URL:news:37aebcbe.110050624@nntp.ix.netcom.com>:
''
'' Where is the rule that says responses must follow quotes?
Common sense. It's on the same page that says you shouldn't
sort all the letters in your response.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Jul 1999 20:27:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Extracting plain text from email
Message-Id: <379bc78d@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
miker3@ix.netcom.com (Michael Rubenstein) writes:
:Where is the guideline
:that says responses must come after quotes?
I repeat.
+---------------------------------------------------------------------------+
| Here's a section from the essential netiquette guide, "A Primer |
| on How to Work With the Usenet Community", which is available in |
| news.announce.newusers. Perhaps your service provider neglected to point |
| you at this newsgroup before you got swallowed up by all of Usenet. |
| It's not only a good read; it's critical to understanding the culture |
| you're now moving in. |
+---------------------------------------------------------------------------+
+----------------------------------------------+
| +------------------------------------------+ |
| | +--------------------------------------+ | |
| | | Summarize What You are Following Up. | | |
| | +--------------------------------------+ | |
| +------------------------------------------+ |
+----------------------------------------------+
+------------------------------------------------------------------------+
| When you are following up someone's article, please summarize the |
| parts of the article to which you are responding. This allows readers |
| to appreciate your comments rather than trying to remember what the |
| original article said. It is also possible for your response to get |
| to some sites before the original article. |
+------------------------------------------------------------------------+
+-----------------------------------------------------------------------+
| Summarization is best done by including appropriate quotes from |
| the original article. Do not include the entire article since it |
| will irritate the people who have already seen it. Even if you are |
| responding to the entire article, summarize only the major points you |
| are discussing. |
+-----------------------------------------------------------------------+
Subject: FREQUENTLY IGNORED ADVICE: your quoting strategy
Message-ID: <379bbaf8@cs.colorado.edu>
Date: 25 Jul 1999 19:33:44 -0700
The following message will be posted daily until posters get a clue.
Enjoy.
--tom
==================================================================
EXECUTIVE SUMMARY:
To send better messages, please trim and summarize what you're
replying to, and integrate your quoted text with the body of your
message. Don't just put everything at the end.
LONG STORY:
Wouldn't you like to make your messages easier for others to read and
understand? If so, I have some news posting tips for you. If not,
just ignore this. (Of course, if you don't want your messages
easier to read and understand, it's not clear why to bother to
send them in the first place. :-) I'm going to take a bit of
time to explain this, because newcomers to Usenet often lack the
cultural background were I to send a superbrief message.
Here's the issue: you appear to have quoted the entire message to which
you were replying. Worst of all, you have done so by merely appending
the complete message at the bottom. Folks are used to reading the
original material first, then the follow-up. That's why it's called a
"follow-up", you know. :-)
If all you want to do is forward a copy of the message, that's one thing,
but here you seem to have just blindly pasted the complete old message at
the end without providing any content. This is neither a proper public
followup nor even a decent private reply. Here's why.
First of all, this is massive overkill -- you're supposed to trim your
quoted text to only what you're replying to. Otherwise you'll probably
violate the netiquette target quoting percentage of 50%. See below.
This isn't really an issue of space (I know that a few bytes here and
there mean less today than 20 years go), so much as it is of integrating
your comments with the old material for continuity.
Second, putting everything at the bottom does little good. It doesn't
provide the proper context. It's far too late. When you reply to
someone's content, the reason you quote the previous message is so that
you can provide some degree of contextual continuity. The best way to
do this is to interleave what you're quoting with your responses to that
particular piece. That means that you should provide a quoted portion,
then address what the points therein, then another quoted section, etc.
For example, here's how followup replies *should* look if you'd
like them to be more effective.
> Joe said we should eat noodles.
But I don't like noodles. They are a pain to prepare -- remember
that what started this thread was how to cook using only a microwave,
not real cooking -- and they provide you with very little sustenance
in the long run. It's like eating cardboard, nutritionally speaking.
> He also suggests adding anchovies.
What is this fish fetish? Not all of us like the little minnows
with the lingering briny taste swimming around our mouths for the
next few hours or days. Can you imagine this on a date? Iccccch!
Notice how in the text above, alternate quoted passages are interleaved
with new response text. Notice also that the new text far exceeds the
old text. This is the way it should be.
If you are receiving this message in response to a news posting, please
understand that all modern newsreaders provide a mechanism to fetch
the parent article, so it is seldom necessary to quote the whole thing.
Sometimes even mail readers provide this, depending on the mail headers
and the list archival mechanism on your own system.
Here's a section from the essential netiquette guide, "A Primer
on How to Work With the Usenet Community", which is available in
news.announce.newusers. Perhaps your service provider neglected to point
you at this newsgroup before you got swallowed up by all of Usenet.
It's not only a good read; it's critical to understanding the culture
you're now moving in.
Summarize What You are Following Up.
When you are following up someone's article, please summarize the
parts of the article to which you are responding. This allows readers
to appreciate your comments rather than trying to remember what the
original article said. It is also possible for your response to get
to some sites before the original article.
Summarization is best done by including appropriate quotes from
the original article. Do not include the entire article since it
will irritate the people who have already seen it. Even if you are
responding to the entire article, summarize only the major points you
are discussing.
I've already given a good example of how you should be quoting followup
responses, and told you why this is a much better approach then what
you've done. Now, by way of demonstration, I'll show you the bad way.
At the end of this message, I include a forwarding of your complete
original, unaltered save for its quoted material. Please note how
completely useless this is, because at no point in the real message do
I pull in summarized portions of your original. In fact, I'm not even
using the data in your message. See how clumsy and unneeded this is?
It's very annoying, too.
It's even more annoying when people needlessly quote the original's
automatic trailing matter, like signatures, adverts, or disclaimers.
Please don't do that.
I'm honestly not trying to annoy you! I'm just trying to give tips
about what works well in electronic messages, and what doesn't. This
used to be standard fare before one got a Usenet account, but now
something seems to be lost.
--
"No problem is so formidable that you can't walk away from it."
--C. Schulz
------------------------------
Date: 25 Jul 1999 20:28:10 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Extracting plain text from email
Message-Id: <379bc7ba@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, miker3@ix.netcom.com (Michael Rubenstein) writes:
:Where is the guideline
:that says responses must come after quotes?
This is question and answer, not answer and question.
We aren't playing Jeopardy.
--tom
--
char program[1]; /* Unwarranted chumminess with compiler. */
--Larry Wall in the Perl source code
(quoting Henry Spencer (quoting Dennis Ritchie (quoting Brian Kerninghan)))
------------------------------
Date: 25 Jul 1999 21:32:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Geekspeak Programming Contest
Message-Id: <slrn7pni3q.f12.abigail@alexandra.delanet.com>
Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote on MMCLV September
MCMXCIII in <URL:news:slrn7pnas9.qvu.sholden@pgrad.cs.usyd.edu.au>:
%%
%% The second solution is correct. Since whoever came up with this AD, BC calend
%% thing (a monk I suspect) wasn't a computer programmer he counted from 1 not 0
%% Hence the year 1 BC is followed by the year 1 AD, there is no year 0. Of cour
%% this is a perl newsgroup that has very little to do with calenders, so I'm
%% probably wrong.
Even if he were a computer programmer, he still wouldn't have counted
from 0. To be able to count from 0, you must know what 0 is. He, and
the society around him didn't. Only later would Arab trading bring
this Indian invention to Europe.
Europe was in its dark ages after all.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Jul 1999 20:43:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Geekspeak Programming Contest
Message-Id: <379bcb61@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
abigail@delanet.com writes:
:Even if he were a computer programmer, he still wouldn't have counted
:from 0. To be able to count from 0, you must know what 0 is. He, and
:the society around him didn't. Only later would Arab trading bring
:this Indian invention to Europe.
One-based versus zero-based is also why the hours of 1-12 before noon
were all orginally "AM" and those of 1-12 after noon were all originally
"PM". There was no zero for the hour. Yes, that meant that the hour
of 12 noon was deemed AM and 12 midnight deemed PM. It couldn't go
PM until after noon, and noon couldn't be *after* noon, so it must
have been AM. (I know, I know, you can argue the other way, too. :-)
Possibly more interesting was that midnight constituted the final hour
of the previous day and date, not the beginning of the subsequent one.
Most people being now comfortable with 0 tend to define them the other way
(noon as PM and midnight as AM), if at all. But it didn't always used
to be that way, and you'll still now and then run across people who swear
it's the other way around. It's probably more reasonable to exempt noon
and midnight from that scheme altogether. I suggest writing "noon" and
"midnight", not "12:00am" or "12:00pm", as the former are unabiguous and
the latter are not. I know -- it's a problem in a numeric-only input
field, but works just fine for speech or free-form correspondence.
And while computers and the military enjoy the zero-based notion of
"00:00", this doesn't seem to go over well in the streets of America.
--tom, waiting for metric time
--
"I know of no country in which there is so little independence of mind and
real freedom of discussion as in America."
- Alexis de Toqueville
------------------------------
Date: Sun, 25 Jul 1999 21:37:47 -0300
From: Julio Carrio <jcarrio@imagelink.com.br>
Subject: Getting page title
Message-Id: <379BADDB.3ADCC409@imagelink.com.br>
Hi there,
Exists some way to get just the page title instead of loading it
totally?
Thanks, Julio Carrio
------------------------------
Date: Sun, 25 Jul 1999 19:11:56 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: Getting page title
Message-Id: <ryPm3.572$zJ.25300@typhoon-sf.snfc21.pbi.net>
$text=~ /<title>(.*)</title>/;
$1= your title
Not sure if the syntax is perfect, but this is the general drift: by
enclosing the wildcard in braces, the matched expression should be saved
into the variable $1.
George
Julio Carrio <jcarrio@imagelink.com.br> wrote in message
news:379BADDB.3ADCC409@imagelink.com.br...
> Hi there,
>
> Exists some way to get just the page title instead of loading it
> totally?
>
> Thanks, Julio Carrio
>
>
------------------------------
Date: 25 Jul 1999 21:41:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting page title
Message-Id: <slrn7pnikq.f12.abigail@alexandra.delanet.com>
Julio Carrio (jcarrio@imagelink.com.br) wrote on MMCLV September MCMXCIII
in <URL:news:379BADDB.3ADCC409@imagelink.com.br>:
``
`` Exists some way to get just the page title instead of loading it
`` totally?
What *are* you talking about?
If you mean the title of HTML pages, then, the answer is, yes, of course.
The title will always be relatively in the beginning, and you can always
close the socket as soon as you've got the title.
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Jul 1999 21:10:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: newlines et al, was Re: remove records from database
Message-Id: <slrn7pngql.f12.abigail@alexandra.delanet.com>
Alan J. Flavell (flavell@mail.cern.ch) wrote on MMCLV September MCMXCIII
in <URL:news:Pine.HPP.3.95a.990726015452.10249B-100000@hpplus03.cern.ch>:
$$ On 25 Jul 1999, Abigail wrote:
$$
$$ > '' Your newsclient is broken: it should be sending \n not \r\n to deliminate
$$ > '' lines.
$$ >
$$ > Nice try, but if you read RFC 822 (which forms the bases for RFC 850,
$$ > format of Usenet messages) then you will see that his newclient is
$$ > *CORRECT*.
$$
$$ However, we seem to have a notation problem here, since (if I've learned
$$ my cross-platform lessons correctly) \r and \n do not denote unambiguous
$$ characters to send on a network connection. Instead, they denote
$$ internal representations of control functions, whose representations
$$ differ from platform to platform.
$$
$$ If you want to refer to \012 and \015, then could I respectfully suggest
$$ there would be less confusion if you would say so directly.
You are correct. I realized I should have mentioned \012 and \015
after I posted it, but then I thought someone else would as well.
man perlipc explains why.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 25 Jul 1999 20:52:05 -0300
From: Julio Carrio <jcarrio@imagelink.com.br>
To: Marc Simard <marc@multicorpora.ca>
Subject: Re: perl and java
Message-Id: <379BA325.80CE10FA@imagelink.com.br>
Marc Simard wrote:
> Hi !
> I jus want to know how can i make my perl script write "print" for
> javascript line so it cna be inserted in my
> web page.
> exemple : print "<STYLE type="text/css">"
> print "<!-- A.URLTitle {text-decoration: none;} -->"
Try: print "<STYLE type=\x22text/css\x22>"
print "<!-- A.URLTitle {text-decoration: none;} -->"
Regards, Julio Carrio.
------------------------------
Date: 25 Jul 1999 20:08:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: random
Message-Id: <slrn7pnd69.f12.abigail@alexandra.delanet.com>
Tony Greenwood (tony@webscripts.org) wrote on MMCLIV September MCMXCIII
in <URL:news:37acff1b.11867048@news.freeserve.co.uk>:
;;
;;
;; I am generating a random number between 2 and 7
;;
;; What I would like to do is fix it so 4,5 and 6 appear more often.
;;
;; I can think of one way and thats to put the numbers 2-7 into an array
;; 50 cells long and put more 4,5 and 6 in than the others and random the
;; 50. This should work as theers more chance of getting those numbers if
;; they appear in the array more.. common sense? :)
;;
;; However it does seem a long way around the problem. is there a better
;; way ?
Define 'better'. I certainly wouldn't put 2 - 7 in a 50 element array.
(2 .. 7, 4 .. 6) is more than enough. Or you could just draw from 0 .. 8,
and map that to 2 .. 7, 4 .. 6. The latter takes less space (though only
minimal) while the former easily generalizes.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 26 Jul 1999 02:45:20 GMT
From: tony@webscripts.org (Tony Greenwood)
Subject: Re: random
Message-Id: <37a0c862.30020512@news.freeserve.co.uk>
Hey! abigail@delanet.com (Abigail)
>;; I can think of one way and thats to put the numbers 2-7 into an array
>;; 50 cells long and put more 4,5 and 6 in than the others and random the
>;; However it does seem a long way around the problem. is there a better
>;; way ?
>
>
>Define 'better'. I certainly wouldn't put 2 - 7 in a 50 element array.
By 'better' I was looking to see if there was a less cumbersome way of
doing the task. My method seemed long winded. it is a method I have
used in BASIC and C but Perl has a reputation (in my eyes) for shall
we say more compact code.
Also it is a learning process.. fix the problem or make the code
myself, then double check to make sure there wasn't an easier way.
does that sound like a reasonable approach?:)
>(2 .. 7, 4 .. 6) is more than enough. Or you could just draw from 0 .. 8,
>and map that to 2 .. 7, 4 .. 6. The latter takes less space (though only
My requirements are to random select one of the numbers but it should
be fixed/weighted so .
5% get 7
10% get 6
20% get 5
35% get 4
25% get 3
5% get 2
I used the number 50 off the top of my head while typing this post.. I
have now landed on a 20 element array as it was easier (for me) to
figure out the correct amounts given the required percentage .
It works :)
--
Tony Greenwood
PORTFOLIO www.webscripts.org
------------------------------
Date: Mon, 26 Jul 1999 12:44:10 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: random
Message-Id: <MPG.1206768a31c98482989b78@news-server>
[ item posted to comp.lang.perl.misc and CCed to Tony Greenwood ]
Abigail writes ..
>Tony Greenwood (tony@webscripts.org) wrote on MMCLIV September MCMXCIII
>in <URL:news:37acff1b.11867048@news.freeserve.co.uk>:
>;;
>;;
>;; I am generating a random number between 2 and 7
>;;
>;; What I would like to do is fix it so 4,5 and 6 appear more often.
>
>Define 'better'. I certainly wouldn't put 2 - 7 in a 50 element array.
>(2 .. 7, 4 .. 6) is more than enough. Or you could just draw from 0 .. 8,
>and map that to 2 .. 7, 4 .. 6. The latter takes less space (though only
>minimal) while the former easily generalizes.
you should have asked for a definition of 'more often' .. you seem to be
assuming here that Tony wanted "twice" as often .. also - as a matter of
interest only .. how does the latter use less space ?
Tony .. the only addition that I have to the '50 elements' solution is
that if the probability of receiving a 2, 3 or 7 should be equal and the
probability of receiving a 4, 5 or 6 should be equal then you could
dispense with the 50 element array and get more exact by using the ratios
eg.
if you want 4, 5 and 6 to come up 1.2 times as often as 2, 3 and 7 then
you could do the following
1.2 times as often means a ratio of 5:6 .. and we have three of the lower
probability elements and three of the higher probability elements ..
hence we need 15 lower markers and 18 higher markers .. time for some
code
#!/usr/bin/perl -w
use strict;
my $p1 = 5; # probability of the first group
my $e1 = 3; # number of elements in the first group
my $p2 = 6; # probability of the second group
my $e2 = 3; # number of elements in the second group
my $r = $p1 * $e1 + $p2 * $e2; # overall sample (33 in this example)
my @d = ( 2,3,7 # first group - $e1 elements
, 4..6 # second group - $e2 elements
);
my $x = int rand( $r); # random 0 to 32 number
# this is the only really complicated bit .. basically it's saying that
# if the number we picked out of 33 is less than 15 then split it into
# 0, 1 or 2 by dividing by 5 .. otherwise split the difference of 33
# and 15 into 3, 4 or 5 by dividing by 6 then adding 3
$x = int( ( $x < ($p1*$e1) ? $x / $p1 : $e1 + ($x - ($p1*$e1)) / $p2));
my $randomised = $d[$x];
__END__
--
jason - remove all hyphens for email reply -
------------------------------
Date: 25 Jul 1999 20:11:49 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: reg expression
Message-Id: <slrn7pnddd.f12.abigail@alexandra.delanet.com>
llornkcor (llornkcor@llornkcor.com) wrote on MMCLIV September MCMXCIII in
<URL:news:hfmsqt47.fsf@wind.localdomain>:
~~ Is there any wild card expressions ? I would like to delete all <img
~~ src="blah blah blah"> tags. Not knowing what the actual url of the
~~ image is. How could I match all the characters from < to >?
To match all characters from < to >, one would use /<[^>]*>/.
But that doesn't solve the problem you are describing. (It may
appear to solve it some cases, but then it'll bite you later.)
The problem you describe is asked in variants about 37 times a day.
It's also a FAQ. Go to school, and learn to read. Then read.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V9 Issue 255
*************************************