Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I prefer rogues to imbeciles, because they sometimes take a rest." -- Alexandre Dumas (fils)


devel / comp.lang.c++ / What Does this program ?

SubjectAuthor
* What Does this program ?Bonita Montero
`* Re: What Does this program ?Bonita Montero
 +* Re: What Does this program ?Bonita Montero
 |`* Re: What Does this program ?Pavel
 | +* Re: What Does this program ?Bonita Montero
 | |`* Re: What Does this program ?Chris M. Thomasson
 | | `* Re: What Does this program ?Bonita Montero
 | |  `- Re: What Does this program ?Chris M. Thomasson
 | `- Re: What Does this program ?Scott Lurndal
 `* Re: What Does this program ?David Brown
  `- Re: What Does this program ?Bonita Montero

1
What Does this program ?

<u7k6qh$26elc$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: What Does this program ?
Date: Thu, 29 Jun 2023 17:09:06 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <u7k6qh$26elc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Jun 2023 15:09:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7cb8593b7a64e4c29bccf2f45d13345a";
logging-data="2308780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T0eJCoVRCp2oAeA/t/PAIiqLa3LsmtO0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:JJGvxafGqTc+zWNKke0kgHDU2YM=
Content-Language: de-DE
 by: Bonita Montero - Thu, 29 Jun 2023 15:09 UTC

What Does this program ?

template<typename StringType>
requires is_same_v<StringType, basic_string<typename
StringType::value_type, typename StringType::traits_type, typename
StringType::allocator_type>>
StringType dottify( uint64_t value )
{ using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
using dig_arr_it = dig_arr_t::iterator;
dig_arr_t reverseDigits;
dig_arr_it rDigitsEnd = reverseDigits.begin();
do
*rDigitsEnd++ = clockCycles % 10,
value /= 10;
while( value );
size_t
digitsLen = rDigitsEnd - reverseDigits.begin(),
groups = (digitsLen - 1) / 3;
StringType str( digitsLen + groups, '\0' );
typename StringType::iterator wrt = str.end();
dig_arr_it digit = reverseDigits.begin();
for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3; digit
!= groupsEnd; wrt -= 4, digit += 3 )
wrt[-1] = digit[0] + '0',
wrt[-2] = digit[1] + '0',
wrt[-3] = digit[2] + '0',
wrt[-4] = '.';
do
*--wrt = *digit++ + '0';
while( digit != rDigitsEnd );
return str;
}

It does this for sure very elegant.

Re: What Does this program ?

<u7k8s5$26l5b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Thu, 29 Jun 2023 17:44:06 +0200
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <u7k8s5$26l5b$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Jun 2023 15:44:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7cb8593b7a64e4c29bccf2f45d13345a";
logging-data="2315435"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tIC8gqNdlXOSRx9t/ARqwt1B4HNHHsBE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:kroI059LQ1RAwYez7geGBsFDGkI=
In-Reply-To: <u7k6qh$26elc$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Thu, 29 Jun 2023 15:44 UTC

This is an enhanced version:

// might throw bad_alloc

template<typename StringType>
requires is_same_v<StringType, basic_string<typename
StringType::value_type, typename StringType::traits_type, typename
StringType::allocator_type>>
StringType dottify( uint64_t value )
{ using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
using dig_arr_it = dig_arr_t::iterator;
dig_arr_t reverseDigits;
dig_arr_it rDigitsEnd = reverseDigits.begin();
do
*rDigitsEnd++ = value % 10,
value /= 10;
while( value );
size_t
digitsLen = rDigitsEnd - reverseDigits.begin(),
groups = (digitsLen - 1) / 3;
using str_arr_t = array<typename StringType::value_type, 20 + (20 - 1)
/ 3>;
using str_arr_it = str_arr_t::iterator;
str_arr_t retArr;
str_arr_it wrt = retArr.end();
dig_arr_it digit = reverseDigits.begin();
for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3; digit
!= groupsEnd; wrt -= 4, digit += 3 )
wrt[-1] = digit[0] + '0',
wrt[-2] = digit[1] + '0',
wrt[-3] = digit[2] + '0',
wrt[-4] = '.';
do
*--wrt = *digit++ + '0';
while( digit != rDigitsEnd );
return StringType( wrt, retArr.end() );
}

Re: What Does this program ?

