Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multi-channel rand()

109 views
Skip to first unread message

Rick C. Hodgin

unread,
Dec 24, 2018, 7:53:10 PM12/24/18
to
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?

--
Rick C. Hodgin

Chris M. Thomasson

unread,
Dec 24, 2018, 10:38:46 PM12/24/18
to
Yes. This can be accomplished in standard C++. Well, not using rand(),
but there are other ways. rand_r in POSIX?, just kidding... Completely
independent per-thread prngs are possible with C++. Interested?

Scott

unread,
Dec 24, 2018, 11:04:43 PM12/24/18
to
Not as such AFAIK. It looks like initstate and setstate (stdlib) let
you extract and reinstate the prng context as you like, which can be
exploited to the same end.

Rick C. Hodgin

unread,
Dec 24, 2018, 11:55:51 PM12/24/18
to
Microsoft's Visual C++ comes with source code you can step into for
their rand() function. It uses a small block of code. I had the
idea to pull that code out and wrap it in a struct or class and then
have instances. I think that would work, but I'm not sure if it's
legal (because it's Microsoft's code) ... so I'm looking for something
that is available for use, preferably in the public domain.

--
Rick C. Hodgin

Mr Flibble

unread,
Dec 25, 2018, 4:22:12 AM12/25/18
to
Professional coders don't use rand(); they use <random> instead.

/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."

Kenny McCormack

unread,
Dec 25, 2018, 5:09:57 AM12/25/18
to
In article <YEmUD.25991$922....@fx06.fr7>,
Mr Flibble <flibbleREM...@i42.co.uk> wrote:
...
>Professional coders don't use rand(); they use <random> instead.

If anything is clear by now, it is that Ricky is anything but a
professional programmer.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/RepInsults

Anton Shepelev

unread,
Dec 25, 2018, 5:35:41 AM12/25/18
to
Rick C. Hodgin:
You can pick one of the published methods from

https://en.wikipedia.org/wiki/List_of_random_number_generators

and implement it yourself.

--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]

fir

unread,
Dec 25, 2018, 5:59:30 AM12/25/18
to
W dniu wtorek, 25 grudnia 2018 11:35:41 UTC+1 użytkownik Anton Shepelev napisał:
> Rick C. Hodgin:
>
> >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?
>
> You can pick one of the published methods from
>
> https://en.wikipedia.org/wiki/List_of_random_number_generators
>
> and implement it yourself.
>



stupidity needs a defence not 'legitimization'

and all those people answering to spamer rick are like sheeps ruled by idiot

this imbecile sheppard will lead you to fields od deep stupidity, do you really want that? - respect minimal inteligence, kick this dumbass in the ass

(said fir)

Bart

unread,
Dec 25, 2018, 6:52:14 AM12/25/18
to
The results are supposed to be random. So does it matter if a single
random number producer is shared between multiple consumers?

(I can see it being a problem with debugging, when you want each
consumer to see the same sequence on each run regardless of how many
other consumers there are.

But for such a case, it might be possible to rig something up to make
that happen.)


--
bart

Anton Shepelev

unread,
Dec 25, 2018, 6:58:11 AM12/25/18
to
Bart to Rick C. Hodgin:

>>Is there an equivalent of a multi-channel rand() function
>>that enables multiple simultaneous separate pseudo-random
>>number generators by something like a handle or instance
>>of each in the standard library?
>
>The results are supposed to be random. So does it matter
>if a single random number producer is shared between
>multiple consumers?

How about thread separation?

Richard Damon

unread,
Dec 25, 2018, 6:59:18 AM12/25/18
to
The results are supposed to be PSEUDO-RANDOM, and repeatable (by
starting with the same seed). I have built some games where a level is
randomly created, but rather than save the entire level, I will first
get somehow a random seed, remember it, and then use it to seed a
specific random number generator. By reusing that remembered seed, and a
bit of information about state changes on the level, I can recreate the
level.

Rick C. Hodgin

unread,
Dec 25, 2018, 7:58:33 AM12/25/18
to
On 12/25/2018 4:22 AM, Mr Flibble wrote:
> Professional coders don't use rand(); they use <random> instead.

"You might look at <random>, Rick. It allows multiple separate instances
you seek."

Fixed it for you. And thank you for the information. I didn't know
<random> existed. It's why I ask questions like these. To learn, and
to be part of a community seeking to help one another.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Dec 25, 2018, 8:00:51 AM12/25/18
to
On 12/25/2018 5:35 AM, Anton Shepelev wrote:
> Rick C. Hodgin:
>
>> 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?
>
> You can pick one of the published methods from
>
> https://en.wikipedia.org/wiki/List_of_random_number_generators
>
> and implement it yourself.

Thank you, Anton.

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Dec 25, 2018, 8:02:57 AM12/25/18
to
On 12/25/2018 6:52 AM, Bart wrote:
> On 25/12/2018 00:54, 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?
>>
>
> The results are supposed to be random. So does it matter if a single random
> number producer is shared between multiple consumers?

I had that thought. I'm currently writing a game, and the interplay
between two or more simultaneous players will cause the random seq-
uences each player receives to not be replicable, short of storing the
full history of moves.

> (I can see it being a problem with debugging, when you want each consumer to
> see the same sequence on each run regardless of how many other consumers
> there are.
>
> But for such a case, it might be possible to rig something up to make that
> happen.)

I don't think it matters for gameplay, but it does matter for debug-
ging and analysis / diagnosis (as you indicate).

--
Rick C. Hodgin

Rick C. Hodgin

unread,
Dec 25, 2018, 8:04:39 AM12/25/18
to
That's something similar to what I'm seeking to do, so its replicable
without the variation of user interaction and timing affecting the draw
from the single stream, but rather for each to have their own streams,
so the timing of user event sequences will not be a factor.

--
Rick C. Hodgin

rbowman

unread,
Dec 25, 2018, 12:13:54 PM12/25/18
to
On 12/24/2018 09:57 PM, Rick C. Hodgin wrote:
>
> Microsoft's Visual C++ comes with source code you can step into for
> their rand() function. It uses a small block of code. I had the
> idea to pull that code out and wrap it in a struct or class and then
> have instances. I think that would work, but I'm not sure if it's
> legal (because it's Microsoft's code) ... so I'm looking for something
> that is available for use, preferably in the public domain.

http://apps.nrbook.com/c/index.html

This is an older edition but the price is right. Chapter 7 covers random
numbers. Knuth also covers the topic in Volume 2. Microsoft stands on
the shoulders of giants so I doubt there is anything novel in their
implementation.

Keith Thompson

unread,
Dec 25, 2018, 1:14:56 PM12/25/18
to
rbowman <bow...@montana.com> writes:
[...]
> http://apps.nrbook.com/c/index.html
>
> This is an older edition but the price is right. Chapter 7 covers random
> numbers. Knuth also covers the topic in Volume 2. Microsoft stands on
> the shoulders of giants so I doubt there is anything novel in their
> implementation.

That's the Numerical Recipes book. The link doesn't work for me.
Visit http://nrbook.com or http://numerical.recipes for more options.

--
Keith Thompson (The_Other_Keith) k...@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"

Mr Flibble

unread,
Dec 25, 2018, 4:59:55 PM12/25/18
to
You are seriously telling me how I should word my replies? What an
egregious self-righteous cockwomble you are.

Scott

unread,
Dec 25, 2018, 9:43:01 PM12/25/18
to
On Tue, 25 Dec 2018 21:59:45 +0000, Mr Flibble
<flibbleREM...@i42.co.uk> wrote:

>On 25/12/2018 12:59, Rick C. Hodgin wrote:
>> On 12/25/2018 4:22 AM, Mr Flibble wrote:
>>> Professional coders don't use rand(); they use <random> instead.
>>
>> "You might look at <random>, Rick.  It allows multiple separate instances
>> you seek."
>>
>> Fixed it for you.  And thank you for the information.  I didn't know
>> <random> existed.  It's why I ask questions like these.  To learn, and
>> to be part of a community seeking to help one another.
>
>You are seriously telling me how I should word my replies? What an
>egregious self-righteous cockwomble you are.

Oh, don't be so unkind, Flib. You know that Rick has a cognitive
disability and can only see things that he's expecting to see.

fir

unread,
Dec 26, 2018, 9:35:54 AM12/26/18
to
saying in short the sin of hodgin (dik) is that he is a bullshitter,
this means that he should be not legitimized with all his bulshit and spam
(as stupidity and bulshit amkes harm)
but defended (obviously one should not exagerrate in taht point to, but better
say big stop to this idiot than not)

Rick C. Hodgin

unread,
Dec 26, 2018, 9:49:22 AM12/26/18
to
On Wednesday, December 26, 2018 at 9:35:54 AM UTC-5, fir wrote:
> saying in short the sin of hodgin (dik) is that he is a .. ,
> this means that he should be not legitimized with all his .. and spam
> (as stupidity and .. amkes harm)
> but defended (obviously one should not exagerrate in taht point to, but better
> say big stop to this idiot than not)

Where do you see me stating anything that is untrue, or in any way
purposefully deceptive?

Backup your claim with facts or the claim is not legitimate.

--
Rick C. Hodin

Mr Flibble

unread,
Dec 26, 2018, 10:13:58 AM12/26/18
to
Your refusal to answer the following question is an example of you being
purposefully deceptive:

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.

Bart

unread,
Dec 26, 2018, 10:48:33 AM12/26/18
to
On 25/12/2018 00:54, Rick C. Hodgin wrote:
This doesn't seem too hard, but it's obviously not in the standard
library (which AFAIK only has rand()). Example:

-------------------
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

typedef uint64_t u64;
typedef u64* Randgen;

Randgen new_randgen(u64 seed1, u64 seed2) {
// needs two 64-bit non-zero seeds
Randgen s;

s=malloc(sizeof(u64)*2);
if (s==NULL) {
return s;
}
s[0]=seed1;
s[1]=seed2;
return s;
}

void free_randgen(Randgen s) {
free(s);
}

u64 random(Randgen s) {
// based on 'xorshift128+'
u64 x = s[0];
u64 const y = s[1];
s[0] = y;
x ^= x << 23; // a
s[1] = x ^ y ^ (x >> 17) ^ (y >> 26); // b, c
return s[1] + y;
}

int main(void) {
u64 a;
Randgen r1,r2,r3;

r1=new_randgen(374646464,84747774);
r2=new_randgen(374646464,84747774);
r3=new_randgen(374646464,84747774);

for (int i=0; i<10; ++i) {
printf("%d %016llX %016llX %016llX\n",i,
random(r1), random(r2), random(r3));
}

free_randgen(r1);
free_randgen(r2);
free_randgen(r3);

}
-----------------------

All three streams show the same results because I've used the same seed
for each.

(To reset a stream R to a new seed, either free R and set R to a new
generator, or change the two u64s that R points to, or provide a
function for that.

However this depends entirely on the PRNG used. The point of my example
is to show how easy it is to superimpose a 'multi-channel' API on a
single-stream PRNG.)

--
bart

Rick C. Hodgin

unread,
Dec 26, 2018, 11:04:55 AM12/26/18
to
On Wednesday, December 26, 2018 at 10:13:58 AM UTC-5, Mr Flibble wrote:
> On 26/12/2018 14:49, Rick C. Hodgin wrote:
> > On Wednesday, December 26, 2018 at 9:35:54 AM UTC-5, fir wrote:
> >> saying in short the sin of hodgin (dik) is that he is a .. ,
> >> this means that he should be not legitimized with all his .. and spam
> >> (as stupidity and .. amkes harm)
> >> but defended (obviously one should not exagerrate in taht point to, but better
> >> say big stop to this idiot than not)
> >
> > Where do you see me stating anything that is untrue, or in any way
> > purposefully deceptive?
> >
> > Backup your claim with facts or the claim is not legitimate.
>
> Your refusal to answer the following question is an example of you being
> purposefully deceptive:
>
> 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.

I don't refuse to answer your question, but you're asking a
question that's along the lines of "do pickles have the same
outer skin as toads," just because they look the same and
maybe even feel the same.

There are things you need to learn to realize why your question
is inappropriate. And, you accuse me of being UNWILLING to
answer your question, but the way it really is is this: you
are UNWILLING to seek to learn enough to understand why your
question is not appropriate.

Satan does this to people, by the way. It's one way he uses
to keep people trapped in their present / current belief sys-
tem. He conjures up a question or scenario in a person's mind
for them, giving them the thoughts, the conclusions, all of
it, and then entices the person to ask the question within a
solid framework ... something like "Do you or don't you ...
yes or no."

Satan knows the answer is not so simple. But Satan also knows
that he has dominion over the flesh and can deceive us in our
natural thinking hand over fist... so he uses that to trick and
deceive you, and keep you pinned down into a place of non-for-
giveness, of unrepentance, of still being on your way to Hell.

Satan is no good. He has nothing positive for any person.
He's as tricky and deceptive and underhanded as they come. He
will say X, Y, or Z to you outright lying, with the full intent
in his heart to keep you deceived and on your way to Hell. He
will hurt you, your family, your neighbors, your friends, your
parents, your kids, your spouse ... anyone he can.

There is information you need to learn to understand why your
question is not appropriate, or why any answer I could give you
to it would need to be framed for a correct understanding. You
need to go to proper school to undo the teachings of that wicked
enemy, so that you are on the path to truth, and not trying to
operate from the false framework the enemy has weaved for you,
the one you're so sure is the correct question to be answering.

And the sad thing is, you'll look at my reply here once again as
me not answering your question, because the enemy has you that
deceived ... but you won't be able to see it because you have no
pursuit of the truth, and the truth is known by the spirit, and
it breaks my heart.

All I can do is pray for you, and continue to lead you rightly.
When / if the day comes where you begin to seek the truth, then
God will open your eyes and you'll be able to see it.

--
Rick C. Hodgin

Mr Flibble

unread,
Dec 26, 2018, 11:16:39 AM12/26/18
to
Yep, your continual refusal to answer that question illustrates how so
full of shit you are.

Rick C. Hodgin

unread,
Dec 26, 2018, 11:44:33 AM12/26/18
to
On Wednesday, December 26, 2018 at 11:16:39 AM UTC-5, Mr Flibble wrote:
> Yep, your continual refusal to answer that question illustrates how so
> full of .. you are.

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.

--
Rick C. Hodgin

Daniel

unread,
Dec 26, 2018, 12:26:31 PM12/26/18
to
On Tuesday, December 25, 2018 at 4:59:55 PM UTC-5, Mr Flibble wrote:
> On 25/12/2018 12:59, Rick C. Hodgin wrote:
> >
> > Fixed it for you.
>
> You are seriously telling me how I should word my replies? What an
> egregious self-righteous cockwomble you are.
>
This sentence could be improved if you ended with "cockwomble", the lacklustre
"you are" at the end weakens the effect.

Daniel

Mr Flibble

unread,
Dec 26, 2018, 12:48:08 PM12/26/18
to
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.

Rick C. Hodgin

unread,
Dec 26, 2018, 12:53:25 PM12/26/18
to
On 12/26/2018 12:47 PM, Mr Flibble wrote:
> On 26/12/2018 16:44, Rick C. Hodgin wrote:
>> On Wednesday, December 26, 2018 at 11:16:39 AM UTC-5, Mr Flibble wrote:
>> 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.
>
> 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.

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

unread,
Dec 26, 2018, 12:55:19 PM12/26/18
to
On 26/12/2018 17:54, Rick C. Hodgin wrote:
> On 12/26/2018 12:47 PM, Mr Flibble wrote:
>> On 26/12/2018 16:44, Rick C. Hodgin wrote:
>>> On Wednesday, December 26, 2018 at 11:16:39 AM UTC-5, Mr Flibble wrote:
>>> 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.
>>
>> 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.

[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.

Rick C. Hodgin

unread,
Dec 26, 2018, 1:00:25 PM12/26/18
to
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

Mr Flibble

unread,
Dec 26, 2018, 1:11:31 PM12/26/18
to
On 26/12/2018 18:01, Rick C. Hodgin wrote:
> 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.

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.

Rick C. Hodgin

unread,
Dec 26, 2018, 1:29:43 PM12/26/18
to
On Wednesday, December 26, 2018 at 1:11:31 PM UTC-5, Mr Flibble wrote:
> On 26/12/2018 18:01, Rick C. Hodgin wrote:
> > 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.
>
> 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.

This is why I don't answer your question. You already have the
courses and paths for your yes/no answers mapped out. These
were prepared for you literally by Satan, or one of his demon
imps, so that no matter what I would reply in direct answer to
your query, you have a way to stay where you are and not advance.

The enemy wants you wallowing in ignorance, Leigh. This is what
I'm trying to teach you.

The truth is far more complex, more interesting, and it has the
added benefit of being the truth.

If you want to know the truth ... you can. It is different than
you think, more amazing, more complete, given to understanding
and full knowledge. It's not a blind "do pickles have the same
skin as toads" type question simply because they look that way
at a quick cursory glance without any real investigation. You
have to dig deeper, Leigh. You can't go by what you think you
know, because there's an active enemy at work against you who
owns your thinking, and until you seek the truth he'll deceive
you continually. But when you seek the truth, God steps into
your life and guides you to that which you cannot find on your
own. He defeats Satan for you, and opens up your understanding.

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.

--
Rick C. Hodgin

Mr Flibble

unread,
Dec 26, 2018, 1:34:03 PM12/26/18
to
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.

Rick C. Hodgin

unread,
Dec 26, 2018, 1:38:36 PM12/26/18
to
On Wednesday, December 26, 2018 at 1:34:03 PM UTC-5, Mr Flibble wrote:
> 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.

God will answer your question... either in this world (I pray),
or in the one to come.

--
Rick C. Hodgin

Mr Flibble

unread,
Dec 26, 2018, 1:50:50 PM12/26/18
to
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.

Rick C. Hodgin

unread,
Dec 26, 2018, 1:58:36 PM12/26/18
to
On 12/26/2018 1:50 PM, Mr Flibble wrote:
> On 26/12/2018 18:38, Rick C. Hodgin wrote:
>> On Wednesday, December 26, 2018 at 1:34:03 PM UTC-5, Mr Flibble wrote:
>>> 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.
>>
>> 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.

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

unread,
Dec 26, 2018, 2:25:32 PM12/26/18
to
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).

Rick C. Hodgin

unread,
Dec 26, 2018, 2:30:30 PM12/26/18
to
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

Mr Flibble

unread,
Dec 26, 2018, 2:34:55 PM12/26/18
to
*plonk*

Rick C. Hodgin

unread,
Dec 26, 2018, 2:53:30 PM12/26/18
to
On 12/26/2018 2:34 PM, Mr Flibble wrote:
> On 26/12/2018 19:31, Rick C. Hodgin wrote:
>> 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.
>>
>
> *plonk*

May the C++ channel now enjoy far greater peace.

--
Rick C. Hodgin

Chris M. Thomasson

unread,
Dec 26, 2018, 2:58:10 PM12/26/18
to
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

Chris M. Thomasson

unread,
Dec 26, 2018, 3:00:53 PM12/26/18
to

Rick C. Hodgin

unread,
Dec 26, 2018, 3:12:28 PM12/26/18
to
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

rbowman

unread,
Dec 26, 2018, 9:18:37 PM12/26/18
to
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

unread,
Dec 26, 2018, 10:17:27 PM12/26/18
to
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

unread,
Dec 26, 2018, 10:19:18 PM12/26/18
to
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

unread,
Dec 26, 2018, 10:34:48 PM12/26/18
to
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) k...@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

unread,
Dec 27, 2018, 12:02:21 AM12/27/18
to
No problem. I just had a strange feeling that this particular
information just might help you out Rick. God works in mysterious ways
indeed. :^)

Bart

unread,
Dec 27, 2018, 6:29:21 AM12/27/18
to
On 27/12/2018 03:34, Keith Thompson wrote:
> rbowman <bow...@montana.com> writes:
>> 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);
>
> 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").
>


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

Jorgen Grahn

unread,
Dec 30, 2018, 3:10:50 PM12/30/18
to
On Thu, 2018-12-27, Keith Thompson wrote:
> rbowman <bow...@montana.com> writes:
>> 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);
>
> 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").

Also, the "multi-channel" aspect is a bit inconvenient: it's still
global state, but you can switch it. Not good for e.g. threaded
use, or for people like me who like objects.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

James Kuyper

unread,
Dec 30, 2018, 4:10:35 PM12/30/18
to
On 12/30/18 15:10, Jorgen Grahn wrote:
> On Thu, 2018-12-27, Keith Thompson wrote:
...
>> 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").
>
> Also, the "multi-channel" aspect is a bit inconvenient: it's still
> global state, but you can switch it. Not good for e.g. threaded
> use, or for people like me who like objects.
>
> /Jorgen
>

The page in the POSIX specification for random() says "Threaded
applications should use erand48(), nrand48(), or jrand48() instead of
random() when an independent random number sequence in multiple threads
is required."

Chris M. Thomasson

unread,
Dec 30, 2018, 4:19:44 PM12/30/18
to
It would become a huge bottleneck if all threads had to fight for a
single global state. However, if each thread had it own personal PRNG
with its own unique seed, then each thread would produce a unique stream
without any synchronization whatsoever. Much better.

Queequeg

unread,
Jan 2, 2019, 7:43:13 AM1/2/19
to
Mr Flibble <flibbleREM...@i42.co.uk> wrote:

> No need to reply (if you do I will add you to my spam filter).

Which would be the best thing you could do for this group, instead of
contributing to the noise.

--
https://www.youtube.com/watch?v=9lSzL1DqQn0
0 new messages