Friday, January 13, 2023

Digest for comp.lang.c++@googlegroups.com - 24 updates in 5 topics

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 13 03:03PM -0800

On 5/12/2022 12:16 PM, Chris M. Thomasson wrote:
> Using my experimental vector field to generate a fractal formation. Here
> is generation two:
 
> https://fractalforums.org/gallery/1612-120522191048.png
 
From an experimental OpenGL project of mine:
 
https://fractalforums.org/gallery/1612-130123223335.png
 
All in real time, all in C++. ;^)
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 13 03:08PM -0800

On 1/13/2023 3:03 PM, Chris M. Thomasson wrote:
 
> From an experimental OpenGL project of mine:
 
> https://fractalforums.org/gallery/1612-130123223335.png
 
> All in real time, all in C++. ;^)
 
 
Fwiw, the model of the observer can be found here. My program can load
up models created by others:
 
https://skfb.ly/6zGMG
Stuart Redmann <DerTopper@web.de>: Jan 13 07:19AM +0100

>> Bite me.
 
>> Message ends.
 
> The god damn MSVC debugger is messed up pretty bad! Got another taste of it!
 
Care to elaborate? I think that the Visual Studios debugging capabilities
are outstanding because of the ability to add custom debug visualization.
This is possible using a rather rich extension interface (badly documented,
though). It enables us to export our data (2D geometries like polygons,
line strings, etc.) into an external viewer with a simple mouse click. It
can't get more convenient than that.
 
Regards,
Stuart
Muttley@dastardlyhq.com: Jan 13 10:15AM

On Fri, 13 Jan 2023 07:19:45 +0100
>though). It enables us to export our data (2D geometries like polygons,
>line strings, etc.) into an external viewer with a simple mouse click. It
>can't get more convenient than that.
 
The sort of people who write extensions to editors and debuggers obviously
don't have enough real work to do.
Manu Raju <MR@invalid.invalid>: Jan 13 02:29PM

On 13/01/2023 06:19, Stuart Redmann wrote:
> though). It enables us to export our data (2D geometries like polygons,
> line strings, etc.) into an external viewer with a simple mouse click. It
> can't get more convenient than that.
 
I think he was sarcastic about Flibble's health issues but I won't say
more because I could be wrong.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 13 01:43PM -0800

On 1/12/2023 10:19 PM, Stuart Redmann wrote:
> though). It enables us to export our data (2D geometries like polygons,
> line strings, etc.) into an external viewer with a simple mouse click. It
> can't get more convenient than that.
 
A line of code would push_back an element into a std::vector. The damn
debugger would show that the vector contained no elements, however, one
was there. Then there are other oddities.
 
I have never had this problem with MSVC before.
Juha Nieminen <nospam@thanks.invalid>: Jan 13 07:51AM

> Actually its your standard response when argued into a corner. You've done it
> multiple times including to me.
 
You seem to be just taunting me to repeat the expletives, don't you?
Muttley@dastardlyhq.com: Jan 13 10:14AM

On Fri, 13 Jan 2023 07:51:08 -0000 (UTC)
>> Actually its your standard response when argued into a corner. You've done it
 
>> multiple times including to me.
 
>You seem to be just taunting me to repeat the expletives, don't you?
 
Please, go ahead and prove my point.
Juha Nieminen <nospam@thanks.invalid>: Jan 13 12:45PM


>>> multiple times including to me.
 
>>You seem to be just taunting me to repeat the expletives, don't you?
 
> Please, go ahead and prove my point.
 
I still find it completely hilarious that all this is the result of me
suggesting that full English words be used in identifier names.
 
I have said this several times, and I repeat it: This thread is
completely insane. It literally makes no sense.
 
It would make no sense even if it were true that I was somehow arrogantly
making the assertion with an air of intellectual superiority, looking
down on people as if they were my inferiors. The fact that I didn't do
such a thing makes it even more insane.
Ben Bacarisse <ben.usenet@bsb.me.uk>: Jan 13 02:08PM

> suggesting that full English words be used in identifier names.
 
> I have said this several times, and I repeat it: This thread is
> completely insane. It literally makes no sense.
 
I disagree. A giant corporation with a huge investment in code (Google)
disagrees with you, but you won't even consider the possibility that the
people saying the very same thing here might have a point. Of course
you can disagree, but for some reason you don't even accept that there
are alternative opinions that might be worth considering. Also, you
cited that every document without quoting the parts that you did not
agree which suggest that you have not been discussing the topic in good
faith. When viewed like that, the thread does make sense.
 
Good-natured, collegiate discussions tend to fizzle out after a range of
opinions have been mulled over. Those where one or more of the parties
takes a "there's nothing controversial here, how could anyone disagree
with me?" stance will run and run.
 
--
Ben.
Daniel <danielaparker@gmail.com>: Jan 13 06:18AM -0800

On Friday, January 13, 2023 at 9:09:02 AM UTC-5, Ben Bacarisse wrote:
 
 
> [discussions] where one or more of the parties
> takes a "there's nothing controversial here, how could anyone disagree
> with me?" stance will run and run.
 
Rather, they'll only run and run if multiple parties take a "how could
anyone disagree with me?" stance. Multiple parties that have already
said everything they have to say about the topic, and are simply repeating
themselves, lest someone keeps being wrong on the internet. It's a
little unfair to single out the OP.
 
Daniel
Muttley@dastardlyhq.com: Jan 13 04:08PM

On Fri, 13 Jan 2023 12:45:28 -0000 (UTC)
 
>> Please, go ahead and prove my point.
 
>I still find it completely hilarious that all this is the result of me
>suggesting that full English words be used in identifier names.
 
You expected fawning agreement from everyone, didn't get it, so threw all your
toys out of the pram.
 
Your lack of self awareness is impressive btw.
gazelle@shell.xmission.com (Kenny McCormack): Jan 13 02:57PM

In article <tpjqe7$i6jj$3@dont-email.me>,
>Am 08.01.2023 um 23:55 schrieb Amine Moulay Ramdane:
 
>> Please ignore this post of mine, since i have just posted it in the wrong forum.
 
>You always post in the wrong forum.
 
You would know (about posting in the wrong forum).
 
--
If Jeb is Charlie Brown kicking a football-pulled-away, Mitt is a '50s
housewife with a black eye who insists to her friends the roast wasn't
dry.
Tim Woodall <news001@woodall.me.uk>: Jan 13 06:35AM


> It looks like shuffle of a set of unique numbers.
 
The original spec wasn't very clear but looked to me to be a choose m
from n - which can be implemented as shuffle then choose first m (with
further optimization that you only need to shuffle the first m slots)
Tim Woodall <news001@woodall.me.uk>: Jan 13 06:32AM

> Now it's perfect:
 
Hmmm, about 20 years ago I was told a story of someone who needed a
'shuffle' function - random permutation. I don't know or don't recall
the context but I'd guess it was part of a test harness.
 
They wrote it, tested it, deployed it, and things ground to a
standstill.
 
Instead of permuting, they'd randomly picked numbers, checked for dupes,
and then added to their output, quick for very small sets, 'never'
terminated for large ones.
 
 
Tim Woodall <news001@woodall.me.uk>: Jan 13 06:39AM


> The original spec wasn't very clear but looked to me to be a choose m
> from n - which can be implemented as shuffle then choose first m (with
> further optimization that you only need to shuffle the first m slots)
 
further optimization that you only need to shuffle *into* the first m slots)
Bonita Montero <Bonita.Montero@gmail.com>: Jan 13 08:26AM +0100

Am 09.01.2023 um 17:42 schrieb Bonita Montero:
> alternative algorithm. You'd have a list of eligible numbers and
> randomly chose one of them. That would also take a lot of time to
> remove the number from the list.
 
Now I make a list of eligible numbers, randomly chode one of them
and remove the item from the list:
 
#include <iostream>
#include <charconv>
#include <random>
#include <concepts>
#include <vector>
 
using namespace std;
 
int main( int argc, char **argv )
{
try
{
if( argc < 4 )
return
cout << argv[0] << " n from to" << endl,
EXIT_FAILURE;
auto parse = []( char const *str, char const *err )
{
size_t value;
if( from_chars_result fcr = from_chars( str, str + strlen( str ),
value ); (bool)fcr.ec || *fcr.ptr )
throw invalid_argument( err );
return value;
};
size_t n = parse( argv[1], "wrong number of values" );
if( !n )
return EXIT_SUCCESS;
size_t
from = parse( argv[2], "wrong from-value" ),
to = parse( argv[3], "wrong to-value" );
if( from > to )
swap( from, to );
if( n - 1 > to - from )
return
cout << "n is too small" << endl,
EXIT_FAILURE;
vector<size_t> free;
free.resize( to - from + 1 );
for( size_t i = from; size_t &v : free )
v = i++;
mt19937_64 mt;
size_t above = to;
while( free.size() )
{
auto pick = free.begin() + (uniform_int_distribution<size_t>( 0,
free.size() - 1 ))( mt );
//cout << *pick << endl;
free.erase( pick );
}
}
catch( exception const &exc )
{
return
cout << exc.what() << endl,
EXIT_FAILURE;
}
}
 
But that's _much_ slower.
"Öö Tiib" <ootiib@hot.ee>: Jan 13 03:26AM -0800

On Friday, 13 January 2023 at 09:26:26 UTC+2, Bonita Montero wrote:
> > remove the number from the list.
> Now I make a list of eligible numbers, randomly chode one of them
> and remove the item from the list:
 
Some kind of weird algorithm ... what it supposedly does?
Why you require n from user if the algorithm does nothing with it?
Variable above is also ignored, perhaps the algorithm is meant as
half-made complete-yourself pseudocode?
 
> But that's _much_ slower.
 
Very likely as it does do something odd.
gazelle@shell.xmission.com (Kenny McCormack): Jan 13 12:21PM

In article <tpr12i$1i7r6$1@dont-email.me>,
some lunatic <Bonita.Montero@gmail.com> wrote:
...
>#include <random>
>#include <concepts>
>#include <vector>
 
You still just don't seem to get this whole topicality thing, do ya?
 
--
Reading any post by Fred Hodgin, you're always faced with the choice of:
lunatic, moron, or troll.
 
I always try to be generous and give benefit of the doubt, by assuming troll.
"Öö Tiib" <ootiib@hot.ee>: Jan 13 05:04AM -0800

On Friday, 13 January 2023 at 08:40:21 UTC+2, Tim Woodall wrote:
 
> Instead of permuting, they'd randomly picked numbers, checked for dupes,
> and then added to their output, quick for very small sets, 'never'
> terminated for large ones.
 
It's bit frustrating to read those stories.
The O(n) algorithm for when the range to pick from and set to be picked
are of close size is not that large or complicated, how they manage
to take tons of time?
 
size_t n, to, from;
// ...
// assign count to pick to "n" and range to "to" and "from"
// ...
size_t size = to - from + 1;
std::vector<size_t> result(size);

std::mt19937_64 gen(time(nullptr)); // or whatever generator
 
for(size_t i = 0; i < n; ++i) {
size_t choice = (std::uniform_int_distribution<size_t>( i, size - 1))( gen );
size_t& current = result[i];
size_t& picked = result[choice];
if (current == 0) current = i + 1;
if (picked == 0) picked = choice + 1;
if (current != picked) std::swap(current, picked);
current += from - 1;
// std::cout << current << '\n';
}
result.resize(n);
Bonita Montero <Bonita.Montero@gmail.com>: Jan 13 02:11PM +0100

Am 13.01.2023 um 13:21 schrieb Kenny McCormack:
>> #include <concepts>
>> #include <vector>
 
> You still just don't seem to get this whole topicality thing, do ya?
 
My code is beyond that topic. You may elect only a small number
of values like in the original code, but you might also chose
million of numbers.
gazelle@shell.xmission.com (Kenny McCormack): Jan 13 01:55PM

In article <tprl89$1k839$1@dont-email.me>,
 
>My code is beyond that topic. You may elect only a small number
>of values like in the original code, but you might also chose
>million of numbers.
 
Whoooooosh!!!
 
--
Many people in the American South think that DJT is, and will be remembered
as, one of the best presidents in US history. They are absolutely correct.
 
He is currently at number 46 on the list. High praise, indeed!
Bonita Montero <Bonita.Montero@gmail.com>: Jan 13 03:02PM +0100

Am 13.01.2023 um 14:55 schrieb Kenny McCormack:
>> of values like in the original code, but you might also chose
>> million of numbers.
 
> Whoooooosh!!!
 
It's not the absolute number of values which can be chosen
but the flexibility or finding the most efficient way to
have this flexibility.
gazelle@shell.xmission.com (Kenny McCormack): Jan 13 02:17PM

In article <tpro7o$1ki63$1@dont-email.me>,
 
>It's not the absolute number of values which can be chosen
>but the flexibility or finding the most efficient way to
>have this flexibility.
 
Due anziani che convivono da una vita:
Lei: "Caro, ormai ci potremmo anche sposare...".
Lui: "Ma cara, alla nostra eta', chi ci prenderebbe?".
 
--
"Women should not be enlightened or educated in any way. They should be
segregated because they are the cause of unholy erections in holy men.
 
-- Saint Augustine (354-430) --
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: