Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Why won't sharks eat lawyers? Professional courtesy.


devel / comp.lang.c / Re: C vis C++ standard deviation function.

SubjectAuthor
* C vis C++ standard deviation function.Malcolm McLean
+* Re: C vis C++ standard deviation function.Bart
|+* Re: C vis C++ standard deviation function.Ben Bacarisse
||+* Re: C vis C++ standard deviation function.Malcolm McLean
|||`* Re: C vis C++ standard deviation function.Ben Bacarisse
||| `* Re: C vis C++ standard deviation function.Malcolm McLean
|||  `* Re: C vis C++ standard deviation function.Ben Bacarisse
|||   `* Re: C vis C++ standard deviation function.Malcolm McLean
|||    `* Re: C vis C++ standard deviation function.Ben Bacarisse
|||     `* Re: C vis C++ standard deviation function.Malcolm McLean
|||      `- Re: C vis C++ standard deviation function.Ben Bacarisse
||`* Re: C vis C++ standard deviation function.Scott Lurndal
|| `* Re: C vis C++ standard deviation function.Ben Bacarisse
||  `* Re: C vis C++ standard deviation function.David Brown
||   +- Re: C vis C++ standard deviation function.Malcolm McLean
||   `* Re: C vis C++ standard deviation function.Ben Bacarisse
||    `* Re: C vis C++ standard deviation function.David Brown
||     `* Re: C vis C++ standard deviation function.Ben Bacarisse
||      `- Re: C vis C++ standard deviation function.Andreas Kempe
|`* Re: C vis C++ standard deviation function.Manu Raju
| +* Re: C vis C++ standard deviation function.Bonita Montero
| |+* Re: C vis C++ standard deviation function.Bart
| ||+- Re: C vis C++ standard deviation function.Bonita Montero
| ||`* Re: C vis C++ standard deviation function.Bonita Montero
| || `* Re: C vis C++ standard deviation function.Bart
| ||  +* Re: C vis C++ standard deviation function.Bonita Montero
| ||  |`* Re: C vis C++ standard deviation function.Bart
| ||  | `- Re: C vis C++ standard deviation function.Bonita Montero
| ||  +* Re: C vis C++ standard deviation function.Ben Bacarisse
| ||  |+* Re: C vis C++ standard deviation function.Bart
| ||  ||`* Re: C vis C++ standard deviation function.Ben Bacarisse
| ||  || `* Re: C vis C++ standard deviation function.Bart
| ||  ||  +- Re: C vis C++ standard deviation function.Ben Bacarisse
| ||  ||  +* Re: C vis C++ standard deviation function.Bonita Montero
| ||  ||  |`* Re: C vis C++ standard deviation function.Bart
| ||  ||  | +- Re: C vis C++ standard deviation function.Bonita Montero
| ||  ||  | `* Re: C vis C++ standard deviation function.Manfred
| ||  ||  |  `* Re: C vis C++ standard deviation function.Bonita Montero
| ||  ||  |   `- Re: C vis C++ standard deviation function.Bart
| ||  ||  `* Re: C vis C++ standard deviation function.Malcolm McLean
| ||  ||   +- Re: C vis C++ standard deviation function.Bonita Montero
| ||  ||   +* Re: C vis C++ standard deviation function.Scott Lurndal
| ||  ||   |+* Re: C vis C++ standard deviation function.Malcolm McLean
| ||  ||   ||`- Re: C vis C++ standard deviation function.Scott Lurndal
| ||  ||   |`- Re: C vis C++ standard deviation function.Manu Raju
| ||  ||   `* Re: C vis C++ standard deviation function.Bart
| ||  ||    `- Re: C vis C++ standard deviation function.Ben Bacarisse
| ||  |`- Re: C vis C++ standard deviation function.Bonita Montero
| ||  `- Re: C vis C++ standard deviation function.Malcolm McLean
| |`* Re: C vis C++ standard deviation function.Manu Raju
| | +- Re: C vis C++ standard deviation function.Bart
| | `- Re: C vis C++ standard deviation function.Bonita Montero
| +- Re: C vis C++ standard deviation function.Bonita Montero
| `* Re: C vis C++ standard deviation function.Bart
|  `* Re: C vis C++ standard deviation function.Bonita Montero
|   `- Re: C vis C++ standard deviation function.Malcolm McLean
+* Re: C vis C++ standard deviation function.Kenny McCormack
|`* Re: C vis C++ standard deviation function.Bonita Montero
| `- Re: C vis C++ standard deviation function.Kenny McCormack
+- Re: C vis C++ standard deviation function.Ben Bacarisse
`* Re: C vis C++ standard deviation function.Bonita Montero
 `- Re: C vis C++ standard deviation function.Bonita Montero

Pages:123
Re: C vis C++ standard deviation function.

<t05ooe$vaj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20879&group=comp.lang.c#20879

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Mon, 7 Mar 2022 21:08:48 +0100
Organization: A noiseless patient Spider
Lines: 2
Message-ID: <t05ooe$vaj$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 7 Mar 2022 20:08:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0e0a92b6625801e4ee0e2a78f342032f";
logging-data="32083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RnxhJce0H9WujZ8MXzeEgTsj1LdkbCg0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Cancel-Lock: sha1:YKJ85buPXtW/yXmpomzVEQPMXVU=
In-Reply-To: <791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Mon, 7 Mar 2022 20:08 UTC

I think Bart is a complete idiot - what
he doesn't understand is overly complex.

Re: C vis C++ standard deviation function.

<t05r53$iam$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20880&group=comp.lang.c#20880

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Mon, 7 Mar 2022 20:49:40 +0000
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <t05r53$iam$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<t05mq3$j43$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 7 Mar 2022 20:49:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9000288fe1b7b70da7788910e43a2962";
logging-data="18774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zqIErMqWnRlhcZAqeIZVKXTn2wbwsz8U="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:VV/464JscXbwRaRlhWV7kzd91AQ=
In-Reply-To: <t05mq3$j43$1@dont-email.me>
 by: Bart - Mon, 7 Mar 2022 20:49 UTC

On 07/03/2022 19:35, Bonita Montero wrote:
>> As it turned out, BM's solution didn't work. I've no idea why
>> and the  C++ is far too complex for me to try and figure it out. ...
>
> You don't understand the code and you say that it doesn't work ?

Why don't you post a version I can run. Or at least tell what what I
have to pass to get the SD of this array:

double A[]={41,53,97,67,62, 82,93, 54,34,11};

(I assume you have tested your routine.)

Re: C vis C++ standard deviation function.

<hfuVJ.104810$Gojc.90868@fx99.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20881&group=comp.lang.c#20881

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx99.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C vis C++ standard deviation function.
Newsgroups: comp.lang.c
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com> <t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me> <t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me> <t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me> <87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me> <874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me> <791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
Lines: 26
Message-ID: <hfuVJ.104810$Gojc.90868@fx99.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 07 Mar 2022 20:51:25 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 07 Mar 2022 20:51:25 GMT
X-Received-Bytes: 2488
 by: Scott Lurndal - Mon, 7 Mar 2022 20:51 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On Monday, 7 March 2022 at 18:39:38 UTC, Bart wrote:
>> On 07/03/2022 16:43, Ben Bacarisse wrote:
>>
>> > Modern C++ has a lot of support for neat programming using iterators.
>> > It would be a serious mistake not to use iterators. Did you see my
>> > example of using views to get the standard deviation of employees'
>> > salaries and ages? How would you do that in C?
>> Over-complex slices and views is something else I'm not keen on either!
>>
>Views should be something built into the language. They shouldn't be implemented,
>however cleverly, using existing language features.
>They are a solution to the employee salary problem. You don't often get a datum
>which is just "a real". It's usually associated with something else. C does sort
>of allow a "stride / offset of" interface, but it's too clumsy to be generally useful.

I would argue that nobody would be handling employee salary in
C or C++. They're be more like to use the built in functionality of
their database SQL interpreter, even to get the standard deviation
of employee salary. At worse, they export from the database into a CSV
using a SQL query and run the output through some spreadsheet software, R,
Matlab or a python script.

Instead of wasting time proposing more and more obscure features for
C++, how about a standard data base access API instead? Something actually
useful?

Re: C vis C++ standard deviation function.

<t05ut6$805$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20882&group=comp.lang.c#20882

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Mon, 7 Mar 2022 21:53:42 +0000
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <t05ut6$805$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 7 Mar 2022 21:53:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9000288fe1b7b70da7788910e43a2962";
logging-data="8197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RMVjnYtcfPTohXtZXKAdZdsXR3a8kD4I="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:xc983v4wpHn2nwwymjHZKyGCQjU=
In-Reply-To: <791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
 by: Bart - Mon, 7 Mar 2022 21:53 UTC

On 07/03/2022 19:55, Malcolm McLean wrote:
> On Monday, 7 March 2022 at 18:39:38 UTC, Bart wrote:
>> On 07/03/2022 16:43, Ben Bacarisse wrote:
>>
>>> Modern C++ has a lot of support for neat programming using iterators.
>>> It would be a serious mistake not to use iterators. Did you see my
>>> example of using views to get the standard deviation of employees'
>>> salaries and ages? How would you do that in C?
>> Over-complex slices and views is something else I'm not keen on either!
>>
> Views should be something built into the language. They shouldn't be implemented,
> however cleverly, using existing language features.

> They are a solution to the employee salary problem.

Is there actually a problem? Is this example posted by Ben just designed
to demonstrate various advanced features of C++?

Employee employees[] = {
{42, 56000}, {22, 46000}, {58, 33000}, {30, 60000}
};

auto salary = [](const Employee &e){ return e.salary; };
auto salaries = employees | std::views::transform(salary);
std::cout << stddev(salaries.begin(), salaries.end()) << "\n";

auto age = [](const Employee &e){ return e.age; };
auto ages = employees | std::views::transform(age);
std::cout << stddev(ages.begin(), ages.end()) << "\n";

How did anyone ever manage this before views? Puzzling!

I suggested elsewhere using list-comps to help with this, when input
data to stddev wasn't a simple array.

This demo is something I don't have working right now, but is a feature
I used to have which fell into disuse. Then the above example would look
like this (assume employees[] has the same structure):

println stddev((e.salary for e in employees))
println stddev((e.age for e in employees))

So considerably simpler. However, the evaluation here is not lazy. That
means that you might run out of memory if you have half a billion people
on your payroll.

> C++ also allows a view. Whilst of course you could implement this in C,
> it would be so difficult that you'd effectively be writing a C
emulator for a
> different labguage. Views separate the trivial data access stage from
the rest
> of the logic.

My views are ultra-simple: a linear slice in the first dimension, with a
step of +1. Python's slices are a little more elaborate in that the step
can be +/- N.

My view (no pun) is that one should strive to keep such features as
simple and streamlined as possible; the opposite approach to C++ which
is to pile in as much as is possible.

Re: C vis C++ standard deviation function.

<875yop5r9v.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20883&group=comp.lang.c#20883

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Mon, 07 Mar 2022 22:31:08 +0000
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <875yop5r9v.fsf@bsb.me.uk>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
<t05ut6$805$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="8b562f22a34111b2cf758c7940e74e5a";
logging-data="31719"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AUmb+67ZGXnG1+oc4zZIrmMj63IzHEdc="
Cancel-Lock: sha1:zoGwWqLL/3YT8Ace114+/WTkTRY=
sha1:Xm1ucHtEEB4PX3F4OqqSTYZxMYs=
X-BSB-Auth: 1.43157f0fae824e8fd99e.20220307223108GMT.875yop5r9v.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 7 Mar 2022 22:31 UTC

Bart <bc@freeuk.com> writes:

> On 07/03/2022 19:55, Malcolm McLean wrote:
>> On Monday, 7 March 2022 at 18:39:38 UTC, Bart wrote:
>>> On 07/03/2022 16:43, Ben Bacarisse wrote:
>>>
>>>> Modern C++ has a lot of support for neat programming using iterators.
>>>> It would be a serious mistake not to use iterators. Did you see my
>>>> example of using views to get the standard deviation of employees'
>>>> salaries and ages? How would you do that in C?
>>> Over-complex slices and views is something else I'm not keen on either!
>>>
>> Views should be something built into the language. They shouldn't be implemented,
>> however cleverly, using existing language features.
>
>> They are a solution to the employee salary problem.
>
> Is there actually a problem? Is this example posted by Ben just
> designed to demonstrate various advanced features of C++?

No, it was designed to answer a point Malcolm made. He wanted to pass
an access function to stddev so it could handle "non-numerical data". I
wanted to support the idea that stddev is inherently numerical and
can be kept that way without limiting it's use too much.

> Employee employees[] = {
> {42, 56000}, {22, 46000}, {58, 33000}, {30, 60000}
> };
>
> auto salary = [](const Employee &e){ return e.salary; };
> auto salaries = employees | std::views::transform(salary);
> std::cout << stddev(salaries.begin(), salaries.end()) << "\n";
>
> auto age = [](const Employee &e){ return e.age; };
> auto ages = employees | std::views::transform(age);
> std::cout << stddev(ages.begin(), ages.end()) << "\n";
>
> How did anyone ever manage this before views? Puzzling!

Surely you could program this in half a dozen languages, couldn't you?
The ones that don't support this sort of high-level data access will be
clumsy or limited in some way. Just thinking of those half a dozen
different designed should reveal the pros and cons of the facilities
provided.

> I suggested elsewhere using list-comps to help with this, when input
> data to stddev wasn't a simple array.

Yes, that's how I might do it in some of the designs I am now imagining.

--
Ben.

Re: C vis C++ standard deviation function.

<t06p7r$ot6$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20884&group=comp.lang.c#20884

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Tue, 8 Mar 2022 06:23:10 +0100
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <t06p7r$ot6$2@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<t05mq3$j43$1@dont-email.me> <t05r53$iam$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Mar 2022 05:23:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="273a2ce5af51ecb619c7f2550bf418d6";
logging-data="25510"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hwn3NENvuMyroWGqh83U5Hual3+KAO7A="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Cancel-Lock: sha1:ruM7TIj57Y6FNlDVZeorfSLESko=
In-Reply-To: <t05r53$iam$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Tue, 8 Mar 2022 05:23 UTC

> Why don't you post a version I can run. ...

Because you are stupid.

Re: C vis C++ standard deviation function.

<8f803e4a-8f90-48e5-9889-8c2c7aefd3ban@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20885&group=comp.lang.c#20885

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:a558:0:b0:67b:1141:4754 with SMTP id o85-20020a37a558000000b0067b11414754mr7645193qke.328.1646732162232;
Tue, 08 Mar 2022 01:36:02 -0800 (PST)
X-Received: by 2002:a05:622a:1906:b0:2e0:77a7:16c4 with SMTP id
w6-20020a05622a190600b002e077a716c4mr57810qtc.119.1646732162017; Tue, 08 Mar
2022 01:36:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 8 Mar 2022 01:36:01 -0800 (PST)
In-Reply-To: <hfuVJ.104810$Gojc.90868@fx99.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:ddd4:b088:d35a:36f6;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:ddd4:b088:d35a:36f6
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me> <t034a2$alm$7@dont-email.me>
<t039p4$r3k$1@dont-email.me> <t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me> <874k497lxp.fsf@bsb.me.uk>
<t05jga$av7$1@dont-email.me> <791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
<hfuVJ.104810$Gojc.90868@fx99.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f803e4a-8f90-48e5-9889-8c2c7aefd3ban@googlegroups.com>
Subject: Re: C vis C++ standard deviation function.
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Tue, 08 Mar 2022 09:36:02 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 38
 by: Malcolm McLean - Tue, 8 Mar 2022 09:36 UTC

On Monday, 7 March 2022 at 20:51:55 UTC, Scott Lurndal wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes:
> >On Monday, 7 March 2022 at 18:39:38 UTC, Bart wrote:
> >> On 07/03/2022 16:43, Ben Bacarisse wrote:
> >>
> >> > Modern C++ has a lot of support for neat programming using iterators.
> >> > It would be a serious mistake not to use iterators. Did you see my
> >> > example of using views to get the standard deviation of employees'
> >> > salaries and ages? How would you do that in C?
> >> Over-complex slices and views is something else I'm not keen on either!
> >>
> >Views should be something built into the language. They shouldn't be implemented,
> >however cleverly, using existing language features.
> >They are a solution to the employee salary problem. You don't often get a datum
> >which is just "a real". It's usually associated with something else. C does sort
> >of allow a "stride / offset of" interface, but it's too clumsy to be generally useful.
> I would argue that nobody would be handling employee salary in
> C or C++. They're be more like to use the built in functionality of
> their database SQL interpreter, even to get the standard deviation
> of employee salary. At worse, they export from the database into a CSV
> using a SQL query and run the output through some spreadsheet software, R,
> Matlab or a python script.
>
Oh sure. In reality it's very unlikely that you want want to calculate the standard
deviation, hardcoded to employees' salaries, in C. You'd have a database or a
spreadsheet. stddev might still be implemented in C, but it would work on label-
free data presented by the calling program.
>
A payroll program is the standard example of "an application program". It's not
that we'll really be working with employees. It's that "struct Employee" is a good
example of a simple structure which shows up some problems in representing
real records in programming.
>
> Instead of wasting time proposing more and more obscure features for
> C++, how about a standard data base access API instead? Something actually
> useful?
>
I agree that a standard database access API might well be useful. But that
clearly belongs in another thread.

Re: C vis C++ standard deviation function.

<O5KVJ.104886$Gojc.69719@fx99.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20886&group=comp.lang.c#20886

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx99.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C vis C++ standard deviation function.
Newsgroups: comp.lang.c
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com> <t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me> <t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me> <t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me> <87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me> <874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me> <791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com> <hfuVJ.104810$Gojc.90868@fx99.iad> <8f803e4a-8f90-48e5-9889-8c2c7aefd3ban@googlegroups.com>
Lines: 24
Message-ID: <O5KVJ.104886$Gojc.69719@fx99.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 08 Mar 2022 14:53:34 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 08 Mar 2022 14:53:34 GMT
X-Received-Bytes: 2510
 by: Scott Lurndal - Tue, 8 Mar 2022 14:53 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
generally useful.
>> I would argue that nobody would be handling employee salary in
>> C or C++. They're be more like to use the built in functionality of
>> their database SQL interpreter, even to get the standard deviation
>> of employee salary. At worse, they export from the database into a CSV
>> using a SQL query and run the output through some spreadsheet software, R,
>> Matlab or a python script.
>>
>Oh sure. In reality it's very unlikely that you want want to calculate the standard
>deviation, hardcoded to employees' salaries, in C. You'd have a database or a
>spreadsheet. stddev might still be implemented in C, but it would work on label-
>free data presented by the calling program.
>>
>A payroll program is the standard example of "an application program". It's not
>that we'll really be working with employees. It's that "struct Employee" is a good
>example of a simple structure which shows up some problems in representing
>real records in programming.

The concept of a "payroll" program (the vast majority of which were
written in COBOL) is a couple decades out of favor - most companies
outsource their payroll now or purchase a third-party application
from Oracle or SAP. It's very difficult to get right given all the
tax code and regulatory hoops that need jumping through.

Re: C vis C++ standard deviation function.

<t08h08$oih$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20887&group=comp.lang.c#20887

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: MR...@invalid.invalid (Manu Raju)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Tue, 8 Mar 2022 21:00:20 +0000
Organization: Aioe.org NNTP Server
Lines: 30
Message-ID: <t08h08$oih$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<791b6244-54fe-42a7-8a2c-f08d6e208358n@googlegroups.com>
<hfuVJ.104810$Gojc.90868@fx99.iad>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Mar 2022 21:14:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="c3b595d289eb080ca028608ce54a1bdf";
logging-data="25169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GyRV3hWFYiEZAD90fbkOEyWjGmlHhIug="
Cancel-Lock: sha1:fWYudebb8ND+xnbM7LYCf0/cB5o=
In-Reply-To: <hfuVJ.104810$Gojc.90868@fx99.iad>
Content-Language: en-US
 by: Manu Raju - Tue, 8 Mar 2022 21:00 UTC

On 07/03/2022 20:51, Scott Lurndal wrote:

>
> I would argue that nobody would be handling employee salary in
> C or C++. They're be more like to use the built in functionality of
> their database SQL interpreter, even to get the standard deviation
> of employee salary.

In MySQL you only need this to get StdDev:
<https://www.mysqltutorial.org/mysql-standard-deviation/>

SELECT customerNumber,
COUNT(*) orderCount
FROM orders
WHERE status = 'Shipped'
GROUP BY customerNumber;

SELECT FORMAT(STD(orderCount),2)
FROM (SELECT customerNumber, count(*) orderCount
FROM orders
GROUP BY customerNumber) t;

For MS-SQL you need this:
<https://docs.microsoft.com/en-us/sql/t-sql/functions/stdev-transact-sql?view=sql-server-ver15>

For Oracle they have something similar.

I agree C/C++ is never used for such things unless it is for some
academic/research purposes.

Re: C vis C++ standard deviation function.

<t0db6o$1t5e$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20891&group=comp.lang.c#20891

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!Puiiztk9lHEEQC0y3uUjRA.user.46.165.242.75.POSTED!not-for-mail
From: non...@add.invalid (Manfred)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Thu, 10 Mar 2022 18:06:32 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t0db6o$1t5e$1@gioia.aioe.org>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<t05mq3$j43$1@dont-email.me> <t05r53$iam$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="62638"; posting-host="Puiiztk9lHEEQC0y3uUjRA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Manfred - Thu, 10 Mar 2022 17:06 UTC

On 3/7/2022 9:49 PM, Bart wrote:
> On 07/03/2022 19:35, Bonita Montero wrote:
>>> As it turned out, BM's solution didn't work. I've no idea why
>>> and the  C++ is far too complex for me to try and figure it out. ...
>>
>> You don't understand the code and you say that it doesn't work ?
>
> Why don't you post a version I can run. Or at least tell what what I
> have to pass to get the SD of this array:
>
>  double A[]={41,53,97,67,62, 82,93, 54,34,11};
>
> (I assume you have tested your routine.)

Bart, you fell into BM's trap!
Before replying to her, consider how much she loves trolling..

Re: C vis C++ standard deviation function.

<t0dbdh$lcu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20892&group=comp.lang.c#20892

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Thu, 10 Mar 2022 18:10:14 +0100
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <t0dbdh$lcu$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<t05mq3$j43$1@dont-email.me> <t05r53$iam$1@dont-email.me>
<t0db6o$1t5e$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Mar 2022 17:10:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="149a9ddcc56d930e1ac595509571807b";
logging-data="21918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tMfWkOJgoBHdVsgnoPb5O2dbF83MCFso="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Cancel-Lock: sha1:0GtbC8CNoniWpx7+m0dQyLLjh5I=
In-Reply-To: <t0db6o$1t5e$1@gioia.aioe.org>
Content-Language: de-DE
 by: Bonita Montero - Thu, 10 Mar 2022 17:10 UTC

> Bart, you fell into BM's trap!

Bart falls into all developers traps which are more skilled
like him - and that are a lot.

Re: C vis C++ standard deviation function.

<t0dct3$mi7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20893&group=comp.lang.c#20893

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: C vis C++ standard deviation function.
Date: Thu, 10 Mar 2022 17:35:32 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <t0dct3$mi7$1@dont-email.me>
References: <b2017949-b97f-4d1e-87c5-5b6ed79ecd10n@googlegroups.com>
<t028t1$53p$1@dont-email.me> <t0340u$dqa$1@dont-email.me>
<t034a2$alm$7@dont-email.me> <t039p4$r3k$1@dont-email.me>
<t04g22$5ge$1@dont-email.me> <t04o5t$902$1@dont-email.me>
<87ilsp7rxf.fsf@bsb.me.uk> <t057t0$9tp$1@dont-email.me>
<874k497lxp.fsf@bsb.me.uk> <t05jga$av7$1@dont-email.me>
<t05mq3$j43$1@dont-email.me> <t05r53$iam$1@dont-email.me>
<t0db6o$1t5e$1@gioia.aioe.org> <t0dbdh$lcu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Mar 2022 17:35:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3fb5909d36b7abdaf037811751fb760d";
logging-data="23111"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cWgs4ZnfASli3N3QkPVxdPcTvrq6jGeQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Cancel-Lock: sha1:7zhBLLb+jF8iRdIiqo3svs59f0E=
In-Reply-To: <t0dbdh$lcu$1@dont-email.me>
 by: Bart - Thu, 10 Mar 2022 17:35 UTC

On 10/03/2022 17:10, Bonita Montero wrote:
>> Bart, you fell into BM's trap!
>
> Bart falls into all developers traps which are more skilled
> like him - and that are a lot.
>

Bart mainly works with languages he has designed and implemented
himself, and which are 100% self-hosted. There are not a lot of a
developers who can claim that.

When it comes to C, he mainly works with a compiler for that language he
has implemented himself. Not many developers can claim that either.

With regard to your routine, it gave a different result because it
evaluated a population SD not a sample SD like most of the other
contributions.

You could have mentioned that, and explained how the routine could be
called by providing a working example, instead of just dishing out insults.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor