Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #157: Incorrect time synchronization


comp / comp.os.linux.advocacy / Re: More Funny Stuff From Joel

SubjectAuthor
* More Funny Stuff From The Joke PythonDiego Garcia
+* Re: More Funny Stuff From The Joke PythonJoel
|+* Re: More Funny Stuff From The Joke Pythonrbowman
||`* Re: More Funny Stuff From The Joke PythonJoel
|| `* Re: More Funny Stuff From The Joke Pythonrbowman
||  +* Re: More Funny Stuff From The Joke PythonJoel
||  |+* Languages (was: Re: More Funny Stuff From The Joke Python)vallor
||  ||+* Re: Languages%
||  |||`- Re: Languagesvallor
||  ||`* Re: Languages (was: Re: More Funny Stuff From The Joke Python)Lawrence D'Oliveiro
||  || `* Re: Languages (was: Re: More Funny Stuff From The Joke Python)Sebastian Wells
||  ||  +- Re: Languages (was: Re: More Funny Stuff From Python)Lawrence D'Oliveiro
||  ||  `- Re: Languages (was: Re: More Funny Stuff From The Joke Python)rbowman
||  |+* Re: More Funny Stuff From JoelDFS
||  ||+* Re: More Funny Stuff From JoelJoel
||  |||+- Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  |||+* Re: More Funny Stuff From Joelrbowman
||  ||||`- Re: More Funny Stuff From JoelChris Ahlstrom
||  |||+* Re: More Funny Stuff From JoelTyrone
||  ||||+* Re: More Funny Stuff From JoelJoel
||  |||||`* Re: More Funny Stuff From Joelrbowman
||  ||||| `* Re: More Funny Stuff From JoelJoel
||  |||||  `* Re: More Funny Stuff From Joelrbowman
||  |||||   `* Re: More Funny Stuff From JoelJoel
||  |||||    `- Re: More Funny Stuff From Joelrbowman
||  ||||+* Re: More Funny Stuff From Joelcandycanearter07
||  |||||+* Re: More Funny Stuff From JoelChris Ahlstrom
||  ||||||`- Re: More Funny Stuff From Joelcandycanearter07
||  |||||`* Re: More Funny Stuff From JoelStéphane CARPENTIER
||  ||||| `* Re: More Funny Stuff From JoelFarley Flud
||  |||||  +* Re: More Funny Stuff From JoelStéphane CARPENTIER
||  |||||  |`* Re: More Funny Stuff From JoelFarley Flud
||  |||||  | +- Re: More Funny Stuff From JoelDFS
||  |||||  | `* Re: More Funny Stuff From JoelStéphane CARPENTIER
||  |||||  |  +* Re: More Funny Stuff From JoelFarley Flud
||  |||||  |  |`- Re: More Funny Stuff From JoelStéphane CARPENTIER
||  |||||  |  `* Re: More Funny Stuff From JoelFarley Flud
||  |||||  |   `- Re: More Funny Stuff From JoelStéphane CARPENTIER
||  |||||  `* Re: More Funny Stuff From JoelDFS
||  |||||   `- Re: More Funny Stuff From JoelAndrzej Matuch
||  ||||`* Re: More Funny Stuff From JoelStéphane CARPENTIER
||  |||| `* Re: More Funny Stuff From JoelJoel
||  ||||  +* Re: More Funny Stuff From JoelStéphane CARPENTIER
||  ||||  |`* Re: More Funny Stuff From Joelcandycanearter07
||  ||||  | +* Re: More Funny Stuff From JoelJoel
||  ||||  | |`- Re: More Funny Stuff From Joelcandycanearter07
||  ||||  | `* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  ||||  |  `- Re: More Funny Stuff From Joelcandycanearter07
||  ||||  `* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  ||||   `* Re: More Funny Stuff From JoelJoel
||  ||||    +* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  ||||    |`- Re: More Funny Stuff From JoelJoel
||  ||||    `* Re: More Funny Stuff From Joelchrisv
||  ||||     `- Re: More Funny Stuff From JoelJoel
||  |||`* Re: More Funny Stuff From JoelDFS
||  ||| `* Re: More Funny Stuff From JoelJoel
||  |||  `* Re: More Funny Stuff From Joelrbowman
||  |||   `* Re: More Funny Stuff From JoelJoel
||  |||    +- Re: More Funny Stuff From Joel%
||  |||    +* Re: More Funny Stuff From JoelDFS
||  |||    |+- Re: More Funny Stuff From JoelJoel
||  |||    |`* "Standard GUI" (was: Re: More Funny Stuff From Joel)vallor
||  |||    | +* Re: "Standard GUI"Andrzej Matuch
||  |||    | |`- Re: "Standard GUI"rbowman
||  |||    | `* Re: "Standard GUI"Lawrence D'Oliveiro
||  |||    |  `- Re: "Standard GUI"Chris Ahlstrom
||  |||    +- Re: More Funny Stuff From Joelrbowman
||  |||    `* Re: More Funny Stuff From Joelcandycanearter07
||  |||     +* Re: More Funny Stuff From JoelDFS
||  |||     |`* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  |||     | `- Re: More Funny Stuff From JoelDFS
||  |||     +* Re: More Funny Stuff From JoelJoel
||  |||     |+* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  |||     ||`* Re: More Funny Stuff From JoelJoel
||  |||     || +* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  |||     || |+- Re: More Funny Stuff From JoelJoel
||  |||     || |+- Re: More Funny Stuff From JoelChris Ahlstrom
||  |||     || |`- Re: More Funny Stuff From JoelDFS
||  |||     || `- Re: More Funny Stuff From Joelcandycanearter07
||  |||     |`- Re: More Funny Stuff From Joelcandycanearter07
||  |||     `- Re: More Funny Stuff From Joelchrisv
||  ||`* Re: More Funny Stuff From Joelcandycanearter07
||  || +- Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  || +* Re: More Funny Stuff From Joelrbowman
||  || |`* Re: More Funny Stuff From Joelcandycanearter07
||  || | `* Re: More Funny Stuff From Joelrbowman
||  || |  +* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  || |  |`- Re: More Funny Stuff From Joelcandycanearter07
||  || |  `* Re: More Funny Stuff From JoelChris Ahlstrom
||  || |   `* Re: More Funny Stuff From Joelrbowman
||  || |    +- Re: More Funny Stuff From JoelChris Ahlstrom
||  || |    `* Re: More Funny Stuff From CLawrence D'Oliveiro
||  || |     `- Re: More Funny Stuff From Ccandycanearter07
||  || `* Re: More Funny Stuff From JoelDFS
||  ||  +* Re: More Funny Stuff From Joelrbowman
||  ||  |`- Re: More Funny Stuff From PythonLawrence D'Oliveiro
||  ||  `* Re: More Funny Stuff From Joelcandycanearter07
||  ||   +* Re: More Funny Stuff From JoelLawrence D'Oliveiro
||  ||   |`- Re: More Funny Stuff From Joelcandycanearter07
||  ||   `* Re: More Funny Stuff From JoelDFS
||  ||    `* Re: More Funny Stuff From Joelcandycanearter07
||  |+- Re: More Funny Stuff From The Joke Pythonrbowman
||  |`- Re: More Funny Stuff From The Joke PythonLawrence D'Oliveiro
||  `* Re: More Funny Stuff From The Joke PythonStéphane CARPENTIER
|`* Re: More Funny Stuff From The Joke PythonDFS
+* Re: More Funny Stuff From The Joke Pythonvallor
+* Re: More Funny Stuff From Feeb's LifeDFS
+* Re: More Funny Stuff From The Joke Pythonrbowman
+- Re: More Funny Stuff From The Joke PythonLawrence D'Oliveiro
`- Re: More Funny Stuff From The Joke PythonStéphane CARPENTIER

Pages:1234567
Subject: Re: More Funny Stuff From C
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.advocacy
Organization: A noiseless patient Spider
Date: Wed, 12 Jun 2024 02:43 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From C
Date: Wed, 12 Jun 2024 02:43:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <v4b1vq$1evff$3@dont-email.me>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<lcq27iF6su7U4@mid.individual.net>
<slrnv6flo3.7fn.candycanearter07@candydeb.host.invalid>
<lcqaljF8hrcU1@mid.individual.net> <v49f1b$11kek$3@dont-email.me>
<lcrj10Fef9rU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 04:43:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="114c653c06754bac2979cba4b47e2f9e";
logging-data="1539567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OLKknnOH/rbDwGymVEoLu"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:MfpXF/CMyF3cSi1X4psncaq6XC4=
View all headers

On 11 Jun 2024 18:23:28 GMT, rbowman wrote:

> ... I've hit instances using functions
> in legacy code where one const in a function resulted in having to
> spread const around to keep the compiler from whining.

Dennis Ritchie himself pointed out some pitfalls with the “const” concept
early on. For example, take this standard library routine:

char *strstr(const char *haystack, const char *needle);

Note that the result is a (non-const) pointer into one of the arguments.
But the arguments are const! So the function is not typesafe. It was done
this way so that, if the user passed a pointer into a modifiable string,
they could get back a pointer they could use to make further
modifications.

The right solution would have been to create two versions of this routine,
one with a non-const haystack pointer returning non-const, and another
with a const haystack pointer, returning const.

Subject: Re: More Funny Stuff From Python
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.advocacy
Organization: A noiseless patient Spider
Date: Wed, 12 Jun 2024 02:44 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Python
Date: Wed, 12 Jun 2024 02:44:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <v4b21m$1evff$4@dont-email.me>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<lcrjj9Fef9rU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 04:44:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="114c653c06754bac2979cba4b47e2f9e";
logging-data="1539567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XXL99AgZ5FYvtFnuDudOa"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:h9ticz61a6eeqw55IHyiX/Hld9s=
View all headers

On 11 Jun 2024 18:33:13 GMT, rbowman wrote:

> On Tue, 11 Jun 2024 12:20:05 -0400, DFS wrote:
>
>> Usually qsort().
>
> Enter Big O...

The “Timsort” algorithm is generally seen to be a significant advance on
Quicksort. It was invented by one of the Python developers.

Subject: Re: More Funny Stuff From Joel
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.advocacy
Organization: A noiseless patient Spider
Date: Wed, 12 Jun 2024 02:45 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 02:45:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <v4b23l$1evff$5@dont-email.me>
References: <kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 04:45:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="114c653c06754bac2979cba4b47e2f9e";
logging-data="1539567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qatiPQJ2JgWfiX9JnMxjc"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:xWeRBrsPj+BiKW87luJFaJ2Fs1Y=
View all headers

On Tue, 11 Jun 2024 12:05:38 -0400, Joel wrote:

> Nice, I bet you will excel in it.

My word, but you make a powerful point.

Subject: Re: More Funny Stuff From Joel
From: Joel
Newsgroups: comp.os.linux.advocacy
Date: Wed, 12 Jun 2024 03:15 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!npeer.as286.net!npeer-ng0.as286.net!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.netnews.com!netnews.com!s1-4.netnews.com!news-out.netnews.com!postmaster.netnews.com!us11.netnews.com!not-for-mail
X-Trace: DXC=81Ikg0G]f?fPHaK9SYdC3bHWonT5<]0TmdjI?Uho:XeklL51CP6LDLl95GMl]75=8a6jU2>fCHj7hWim7Li1M05nbA4<PQUTBUkFeF>2oJX=@`
X-Complaints-To: support@blocknews.net
From: joelcrump@gmail.com (Joel)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Tue, 11 Jun 2024 23:15:11 -0400
Message-ID: <ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com>
References: <lcjvk1F9n7aU1@mid.individual.net> <2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com> <6664e989$0$2363151$882e4bbb@reader.netnews.com> <v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com> <666522c8$1$3747325$882e4bbb@reader.netnews.com> <hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com> <lcm7j9Fk632U1@mid.individual.net> <34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com> <slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid> <qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
OS: Linux Mint 21.3 Cinnamon, with Wine 9.0 for WinAPI
Lines: 26
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718162111 reader.netnews.com 2363137 127.0.0.1:48939
X-Received-Bytes: 2166
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

>> Nice, I bet you will excel in it.
>
>My word, but you make a powerful point.

I'm a fan of candycanearter07, he's a wonderful contributor, I dare
say the most valued one we have, being younger than most of us. He's
our future, the future of Linux.

--
Joel W. Crump

Amendment XIV
Section 1.

[...] No state shall make or enforce any law which shall
abridge the privileges or immunities of citizens of the
United States; nor shall any state deprive any person of
life, liberty, or property, without due process of law;
nor deny to any person within its jurisdiction the equal
protection of the laws.

Dobbs rewrites this, it is invalid precedent. States are
liable for denying needed abortions, e.g. TX.

Subject: Re: More Funny Stuff From Joel
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.advocacy
Organization: A noiseless patient Spider
Date: Wed, 12 Jun 2024 05:59 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 05:59:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <v4bdgl$1gvnv$2@dont-email.me>
References: <lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me>
<ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 07:59:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="114c653c06754bac2979cba4b47e2f9e";
logging-data="1605375"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TIBZY8/8Hb/zvlwU2Z+tV"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:VcLv6PM+X+AmQFs2O2KM7Asf9Wg=
View all headers

On Tue, 11 Jun 2024 23:15:11 -0400, Joel wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>>> Nice, I bet you will excel in it.
>>
>> My word, but you make a powerful point.
>
> I'm a fan of candycanearter07 ...

Maybe my humour was not quite as ... Access-ible ... as it could have
been ...

Subject: Re: More Funny Stuff From Joel
From: Joel
Newsgroups: comp.os.linux.advocacy
Date: Wed, 12 Jun 2024 06:17 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.netnews.com!netnews.com!s1-4.netnews.com!news-out.netnews.com!postmaster.netnews.com!us11.netnews.com!not-for-mail
X-Trace: DXC=OVKVb6;8JbJIV\cFdG^e9FHWonT5<]0TMdjI?Uho:XeKlL51CP6LDLL95GMl]75=8A5;R1>X6g_EJ7@<I4Rf8bAAl3[[dIf;_mF2Do^b@=QS7G
X-Complaints-To: support@blocknews.net
From: joelcrump@gmail.com (Joel)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 02:17:26 -0400
Message-ID: <7afi6jdji7stduvcvil4oe2h05rm2899am@4ax.com>
References: <6664e989$0$2363151$882e4bbb@reader.netnews.com> <v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com> <666522c8$1$3747325$882e4bbb@reader.netnews.com> <hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com> <lcm7j9Fk632U1@mid.individual.net> <34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com> <slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid> <qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me> <ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com> <v4bdgl$1gvnv$2@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
OS: Linux Mint 21.3 Cinnamon, with Wine 9.0 for WinAPI
Lines: 29
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718173045 reader.netnews.com 2363139 127.0.0.1:59245
X-Received-Bytes: 2060
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

>>>> Nice, I bet you will excel in it.
>>>
>>> My word, but you make a powerful point.
>>
>> I'm a fan of candycanearter07 ...
>
>Maybe my humour was not quite as ... Access-ible ... as it could have
>been ...

Ah, yeah. M$ Office.

--
Joel W. Crump

Amendment XIV
Section 1.

[...] No state shall make or enforce any law which shall
abridge the privileges or immunities of citizens of the
United States; nor shall any state deprive any person of
life, liberty, or property, without due process of law;
nor deny to any person within its jurisdiction the equal
protection of the laws.

Dobbs rewrites this, it is invalid precedent. States are
liable for denying needed abortions, e.g. TX.

Subject: Re: More Funny Stuff From C
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Wed, 12 Jun 2024 06:25 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From C
Date: Wed, 12 Jun 2024 06:25:05 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 27
Message-ID: <slrnv6ifpq.13pi.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<lcq27iF6su7U4@mid.individual.net>
<slrnv6flo3.7fn.candycanearter07@candydeb.host.invalid>
<lcqaljF8hrcU1@mid.individual.net> <v49f1b$11kek$3@dont-email.me>
<lcrj10Fef9rU1@mid.individual.net> <v4b1vq$1evff$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 08:25:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf";
logging-data="1616100"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HXN9lduu4xtJoIAykNXEPfy5/hug+jgN+LMgjn1tSuw=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:aLEqKMO6DoJ+++WGVHKgif09OOk=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 02:43 this Wednesday (GMT):
> On 11 Jun 2024 18:23:28 GMT, rbowman wrote:
>
>> ... I've hit instances using functions
>> in legacy code where one const in a function resulted in having to
>> spread const around to keep the compiler from whining.
>
> Dennis Ritchie himself pointed out some pitfalls with the “const” concept
> early on. For example, take this standard library routine:
>
> char *strstr(const char *haystack, const char *needle);
>
> Note that the result is a (non-const) pointer into one of the arguments.
> But the arguments are const! So the function is not typesafe. It was done
> this way so that, if the user passed a pointer into a modifiable string,
> they could get back a pointer they could use to make further
> modifications.
>
> The right solution would have been to create two versions of this routine,
> one with a non-const haystack pointer returning non-const, and another
> with a const haystack pointer, returning const.

I guess that's why function overloading was introduced in C++. Of
course, that's a whole other can o worms.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Wed, 12 Jun 2024 06:35 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 06:35:02 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 171
Message-ID: <slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
Injection-Date: Wed, 12 Jun 2024 08:35:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf";
logging-data="1619543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++mtzD90V0mxavT/SYs/5hfN4S0FhJ7y1Z9aSd2OHTKA=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:WZB1y01oo57QtMTdwd5uV8W50Lc=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):
> On 6/10/2024 10:40 PM, candycanearter07 wrote:
>> DFS <nospam@dfs.com> wrote at 23:30 this Saturday (GMT):
>>> On 6/8/2024 5:32 PM, Joel wrote:
>>>
>>>> I can't imagine I'd need anything beyond C.
>>>
>>>
>>> I hope you're not gonna pull a Feeb and claim you're a C guru that can
>>> 'move the Earth', but refuse to show ANY decent code, then make lame
>>> excuses like "I have other fish to fry".
>>
>> Seems like a fun challenge.. especially since im kinda rusty with c
>>
>>> 1) write your own C to sort these 3 names (by last then first):
>>>
>>> William Thomas
>>> Zachary Jones
>>> Jim Thomas
>>
>> I'll be honest, I might be bad but I completely forgot how to sort
>> strings.. sorry
>
>
> Usually qsort().
>
I knew there was an official implementation!
>
>>> 2) write your own C to count the words in:
>>>
>>> "Now is the time for all good men to come to the aid of their country."
>>
>> #include <stdio.h>
>> #include <ctype.h>
>>
>> const char phrase[] = "Now is the time for all good men to come to the
>> aid of their country.";
>>
>> int main()
>> {
>> const char *phr = phrase;
>> int words = 0;
>> int space = 0; // does c have bool?
>
> Yes.
>
>> while(*phr)
>> {
>> if(space && isalpha(*phr))
>> {
>> space = 0;
>> words++;
>> }
>> if(isblank(*phr)) space = 1;
>>
>> phr++;
>> }
>>
>> printf("Words: %d, words);
>> }
>
>
> My wordcounter code used:
>
> if(isspace(myStr[i]) && !isspace(myStr[i+1])) {countWords++;}
>
> to also count words that might begin with numbers.
>
> "For the right money cola Linux 'advocates' would work 4MS in 2ms."
>
Right, I forgot isalnum was a thing.
>
>
>>> 3) write your own C to calc the mean, median and mode of:
>>>
>>> 1,2,3,4,5,5,6,7,8,9
>>
>> #include <stdio.h>
>> #define COUNT_CNT 10
>>
>> int nums[] = {1, 2, 3, 4, 5, 5, 6, 7, 8, 9, -1};
>>
>> int main()
>> {
>> double mean;
>> int median, mode, md_count[COUNT_CNT], len;
>>
>> for( len = 0; nums[len] != -1; len++ )
>> {
>> mean += nums[len];
>> md_count[nums[len]]++;
>> }
>> mean /= len;
>>
>> if(len % 2 == 0)
>> {
>> int mid = len / 2;
>> median = nums[mid] + nums[mid + 1]];
>> median /= 2;
>> }
>> else
>> median = nums[len / 2];
>>
>> for( int i = 0; i < COUNT_CNT; i++ )
>> {
>> if(md_count[mode] < md_count[i]) mode = i;
>> }
>>
>> printf("mean %g, median %d, mode %d", mean, median, mode);
>> }
>>
>> These compiled fine on my machine (gcc 12.2.0)
>
>
> Did you actually run the code?

Yes, but I also typed it into slrn by hand bc I was worried that pasting
it would mess up word wrapping

> I got a segfault (WSL Ubuntu, gcc 11.4). Had to make a few tweaks to
> get it to run and provide correct answers.
>
> Do you want me to tell you what I did, or do you want to figure it out?
>
> Hint: after the line "mean /= len;" print out the contents of
> md_count[]. You should get:
>
> 1. 1
> 2. 1
> 3. 1
> 4. 1
> 5. 2
> 6. 1
> 7. 1
> 8. 1
> 9. 1

I don't see it sorry ^^:

> I like the technique you use for the mode count, but something to
> remember is there can be multiple modes, and your code as is will
> identify only one.
>
> And the numbers were already sorted, but if they weren't you would have
> to sort them - forward or reverse - before getting the median.

Thanks, I'll keep it in mind next time

>
>>> Why is it I have a VERY strong feeling you and Feeb and C are about to
>>> be pwned by python?
>>
>>
>> IMO, both are pretty good languages, with their own strengths..like, C
>> is good for dealing with the raw data and it can be really satisfying to
>> get everything working, and python is great for throwing something
>> together.
>
>
> I like them both, too. But C is too time-consuming for me. I just
> don't spend enough time using it exclusively to be productive vs python.

Yeah, it can be frustrating sometimes (like how arrays don't really
exist and you have to be /very careful/ around them)

> Another language I've had my eye on is Julia.

Oh, never heard of it.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Wed, 12 Jun 2024 06:35 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 06:35:03 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 19
Message-ID: <slrnv6igar.13pi.candycanearter07@candydeb.host.invalid>
References: <kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com>
Injection-Date: Wed, 12 Jun 2024 08:35:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf";
logging-data="1619543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18v+M35WI0hOsbJhHpwEZd6j4KCQBa8tZX7xODDVegAeg=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:UT3MPgCsNL8Vv/Xx7Wqps81cu1I=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

Joel <joelcrump@gmail.com> wrote at 16:05 this Tuesday (GMT):
> candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
> wrote:
>
>>> I majored in comp sci, I have used a number of languages, even
>>> multiple platforms of assembly, just not in a long time. I've done
>>> amazing things with mIRC script's language. It's not a hard thing for
>>> me to pick up the process of coding, it *is* hard to think of an
>>> original idea for something to code, though.
>>
>>Oh, awesome. I'm about to start comp sci myself ^^
>
>
> Nice, I bet you will excel in it.

Thanks.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Wed, 12 Jun 2024 06:35 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 06:35:04 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 16
Message-ID: <slrnv6igbp.13pi.candycanearter07@candydeb.host.invalid>
References: <lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me>
<ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com>
Injection-Date: Wed, 12 Jun 2024 08:35:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf";
logging-data="1619543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YwdWQuxn1IBfuE5p0Nan8HQwx+fRpYD4hRw6bKO5x5g=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:f2UpeSt9tdgZNsp9xTVZmyTVEiU=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

Joel <joelcrump@gmail.com> wrote at 03:15 this Wednesday (GMT):
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>>> Nice, I bet you will excel in it.
>>
>>My word, but you make a powerful point.
>
>
> I'm a fan of candycanearter07, he's a wonderful contributor, I dare
> say the most valued one we have, being younger than most of us. He's
> our future, the future of Linux.

:D thx!
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Wed, 12 Jun 2024 06:40 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 06:40:03 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 34
Message-ID: <slrnv6igd1.13pi.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<Y6WdndgvFc_bifj7nZ2dnZfqnPudnZ2d@supernews.com>
<slrnv6f9uh.2hg.candycanearter07@candydeb.host.invalid>
<v49f8q$11kek$4@dont-email.me>
Injection-Date: Wed, 12 Jun 2024 08:40:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf";
logging-data="1621066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HmOHbhyBHhkmbVnowp+UJNbbf9h2M/nh2vlyx4F6KHg=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:YVdiExwlj7eX6pTExI2GA5z8rHc=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

Chris Ahlstrom <OFeem1987@teleworm.us> wrote at 12:17 this Tuesday (GMT):
> candycanearter07 wrote this copyrighted missive and expects royalties:
>
>> Tyrone <none@none.none> wrote at 02:32 this Sunday (GMT):
>>
>> <brevsnip>
>>
>> A lot of times, programming involves connecting "trivial problems in an
>> advanced way". Sorting a list of names would be needed for a dropdown,
>> letter or word counts are usually used to limit how much text a user can
>> input, and averages are useful for any kind of data summary. While
>> they're not /everything/ in programming, knowing the basics (or being
>> able to figure it out easily) can definitely help you out. They're also
>> fun to figure out in my opinion.
>>
>> [snip]
>>> In the real world, very few problems have "already been coded". Which is why
>>> people who proclaim that "AI" is going to make programmers "obsolete" have no
>>> GD clue what they are talking about.
>>
>> Yeah, AI is very very annoying and not a good replacement for coders.
>
> But here is another take:
>
> https://www.newyorker.com/magazine/2023/11/20/a-coder-considers-the-waning-days-of-the-craft
>
> There will also be a need for coders, though. Cannot completely trust what AI
> mines from the internet.

Well, yeah. Google tried that and everyone is rightfully laughing at
them for it.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.advocacy
Organization: A noiseless patient Spider
Date: Wed, 12 Jun 2024 07:22 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 07:22:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <v4biao$1hs21$3@dont-email.me>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Jun 2024 09:22:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="114c653c06754bac2979cba4b47e2f9e";
logging-data="1634369"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19avlldzcun+JdtLEI8Xnzx"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:7xJCkUapCgsQOeCn3187HP+TIVs=
View all headers

On Wed, 12 Jun 2024 06:35:02 -0000 (UTC), candycanearter07 wrote:

> DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):
>>
>> Usually qsort().
>>
> I knew there was an official implementation!

Just a note that Quicksort is quite bad on nearly-sorted lists.

A very simple, easy-to-implement sorting algorithm, that works
surprisingly well in a wide range of situations, is Shellsort.

Subject: Re: More Funny Stuff From Joel
From: chrisv
Newsgroups: comp.os.linux.advocacy
Organization: fastusenet - www.fastusenet.org
Date: Wed, 12 Jun 2024 11:10 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
From: chrisv@nospam.invalid (chrisv)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Message-ID: <j80j6jp5mpctuk09v0mv7p2n0bf2uuh428@4ax.com>
References: <kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com> <lcjvk1F9n7aU1@mid.individual.net> <2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com> <6664e989$0$2363151$882e4bbb@reader.netnews.com> <v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com> <666522c8$1$3747325$882e4bbb@reader.netnews.com> <hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com> <lcm7j9Fk632U1@mid.individual.net> <34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com> <slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 18
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Wed, 12 Jun 2024 11:10:41 UTC
Organization: fastusenet - www.fastusenet.org
Date: Wed, 12 Jun 2024 06:10:43 -0500
X-Received-Bytes: 1686
View all headers

candycanearter07 wrote:

> Joel wrote:
>>
>> I majored in comp sci, I have used a number of languages, even
>> multiple platforms of assembly, just not in a long time. I've done
>> amazing things with mIRC script's language. It's not a hard thing for
>> me to pick up the process of coding, it *is* hard to think of an
>> original idea for something to code, though.
>
> Oh, awesome. I'm about to start comp sci myself ^^

Way back when, I thought that I would major in CSci. I switched to EE
as I thought it a more versatile degree.

--
'Too bad Mr "BSEE" has tried to BS us about his alleged credentials in
the past.' -highhorse, lying shamelessly

Subject: Re: More Funny Stuff From Joel
From: Chris Ahlstrom
Newsgroups: comp.os.linux.advocacy
Organization: None
Date: Wed, 12 Jun 2024 12:16 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: OFeem1987@teleworm.us (Chris Ahlstrom)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Wed, 12 Jun 2024 08:16:01 -0400
Organization: None
Lines: 19
Message-ID: <v4c3i1$1l5ce$2@dont-email.me>
References: <lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me>
<ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com> <v4bdgl$1gvnv$2@dont-email.me>
Reply-To: OFeem1987@teleworm.us
Injection-Date: Wed, 12 Jun 2024 14:16:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="adb5e9f3c5052330c6b1cbc8748aa7ea";
logging-data="1742222"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18F6Ch8tlXGNiulA6jkNmYI"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:pXfv32QfDOJwq2UY3cXDvuOt/Ns=
X-Mutt: The most widely-used MUA
X-Slrn: Why use anything else?
X-User-Agent: Microsoft Outl00k, Usenet K00k Editions
View all headers

Lawrence D'Oliveiro wrote this copyrighted missive and expects royalties:

> On Tue, 11 Jun 2024 23:15:11 -0400, Joel wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>>>> Nice, I bet you will excel in it.
>>>
>>> My word, but you make a powerful point.
>>
>> I'm a fan of candycanearter07 ...
>
> Maybe my humour was not quite as ... Access-ible ... as it could have
> been ...

It's a problem with your visio-n.

--
A tall, dark stranger will have more fun than you.

Subject: Re: More Funny Stuff From Joel
From: DFS
Newsgroups: comp.os.linux.advocacy
Date: Wed, 12 Jun 2024 13:15 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!s1-1.netnews.com!news-out.netnews.com!postmaster.netnews.com!us14.netnews.com!not-for-mail
X-Trace: DXC=H0GdQO3jo>\;WJ0ZJ7CLb_HWonT5<]0T]Q;nb^V>PUfV=AnO\FUBY[PnF54O@^\1?ToE=HZ=K_m^SLQ^D7JJN18QankHQ>:kCVROT>gi^X=X_QCGm4YP8f00Z
X-Complaints-To: support@blocknews.net
Date: Wed, 12 Jun 2024 09:15:32 -0400
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: More Funny Stuff From Joel
Newsgroups: comp.os.linux.advocacy
References: <lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<v0r96jtsvodcnn4sk91ug1ulh2h76jgbvm@4ax.com>
<666522c8$1$3747325$882e4bbb@reader.netnews.com>
<hdpa6j5uns00bbcn76nsf8pugj4pdlu0tr@4ax.com>
<lcm7j9Fk632U1@mid.individual.net>
<34rb6j1h6sittv7fj19ur2bcji7pjrus1c@4ax.com>
<slrnv6f9hj.2hg.candycanearter07@candydeb.host.invalid>
<qdtg6jlkrl1fvch7i7b3p0068blkf4m63u@4ax.com> <v4b23l$1evff$5@dont-email.me>
<ck4i6j5969cgn8d60emsnd73eje3n1c2s0@4ax.com> <v4bdgl$1gvnv$2@dont-email.me>
Content-Language: en-US
In-Reply-To: <v4bdgl$1gvnv$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: <66699f72$0$963$882e4bbb@reader.netnews.com>
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718198130 reader.netnews.com 963 127.0.0.1:38425
X-Received-Bytes: 1770
View all headers

On 6/12/2024 1:59 AM, Lawrence D'Oliveiro wrote:
> On Tue, 11 Jun 2024 23:15:11 -0400, Joel wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>>>> Nice, I bet you will excel in it.
>>>
>>> My word, but you make a powerful point.
>>
>> I'm a fan of candycanearter07 ...
>
> Maybe my humour was not quite as ... Access-ible ... as it could have
> been ...

Word.

Subject: Re: More Funny Stuff From Joel
From: DFS
Newsgroups: comp.os.linux.advocacy
Date: Wed, 12 Jun 2024 13:15 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.netnews.com!netnews.com!s1-4.netnews.com!news-out.netnews.com!postmaster.netnews.com!us14.netnews.com!not-for-mail
X-Trace: DXC=H0GdQO3jo><bm`LXY\IR50HWonT5<]0T=Q;nb^V>PUf6=AnO\FUBY[0nF54O@^\1?4oE=HZ=K_m^3LQ^D7JJN181ankHQ>:kCV2OT>gi^X=X_1CGm4YP8f00:
X-Complaints-To: support@blocknews.net
Date: Wed, 12 Jun 2024 09:15:59 -0400
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: More Funny Stuff From Joel
Newsgroups: comp.os.linux.advocacy
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
Content-Language: en-US
In-Reply-To: <slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 75
Message-ID: <66699f8c$0$966$882e4bbb@reader.netnews.com>
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718198156 reader.netnews.com 966 127.0.0.1:48461
X-Received-Bytes: 2960
View all headers

On 6/12/2024 2:35 AM, candycanearter07 wrote:
> DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):

>>>> 3) write your own C to calc the mean, median and mode of:
>>>>
>>>> 1,2,3,4,5,5,6,7,8,9
>>>
>>> #include <stdio.h>
>>> #define COUNT_CNT 10
>>>
>>> int nums[] = {1, 2, 3, 4, 5, 5, 6, 7, 8, 9, -1};
>>>
>>> int main()
>>> {
>>> double mean;
>>> int median, mode, md_count[COUNT_CNT], len;
>>>
>>> for( len = 0; nums[len] != -1; len++ )
>>> {
>>> mean += nums[len];
>>> md_count[nums[len]]++;
>>> }
>>> mean /= len;
>>>
>>> if(len % 2 == 0)
>>> {
>>> int mid = len / 2;
>>> median = nums[mid] + nums[mid + 1]];
>>> median /= 2;
>>> }
>>> else
>>> median = nums[len / 2];
>>>
>>> for( int i = 0; i < COUNT_CNT; i++ )
>>> {
>>> if(md_count[mode] < md_count[i]) mode = i;
>>> }
>>>
>>> printf("mean %g, median %d, mode %d", mean, median, mode);
>>> }
>>>
>>> These compiled fine on my machine (gcc 12.2.0)
>>
>>
>> Did you actually run the code?
>
> Yes, but I also typed it into slrn by hand bc I was worried that pasting
> it would mess up word wrapping
>
>> I got a segfault (WSL Ubuntu, gcc 11.4). Had to make a few tweaks to
>> get it to run and provide correct answers.
>>
>> Do you want me to tell you what I did, or do you want to figure it out?
>>
>> Hint: after the line "mean /= len;" print out the contents of
>> md_count[]. You should get:
>>
>> 1. 1
>> 2. 1
>> 3. 1
>> 4. 1
>> 5. 2
>> 6. 1
>> 7. 1
>> 8. 1
>> 9. 1
>
> I don't see it sorry ^^:

You don't see what?

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Thu, 13 Jun 2024 06:05 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Thu, 13 Jun 2024 06:05:05 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 78
Message-ID: <slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
Injection-Date: Thu, 13 Jun 2024 08:05:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8c464b488a5de1d3dcb3d85cc58e2c0d";
logging-data="2246378"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JbhZ7StFwvrhJ7/IXEqAtK66cpu+0bIkcVIc41xWiCg=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ZKjnDzBW+eQEKttmtnYdhHUyU9k=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

DFS <nospam@dfs.com> wrote at 13:15 this Wednesday (GMT):
> On 6/12/2024 2:35 AM, candycanearter07 wrote:
>> DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):
>
>
>>>>> 3) write your own C to calc the mean, median and mode of:
>>>>>
>>>>> 1,2,3,4,5,5,6,7,8,9
>>>>
>>>> #include <stdio.h>
>>>> #define COUNT_CNT 10
>>>>
>>>> int nums[] = {1, 2, 3, 4, 5, 5, 6, 7, 8, 9, -1};
>>>>
>>>> int main()
>>>> {
>>>> double mean;
>>>> int median, mode, md_count[COUNT_CNT], len;
>>>>
>>>> for( len = 0; nums[len] != -1; len++ )
>>>> {
>>>> mean += nums[len];
>>>> md_count[nums[len]]++;
>>>> }
>>>> mean /= len;
>>>>
>>>> if(len % 2 == 0)
>>>> {
>>>> int mid = len / 2;
>>>> median = nums[mid] + nums[mid + 1]];
>>>> median /= 2;
>>>> }
>>>> else
>>>> median = nums[len / 2];
>>>>
>>>> for( int i = 0; i < COUNT_CNT; i++ )
>>>> {
>>>> if(md_count[mode] < md_count[i]) mode = i;
>>>> }
>>>>
>>>> printf("mean %g, median %d, mode %d", mean, median, mode);
>>>> }
>>>>
>>>> These compiled fine on my machine (gcc 12.2.0)
>>>
>>>
>>> Did you actually run the code?
>>
>> Yes, but I also typed it into slrn by hand bc I was worried that pasting
>> it would mess up word wrapping
>>
>>> I got a segfault (WSL Ubuntu, gcc 11.4). Had to make a few tweaks to
>>> get it to run and provide correct answers.
>>>
>>> Do you want me to tell you what I did, or do you want to figure it out?
>>>
>>> Hint: after the line "mean /= len;" print out the contents of
>>> md_count[]. You should get:
>>>
>>> 1. 1
>>> 2. 1
>>> 3. 1
>>> 4. 1
>>> 5. 2
>>> 6. 1
>>> 7. 1
>>> 8. 1
>>> 9. 1
>>
>> I don't see it sorry ^^:
>
>
> You don't see what?

The mistake I made.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Thu, 13 Jun 2024 06:10 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Thu, 13 Jun 2024 06:10:03 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 18
Message-ID: <slrnv6l30k.24pu.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<v4biao$1hs21$3@dont-email.me>
Injection-Date: Thu, 13 Jun 2024 08:10:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8c464b488a5de1d3dcb3d85cc58e2c0d";
logging-data="2248026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JoXEcTYCwEBrldcllV1oP3HaNp4DHI7luMApVowGt5w=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:5RQ5Keq4eGdm6s0LSAKnLjvRGRw=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 07:22 this Wednesday (GMT):
> On Wed, 12 Jun 2024 06:35:02 -0000 (UTC), candycanearter07 wrote:
>
>> DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):
>>>
>>> Usually qsort().
>>>
>> I knew there was an official implementation!
>
> Just a note that Quicksort is quite bad on nearly-sorted lists.
>
> A very simple, easy-to-implement sorting algorithm, that works
> surprisingly well in a wide range of situations, is Shellsort.

I'll note it down.
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: DFS
Newsgroups: comp.os.linux.advocacy
Date: Thu, 13 Jun 2024 14:59 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.netnews.com!postmaster.netnews.com!us14.netnews.com!not-for-mail
X-Trace: DXC=eHhEaRI]40kYi@fQk=;MdlHWonT5<]0TmQ;nb^V>PUff=AnO\FUBY[`nF54O@^\1?dESf2LZ4kKliLQ^D7JJN18aankHQ>:kCVbOT>gi^X=X_aCGm4YP8f00j
X-Complaints-To: support@blocknews.net
Date: Thu, 13 Jun 2024 10:59:51 -0400
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
Subject: Re: More Funny Stuff From Joel
Newsgroups: comp.os.linux.advocacy
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
Content-Language: en-US
From: nospam@dfs.com (DFS)
In-Reply-To: <slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 84
Message-ID: <666b0963$0$985$882e4bbb@reader.netnews.com>
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718290787 reader.netnews.com 985 127.0.0.1:42255
View all headers

On 6/13/2024 2:05 AM, candycanearter07 wrote:
> DFS <nospam@dfs.com> wrote at 13:15 this Wednesday (GMT):
>> On 6/12/2024 2:35 AM, candycanearter07 wrote:
>>> DFS <nospam@dfs.com> wrote at 16:20 this Tuesday (GMT):
>>
>>
>>>>>> 3) write your own C to calc the mean, median and mode of:
>>>>>>
>>>>>> 1,2,3,4,5,5,6,7,8,9
>>>>>
>>>>> #include <stdio.h>
>>>>> #define COUNT_CNT 10
>>>>>
>>>>> int nums[] = {1, 2, 3, 4, 5, 5, 6, 7, 8, 9, -1};
>>>>>
>>>>> int main()
>>>>> {
>>>>> double mean;
>>>>> int median, mode, md_count[COUNT_CNT], len;
>>>>>
>>>>> for( len = 0; nums[len] != -1; len++ )
>>>>> {
>>>>> mean += nums[len];
>>>>> md_count[nums[len]]++;
>>>>> }
>>>>> mean /= len;
>>>>>
>>>>> if(len % 2 == 0)
>>>>> {
>>>>> int mid = len / 2;
>>>>> median = nums[mid] + nums[mid + 1]];
>>>>> median /= 2;
>>>>> }
>>>>> else
>>>>> median = nums[len / 2];
>>>>>
>>>>> for( int i = 0; i < COUNT_CNT; i++ )
>>>>> {
>>>>> if(md_count[mode] < md_count[i]) mode = i;
>>>>> }
>>>>>
>>>>> printf("mean %g, median %d, mode %d", mean, median, mode);
>>>>> }
>>>>>
>>>>> These compiled fine on my machine (gcc 12.2.0)
>>>>
>>>>
>>>> Did you actually run the code?
>>>
>>> Yes, but I also typed it into slrn by hand bc I was worried that pasting
>>> it would mess up word wrapping
>>>
>>>> I got a segfault (WSL Ubuntu, gcc 11.4). Had to make a few tweaks to
>>>> get it to run and provide correct answers.
>>>>
>>>> Do you want me to tell you what I did, or do you want to figure it out?
>>>>
>>>> Hint: after the line "mean /= len;" print out the contents of
>>>> md_count[]. You should get:
>>>>
>>>> 1. 1
>>>> 2. 1
>>>> 3. 1
>>>> 4. 1
>>>> 5. 2
>>>> 6. 1
>>>> 7. 1
>>>> 8. 1
>>>> 9. 1
>>>
>>> I don't see it sorry ^^:
>>
>>
>> You don't see what?
>
>
> The mistake I made.

Did you print the contents of md_count[] ? That should give you a clue.

The code you posted shouldn't have run. What answers did it give you?

Subject: Re: More Funny Stuff From Joel
From: rbowman
Newsgroups: comp.os.linux.advocacy
Date: Thu, 13 Jun 2024 17:30 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bowman@montana.com (rbowman)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: 13 Jun 2024 17:30:32 GMT
Lines: 83
Message-ID: <ld0olnF7p22U1@mid.individual.net>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
<666b0963$0$985$882e4bbb@reader.netnews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net f06EKcscRUBVmo+pjD4ufAcg82hrRUTGPegI/q/vc+KYNRduNN
Cancel-Lock: sha1:7AJmSqj+MIDRfN8/i8AeGbEYjd4= sha256:SRW6o7dHCZlKd67PBQX+sxoq7iDRx+hAykisPmvNtEQ=
User-Agent: Pan/0.149 (Bellevue; 4c157ba)
View all headers

On Thu, 13 Jun 2024 10:59:51 -0400, DFS wrote:

> Did you print the contents of md_count[] ? That should give you a clue.

Or print mode. Maybe you got lucky.

$ gcc -Wall -o mean mean.c
$

$ clang -Wall -o mean mean.c
mean.c:13:4: warning: variable 'mean' is uninitialized when used here [-
Wuninitialized]
mean += nums[len];
^~~~
mean.c:8:14: note: initialize the variable 'mean' to silence this warning
double mean;
^
= 0.0
1 warning generated.

Where this gets interesting is adding

printf("mode %d\n", mode);
for( int i = 0; i < COUNT_CNT; i++ )
.....

$ gcc -Wall -o mean mean.c
mean.c: In function ‘main’:
mean.c:27:9: warning: ‘mode’ is used uninitialized [-Wuninitialized]
27 | printf("mode %d\n", mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~

$ ./mean
mode -678188295
Segmentation fault (core dumped)

$ clang -Wall -o mean mean.c
mean.c:27:29: warning: variable 'mode' is uninitialized when used here [-
Wuninitialized]
printf("mode %d\n", mode);
^~~~
mean.c:9:19: note: initialize the variable 'mode' to silence this warning
int median, mode, md_count[COUNT_CNT], len;
^
= 0
1 warning generated.

$ ./mean
mode 100
mean 5, median 5, mode 6

Not quite out of the woods... Adding

int median, md_count[COUNT_CNT], len;
int mode = 0;
.....

$ clang -Wall -o mean mean.c
$ ./mean
mean 5, median 5, mode 0

$ gcc -Wall -o mean mean.c
mean 5, median 5, mode 2

So what else might be uninitialized?

I'm a little disappointed in both compilers.

Subject: Re: More Funny Stuff From Joel
From: DFS
Newsgroups: comp.os.linux.advocacy
Date: Thu, 13 Jun 2024 19:08 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!s1-3.netnews.com!news-out.netnews.com!postmaster.netnews.com!us14.netnews.com!not-for-mail
X-Trace: DXC=1\1dXY0C?`U;WJ0ZJ7CLb_HWonT5<]0T]Q;nb^V>PUfV=AnO\FUBY[PnF54O@^\1?Tj6og>_A:dBRhS;72ohBc6Vnk9`jfQW@>]dDioXmM8L1QOXeKkS2`?jY
X-Complaints-To: support@blocknews.net
Date: Thu, 13 Jun 2024 15:08:50 -0400
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
From: nospam@dfs.com (DFS)
Subject: Re: More Funny Stuff From Joel
Newsgroups: comp.os.linux.advocacy
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
<666b0963$0$985$882e4bbb@reader.netnews.com>
<ld0olnF7p22U1@mid.individual.net>
Content-Language: en-US
In-Reply-To: <ld0olnF7p22U1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 491
Message-ID: <666b43c2$0$966$882e4bbb@reader.netnews.com>
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718305730 reader.netnews.com 966 127.0.0.1:37009
X-Received-Bytes: 14658
View all headers

On 6/13/2024 1:30 PM, rbowman wrote:
> On Thu, 13 Jun 2024 10:59:51 -0400, DFS wrote:
>
>> Did you print the contents of md_count[] ? That should give you a clue.
>
> Or print mode. Maybe you got lucky.

You mean I got lucky with:

1. 1
2. 1
3. 1
4. 1
5. 2
6. 1
7. 1
8. 1
9. 1

?

Not luck. It didn't look like that at first. I got there only after
making various fixes.

With his 3-word responses and 2-day delay, candycane doesn't seem too
interested in his program. The fixes I made are below.

> $ gcc -Wall -o mean mean.c
> $

It compiled for me too (after fixing the typo). But it segfaulted at
runtime.

> $ clang -Wall -o mean mean.c
> mean.c:13:4: warning: variable 'mean' is uninitialized when used here [-
> Wuninitialized]
> mean += nums[len];
> ^~~~
> mean.c:8:14: note: initialize the variable 'mean' to silence this warning
> double mean;
> ^
> = 0.0
> 1 warning generated.

C did something REALLY strange recently because I didn't initialize a
char[] variable. It was a stats program (see at bottom), and it worked
well until I tested a dataset of consecutive numbers. Up to 40 it was
fine, but it flagged as outliers every number above 40, but only if the
dataset was consecutive numbers. None of them were actually outliers,
as defined by the formula I used.

No matter the code changes, file saves, compiles, etc it kept flagging
40+ as outliers. Until I initialized the variable with ="". Then it
worked right.

> Where this gets interesting is adding
>
> printf("mode %d\n", mode);
> for( int i = 0; i < COUNT_CNT; i++ )
> .....
>
>
> $ gcc -Wall -o mean mean.c
> mean.c: In function ‘main’:
> mean.c:27:9: warning: ‘mode’ is used uninitialized [-Wuninitialized]
> 27 | printf("mode %d\n", mode);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~

That's a good thing.

> $ ./mean
> mode -678188295
> Segmentation fault (core dumped)

There it is.

> $ clang -Wall -o mean mean.c
> mean.c:27:29: warning: variable 'mode' is uninitialized when used here [-
> Wuninitialized]
> printf("mode %d\n", mode);
> ^~~~
> mean.c:9:19: note: initialize the variable 'mode' to silence this warning
> int median, mode, md_count[COUNT_CNT], len;
> ^
> = 0
> 1 warning generated.
> $ ./mean
> mode 100
> mean 5, median 5, mode 6
>
> Not quite out of the woods... Adding
>
> int median, md_count[COUNT_CNT], len;
> int mode = 0;
> .....
>
> $ clang -Wall -o mean mean.c
> $ ./mean
> mean 5, median 5, mode 0

The mode is incorrect.

> $ gcc -Wall -o mean mean.c
> mean 5, median 5, mode 2

That mode is also incorrect. There does happen to be 2 instances of the
mode, but the mode isn't 2.

> So what else might be uninitialized?
>
>
> I'm a little disappointed in both compilers.
I learned yesterday about a gcc option:
-fsanitize=undefined
that might help you.

I made a few fixes to candy cane's code:

- fix typo with two closing brackets ]]
- add stdlib.h include
- set mean, median, mode and len to 0 beforehand
- malloc the md_count[] array to size 9 (because there
are only 9 unique values in the size 10 dataset)
- add return 0

============================================================
#include <stdio.h>
#include <stdlib.h>

#define COUNT_CNT 10

int nums[] = {1,2,3,4,5,5,6,7,8,9,-1};

int main()
{ double mean = 0.0;
int median = 0, mode = 0, len = 0;
int *md_count = malloc((COUNT_CNT-1) * sizeof(int));
//calc mean and count mode
for( len = 0; nums[len] != -1; len++ )
{
mean += nums[len];
md_count[nums[len]]++;
}
mean /= len;
//temp to see contents of md_count[]
// for( int i = 1; i < COUNT_CNT; i++ )
// {
// printf("%d. %d\n",i,md_count[i]);
// }

//median
if(len % 2 == 0)
{
int mid = len / 2;
median = nums[mid] + nums[mid + 1];
median /= 2;
}
else
{
median = nums[len / 2];
}
//mode
for( int i = 0; i < COUNT_CNT; i++ )
{
if(md_count[mode] < md_count[i])
{
mode = i;
}
}
printf("mean %g, median %d, mode %d\n", mean, median, mode);
free(md_count);
return 0;
}

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

$ gcc -Wall mmm_fixed.c -o mmm_fixed
$ ./mmm_fixed
mean 5, median 5, mode 5

And 5 IS the correct mode.

Here's something you might enjoy playing with:

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

//this code is hereby released to the public domain

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>

/*
this program computes the descriptive statistics of sets of integers

1.0 release Dec 2020
2.0 release Jun 2024

used the population skewness and Kurtosis formulas from:

https://www.calculatorsoup.com/calculators/statistics/descriptivestatistics.php
also test the results of this code against that site

compile:
$ gcc -Wall -Wextra -O2 prog.c -o prog -lm
or
$ gcc -Wall -Wextra -O2 -fsanitize=undefined prog.c -o prog
-lm
usage : ./prog N -option (where N is 2 or higher, and option is -r or
-c or -o)
-r generates N random numbers
-c generates consecutive numbers 1 to N
-o generates random numbers with outliers
*/

//random ints
int randNbr(int low, int high) {
return (low + rand() / (RAND_MAX / (high - low + 1) + 1));
}

//comparator function used with qsort
int compareint (const void * a, const void * b)
{ if (*(int*)a > *(int*)b) return 1;
else if (*(int*)a < *(int*)b) return -1;
else return 0;
}

int main(int argc, char *argv[])
{ if(argc < 3) {
printf("Missing argument:\n");
printf(" * enter a number greater than 2\n");
printf(" * enter an option -r -c or -o\n");
exit(0);
}

//vars
int i=0;
int N = atoi(argv[1]);
int *nums = malloc(N * sizeof(int));
double sumN=0.0, median=0.0, Q1=0.0, Q2=0.0, Q3=0.0, IQR=0.0;
double stddev = 0.0, kurtosis = 0.0;
double sqrdiffmean = 0.0, cubediffmean = 0.0, quaddiffmean = 0.0;
double meanabsdev = 0.0, rootmeansqr = 0.0;

//generate random dataset
if(strcmp(argv[2],"-r") == 0) {
srand(time(NULL));
for(i=0;i<N;i++) { nums[i] = randNbr(1,N*3); }

printf("%d Randoms:\n", N);
printf("No commas : "); for(i=0;i<N;i++) { printf("%d ", nums[i]); }
printf("\nWith commas: "); for(i=0;i<N;i++) { printf("%d,", nums[i]); }
qsort(nums,N,sizeof(int),compareint);
printf("\nSorted : "); for(i=0;i<N;i++) { printf("%d ", nums[i]); }
printf("\nSorted : "); for(i=0;i<N;i++) { printf("%d,", nums[i]); }
}
//generate random dataset with outliers
if(strcmp(argv[2],"-o") == 0) {
srand(time(NULL));
nums[0] = 1; nums[1] = 3;
for(i=2;i<N-2;i++) { nums[i] = randNbr(100,N*30); }
nums[N-2] = 1000; nums[N-1] = 2000;

printf("%d Randoms with outliers:\n", N);
printf("No commas : "); for(i=0;i<N;i++) { printf("%d ", nums[i]); }
printf("\nWith commas: "); for(i=0;i<N;i++) { printf("%d,", nums[i]); }
qsort(nums,N,sizeof(int),compareint);
printf("\nSorted : "); for(i=0;i<N;i++) { printf("%d ", nums[i]); }
printf("\nSorted : "); for(i=0;i<N;i++) { printf("%d,", nums[i]); }
}

//generate consecutive numbers 1 to N
if(strcmp(argv[2],"-c") == 0) {
for(i=0;i<N;i++) { nums[i] = i + 1; }

printf("%d Consecutive:\n", N);
printf("No commas : "); for(i=0;i<N;i++) { printf("%d ", nums[i]); }
printf("\nWith commas : "); for(i=0;i<N;i++) { printf("%d,", nums[i]); }
}

//calc various descriptive stats
double min = nums[0], max = nums[N-1];
for(i=0;i<N;i++) {sumN += nums[i];}
double mean = sumN / (double)N;
for(i = 0; i < N; i++)
{
double diff = nums[i] - mean;
sqrdiffmean += diff * diff ; // for variance and sum squares
cubediffmean += diff * diff * diff ; // for skewness
quaddiffmean += diff * diff * diff * diff ; // for Kurtosis
meanabsdev += fabs(diff) ; // for mean absolute deviation
rootmeansqr += nums[i] * nums[i] ; // for root mean square
}


Click here to read the complete article
Subject: Re: More Funny Stuff From Joel
From: rbowman
Newsgroups: comp.os.linux.advocacy
Date: Thu, 13 Jun 2024 22:16 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bowman@montana.com (rbowman)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: 13 Jun 2024 22:16:24 GMT
Lines: 28
Message-ID: <ld19dnFa6idU1@mid.individual.net>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
<666b0963$0$985$882e4bbb@reader.netnews.com>
<ld0olnF7p22U1@mid.individual.net>
<666b43c2$0$966$882e4bbb@reader.netnews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net OfwjAYbR8m4KZPu85InEOA6AS2cGXDMGngT7hqEtOy1OuEzoQv
Cancel-Lock: sha1:2cYnQnUxjhnbRL7AA8ii2eSXlcg= sha256:z/fKUg8UpEqW5BwpNsYJY2KEalpIMSZuYi6IiRpaffw=
User-Agent: Pan/0.149 (Bellevue; 4c157ba)
View all headers

On Thu, 13 Jun 2024 15:08:50 -0400, DFS wrote:

> - malloc the md_count[] array to size 9 (because there
> are only 9 unique values in the size 10 dataset)

What memory location is md_count[9]++ incrementing? For that matter what
are the initial values of md_count[0] through md_count[8] ?

I used memset(&md_count, 0, sizeof md_count); with the original
declaration or you could have used calloc().

Same difference. You wind up with something that's not an array of
whatever random crap is on the stack.

> - add return 0

picky, picky... I suppose you want 'int main(void)' too. I can't remember
the guy's name but he was a prolific author of programming books in the
early '80s whose examples always started with 'void main(). If comments
in programming forums could kill he would have had an early retirement.

Not for nothing but in VS Code if you don't initialize 'mode' at the point
where it's used there is a red squiggle that pops up 'identifier "mode" is
undefinedC/C++(20)' It doesn't flag an uninitialized 'mean', although
'mean += nums[len];' assumes it was 0.0. Points to clang for that one.

Subject: Re: More Funny Stuff From Joel
From: candycanearter07
Newsgroups: comp.os.linux.advocacy
Organization: the-candyden-of-code
Date: Fri, 14 Jun 2024 06:00 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.os.linux.advocacy
Subject: Re: More Funny Stuff From Joel
Date: Fri, 14 Jun 2024 06:00:03 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 33
Message-ID: <slrnv6nmon.30ai.candycanearter07@candydeb.host.invalid>
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
<666b0963$0$985$882e4bbb@reader.netnews.com>
<ld0olnF7p22U1@mid.individual.net>
<666b43c2$0$966$882e4bbb@reader.netnews.com>
Injection-Date: Fri, 14 Jun 2024 08:00:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a5412a3b682daf598a5e904c68c6451b";
logging-data="2911750"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ush+hm9liLIk6F8M7qT4MnduDI3VD3jrvNtVuxzhaKA=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:QbG0q7jHnromXZA2kSqCek7YG6w=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

DFS <nospam@dfs.com> wrote at 19:08 this Thursday (GMT):
> On 6/13/2024 1:30 PM, rbowman wrote:
>> On Thu, 13 Jun 2024 10:59:51 -0400, DFS wrote:
>>
>>> Did you print the contents of md_count[] ? That should give you a clue.
>>
>> Or print mode. Maybe you got lucky.
>
> You mean I got lucky with:
>
> 1. 1
> 2. 1
> 3. 1
> 4. 1
> 5. 2
> 6. 1
> 7. 1
> 8. 1
> 9. 1
>
> ?
>
> Not luck. It didn't look like that at first. I got there only after
> making various fixes.
>
> With his 3-word responses and 2-day delay, candycane doesn't seem too
> interested in his program. The fixes I made are below.
>

Sorry, I've been kinda busy this week..
[snip]
--
user <candycane> is generated from /dev/urandom

Subject: Re: More Funny Stuff From Joel
From: DFS
Newsgroups: comp.os.linux.advocacy
Date: Fri, 14 Jun 2024 13:45 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!s1-1.netnews.com!news-out.netnews.com!postmaster.netnews.com!us11.netnews.com!not-for-mail
X-Trace: DXC=XXQ8bdC]a\I@dH[gO7?^]LHWonT5<]0TMdjI?Uho:XeKlL51CP6LDLL95GMl]75=8AW6]ZOR`<:?GLQ^D7JJN18AankHQ>:kCVBOT>gi^X=X_ACGm4YP8f00J
X-Complaints-To: support@blocknews.net
Date: Fri, 14 Jun 2024 09:45:29 -0400
MIME-Version: 1.0
User-Agent: Betterbird (Windows)
Subject: Re: More Funny Stuff From Joel
Newsgroups: comp.os.linux.advocacy
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
<ej496jd0tb59u2l0nqtghq3u9ahhmann3s@4ax.com>
<lcjnnuF896hU5@mid.individual.net>
<kma96j1no1tp926ctejldkdk2c19aeruft@4ax.com>
<lcjvk1F9n7aU1@mid.individual.net>
<2ej96j1mbvgiok4q5c57vdlo94itpfu5dt@4ax.com>
<6664e989$0$2363151$882e4bbb@reader.netnews.com>
<slrnv6f9fl.2hg.candycanearter07@candydeb.host.invalid>
<66687931$0$3747328$882e4bbb@reader.netnews.com>
<slrnv6ig9v.13pi.candycanearter07@candydeb.host.invalid>
<66699f8c$0$966$882e4bbb@reader.netnews.com>
<slrnv6l2vk.24pu.candycanearter07@candydeb.host.invalid>
<666b0963$0$985$882e4bbb@reader.netnews.com>
<ld0olnF7p22U1@mid.individual.net>
<666b43c2$0$966$882e4bbb@reader.netnews.com>
<ld19dnFa6idU1@mid.individual.net>
Content-Language: en-US
From: nospam@dfs.com (DFS)
In-Reply-To: <ld19dnFa6idU1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 52
Message-ID: <666c4979$0$2363133$882e4bbb@reader.netnews.com>
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1718372729 reader.netnews.com 2363133 127.0.0.1:47385
X-Received-Bytes: 3338
View all headers

On 6/13/2024 6:16 PM, rbowman wrote:
> On Thu, 13 Jun 2024 15:08:50 -0400, DFS wrote:
>
>> - malloc the md_count[] array to size 9 (because there
>> are only 9 unique values in the size 10 dataset)
>
> What memory location is md_count[9]++ incrementing?

9 is the correct size for md_count[], but then you have to play games
with index addressing and looping.

So malloc() to size 10 and life's good.

> For that matter what are the initial values of md_count[0] through md_count[8] ?

0.

gcc 11.4 on Ubuntu WSL

> I used memset(&md_count, 0, sizeof md_count); with the original
> declaration or you could have used calloc().
>
> Same difference. You wind up with something that's not an array of
> whatever random crap is on the stack.
>
>> - add return 0
>
> picky, picky... I suppose you want 'int main(void)' too.

Definitely. I should've caught that.

You HAVE to be picky to write good C programs. Way too picky I think.

> I can't remember
> the guy's name but he was a prolific author of programming books in the
> early '80s whose examples always started with 'void main(). If comments
> in programming forums could kill he would have had an early retirement.

Bring up void main() in comp.lang.c and you'll get an earful, I'm sure.

> Not for nothing but in VS Code if you don't initialize 'mode' at the point
> where it's used there is a red squiggle that pops up 'identifier "mode" is
> undefinedC/C++(20)' It doesn't flag an uninitialized 'mean', although
> 'mean += nums[len];' assumes it was 0.0. Points to clang for that one.

I just tried VS Code with a light theme and it looked good. I guess I
could get used to it, but I'll stick with Notepad++.

Subject: Re: More Funny Stuff From The Joke Python
From: Stéphane CARPENTIER
Newsgroups: comp.os.linux.advocacy
Organization: Mulots' Killer
Date: Fri, 14 Jun 2024 16:30 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-a.proxad.net!nnrp6-1.free.fr!not-for-mail
Newsgroups: comp.os.linux.advocacy
From: sc@fiat-linux.fr (Stéphane CARPENTIER)
Subject: Re: More Funny Stuff From The Joke Python
References: <17d716103c089ab3$7951$675878$802601b3@news.usenetexpress.com>
Organization: Mulots' Killer
User-Agent: slrn/pre1.0.4-9 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Date: 14 Jun 2024 16:30:53 GMT
Lines: 80
Message-ID: <666c703d$0$7519$426a74cc@news.free.fr>
NNTP-Posting-Date: 14 Jun 2024 18:30:53 CEST
NNTP-Posting-Host: 78.201.248.7
X-Trace: 1718382653 news-1.free.fr 7519 78.201.248.7:48400
X-Complaints-To: abuse@proxad.net
View all headers

Le 08-06-2024, Diego Garcia <dg@chaos.rocks> a écrit :
>
> I can write my name in 2 seconds,

Are you sure about it? I don't believe it.

> but with Python it would require 20 minutes

I believe in this part. I already knew you aren't a programmer. A little
girl could do it in five minutes. If a child comes to see you in your asylum,
you could ask her to teach you. It would take less than 20 minutes.

> -- not including the installation of appropriate modules.

You already have three versions of python on your gentoo distro managed
by others. You don't need to install anything more on it.

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

> Python is taking the computing world by storm, because the majority of the
> computing world are totally incompetent idiots.
>
> Aside: Does anyone see a Microslop connection? Ha, ha, ha, ha, ha, ha, ha!
>
> While updating my fantastic Gentoo machines I notice these funny things:
>
> hatch-fancy-pypi-readme (https://pypi.org/project/hatch-fancy-pypi-readme/)
>
> pluggy (https://pluggy.readthedocs.io/en/stable/)
>
> calver (https://github.com/di/calver/)
>
>
> Holy shish kabob! Junk Python requires a thousand auxiliary modules
> just to output a single char! (And millions more to do anything remotely
> worthwhile.)
>
> The inescapable conclusion:
>
> Python absolutely requires a humongous mountain of support functions to
> accomplish its seeming magical ease, and this mountain is conveniently
> hidden from the incompetent Python user who will drool in awe over the
> "effortless" capability.
>
> The unhidden cost, however, is extreme sluggishness and sluggishness
> violates the very concept of digital computing.
>
> Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!
>
> I can write my name in 2 seconds, but with Python it would require 20
> minutes -- not including the installation of appropriate modules.
>
> Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!
>
>

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

Pages:1234567

rocksolid light 0.9.8
clearnet tor