<u7k9p4$26nls$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Thu, 29 Jun 2023 17:59:33 +0200
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <u7k9p4$26nls$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Jun 2023 15:59:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7cb8593b7a64e4c29bccf2f45d13345a";
logging-data="2318012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/t53Zocn91Jeyi6Xedj8bN35oQM+Wc4kc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:w/g78ptV5FLdd9zLOErvu8TmdA8=
In-Reply-To: <u7k8s5$26l5b$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Thu, 29 Jun 2023 15:59 UTC

Now it's the most beautiful code:

template<typename StringType, integral ValueType>
requires is_same_v<StringType, basic_string<typename
StringType::value_type, typename StringType::traits_type, typename
StringType::allocator_type>>
StringType dottify( ValueType value )
{ using uvalue_t = make_unsigned_t<ValueType>;
uvalue_t uValue;
if constexpr( signed_integral<ValueType> )
uValue = value >= 0 ? value : -value;
else
uValue = value;
using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
using dig_arr_it = dig_arr_t::iterator;
dig_arr_t reverseDigits;
dig_arr_it rDigitsEnd = reverseDigits.begin();
do
*rDigitsEnd++ = value % 10,
value /= 10;
while( value );
size_t
digitsLen = rDigitsEnd - reverseDigits.begin(),
groups = (digitsLen - 1) / 3;
using str_arr_t = array<typename StringType::value_type, 1 + 20 + (20 -
1) / 3>;
using str_arr_it = str_arr_t::iterator;
str_arr_t retArr;
str_arr_it wrt = retArr.end();
dig_arr_it digit = reverseDigits.begin();
for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3; digit
!= groupsEnd; wrt -= 4, digit += 3 )
wrt[-1] = digit[0] + '0',
wrt[-2] = digit[1] + '0',
wrt[-3] = digit[2] + '0',
wrt[-4] = '.';
do
*--wrt = *digit++ + '0';
while( digit != rDigitsEnd );
if constexpr( signed_integral<ValueType> )
if( value < 0 )
*--wrt = '-';
return StringType( wrt, retArr.end() );
}

Re: What Does this program ?

<NArnM.367$edN3.188@fx14.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!news.swapon.de!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
Subject: Re: What Does this program ?
Newsgroups: comp.lang.c++
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7k9p4$26nls$1@dont-email.me>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
MIME-Version: 1.0
In-Reply-To: <u7k9p4$26nls$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 72
Message-ID: <NArnM.367$edN3.188@fx14.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Fri, 30 Jun 2023 03:02:05 UTC
Date: Thu, 29 Jun 2023 23:02:05 -0400
X-Received-Bytes: 3468
 by: Pavel - Fri, 30 Jun 2023 03:02 UTC

Bonita Montero wrote:
> Now it's the most beautiful code:
>
> template<typename StringType, integral ValueType>
>     requires is_same_v<StringType, basic_string<typename
> StringType::value_type, typename StringType::traits_type, typename
> StringType::allocator_type>>
> StringType dottify( ValueType value )
> {
>     using uvalue_t = make_unsigned_t<ValueType>;
>     uvalue_t uValue;
>     if constexpr( signed_integral<ValueType> )
>         uValue = value >= 0 ? value : -value;
>     else
>         uValue = value;
>     using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
>     using dig_arr_it = dig_arr_t::iterator;
>     dig_arr_t reverseDigits;
>     dig_arr_it rDigitsEnd = reverseDigits.begin();
>     do
>         *rDigitsEnd++ = value % 10,
>         value /= 10;
>     while( value );
>     size_t
>         digitsLen = rDigitsEnd - reverseDigits.begin(),
>         groups = (digitsLen - 1) / 3;
>     using str_arr_t = array<typename StringType::value_type, 1 + 20 +
> (20 - 1) / 3>;
>     using str_arr_it = str_arr_t::iterator;
>     str_arr_t retArr;
>     str_arr_it wrt = retArr.end();
>     dig_arr_it digit = reverseDigits.begin();
>     for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3;
> digit != groupsEnd; wrt -= 4, digit += 3 )
>         wrt[-1] = digit[0] + '0',
>         wrt[-2] = digit[1] + '0',
>         wrt[-3] = digit[2] + '0',
>         wrt[-4] = '.';
>     do
>         *--wrt = *digit++ + '0';
>     while( digit != rDigitsEnd );
>     if constexpr( signed_integral<ValueType> )
>         if( value < 0 )
>             *--wrt = '-';
>     return StringType( wrt, retArr.end() );
> }

Why does it constrain the return type but not the argument type? The
former limits the code usefulness by requiring a string where the client
might want to return any sequence like a vector or deque (not to mention
ideally the result should have been consumed by a back inserter second
arg); the latter provokes UB or ill-formed prog if the caller passes
double as an arg.

Why to hardcode dots? Some use commas, some prefer underscores, some
spaces...

Why to hardcode 3?

Why so many copies?

Why unhelpful names?

Why a single function for at least two distinct jobs?

Why no braces -- is this to make maintenance as error-prone as possible?

Why do I still have to read the code like this ??????? It's no longer
1983! (cries and hits his head against his monitor)

-Pavel

Re: What Does this program ?

<u7md6e$2h93r$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Fri, 30 Jun 2023 13:10:08 +0200
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <u7md6e$2h93r$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7k9p4$26nls$1@dont-email.me> <NArnM.367$edN3.188@fx14.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 30 Jun 2023 11:10:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1ee7472c2d4457b22206aebc8835d573";
logging-data="2663547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IvMPpFTUqpXhETJZLs8uiEUI4NzuhXDA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:AULduioG9b3Q1g8dv7GKA9QFjlM=
In-Reply-To: <NArnM.367$edN3.188@fx14.iad>
Content-Language: de-DE
 by: Bonita Montero - Fri, 30 Jun 2023 11:10 UTC

Am 30.06.2023 um 05:02 schrieb Pavel:

> Why to hardcode dots? Some use commas, some prefer underscores, some
> spaces...

That's just a detail. For my purpose dots are sufficient.

> Why to hardcode 3?

Because the groups will never be different.

> Why so many copies?

Because the row of / 10 calculations would be done only once.

> Why unhelpful names?

That's a matter of taste.

> Why a single function for at least two distinct jobs?

The function is for one jjob.

> Why no braces -- is this to make maintenance as error-prone as possible?

I don't make errors at this level-

> Why do I still have to read the code like this ???????
> It's no longer 1983! (cries and hits his head against his monitor)

My code is sexy for me.

This is the completed version:

#pragma once
#include <string_view>
#include <concepts>
#include <type_traits>
#include <array>

template<std::integral CharType, std::integral ValueType>
std::basic_string_view<CharType> dottifySv( ValueType value )
{ using namespace std;
static_assert(sizeof(ValueType) <= 8, "");
using uvalue_t = make_unsigned_t<ValueType>;
uvalue_t uValue;
if constexpr( signed_integral<ValueType> )
uValue = value >= 0 ? value : -value;
else
uValue = value;
using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
using dig_arr_it = dig_arr_t::iterator;
dig_arr_t reverseDigits;
dig_arr_it rDigitsEnd = reverseDigits.begin();
do
*rDigitsEnd++ = uValue % 10,
uValue /= 10;
while( uValue );
size_t groups = (rDigitsEnd - reverseDigits.begin() - 1) / 3;
using str_arr_t = array<CharType, 1 + 20 + (20 - 1) / 3>;
using str_arr_it = str_arr_t::iterator;
thread_local str_arr_t retArr;
str_arr_it wrt = retArr.end();
dig_arr_it digit = reverseDigits.begin();
auto append = [&]() { *--wrt = *digit++ + '0'; };
for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3; digit
!= groupsEnd; wrt -= 4, digit += 3 )
append(),
append(),
append(),
*--wrt = '.';
do
append();
while( digit != rDigitsEnd );
if constexpr( signed_integral<ValueType> )
if( value < 0 )
*--wrt = '-';
return basic_string_view<CharType>( wrt, retArr.end() );
}

template<std::integral CharType, std::integral ValueType>
std::basic_string<CharType> dottify( ValueType value )
{ using namespace std;
basic_string_view<CharType> sv( dottifySv<CharType>( value ) );
return basic_string<CharType>( sv.begin(), sv.end() );
}

Re: What Does this program ?

<6VAnM.9$lzu4.2@fx04.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.neodome.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx04.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: What Does this program ?
Newsgroups: comp.lang.c++
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me> <u7k9p4$26nls$1@dont-email.me> <NArnM.367$edN3.188@fx14.iad>
Lines: 62
Message-ID: <6VAnM.9$lzu4.2@fx04.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 30 Jun 2023 13:38:10 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 30 Jun 2023 13:38:10 GMT
X-Received-Bytes: 3331
 by: Scott Lurndal - Fri, 30 Jun 2023 13:38 UTC

Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>Bonita Montero wrote:
>> Now it's the most beautiful code:
>>
>> template<typename StringType, integral ValueType>
>>     requires is_same_v<StringType, basic_string<typename
>> StringType::value_type, typename StringType::traits_type, typename
>> StringType::allocator_type>>
>> StringType dottify( ValueType value )
>> {
>>     using uvalue_t = make_unsigned_t<ValueType>;
>>     uvalue_t uValue;
>>     if constexpr( signed_integral<ValueType> )
>>         uValue = value >= 0 ? value : -value;
>>     else
>>         uValue = value;
>>     using dig_arr_t = array<uint8_t, 20>; // max 20 digits for 64 bit
>>     using dig_arr_it = dig_arr_t::iterator;
>>     dig_arr_t reverseDigits;
>>     dig_arr_it rDigitsEnd = reverseDigits.begin();
>>     do
>>         *rDigitsEnd++ = value % 10,
>>         value /= 10;
>>     while( value );
>>     size_t
>>         digitsLen = rDigitsEnd - reverseDigits.begin(),
>>         groups = (digitsLen - 1) / 3;
>>     using str_arr_t = array<typename StringType::value_type, 1 + 20 +
>> (20 - 1) / 3>;
>>     using str_arr_it = str_arr_t::iterator;
>>     str_arr_t retArr;
>>     str_arr_it wrt = retArr.end();
>>     dig_arr_it digit = reverseDigits.begin();
>>     for( dig_arr_it groupsEnd = reverseDigits.begin() + groups * 3;
>> digit != groupsEnd; wrt -= 4, digit += 3 )
>>         wrt[-1] = digit[0] + '0',
>>         wrt[-2] = digit[1] + '0',
>>         wrt[-3] = digit[2] + '0',
>>         wrt[-4] = '.';
>>     do
>>         *--wrt = *digit++ + '0';
>>     while( digit != rDigitsEnd );
>>     if constexpr( signed_integral<ValueType> )
>>         if( value < 0 )
>>             *--wrt = '-';
>>     return StringType( wrt, retArr.end() );
>> }
>
>Why does it constrain the return type but not the argument type? The
>former limits the code usefulness by requiring a string where the client
>might want to return any sequence like a vector or deque (not to mention
>ideally the result should have been consumed by a back inserter second
>arg); the latter provokes UB or ill-formed prog if the caller passes
>double as an arg.
>
>Why to hardcode dots? Some use commas, some prefer underscores, some
>spaces...

Indeed, why not just use snprintf (with the "'" modifier)? It's
perfectly legal C++ _and_ uses the locale rules for the '.' vs. ','.

Bonita's code is simply unreadable.

Re: What Does this program ?

<u7n1m2$2jdlf$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Fri, 30 Jun 2023 09:59:46 -0700
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <u7n1m2$2jdlf$2@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7k9p4$26nls$1@dont-email.me> <NArnM.367$edN3.188@fx14.iad>
<u7md6e$2h93r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Jun 2023 16:59:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00ea898eae53548151a4d1284853b49c";
logging-data="2733743"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YqhmS2bmrsJbsktr2AmWWbucmrWsiMiE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:DOue0Q6JyHt1RTo2+Y0bavtANSY=
In-Reply-To: <u7md6e$2h93r$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Fri, 30 Jun 2023 16:59 UTC

On 6/30/2023 4:10 AM, Bonita Montero wrote:
> Am 30.06.2023 um 05:02 schrieb Pavel:
>
>> Why to hardcode dots? Some use commas, some prefer underscores, some
>> spaces...
>
> That's just a detail. For my purpose dots are sufficient.
>
>> Why to hardcode 3?
>
> Because the groups will never be different.
>
>> Why so many copies?
>
> Because the row of / 10 calculations would be done only once.
>
>> Why unhelpful names?
>
> That's a matter of taste.
>
>> Why a single function for at least two distinct jobs?
>
> The function is for one jjob.
>
>> Why no braces -- is this to make maintenance as error-prone as possible?
>
> I don't make errors at this level-
>
>> Why do I still have to read the code like this ???????
>> It's no longer  1983! (cries and hits his head against his monitor)
>
>  My code is sexy for me.
[...]

Hey now! You should ask an AI to convert your code into a rendition of a
human. What does it look like? ;^) lol.

Re: What Does this program ?

<u7n1t5$2jfer$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Fri, 30 Jun 2023 19:03:35 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <u7n1t5$2jfer$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7k9p4$26nls$1@dont-email.me> <NArnM.367$edN3.188@fx14.iad>
<u7md6e$2h93r$1@dont-email.me> <u7n1m2$2jdlf$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 30 Jun 2023 17:03:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1ee7472c2d4457b22206aebc8835d573";
logging-data="2735579"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dq0fZPUWXGR1CGA7/Llj+DZWjC9VzsxA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:oLJRhagwMeHGncIyti0WACARWpo=
Content-Language: de-DE
In-Reply-To: <u7n1m2$2jdlf$2@dont-email.me>
 by: Bonita Montero - Fri, 30 Jun 2023 17:03 UTC

Am 30.06.2023 um 18:59 schrieb Chris M. Thomasson:

> Hey now! You should ask an AI to convert your code into a rendition of a
> human. What does it look like? ;^) lol.

I'm using C++ as abstract as possible to have things like
type-constraining on generic types, iterator-debugging e.g..

Re: What Does this program ?

<u7n25b$2jdlf$6@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Fri, 30 Jun 2023 10:07:55 -0700
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <u7n25b$2jdlf$6@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7k9p4$26nls$1@dont-email.me> <NArnM.367$edN3.188@fx14.iad>
<u7md6e$2h93r$1@dont-email.me> <u7n1m2$2jdlf$2@dont-email.me>
<u7n1t5$2jfer$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 30 Jun 2023 17:07:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00ea898eae53548151a4d1284853b49c";
logging-data="2733743"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18H1iQANW83SSmbZT0aFnXF2Y0NU8LfGGU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:s03C0gcsRTBgLz7FEdlMNg2KUkc=
In-Reply-To: <u7n1t5$2jfer$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Fri, 30 Jun 2023 17:07 UTC

On 6/30/2023 10:03 AM, Bonita Montero wrote:
> Am 30.06.2023 um 18:59 schrieb Chris M. Thomasson:
>
>> Hey now! You should ask an AI to convert your code into a rendition of
>> a human. What does it look like? ;^) lol.
>
> I'm using C++ as abstract as possible to have things like
> type-constraining on generic types, iterator-debugging e.g..
>

No problem with that. I was just wondering if an AI might be able to
relate your code to a picture of a human. ;^)

Re: What Does this program ?

<u7uglp$3n1sa$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Mon, 3 Jul 2023 14:58:32 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <u7uglp$3n1sa$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 3 Jul 2023 12:58:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="eb2fb2ebdb075a8982dcb162f067236a";
logging-data="3901322"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ltI85vMxIqYksAxU/MVpcbOymGkDOpkg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:EVZ3fg59+iaFAxrtMDqWOXcffmA=
In-Reply-To: <u7k8s5$26l5b$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 3 Jul 2023 12:58 UTC

On 29/06/2023 17:44, Bonita Montero wrote:
> This is an enhanced version:
>

Do you always use "enhanced" as a euphemism for "fewer bugs" ?

You make a lot of claims about how "elegant" your style is, and even
claim "I don't make errors at this level". Yet it is rare for you to
post code without then following up shortly afterwards with corrections
and fixes.

If you want people to judge your code fairly, please try to test and
debug your code before posting it. No one wants to have to read through
multiple different versions with minor changes, and your
self-corrections make it clear that your code is /not/ "elegant",
"beautiful", "perfect" or however you describe it. It is, in fact, a
rough draft that even the author finds hard to understand and correct.
If that's not the impression you want to give us, then don't post it
until you are sure it is correct. (But please do keep posting the code.)

Re: What Does this program ?

<u80e70$118m$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What Does this program ?
Date: Tue, 4 Jul 2023 08:28:52 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <u80e70$118m$1@dont-email.me>
References: <u7k6qh$26elc$1@dont-email.me> <u7k8s5$26l5b$1@dont-email.me>
<u7uglp$3n1sa$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 4 Jul 2023 06:28:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2ec938a5373eec2ad5c52292b4ab9d7c";
logging-data="34070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0VTO9eg9LefJ9VsQmO3zNIeIINFeSOco="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:gE71TybhWwK2FJoKRy23LyTjQiM=
Content-Language: de-DE
In-Reply-To: <u7uglp$3n1sa$1@dont-email.me>
 by: Bonita Montero - Tue, 4 Jul 2023 06:28 UTC

Am 03.07.2023 um 14:58 schrieb David Brown:
> On 29/06/2023 17:44, Bonita Montero wrote:
>> This is an enhanced version:
>>
>
> Do you always use "enhanced" as a euphemism for "fewer bugs" ?
>
> You make a lot of claims about how "elegant" your style is, and even
> claim "I don't make errors at this level".  Yet it is rare for you to
> post code without then following up shortly afterwards with corrections
> and fixes.

I didn't fix anything in this thread but made the code more elegant
in my opinion.


devel / comp.lang.c++ / What Does this program ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor