How to improve this sort?

C

Christopher Layne

CBFalconer said:
Don't snip attribution lines for material you quote. The
attribution lines are those that say "Foo wrote:" at the beginning.

What different does it make for simple replies? Also, do you not keep a
temporary archive of last posts in your newsreader?

Less crap for me to read - if I'm really interested in WHO wrote something, I
know where to find it. This should be the LEAST important information
pertinent to a response anyways.
 
B

Ben Pfaff

[reentrancy]
I cannot possibly take that as being across the board. But then again, it
might just be another case where we've to refer to OS specific manpages. I
thought the rule is that they were reentrant unless otherwise stated as not
required to be reentrant and/or was specifically NOT reentrant (strtok, etc)?

You may be confusing C with POSIX or SUSv3. C doesn't require
many functions to be reentrant (and doesn't have the concept of
threads), but SUSv3 requires most functions to be thread-safe
(and reentrant) and has an explicit list of functions that need
not be.
 
B

Ben Pfaff

Christopher Layne said:
What different does it make for simple replies? Also, do you not keep a
temporary archive of last posts in your newsreader?

Chuck is particularly sensitive about this kind of thing, but
it's considered kind to preserve attributions.
 
C

CBFalconer

Ben said:
Chuck is particularly sensitive about this kind of thing, but
it's considered kind to preserve attributions.

For one thing, the attribution allows one to evaluate the validity
of quoted material (in some cases). For example, if it comes from
werty, MI5, or Kenny McCormack it is immediately know to be
worthless. If it comes from Ben Pfaff, Chris Torek, Richard
Heathfield, it is expected to be pertinent. Just sample names that
immediately come to mind, omission (from either list) is not
significant. Inclusion is.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
C

Chris Dollin

Christopher said:
What different does it make for simple replies? Also, do you not keep a
temporary archive of last posts in your newsreader?

I don't. Why should I have to?
 
R

Richard Tobin

Do you mean existing library implementations? Allowing the comparison
function in qsort() to call qsort() couldn't break any user code.

If qsort is using static memory, it would.[/QUOTE]

How could it break user code, rather than the implementation of
qsort()?
Don't snip attribution lines for material you quote. The
attribution lines are those that say "Foo wrote:" at the beginning.

I know what attribution lines are, and I don't see the point of
keeping them all the way back.

-- Richard
 
R

Richard Tobin

Do you mean existing library implementations? Allowing the comparison
function in qsort() to call qsort() couldn't break any user code.
[/QUOTE]
If qsort() calls compare() and compare() calls qsort(), then it will
break things if qsort() is not reentrant.

Yes, exactly. I'm wondering why the standard didn't require this to
work. Presumably the answer is just that some existing qsort()
implementations (in the 1980s) weren't re-entrant.
Not sure why you would want to call qsort() from compare, but that's
neither here nor there.

It would probably reflect an inefficient design, but there may well be
cases where it's the natural solution.
If (for instance) a lame library qsort() had static read/write
variables in it, all heck would break loose if it was called in a
manner as described above.

As was the case with the ancient Solaris implementation someone posted.
They've fixed it now, but then they've probably made most library
functions re-entrant for thread safety.

-- Richard
 
D

Default User

comparison >> function in qsort() to call qsort() couldn't break any
user code.
If qsort is using static memory, it would.

How could it break user code, rather than the implementation of
qsort()?
Don't snip attribution lines for material you quote. The
attribution lines are those that say "Foo wrote:" at the beginning.

I know what attribution lines are, and I don't see the point of
keeping them all the way back.[/QUOTE]

Because it's useful to see who made all the various quoted passages.
Why is it worthwhile deleting them?




Brian
 
R

Richard Harter

If qsort is using static memory, it would.

How could it break user code, rather than the implementation of
qsort()?
Don't snip attribution lines for material you quote. The
attribution lines are those that say "Foo wrote:" at the beginning.

I know what attribution lines are, and I don't see the point of
keeping them all the way back.[/QUOTE]

There's no point to keeping them all the way back but one should keep
them for any quoted material.
 
C

CBFalconer

Who wrote the above?
Yes, exactly. I'm wondering why the standard didn't require this
to work. Presumably the answer is just that some existing qsort()
implementations (in the 1980s) weren't re-entrant.

Why do you want to hide the author of the first quote? That is, to
my mind, unethical. In fact it could be considered plagiarism.
 
C

Christopher Layne

CBFalconer said:
For one thing, the attribution allows one to evaluate the validity
of quoted material (in some cases). For example, if it comes from
werty, MI5, or Kenny McCormack it is immediately know to be
worthless. If it comes from Ben Pfaff, Chris Torek, Richard
Heathfield, it is expected to be pertinent. Just sample names that
immediately come to mind, omission (from either list) is not
significant. Inclusion is.

So are you admitting that you establish bias before even reading the quoted
material? Quite modern.
 
R

Richard Bos

Christopher Layne said:
So are you admitting that you establish bias before even reading the quoted
material? Quite modern.

Everybody does this. Not everybody admits to it. Perhaps being honest is
quite modern where you live; I have to say that over this way it's
considered an old-fashioned virtue.

Richard
 
R

Richard Heathfield

Christopher Layne said:
So are you admitting that you establish bias before even reading the
quoted material?

Of course. I do it every time I walk into a bookshop. It's full of quoted
material, but one glance at the attribution on the cover is normally
sufficient to give me the information I need on whether the quoted material
is something I want to spend my time investigating. For example, if it's
Kernighan, Stewart, or Pratchett, the answer is an unequivocal "yes". If
it's Schildt, the answer is an unequivocal "no" (except perhaps out of a
kind of macabre fascination with the unspeakably evil).
Quite modern.

Kind of you to say so, but being discerning in my reading choice is
something I've been doing for decades.
 
R

Richard Heathfield

CBFalconer said:
Who wrote the above?

Richard Tobin.
Why do you want to hide the author of the first quote? That is, to
my mind, unethical. In fact it could be considered plagiarism.

Plagiarising one's own work is not normally considered unethical.
 
R

Richard Heathfield

Default User said:

Why is it worthwhile deleting [attributions]?

The more there are, the more worthwhile it becomes to remove a few. The
optimum level is <= N, where N depends on what floats your boat. For me,
N = 6 (for various values of 6).
 
D

Default User

Richard said:
Default User said:

Why is it worthwhile deleting [attributions]?

The more there are, the more worthwhile it becomes to remove a few.
The optimum level is <= N, where N depends on what floats your boat.
For me, N = 6 (for various values of 6).

That generally means that unnecessary text has been left quoted. Once
you get that deep into quote levels, the chances are pretty good that
the earlier stuff needs to be excised completely. If it is still
relevant, then the attributions are as well.




Brian
 
C

Christopher Layne

Richard Heathfield wrote:

Of course. I do it every time I walk into a bookshop. It's full of quoted
material, but one glance at the attribution on the cover is normally
sufficient to give me the information I need on whether the quoted material
is something I want to spend my time investigating. For example, if it's
Kernighan, Stewart, or Pratchett, the answer is an unequivocal "yes". If
it's Schildt, the answer is an unequivocal "no" (except perhaps out of a
kind of macabre fascination with the unspeakably evil).

Yes - I do this as well. You know why? Because I most likely have to open the
book and wade through it.

But a paragraph of contextual information like a usenet reply usually doesn't
require as much pre-measurement to just read and then determine
afterwards "looks like crap or not." At that people you can then check the
sender and see, oh Richard Heathfield wrote that - there's probably some
validity to it and maybe I should examine why I thought it looked bogus in
the first place.
 
K

Keith Thompson

Christopher Layne said:
But a paragraph of contextual information like a usenet reply usually doesn't
require as much pre-measurement to just read and then determine
afterwards "looks like crap or not." At that people you can then check the
sender and see, oh Richard Heathfield wrote that - there's probably some
validity to it and maybe I should examine why I thought it looked bogus in
the first place.

Most newsreaders (in fact, all the ones I know of) provide attribution
lines automatically. Even Google Groups does so. All you have to do
is leave them in place rather than manually deleting them.

Quoting someone else's words without attribution is rude, especially
when it's easier to provide attribution than to delete it.
 
R

Richard Heathfield

Christopher Layne said:

But a paragraph of contextual information like a usenet reply usually
doesn't require as much pre-measurement to just read and then determine
afterwards "looks like crap or not." At that people you can then check the
sender and see, oh Richard Heathfield wrote that - there's probably some
validity to it and maybe I should examine why I thought it looked bogus in
the first place.

This happened to me in comp.programming recently. Some guy posted what
looked at first glance like a load of bizarre techno-babble about some new
data structure or other. "Yeah, right", thought I. "Who wrote this junk
anyway?" Well, it turned out to be Ben Pfaff. Which, of course, meant that
it wasn't junk at all, because Ben Pfaff doesn't waste time with junk - and
that meant I had to read the whole darn thing over again to find out what
he was actually getting at.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top