Tuesday, April 13, 2010

comp.lang.c - 25 new messages in 6 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* Endless arguing - 5 messages, 3 authors
http://groups.google.com/group/comp.lang.c/t/a99361379a499175?hl=en
* small question - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.c/t/08850414dcd0b366?hl=en
* Son of Snarky Tirade: a response to Seebach's new CTCN: part 1 - 10 messages,
6 authors
http://groups.google.com/group/comp.lang.c/t/383e6d5a95dc3f75?hl=en
* seebs/schildt II - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.c/t/c86133d7ad6b90c2?hl=en
* In the Matter of Herb Schildt: a Detailed Analysis of "C: The Complete
Nonsense" - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/caf17fab4e7d8530?hl=en
* error - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/1d16924d271398d9?hl=en

==============================================================================
TOPIC: Endless arguing
http://groups.google.com/group/comp.lang.c/t/a99361379a499175?hl=en
==============================================================================

== 1 of 5 ==
Date: Tues, Apr 13 2010 1:33 am
From: Nick Keighley


On 12 Apr, 21:07, jacob navia <ja...@spamsink.net> wrote:
> Ersek, Laszlo a écrit :


> > If I ever intended to unify iterator interfaces at all, that was about
> > the end of it. As soon as I wanted to bolt something "really useful" on
> > an iterator interface, it was immediately shown to be container
> > specific. I took it as proof that my pursuit is futile.
>
> I have found the solution.
>
> There is the "Iterator" object with 3 fields:
>
> GetNext
> GetPrevious

might that be expensive with some containers?

> GetFirst

<snip>


== 2 of 5 ==
Date: Tues, Apr 13 2010 1:43 am
From: Ian Collins


On 04/13/10 08:33 PM, Nick Keighley wrote:
> On 12 Apr, 21:07, jacob navia<ja...@spamsink.net> wrote:
>> Ersek, Laszlo a écrit :
>
>
>>> If I ever intended to unify iterator interfaces at all, that was about
>>> the end of it. As soon as I wanted to bolt something "really useful" on
>>> an iterator interface, it was immediately shown to be container
>>> specific. I took it as proof that my pursuit is futile.
>>
>> I have found the solution.
>>
>> There is the "Iterator" object with 3 fields:
>>
>> GetNext
>> GetPrevious
>
> might that be expensive with some containers?

Very.

Trying to be too abstract is a flaw in the design. Containers are
chosen based on their properties. If you want a container that is
efficient to append and you only want to iterate forward, a singly
linked list will be appropriate. If you want reverse iteration as well,
a doubly linked list will be required. That extra functionality has a
cost, but potentially significantly less than the cost of reverse
iteration of a singly linked list.

As I mentioned else-thread, the C++ library's split of containers into
categories makes a lot of sense. If the iterator interface is too
abstract, there may as well only be one container type.

--
Ian Collins


== 3 of 5 ==
Date: Tues, Apr 13 2010 1:44 am
From: Nick Keighley


On 13 Apr, 08:50, Ian Collins <ian-n...@hotmail.com> wrote:
> On 04/13/10 06:57 PM, jacob navia wrote:
>
> > Ian Collins a écrit :
> >> On 04/13/10 08:41 AM, Seebs wrote:
> >>> On 2010-04-12, Ian Collins<ian-n...@hotmail.com> wrote:
> >>>> But you only replied to one, so the debate never got going.
>
> >>> I'm pretty sure he's killfiled me, which turns out to remove about
> >>> half of the responses to his container library posts and discussion.
>
> >> He appears to have done the same to me, so that removes half of the rest!
>
> > I have always said that I have no killfile. I did not answer because you
> > just replied a short sentence.
>
> I thought I offered some useful suggestions and simplifications.  The
> reply was a couple of finely tuned paragraphs!
>
> > In general you (and Seebs) always say
> > that there is no point in doing a container library.
>
> No, I don't.
>
> > You because you
> > want us to use C++, Seebs because he can't see the advantages of having
> > code reuse.
>
> I don't want you, or anyone else to use anything.  I just point to
> alternatives when C might not be the best solution in some environments.

so he lied about both you

== 4 of 5 ==
Date: Tues, Apr 13 2010 1:47 am
From: Ian Collins


On 04/13/10 08:44 PM, Nick Keighley wrote:
>
> so he lied about both you

Oh no, let's not start another one of those threads, spinny might be
watching :)

--
Ian Collins


== 5 of 5 ==
Date: Tues, Apr 13 2010 2:49 am
From: Noob


Tim Streater wrote:

> Sure. But if everyone else does it, and I don't, then I have an almost
> entirely clean city at no cost to me. So if I'm selfish, where's my
> incentive?

http://en.wikipedia.org/wiki/Tragedy_of_the_commons

==============================================================================
TOPIC: small question
http://groups.google.com/group/comp.lang.c/t/08850414dcd0b366?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Apr 13 2010 1:50 am
From: Nick Keighley


please don't top post I've rearranged your post

On 11 Apr, 22:40, Tucker <noth...@nowhere.net> wrote:> > On 11 Apr,
19:00, "Bill Cunningham" <nos...@nspam.invalid> wrote:
> On 04/11/2010 14:05:13:000 Nick Keighley <nick_keighley_nos...@hotmail.com> wrote:

> > > Oops forgot code.
>
> > oops forgot the question
>
> > > #include <stdio.h>
> > > #include <stdlib.h>
> > > #include <string.h>
> > > #include <sys/types.h>
> > > #include <netdb.h>
> > > #include <sys/socket.h>
>
> > > struct addrinfo hints, *servinfo;
> > > int main()
> > > {
> > > int status;
> > > memset(&hints, '\0', sizeof hints);
>
> > memeset() requires a pointer as the first parameter. The & on the
> > front of hints takes hints address hence &hints /is/ a pointer
>
> hints is not a pointer,

where did I say it was?

but &hints is a pointer.  However, &hints is not a variable, so you
can't assign to it.  

where did I say it was?

> You can only assign to *(&hints).


== 2 of 3 ==
Date: Tues, Apr 13 2010 4:44 am
From: "Bill Cunningham"

"pete" <pfiland@mindspring.com> wrote in message
news:4BC397CF.4C32@mindspring.com...

> /*
> ** Here's the long way:
> */
> struct addrinfo hints;
>
> int main()
> {
> struct addrinfo *pointer = &hints;
>
> memset(pointer, '\0', sizeof hints);

Ok now that's familiar to me. Pointer points to an assigned address. So
memset(&hints,'\0',sizeof hints); is a shortcut then? I didn't know you
could shortcut this kind of thing.

Bill


== 3 of 3 ==
Date: Tues, Apr 13 2010 5:42 am
From: "Bill Cunningham"


pete wrote:

> /*
> ** Here's the long way:
> */
> struct addrinfo hints;
>
> int main()
> {
> struct addrinfo *pointer = &hints;
>
> memset(pointer, '\0', sizeof hints);

Yes that helps alot!

Bill

==============================================================================
TOPIC: Son of Snarky Tirade: a response to Seebach's new CTCN: part 1
http://groups.google.com/group/comp.lang.c/t/383e6d5a95dc3f75?hl=en
==============================================================================

== 1 of 10 ==
Date: Tues, Apr 13 2010 1:52 am
From: Richard Heathfield


Seebs wrote:
<snip>

> Now you've got me curious. Someone remind me to check next time I'm
> in a large bookstore.

Check next time you're in a large bookstore.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 2 of 10 ==
Date: Tues, Apr 13 2010 2:07 am
From: J de Boyne Pollard


> So Schildt's book is working to the the 1999 standard.

I'm not sure that that's really true. As I said before,
Schildt wasn't writing about C, but about DOS implementations
of C. As Jonathan Leffler said, "Once you have one of his
books, you also have a majority of the material in all his
other books.". And we all know that "Turbo C: The complete
reference" exists. (-:

Schildt was really documenting the language as DOS
programmers see it, and working to that. I suspect
that his primary references were the programmers' guides
and library references for DOS implementations, not the
C standard. After all, there wasn't a published C
standard in 1988. But there was a Turbo C manual. (-:


== 3 of 10 ==
Date: Tues, Apr 13 2010 2:15 am
From: J de Boyne Pollard


> If you think Schildt is the only one who
> writes useless C books, you're mistaken.

Yechiel M. Kimchi lists quite a few books on
xyr "C Books and C++ Books You Don't Want !"
WWW site.


== 4 of 10 ==
Date: Tues, Apr 13 2010 2:29 am
From: Richard Heathfield


Keith Thompson wrote:
<snip>

> "double main(double x)" isn't a constraint violation. The behavior of
> any program that uses it is undefined (unless the implementation
> defines the behavior).

I once tried this under NT4. I don't remember what parameter list I
chose, but I used double for main's return type. The crash was extremely
colourful - a DOS screen filled with random characters having random
attributes - and the machine refused to respond until a reboot.

Return types matter.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 5 of 10 ==
Date: Tues, Apr 13 2010 2:43 am
From: Richard Heathfield


J de Boyne Pollard wrote:
>> If you think Schildt is the only one who
>> writes useless C books, you're mistaken.
>
> Yechiel M. Kimchi lists quite a few books on
> xyr "C Books and C++ Books You Don't Want !"
> WWW site.

All the original text I post to Usenet is protected by copyright law. If
you quote me, kindly have the courtesy to attribute the quotation correctly.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 6 of 10 ==
Date: Tues, Apr 13 2010 3:14 am
From: Walter Banks


spinoza1111 wrote:

Mr Nilges on what basis do you have standing here. So far
a 40 year old degree and a few grad classes. Refereed paper list

Well sir I used to program in C.

Have you written a C compiler? No sir I wrote a compiler.
A C compiler ?
No Sir that would be a compiler for a real language


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---


== 7 of 10 ==
Date: Tues, Apr 13 2010 3:34 am
From: blmblm@myrealbox.com


In article <0559b6ae-e06d-4f1f-8b27-dbabac70400a@e7g2000yqf.googlegroups.com>,
Nick Keighley <nick_keighley_nospam@hotmail.com> wrote:
> On 12 Apr, 15:24, blm...@myrealbox.com <blm...@myrealbox.com> wrote:
> > In article <6be118ea-7c38-487d-b183-b0ad252ce...@12g2000yqi.googlegroups.com>,
> > Nick Keighley <nick_keighley_nos...@hotmail.com> wrote:

[ snip ]

> > As can I (using news.individual.net). However, Seebs's subject line
> > was
> >
> > "Re: [NILGES] Son of Snarky Tirade: a response to Seebach's new CTCN: part 1"
> >
> > and yours doesn't seem to have the beginning "[NILGES]". That's what
> > I thought would happen.
> >
> > So maybe the trick is to put the text in square brackets at the end
> > rather than the beginning?
>
> the subject of this post is
> "[PREFIX ENCLOSED IN SQUARE BRACKETS] google test [POSTFIX ENCLOSED
> IN SQUARE BRACKETS]"

And I also get

"[PREFIX ENCLOSED IN SQUARE BRACKETS] google test [POSTFIX ENCLOSED
IN SQUARE BRACKETS]"

> > (Cue chorus of ungrateful whining about what GG has done for/to/with
> > Usenet .... )
>
> --
>
> All right, but apart from the sanitation, the medicine,
> education,
> wine, public order, irrigation, roads, a fresh water system, and
> public health, what have the Romans ever done for us?

There's a reason I said "ungrateful" and "for/to/with" rather
than just "to/with" .... I was very pleased and relieved when
Google rescued DejaNews's archives and made them available again,
and there's something to be said too for their providing a posting
interface. But the archive-searching functionality seems to often
break in mysterious ways, and that business of altering/hiding
anything that looks like an e-mail address is quite annoying, and in
general sometimes it seems like the people assigned to the GG project
aren't as familiar with Usenet customs as one might like. <shrug>

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.


== 8 of 10 ==
Date: Tues, Apr 13 2010 3:36 am
From: blmblm@myrealbox.com


In article <27d8f87c-fd50-410d-a449-508a86d29bd9@v20g2000yqv.googlegroups.com>,
Nick Keighley <nick_keighley_nospam@hotmail.com> wrote:
> On 13 Apr, 08:28, Nick Keighley <nick_keighley_nos...@hotmail.com>
> wrote:
> > On 12 Apr, 15:24, blm...@myrealbox.com <blm...@myrealbox.com> wrote:
> > > In article <6be118ea-7c38-487d-b183-b0ad252ce...@12g2000yqi.googlegroups.com>,
> > > Nick Keighley <nick_keighley_nos...@hotmail.com> wrote:
> > > > On 12 Apr, 15:07, Nick Keighley <nick_keighley_nos...@hotmail.com>
> > > > > On 12 Apr, 10:03, blm...@myrealbox.com <blm...@myrealbox.com> wrote:

[ snip ]

> > the subject of this post is
> > "[PREFIX ENCLOSED IN SQUARE BRACKETS] google test [POSTFIX ENCLOSED
> > IN SQUARE BRACKETS]"
>
> again it appears to survive...
>

Not for me -- for this one I get

"Re: google test [POSTFIX ENCLOSED IN SQUARE BRACKETS]"

Huh.

(Probably clc is not the best place to be doing this testing,
but then again I think you need a non-GG helper .... )

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.


== 9 of 10 ==
Date: Tues, Apr 13 2010 5:25 am
From: Eric Sosman


On 4/13/2010 2:51 AM, Nick Keighley wrote:
> On 12 Apr, 16:20, Eric Sosman<esos...@ieee-dot-org.invalid> wrote:
>> On 4/12/2010 10:04 AM, Nick Keighley wrote:
>>> On 12 Apr, 14:58, Richard Heathfield<r...@see.sig.invalid> wrote:
>>>>[...]
>>>> Implementations *may* accept main functions of other types, but are not
>>>> required so to do.
>>
>>> does it explicitly say that?
>>
>> 5.1.2.2.1p1.
>
> I've got the ANSI standard. Is that "Program Startup"? (ie. the bit I
> already quoted?)

You won't find 5.1.2.2.1p1 in the ANSI standard, whose section
numbers only go up to 4.13.8 (plus appendices). My reference was
to ISO/IEC 9899:1999, the language definition now in force (leaving
aside TC's and such interim amendments). The cited paragraph has
three count them three sentences. I draw your attention to the final
clause of the third sentence -- the bit after the semicolon, near
the footnote reference, just past the gas station, you can't miss it.

As for the ANSI standard, there's similar but not identical
text in 2.1.2.2. The ANSI text does *not* explicitly mention the
implementation's freedom to accept other forms of main() -- but
the freedom is there anyhow, under the provisions of 1.7, similar
(but again not identical) to ISO 4p6.

--
Eric Sosman
esosman@ieee-dot-org.invalid


== 10 of 10 ==
Date: Tues, Apr 13 2010 5:33 am
From: Nick Keighley


On 13 Apr, 08:30, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On 13 Apr, 08:28, Nick Keighley <nick_keighley_nos...@hotmail.com>
> wrote:
>
> > On 12 Apr, 15:24, blm...@myrealbox.com <blm...@myrealbox.com> wrote:
> > > In article <6be118ea-7c38-487d-b183-b0ad252ce...@12g2000yqi.googlegroups.com>,
> > > Nick Keighley  <nick_keighley_nos...@hotmail.com> wrote:
> > > > On 12 Apr, 15:07, Nick Keighley <nick_keighley_nos...@hotmail.com>
> > > > > On 12 Apr, 10:03, blm...@myrealbox.com <blm...@myrealbox.com> wrote:
>
> <snip>
>
>
>
>
>
> > > > > > As I understand it, Google's posting interface strips tags in square
> > > > > > brackets from subject lines, so your proposed fix here may not be as
> > > > > > effective as you might like.  Just sayin'.
>
> > > > > this is a test.
> > > > > this is posted from google and the subject line should contain square
> > > > > brackets
>
> > > > well I can see em
>
> > > As can I (using news.individual.net).  However, Seebs's subject line
> > > was
>
> > > "Re: [NILGES] Son of Snarky Tirade: a response to Seebach's new CTCN: part 1"
>
> > > and yours doesn't seem to have the beginning "[NILGES]".  That's what
> > > I thought would happen.
>
> > > So maybe the trick is to put the text in square brackets at the end
> > > rather than the beginning?
>
> > the subject of this post is
> > "[PREFIX ENCLOSED IN SQUARE BRACKETS]  google test  [POSTFIX ENCLOSED
> > IN SQUARE BRACKETS]"
>
> again it appears to survive...- Hide quoted text -

but its now gone away...


==============================================================================
TOPIC: seebs/schildt II
http://groups.google.com/group/comp.lang.c/t/c86133d7ad6b90c2?hl=en
==============================================================================

== 1 of 4 ==
Date: Tues, Apr 13 2010 2:06 am
From: Mark


spinoza1111 <spinoza1111@yahoo.com> wrote:
> On Apr 13, 3:59 am, Seebs <usenet-nos...@seebs.net> wrote:
>> On 2010-04-12, William Hughes <wpihug...@hotmail.com> wrote:
>>
>> > On Apr 12, 1:34 pm, spinoza1111 <spinoza1...@yahoo.com> wrote:
>> ><snip>
>> >> ..constructive discourse (such as the fact that
>> >> the purpose of int main() is to make Linux into a standard, or the
>> >> fact that C semantics was not defined properly in C99 owing to vendor
>> >> greed)
>> > The mind boggles.
>>
>> Yes, rather.  The return type of main predates Linux by upwards of a decade.
>
> Yes, because Torvalds essentially stole unix, a 1970s operating
> system, from the author of a book about unix for the PC, a unix called
> Minix. I had that book and was shocked that Torvalds would so steal
> the work of another, but it seems that computer authors are fair game
> for bullying and theft. Gates was right in 1976; most "hackers" are
> criminals. Most are common thieves, others are stalkers.

For someone so keen to accuse people of libel, you are quick to level
serious accusations against others.

This version of events is *so* wrong, it's hard to know where to start.

I'd retract this and apologise to Torvalds, if I were you.


== 2 of 4 ==
Date: Tues, Apr 13 2010 2:19 am
From: Ian Collins


On 04/13/10 09:06 PM, Mark wrote:
> spinoza1111<spinoza1111@yahoo.com> wrote:

<deluded twaddle snipped>

> For someone so keen to accuse people of libel, you are quick to level
> serious accusations against others.
>
> This version of events is *so* wrong, it's hard to know where to start.
>
> I'd retract this and apologise to Torvalds, if I were you.

I used to think he posted bollocks out of ignorance, now it's clear he
does it to get a reaction. Just ignore him.

--
Ian Collins


== 3 of 4 ==
Date: Tues, Apr 13 2010 2:33 am
From: Richard Heathfield


Mark wrote:
> spinoza1111 <spinoza1111@yahoo.com> wrote:
>> On Apr 13, 3:59 am, Seebs <usenet-nos...@seebs.net> wrote:
>>> On 2010-04-12, William Hughes <wpihug...@hotmail.com> wrote:
>>>
>>>> On Apr 12, 1:34 pm, spinoza1111 <spinoza1...@yahoo.com> wrote:
>>>> <snip>
>>>>> ..constructive discourse (such as the fact that
>>>>> the purpose of int main() is to make Linux into a standard, or the
>>>>> fact that C semantics was not defined properly in C99 owing to vendor
>>>>> greed)
>>>> The mind boggles.
>>> Yes, rather. The return type of main predates Linux by upwards of a decade.
>> Yes, because Torvalds essentially stole unix, a 1970s operating
>> system, from the author of a book about unix for the PC, a unix called
>> Minix. I had that book and was shocked that Torvalds would so steal
>> the work of another, but it seems that computer authors are fair game
>> for bullying and theft. Gates was right in 1976; most "hackers" are
>> criminals. Most are common thieves, others are stalkers.
>
> For someone so keen to accuse people of libel, you are quick to level
> serious accusations against others.
>
> This version of events is *so* wrong, it's hard to know where to start.
>
> I'd retract this and apologise to Torvalds, if I were you.

Torvalds won't be suing him for libel any time soon. There's no mileage
in claiming that a nut has damaged your reputation.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within


== 4 of 4 ==
Date: Tues, Apr 13 2010 2:36 am
From: Mark


Richard Heathfield <rjh@see.sig.invalid> wrote:
> Mark wrote:
>> spinoza1111 <spinoza1111@yahoo.com> wrote:
>>> On Apr 13, 3:59 am, Seebs <usenet-nos...@seebs.net> wrote:
>>>> On 2010-04-12, William Hughes <wpihug...@hotmail.com> wrote:
>>>>
>>>>> On Apr 12, 1:34 pm, spinoza1111 <spinoza1...@yahoo.com> wrote:
>>>>> <snip>
>>>>>> ..constructive discourse (such as the fact that
>>>>>> the purpose of int main() is to make Linux into a standard, or the
>>>>>> fact that C semantics was not defined properly in C99 owing to vendor
>>>>>> greed)
>>>>> The mind boggles.
>>>> Yes, rather. The return type of main predates Linux by upwards of a decade.
>>> Yes, because Torvalds essentially stole unix, a 1970s operating
>>> system, from the author of a book about unix for the PC, a unix called
>>> Minix. I had that book and was shocked that Torvalds would so steal
>>> the work of another, but it seems that computer authors are fair game
>>> for bullying and theft. Gates was right in 1976; most "hackers" are
>>> criminals. Most are common thieves, others are stalkers.
>>
>> For someone so keen to accuse people of libel, you are quick to level
>> serious accusations against others.
>>
>> This version of events is *so* wrong, it's hard to know where to start.
>>
>> I'd retract this and apologise to Torvalds, if I were you.
>
> Torvalds won't be suing him for libel any time soon. There's no mileage
> in claiming that a nut has damaged your reputation.

Oh, Torvalds won't care. This period of history has been done to death.
I was just offering Nilges an opportunity to avoid another charge of
hypocrisy.

==============================================================================
TOPIC: In the Matter of Herb Schildt: a Detailed Analysis of "C: The Complete
Nonsense"
http://groups.google.com/group/comp.lang.c/t/caf17fab4e7d8530?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Apr 13 2010 3:42 am
From: blmblm@myrealbox.com


In article <c474d1c9-77dd-4d0d-a1c0-74996f5414aa@x12g2000yqx.googlegroups.com>,
spinoza1111 <spinoza1111@yahoo.com> wrote:
> On Apr 10, 9:47 pm, blm...@myrealbox.com <blm...@myrealbox.com> wrote:
> <snip>
> >
> > > I need a full link; this has ellipses.
> >
> > Digression:
> >
> > "This"? presumably you mean the message ID in my post? I don't
> > want to discourage you from making some attempt to prune quoted
> > text, but aren't you supposed to leave in enough that people can
> > make sense of your reply just on the basis of what's quoted?
> > Well, moving on, and ignoring whether it should be "ellipses"
> > or "ellipsis" ....
> >
>
> Unabridged OED confirms "ellipses" for the plural. In general,
> literate people tend to spell Greek words that end in -is with -es
> following the Greek rule. I used plural because I am referring to
> three dots. I am not certain whether that latter microdecision was
> correct.

Not that it matters, but as best I can tell from the definitions in
the online OED and Merriam-Webster, "ellipsis" refers to the omission
of a word or words, and also the mark *or marks* used to indicate the
omission. So one set of dots might properly be called "an ellipsis".

> <snip>
> >
> > Anyway, here is a URL that works for me:
> >
> > http://groups.google.com/group/comp.lang.c/msg/f86ace21f0dd9892?hl=en...
>
> for (count = 0, t = strstr(target, in); t && *t; t = strstr(t, in)) {
> ++count;
> t += inlen;
> }
>
> (1) Apples and oranges. My code was intended not to count occurences
> but to replace them.

The above code is Seebs's, not mine, and as best I can tell from
comments is intended to be used *as part of* a string-replacement
function.

> (2) Your code uses string.h. My purpose was to avoid it.

My code as posted includes several implementations of a string-replace
function, set up to use either the string.h library functions or
user-written functions implementing the same API, because I thought it
would be interesting to compare the performance of the two. I think
I wrote this code before it became apparent that when you said "no
string.h" you meant "and also no user-written functions implementing
the same API".

> (3) Your code does not, as far as I can see, count overlapping
> occurences such as in the two occurences of 123123 in 123123123.

I'm not sure you've actually looked at *my* code, given the above
comments, but -- yes, that's true: Given that I'm not going to
do anything with overlapping occurrences it doesn't strike me as
useful to count them. What my code *does* need is a count of how
many times the "needle" string is going to be replaced, so I can
calculate the size of the output string.

> > I don't have a lot of confidence that it's going to work for you too,
> > but it's the best I can do.
>
> You claim simplicity as the virtue of your code but you didn't do a
> "requirements" study imo.

What do you mean by "requirements" study? and I'm not sure I ever
claimed simplicity as a virtue of my code. though Seebs made that
claim about *his* code, quoted in my post.

[ snip ]

> > The factors I had in mind included, oh, affinity between the
> > language and the problem domain (e.g., APL is apparently very
> > good for problems that can expressed in terms of working on arrays
> > or lists), suitability for the target hardware/software platform,
> > the programmer's background and interests, and probably some others
> > I'm not thinking of right now.
>
> But phrasing this as an engineering problem means you're basically
> abusing human beings. It's one thing to be a civil engineer and master
> Nature. It's quite another to distort yourself and your perceptions in
> order to meet corporate programming expectations. For example, if the
> flavor du jour is a false "simplicity" it's a disservice to subtly
> change the requirements and to even unintentionally try to make
> someone who's met requirements look "wrong".

Huh?

> <snip>
> > Did you have a point to make here, or is this just a demonstration
> > that you're just as willing to be vulgar when conversing(?) with a
> > woman as with a man?
>
> Yes. It is that compared to stalking Schildt, the constant verbal
> assaults on unpopular posters including Kenny, Navia and myself, and
> the disagreeable manners shown mainland Chinese posters, ironic sexism
> is pretty small potatoes.

I don't quite understand how this explains your replying to a technical
point with

"(Sigh) (Eye roll) (Crotch grab)"

Well, whatever.

[ snip ]

> > I'll admit to a preference for UNIX-like environments -- but the
> > thing is, declaring main() to return an int is compliant with the
> > C standard for what it calls "hosted environments" and presumably
> > will work on platforms that don't care about the return value as well
> > as those that do. So to me this is the more portable choice and
> > therefore the better one.
>
> I think that part of this talk about "portability" is grandiose, a
> programmer fantasy that "my code is so great that generations yet
> unborn will want to port it".

Or a recognition of the fact that code, great or not, often survives
much longer than its author(s) might have intended, and is put to
uses they might not have imagined in writing it.

> The fact is that C is not portable. Because it is possible to make
> things subtly dependent on hardware, any port needs a great deal of
> diligence. The fact that this diligence isn't manifest doesn't change
> this.

So why make the job more difficult ....

[ snip ]

> > > basically (cf Lanier's book) just a copy of unix, based on the work of
> > > an author other than the millionaire Torvaldys whose work was stolen
> > > by Torvaldys much as MS-DOS was stolen. The same sleaze and inferior
> > > praxis occurs in both communities.
> >
> > I don't quite understand who you're saying stole from whom here,
> > but whatever. (I'm also not sure why you spell the Linux
> > originator's name with a y, when no one else seems to, but
> > "whatever" on that too.)
>
> An infinite number of spelling flames will not establish a higher
> level of literacy.

I think it's mildly disrespectful to not get someone's name right.
<shrug>

[ snip ]

> > > Back to 1984...
> >
> > Instead you want us all to conform to the expectations of a
> > platform defined and owned by another corporate entity (Microsoft)
> > whose reputation is not exactly spotless?
>
> This is associative thinking, where if one's affiliated with Microsoft
> in some way the inference is made, rather childishly based on Lucas'
> myths in Star Wars etc., that one's gone over to the Dark Side.
> Whereas merely using Linux, a copy of unix, which could be considered
> a considerably improved MS-DOS since MS-DOS was a misunderstood unix,

Where "considerably improved" here means -- *very* considerably,
I'd say, and "misunderstood" means -- I have no idea.

Would you like to hear the story I call "How I Discovered
the Difference Between (MS-)DOS and a Real Operating System"?
(Summary version: Buggy user program puts machine in a state from
which only physically turning it off and back on can rescue it.)

Single-user versus multi-user, remotely accessible via not ....
I'm sure I can come up with some other differences that seem
pretty significant to me.

> and all three are based on Western Union Teletypewriter IO,

The *command shells* may be. A command shell is not an operating
system.

> is
> supposed to make one one of the Shining Ones, even if one works for an
> Israeli firm, say, that deliberately mistranslates Iranian government
> statements in order to deceive the Americans.
>
> At least Microsoft pays its developers.

Pays them, but -- rumor has it -- expects rather a lot of hours in
return.

> Furthermore, minorities need
> to learn it and I prefer working at campuses like DeVry where people
> show up for classes and major in what they plan to profess.

Just out of curiosity, how many of these students seemed to you
to be motivated by genuine interest in the field, and how many
by the desire to get training and/or a credential that would lead
to a good-paying job? (Not that there's necessarily much wrong
with the latter, especially in people who didn't grow up affluent.)

(What I've observed in the students where I teach is that, oh,
ten years ago during the so-called dot-com boom, there seemed
to be a lot of the latter, while now it's more the former.
We have fewer majors now, but the ones we have are more capable,
and more interested.)

[ snip ]

> > > > Well, you never know. One thing I figured out a long time ago is
> > > > that some people come across as being smarter than they actually
> > > > are, by virtue of being articulate and self-confident, while others
> > > > who are actually very bright fly under the radar, so to speak.
> >
> > > This is an urban legend.
> >
> > You do realize that when I said "I figured out" I meant that
> > I, well, figured it out, based on my own experiences, rather
> > than simply believing something I was told, right? I guess it's
> > possible that someone else did draw my attention to it, but if
> > so I believed it because it accorded with my own experience.
>
> It remains a data processing myth which has created several software
> crises, because it's more convenient to the corporation to celebrate
> idiot savants than men and women.

I don't agree that it's a myth, or that it's confined to data
processing; I first noticed this phenomenon by comparing two of
my undergraduate acquaintances, neither of them involved with
data processing.

> <snip>
> > My own thinking is that academic credentials are a useful screening
> > mechanism in the absence of other information about a person,
> > but the correlation between them and genuine qualifications is
> > not 100%. Indeed, I strongly suspect you'd claim that you're
> > more qualified than your academic credentials might imply, no?
>
> Yes, but in Seebach's case the lack has real consequences. I did take
> the classes and worked for the grades: he did not. The final
> credential is what's missing in my case, but it appears that Seebach
> didn't leave the starting gate.
>
> Furthermore, anyone with any respect for learning would never (and I
> mean never) reduce university attendance as opposed to final
> credentials to a "useful screening mechanism".

I have no idea what you mean here, but perhaps it will clarify
*my* intended meaning if I say that by "academic credentials"
I mean to include not only degrees but the entire record --
think "transcript" rather than "diploma(s)". But even the fuller
record doesn't tell the whole story. And really, I'm inclined to
have more respect for someone who's self-taught, since I think
that indicates a level of interest and commitment in a way that
academic coursework might -- *might* -- not.

[ snip ]

> > > My sexism is ironic. Real malice, of the sort shown Kenny, Navia,
> > > Schildt, Chinese visitors and myself, as well as competent female
> > > programmers, is my concern here.
> >
> > I have no idea what "ironic" means here.
>
> It means I'm pulling your leg.

This is not apparent, and indeed I'm -- skeptical. That's
offensive, yes, but so be it.

(Why am I reminded of "can't you take a joke?" used as a defense against
accusations of various -isms?)

> > > > > The New York Times did a followup circa 1997 of the Princeton computer
> > > > > science fe-male
> >
> > > > Okay, I guess I'm going to ask -- why the hyphen?
> >
> > > A deliberate affectation.
> >
> > No idea what this means either.
>
> OED: An ostentatious fondness for something; a studied display

I know what "affectation" means in general. I don't understand what
it means in context. Well, whatever.

[ snip ]

> > I would be mildly interested in an explanation of how anything I've
> > said constitutes a tu quoque argument.
>
> Each spelling flame is one, since you want to disprove my claim that
> I'm more literate by bringing down to the level of normalized
> deviance.

I do? that seems unlikely, since I don't even know what "normalized
deviance" means. The point *I* think I'm making, in drawing attention
to spelling mistakes, is that you are not in the strongest position
to comment on others' spelling, as you sometimes do, or have done.

I'd ask how what I'm doing here is different from *your* claiming(?)
that Seebs is in no position to criticize others' code given that he
makes mistakes in his own code, but -- that's rather the same line of
reasoning, isn't it?

> You will fail.

I'll probably give up before you do, yes.

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.

==============================================================================
TOPIC: error
http://groups.google.com/group/comp.lang.c/t/1d16924d271398d9?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Apr 13 2010 5:54 am
From: "Bill Cunningham"


I received this error and can't figure it out so I thought I would post
it. This has to do with posix and I guess it would fit under standard C.

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

struct addrinfo sin, *psin;

int pass(void)
{
sin.ai_family = PF_INET;
sin.ai_socktype = SOCK_STREAM;
sin.ai_protocol = 0;
sin.ai_flags = AF_PASSIVE;
}

pass.c:6: warning: built-in function 'sin' declared as non-function
pass.c: In function `pass':
pass.c:13: error: `AF_PASSIVE' undeclared (first use in this function)
pass.c:13: error: (Each undeclared identifier is reported only once
pass.c:13: error: for each function it appears in.)

It looks to me like some macros are out of scope. I'm using the headers
I am supposed to. I believe I am following directions properly. As per this
site where I'm learning but writing my own code.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

Bill

== 2 of 2 ==
Date: Tues, Apr 13 2010 5:56 am
From: "Bill Cunningham"


Bill Cunningham wrote:

Should I not have put this in a function? Is that why things are out of
scope?

Bill


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate