- About Flibble - 6 Updates
- Compute Unique Numbers in a Set - 5 Updates
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 18 11:56AM -0800 > The sort of bugs we're discussing here arn't the obvious "Oh, that result isn't > correct" type. They're the "Oh, why has is suddenly hung/crashed when its run > fine for 2 months" type. Usually, those type of bugs are with race-conditions. My code is not using multiple threads yet. |
scott@slp53.sl.home (Scott Lurndal): Jan 18 08:00PM >> correct" type. They're the "Oh, why has is suddenly hung/crashed when its run >> fine for 2 months" type. >Usually, those type of bugs are with race-conditions. Or using uninitialized variables, particularly in functions. Could work for weeks, then the program takes a different path and the stack contains a value that causes a crash. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 18 12:11PM -0800 On 1/18/2023 12:00 PM, Scott Lurndal wrote: > functions. Could work for weeks, then the program > takes a different path and the stack contains a > value that causes a crash. True. Well, so far, I don't think I have a problem. MSVC is pretty good at flagging uninitialized variables, and I have a habit of always initializing them. int x = 0; instead of: int x; Well, if I do have a bug, its a good thing that my program is in pre-alpha experimental stage! |
David Brown <david.brown@hesbynett.no>: Jan 18 09:17PM +0100 On 18/01/2023 21:11, Chris M. Thomasson wrote: > int x = 0; > instead of: > int x; That's a /really/ bad idea (unless you actually /want/ x to be 0, of course). It is bad precisely because it stops the compiler from warning you when you have forgotten to put a real value in the variable. Get in the habit of declaring local variables only when you have something useful to put in them, and initialising them at that point. But if you must declare a variable before you have an initial value, do not artificially initialise it - you are just making it harder for the tools to find your bugs. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 18 12:35PM -0800 On 1/18/2023 12:17 PM, David Brown wrote: > But if you must declare a variable before you have an initial value, do > not artificially initialise it - you are just making it harder for the > tools to find your bugs. Yes. I have been told this, damn near, exact same warning before David on a couple of jobs. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 18 12:37PM -0800 On 1/18/2023 12:17 PM, David Brown wrote: > But if you must declare a variable before you have an initial value, do > not artificially initialise it - you are just making it harder for the > tools to find your bugs. Fwiw, I am going to start fresh in a couple of days. Basically refactor my experimental pre-alpha code base into a fresh project on a part-by-part basis. I need to do it. Basically, clean house! |
Muttley@dastardlyhq.com: Jan 18 04:24PM On Wed, 18 Jan 2023 17:20:23 +0100 >I was talking about a non-cryptographical PRNG, and you talk about sth. >different because you have a constant feeling of uncertainty and you >think nothing is reliable in that sense. Pop psychology now? Really? Stick to writing over complicated code then bragging about how perfect it is so someone else can prove you wrong. Again. |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 18 05:59PM +0100 > Pop psychology now? Really? Stick to writing over complicated code then > bragging about how perfect it is so someone else can prove you wrong. Again. No one uses this perfect randomness you suggest but only as a seed for a cryptographic PRNG. And for the purpose here you even don't need this quality of randomness. Your personal issues aren't practically relevant. |
Muttley@dastardlyhq.com: Jan 18 05:14PM On Wed, 18 Jan 2023 17:59:08 +0100 >> bragging about how perfect it is so someone else can prove you wrong. Again. >No one uses this perfect randomness you suggest but only as a seed for >a cryptographic PRNG. And for the purpose here you even don't need this I was simply making a point that if you don't care about actual randomness then standard RPGs are fine. >quality of randomness. Your personal issues aren't practically relevant. I'm not the one with the issues in this discussion. |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 18 06:23PM +0100 > I was simply making a point that if you don't care about actual randomness > then standard RPGs are fine. With that ? | I'll say again - there is no such thing as random for formula generated | "random" number sequences. Given the same start conditions the same sequence | will be generated whether its 2^19937 or 2^infinity. You'd be better off using | /dev/random, at least its entropy comes from nominally external sources so | is unpredictable in a busy enviroment. Absolutely not. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 18 11:59AM -0800 On 1/18/2023 6:50 AM, Paul N wrote: >>> https://en.wikipedia.org/wiki/Faro_shuffle >> Touche. How about riffle shuffles? > I think a Faro shuffle is just a perfect riffle shuffle. 8 out-shuffles or 52 in-shuffles put the deck back into its original order. I do not want a perfect shuffle. > Also, any sort of shuffle based on a 32-bit seed will give one of about 4 billion orders for the cards. This sounds a lot but is dwarfed by the 52! possible orders, and it means that once you've seen about 6 or 7 of the cards you can work out exactly what all the others are. How do the Casinos handle it? |
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:
Post a Comment