Thursday, December 27, 2018

Digest for comp.lang.c++@googlegroups.com - 25 updates in 4 topics

rbowman <bowman@montana.com>: Dec 26 07:19PM -0700

On 12/26/2018 08:48 AM, Bart wrote:
 
> This doesn't seem too hard, but it's obviously not in the standard
> library (which AFAIK only has rand()). Example:
 
Seems to be in mine...
 
 
RANDOM(3) Linux Programmer's Manual RANDOM(3)
 
NAME
random, srandom, initstate, setstate - random number generator
 
SYNOPSIS
#include <stdlib.h>
 
long int random(void);
 
void srandom(unsigned int seed);
Richard Damon <Richard@Damon-Family.org>: Dec 26 10:17PM -0500

On 12/26/18 9:19 PM, rbowman wrote:
 
>        long int random(void);
 
>        void srandom(unsigned int seed);
 
random() isn't is ISO C, but is (I beleive) defined in the POSIX
standard. Note, that is a Linux man page.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 10:20PM -0500

On 12/26/2018 3:13 PM, Rick C. Hodgin wrote:
>> Jesus told me to tell you about:
>> https://en.wikipedia.org/wiki/Permuted_congruential_generator
 
> Then I'll thank Jesus for that.  And you for being obedient. :-)
 
I implemented this prng tonight and it's perfect. It's made all the
different in the game. Thank you.
 
--
Rick C. Hodgin
Keith Thompson <kst-u@mib.org>: Dec 26 07:34PM -0800

> #include <stdlib.h>
 
> long int random(void);
 
> void srandom(unsigned int seed);
 
Scroll down, and you'll see this:
 
CONFORMING TO
POSIX.1-2001, POSIX.1-2008, 4.3BS
 
It's defined by POSIX, but not by ISO C (which is what Bart
presumably meant by "standard library").
 
--
Keith Thompson (The_Other_Keith) kst@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Dec 26 09:02PM -0800

On 12/26/2018 7:20 PM, Rick C. Hodgin wrote:
 
>> Then I'll thank Jesus for that.  And you for being obedient. :-)
 
> I implemented this prng tonight and it's perfect.  It's made all the
> different in the game.  Thank you.
 
No problem. I just had a strange feeling that this particular
information just might help you out Rick. God works in mysterious ways
indeed. :^)
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 05:55PM

On 26/12/2018 17:54, Rick C. Hodgin wrote:
 
>> Do you agree with Jesus that homosexuals should be put to death or not?
>> If Jesus is wrong about putting homosexuals to death then what else is
>> Jesus wrong about?  I thought gods were supposed to be infallible.
 
[snip TL;DR]
 
Jesus believed the Old Testament was the commandment of God (Matthew 15:3)
ergo Jesus believed that homosexuals should be put to death (Leviticus 20:13).
 
Do you agree with Jesus that homosexuals should be put to death or not? If
Jesus is wrong about putting homosexuals to death then what else is Jesus
wrong about? I thought gods were supposed to be infallible.
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 12:54PM -0500

On 12/26/2018 12:47 PM, Mr Flibble wrote:
 
> Do you agree with Jesus that homosexuals should be put to death or not? If
> Jesus is wrong about putting homosexuals to death then what else is Jesus
> wrong about?  I thought gods were supposed to be infallible.
 
Is the theme for today "repeating oureselves?" Okay, here goes:
 
Leigh, I'm trying to teach you there's something more. If you'll
seek that new information your question will be answered, and you'll
know the truth as your eyes are opened and you literally say out
loud, "Wow. I mean seriously. Wow."
 
God is not foolish or a joke. When you set your sights on learning
the truth ... you'll be flatly amazed at what you find.
 
And I'll add: The answer you seek lies in understanding more than
you do today. You're asking the wrong question, to get an answer
that you would take the wrong way, as has been hand-crafted for you
to do by the enemy of your soul. I'm guiding you to the truth. My
guidance does not come from me. It comes from the one you mock. I
point you to His teachings on this matter, and not just the snippet
one-liners to pull out of context and demand an accounting of. In
order to properly understand things, you have to understand more than
you do. If you do this, YOU will know the answer on the inside.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 05:47PM

On 26/12/2018 16:44, Rick C. Hodgin wrote:
> loud, "Wow. I mean seriously. Wow."
 
> God is not foolish or a joke. When you set your sights on learning
> the truth ... you'll be flatly amazed at what you find.
 
Jesus believed the Old Testament was the commandment of God (Matthew 15:3)
ergo Jesus believed that homosexuals should be put to death (Leviticus 20:13).
 
Do you agree with Jesus that homosexuals should be put to death or not? If
Jesus is wrong about putting homosexuals to death then what else is Jesus
wrong about? I thought gods were supposed to be infallible.
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 06:11PM

On 26/12/2018 18:01, Rick C. Hodgin wrote:
>> [snip TL;DR]
 
> You often write this in replying to me.  It does your soul
> a tremendous disservice.
 
It seems obvious to me that the real reason you won't answer this question
(which I am now going to use to shut you down in future) is if you do
agree with Jesus that homosexuals should be put to death then you reveal
that both yourself and your god are bigoted cunts: what would your
supposed gay friends think? And if you don't agree with Jesus that
homosexuals should be put to death then that shows an inconsistency in
your faith which is revealed to be a house built on sand.
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 06:33PM

On 26/12/2018 18:29, Rick C. Hodgin wrote:
 
> It's time to grow up, Leigh. It's time to shun childish hard-
> headedness and ignorance, and mature into someone who is truly
> looking at things as they are, who is truly truth-seeking.
 
Jesus believed the Old Testament was the commandment of God (Matthew 15:3)
ergo Jesus believed that homosexuals should be put to death (Leviticus 20:13).
 
Do you agree with Jesus that homosexuals should be put to death or not? If
Jesus is wrong about putting homosexuals to death then what else is Jesus
wrong about? I thought gods were supposed to be infallible.
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 06:50PM

On 26/12/2018 18:38, Rick C. Hodgin wrote:
>> wrong about? I thought gods were supposed to be infallible.
 
> God will answer your question... either in this world (I pray),
> or in the one to come.
 
That is not an acceptable response as it presupposes an a priori agreement
that your god exists. I know for a fact that your god doesn't exist.
 
Disregard the e-mail I sent to you in error.
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 01:59PM -0500

On 12/26/2018 1:50 PM, Mr Flibble wrote:
>> or in the one to come.
 
> That is not an acceptable response as it presupposes an a priori agreement
> that your god exists.  I know for a fact that your god doesn't exist.
 
The truth is as the truth is, Leigh.
 
I used to believe as you do. Something I could never have accepted
before it happened to me ... happened to me. Now I sit on this side
of that transformation teaching you that it exists.
 
You'll never be able to believe it or receive it ... until you set
your sights on the truth and God transforms you from the inside out.
 
-----
Happy living, Leigh. I wish you nothing but success in your dreams.
And I further wish salvation for your soul.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 07:25PM

On 26/12/2018 18:59, Rick C. Hodgin wrote:
 
> -----
> Happy living, Leigh.  I wish you nothing but success in your dreams.
> And I further wish salvation for your soul.
 
You think you are teaching me? You really are a pompous, sanctimonious,
self righteous cockwomble. You remind me of that Christian missionary
John Chau who was killed by an isolated Indian tribe recently. He paid the
ultimate sacrifice for not being able to take a hint. Beware the bows and
arrows mate as not everyone wants to be "taught" your flavour of bullshit.
 
No need to reply (if you do I will add you to my spam filter).
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 07:34PM

On 26/12/2018 19:31, Rick C. Hodgin wrote:
> proceed with looking at Jesus, the Bible, and other such things.
 
> It's the true seeking the truth that makes the difference, and allows
> the change to come.
 
*plonk*
 
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 02:31PM -0500

On 12/26/2018 2:25 PM, Mr Flibble wrote:
> You think you are teaching me?
 
Trying to teach you. And not to listen to me, but to go to the source
and read and learn and seek to understand.
 
All I ask is that you set your heart on knowing the truth truly, without
any deception or falseness. Resolve to do this in your heart, and then
proceed with looking at Jesus, the Bible, and other such things.
 
It's the true seeking the truth that makes the difference, and allows
the change to come.
 
--
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 01:01PM -0500

On 12/26/2018 12:55 PM, Mr Flibble wrote:
> [snip TL;DR]
 
You often write this in replying to me. It does your soul
a tremendous disservice.
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Dec 26 11:58AM -0800

On 12/24/2018 4:54 PM, Rick C. Hodgin wrote:
> Is there an equivalent of a multi-channel rand() function that enables
> multiple simultaneous separate pseudo-random number generators by some-
> thing like a handle or instance of each in the standard library?
 
Fwiw, take a deep look at:
 
https://en.wikipedia.org/wiki/Linear_congruential_generator
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 02:54PM -0500

On 12/26/2018 2:34 PM, Mr Flibble wrote:
 
>> It's the true seeking the truth that makes the difference, and allows
>> the change to come.
 
> *plonk*
 
May the C++ channel now enjoy far greater peace.
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Dec 26 12:00PM -0800

On 12/26/2018 11:54 AM, Rick C. Hodgin wrote:
>>> the change to come.
 
>> *plonk*
 
> May the C++ channel now enjoy far greater peace.
 
Jesus told me to tell you about:
 
https://en.wikipedia.org/wiki/Permuted_congruential_generator
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 26 03:13PM -0500

On 12/26/2018 3:00 PM, Chris M. Thomasson wrote:
> Jesus told me to tell you about:
> https://en.wikipedia.org/wiki/Permuted_congruential_generator
 
Then I'll thank Jesus for that. And you for being obedient. :-)
 
--
Rick C. Hodgin
Bart <bc@freeuk.com>: Dec 27 11:29AM

On 27/12/2018 03:34, Keith Thompson wrote:
> POSIX.1-2001, POSIX.1-2008, 4.3BS
 
> It's defined by POSIX, but not by ISO C (which is what Bart
> presumably meant by "standard library").
 
Also the fact that rand() doesn't support the 'multi-channel' requirement.
 
The Posix set of functions might enable that, but it's difficult to
tell. If they do, then they rely on global state which is fiddly to
change; it might be better to apply an API like mine.
 
--
bart
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 26 09:55PM

> wraps the call to WSAStartup(). On FreeBSD and
> Linux, winStart() is a no-op. 2019 would be a
> good time to clean that up!
 
Just use boost.asio.
 
[snip]
 
/Flibble
 
--
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
gazelle@shell.xmission.com (Kenny McCormack): Dec 26 06:09PM

In article <ff2a0772-2e7c-4c00-8c6e-2a0ae3118ca4@googlegroups.com>,
>> religious ideas and how they came about, that would only frighten you.
 
>You've probably read this before, but I was not looking to be
>saved. I was looking to live my life as I was, as an atheist.
 
You are so full of shit.
 
--
Modern Conservative: Someone who can take time out from flashing her
wedding ring around and bragging about her honeymoon to complain that a
fellow secretary who keeps a picture of her girlfriend on her desk is
"flauting her sexuality" and "forcing her lifestyle down our throats".
anhongleetcode@gmail.com: Dec 26 10:12PM -0800

Hi all,
 
I am pretty new to the c++ language, I have a question for vector swap:
 
std::vector<int> a(10);
auto p = a.data();
 
std::vector<int> b;
b.swap(a);
 
assert(b.data() == p);
 
Is there any possibility that the assertion would fail here?
I tried seems the eq holds, but is there any guarantee in the standard doc?
 
 
 
Thanks,
Anhong
ViralTaco <kiiwy112@gmail.com>: Dec 26 10:53PM -0800

> I tried seems the eq holds, but is there any guarantee in the standard doc?
 
> Thanks,
> Anhong
 
Actually no. (Unless there is a specific behaviour I'm unaware of)
It should be the same as
`assert(a.data() == a.data());`
Since you use std::swap(). https://en.cppreference.com/w/cpp/container/vector/swap2
 
(cf: https://godbolt.org/z/p_RA0X )
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: