Thursday, October 31, 2019

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

woodbrian77@gmail.com: Oct 30 10:36PM -0700

On Wednesday, October 30, 2019 at 5:13:42 PM UTC-5, Mr Flibble wrote:
 
> I mean who else writes code like this:
 
I take some inspiration from Boost author Joaquín M López Muñoz.
I go further though than he does, probably.
 
> if('.'==name[0]||name[0]=='/')receive(buf,::strrchr(name,'/')+1,1);
 
> Is the space bar on your keyboard broken? Are you deliberately trying to
> make your code hard to read?
It takes some getting used to, but I like it that way.
 
 
> You seem to bang on about how small you can
> make files so is this the reason? Demented.
 
The less code that has to be generated, the less that
has to be compressed and sent over a network, decompressed
and compiled. I decided after a while to adopt the same
format for the code I've written by hand. It's a terse,
poetic format.
Ian Collins <ian-news@hotmail.com>: Oct 31 08:35PM +1300

> and compiled. I decided after a while to adopt the same
> format for the code I've written by hand. It's a terse,
> poetic format.
 
So you don't like spaces, but you make up for them with superfluous colons?
 
--
Ian.
woodbrian77@gmail.com: Oct 31 10:28AM -0700

On Thursday, October 31, 2019 at 2:36:06 AM UTC-5, Ian Collins wrote:
> > format for the code I've written by hand. It's a terse,
> > poetic format.
 
> So you don't like spaces, but you make up for them with superfluous colons?
 
We've discussed that a number of times. I think we'll have to
agree to disagree.
 
 
Brian
Frederick Gotham <cauldwell.thomas@gmail.com>: Oct 31 03:00AM -0700

On Wednesday, October 30, 2019 at 5:09:35 PM UTC, Real Troll wrote:
 
 
> <news://news.gmane.org/gmane.comp.lib.boost.user>
 
> After posting, you get an eMail asking for confirmation of your eMail
> address and then your post will appear on the newsgroup.
 
 
I got it working. Previously I had been using my favourite newsreader, XNews, to submit the post, but I've just emailed instead. I still use XNews for reading the list/group though.
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.

Wednesday, October 30, 2019

Digest for comp.lang.c++@googlegroups.com - 15 updates in 6 topics

woodbrian77@gmail.com: Oct 30 09:58AM -0700

Shalom
 
Can you give me some suggestions on how to improve my
repo: https://github.com/Ebenezer-group/onwards
?
 
What do you think of recent changes to this file?
https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc
 
and a version from the end of September:
https://github.com/Ebenezer-group/onwards/blob/9bc4c2646e7dc6421dfdcd9d1107d544c320a13a/src/cmw/tiers/cmwA.cc
 
The number of lines hasn't changed much, but the size of the
event loop, the most complicated part of the program, has been
reduced by switching from TCP to SCTP. Thanks in advance.
 
 
Brian
Ebenezer Enterprise - America isn't great because America is powerful.
America is powerful because America is great. Ben Shapiro at dailywire.com
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 30 06:16PM

> ?
 
> What do you think of recent changes to this file?
> https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc
 
I think your code is fucking shite. I think this not because you are a
misogynist homophobic bigot but because your code is shite. Your code
makes you look like a C programmer who has failed to grasp how to use C++
effectively (or even getting the basics down properly).
 
 
> Brian
> Ebenezer Enterprise - America isn't great because America is powerful.
> America is powerful because America is great. Ben Shapiro at dailywire.com
 
We don't want your spam here, dear.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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>: Oct 30 06:27PM

On 30/10/2019 18:16, Mr Flibble wrote:
>> Ebenezer Enterprise - America isn't great because America is powerful.
>> America is powerful because America is great.  Ben Shapiro at dailywire.com
 
> We don't want your spam here, dear.
 
*hateful spam
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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>: Oct 30 10:13PM

On 30/10/2019 18:16, Mr Flibble wrote:
> misogynist homophobic bigot but because your code is shite.  Your code
> makes you look like a C programmer who has failed to grasp how to use C++
> effectively (or even getting the basics down properly).
 
I mean who else writes code like this:
 
if('.'==name[0]||name[0]=='/')receive(buf,::strrchr(name,'/')+1,1);
 
Is the space bar on your keyboard broken? Are you deliberately trying to
make your code hard to read? You seem to bang on about how small you can
make files so is this the reason? Demented.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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."
Frederick Gotham <cauldwell.thomas@gmail.com>: Oct 30 07:16AM -0700

I submitted my idea for a Limited Input Iterator to the Boost development mailing list a few days ago, but it seems it hasn't made it through moderation.
 
I tried emailing the list owner, but nothing back yet. Strangely I haven't gotten an email saying that my post was rejected (but I did the first time when I tried to post a Test message).
 
Here's the details about my idea:
 
https://groups.google.com/forum/#!topic/comp.lang.c++/HattX03aFUA
 
By the way who do I talk to about getting this added to C++20 / C++23 ?
Real Troll <real.troll@trolls.com>: Oct 30 01:10PM -0400

On 30/10/2019 14:16, Frederick Gotham wrote:
 
> Here's the details about my idea:
 
> https://groups.google.com/forum/#!topic/comp.lang.c++/HattX03aFUA
 
> By the way who do I talk to about getting this added to C++20 / C++23 ?
 
How did you post? I use this link:
 
<news://news.gmane.org/gmane.comp.lib.boost.user>
 
After posting, you get an eMail asking for confirmation of your eMail
address and then your post will appear on the newsgroup.
Bo Persson <bo@bo-persson.se>: Oct 24 05:27PM +0200

On 2019-10-24 at 16:21, Paavo Helde wrote:
 
> Storing the length separately would also mean that it's not needed to
> calculate it as if by strlen() each time when needed (although strlen()
> should also by very fast on such small strings).
 
If you want to force it, you can store "unused space" instead of "size"
in the last byte. Then that byte happens to be zero when the space is
full. :-)
 
https://github.com/elliotgoodrich/SSO-23
 
For various reasons, like preferring an all-zero init being the empty
string, this is not used by the major implementations.
 
 
Bo Persson
Bonita Montero <Bonita.Montero@gmail.com>: Oct 24 04:16PM +0200

> ICC does not vectorise the code at all.
 
Check the ICC documentation ...
Real Troll <Real.Troll@Trolls.com>: Oct 25 04:50PM -0400

On 25/10/2019 20:03, Keith Thompson wrote:
 
> Everyone, please don't increase the signal-to-noise ratio by posting
> further about this here. Anyone who insists on doing so will have
> to change the followup headers.
 
People wants to discuss the meaning of Troll so where else can they
discuss this?
 
Follow up to alt.idiots
Ben Bacarisse <ben.usenet@bsb.me.uk>: Oct 24 10:39PM +0100

>>(including your angling one).
 
> I've been on usenet for almost forty years; It has always been well
> understood that the term derives from the fishing usage.
 
For a lot of people in the UK, the reference that springs to mind will
be to Julian and Sandy "trolling about" in Round the Horn. That polari
word probably comes from the fishing usage, but that one will be far
less well known to many Brits of a certain age.
 
--
Ben.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 24 12:45PM -0700

On 10/23/2019 10:38 PM, Jorgen Grahn wrote:
 
> The software (as I understand it) is Unix-specific; standard practice
> there is to have parent--child process relationships, and to use the
> wait() family of functions to detect when a child dies.
 
That's fine. Missed the Unix part. Imvho, it would be nice for other
processes to be able to ask the Supervisor to shutdown/pause/whatever
one of its children. Creating a little webserver per main component of a
system can work pretty good. Being able to control the Supervisor from a
browser can be nice.
Bonita Montero <Bonita.Montero@gmail.com>: Oct 24 11:00AM +0200


> Are you using an embedded version count within the data the CAS's work
> on? Like an ABA counter? If a CAS fails, how far back do you have to
> restart, or unroll if you will?
 
No, I'm not using ABA-counters.
Bonita Montero <Bonita.Montero@gmail.com>: Oct 25 08:20AM +0200

> Interesting. Are you "pinning" with the CAS?
 
Yes, I pin entries in the LRU-list with a CAS so that they can't be
evicted. But that has nothing to do with the parallel updates of the
LRU-list.
 
So I describe it another time to give you a chance to guess how my
idea works: cache-hits cann occur paralell, i.e. the updating of the
links to push a LRU-entry to the first place can be done by an arbi-
trary numbr of threads. That's the most relevant case because cache
-hits have a high frequency. When new elements are inserted into the
LRU-list or flushed from it the LRU-list is exclusively locked. But
this doesn't hurt since I/O is usually slow in comparison to a cache
hit.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 23 07:42PM -0700

On 9/26/2019 2:13 AM, Bonita Montero wrote:
> CMPXCHGs on three 64 bit values (in a 64-bit-system, in a 32-bit
> system you would have two 64- and one 32-bit exchange) if there's
> no collision.
 
Are you using an embedded version count within the data the CAS's work
on? Like an ABA counter? If a CAS fails, how far back do you have to
restart, or unroll if you will?
 
 
 
 
I'm asking myself if this would be faster with trans-
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 24 01:13PM -0700

On 10/24/2019 2:00 AM, Bonita Montero wrote:
>> on? Like an ABA counter? If a CAS fails, how far back do you have to
>> restart, or unroll if you will?
 
> No, I'm not using ABA-counters.
 
Are you embedding any state with a pointer? bit stealing?
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.

F3B8F3AB-88E3-4E40-A119-F57184E4095D.pdf

HAPPY HALLOWEEN!

此刊中有我以筆名【硯耕】寫的"見蝠得褔",希望你们好運好褔!

硯耕(劉田問候)

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

Ian Collins <ian-news@hotmail.com>: Oct 26 12:21AM +1300

On 25/10/2019 22:21, Frederick Gotham wrote:
 
> I added a static library to my project (Linux ".a" file), but then I
> went to commit the changes to a repository, but the commit failed
> because the ".a" file was too big.
 
So don't do that. There's seldom a need to commit generated files to SCM.
 
--
Ian.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 25 03:18PM

On Fri, 2019-10-25, Frederick Gotham wrote:
 
> My program would be too easy to reverse-engineer if I linked the
> library dynamically, so I'm linking it statically and obfuscating it
> as best I can.
 
I'll not comment on obscurity as a technique for security, but what
you write is orthogonal to what Ian Collins wrote. You don't have to
commit libfoo.a binaries to SCM in order to link statically.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
David Brown <david.brown@hesbynett.no>: Oct 24 12:51PM +0200

On 24/10/2019 11:01, Bonita Montero wrote:
>> gcc and clang produce using automatic vectorization? Because I have.
 
> Have you checked the compiler-docs? They document which code-patterns
> they can detect and vectorize. That are only very special patterns.
 
Can you give links to these documentation pages for gcc and clang?
Bonita Montero <Bonita.Montero@gmail.com>: Oct 24 04:23PM +0200

https://gcc.gnu.org/projects/tree-ssa/vectorization.html
Real Troll <real.troll@trolls.com>: Oct 24 12:40PM -0400

On 22/10/2019 08:28, Frederick Gotham wrote:
> std::cout << std::extent<decltype(values)>::value << std::endl;
> }
 
> Or is there an even nicer way?
 
 
values.size();
scott@slp53.sl.home (Scott Lurndal): Oct 24 03:50PM

>On Wednesday, October 23, 2019 at 6:18:17 PM UTC+1, James Kuyper wrote:
 
>I think it's likely that the modern use of "troll" on internet forums actually comes from the doll: https://en.wikipedia.org/wiki/Troll_doll
 
>This makes the most sense to me out of all the possibilities (including your angling one).
 
I've been on usenet for almost forty years; It has always been well understood that the
term derives from the fishing usage.
Bonita Montero <Bonita.Montero@gmail.com>: Oct 24 01:37PM +0200

> Can you give links to these documentation pages for gcc and clang?
 
No, but I'll bet they're not cleverer as Intel-C++:
https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-automatic-vectorization-overview
Ian Collins <ian-news@hotmail.com>: Oct 25 05:05PM +1300

On 25/10/2019 09:44, David Brown wrote:
 
> It is quite clear that you don't know about auto-vectorisation in
> compilers -
 
.. and you have been successfully tolled again :)
 
--
Ian.
David Brown <david.brown@hesbynett.no>: Oct 25 09:11AM +0200

> project if we use my software as part of the project.
> More info here: http://webEbenezer.net/about.html
> .
 
You do realise that spam is not appreciated in this group?
 
If you want to talk about C++ aspects of your project, great. If you
want to advertise your commercial company, do it elsewhere.
 
(And my advice is don't advertise like that - it makes you sound utterly
desperate. If you have been working on this system for years, and you
have to offer heavy bribes to have any chance of getting a single user,
then you should be questioning the business sense of the project.)
Bonita Montero <Bonita.Montero@gmail.com>: Oct 25 09:14AM +0200

There are already good serialization-frameworks like Google Protocol
Buffers which are far supoerior to your rudimentary code.
Juha Nieminen <nospam@thanks.invalid>: Oct 25 11:11AM


> You do realise that spam is not appreciated in this group?
 
> If you want to talk about C++ aspects of your project, great. If you
> want to advertise your commercial company, do it elsewhere.
 
To be completely honest, I think you are being a bit too harsh,
probably based on his past behavior in this newsgroup.
 
> desperate. If you have been working on this system for years, and you
> have to offer heavy bribes to have any chance of getting a single user,
> then you should be questioning the business sense of the project.)
 
But you may have a point there.
Keith Thompson <kst-u@mib.org>: Oct 25 11:47AM -0700

David Brown <david.brown@hesbynett.no> writes:
[...]
> His post is therefore an unsolicited commercial post - spam.
[...]
 
Spam needn't be commercial. (This is a small quibble, not affecting
your main point.)
 
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 25 04:07PM

On Fri, 2019-10-25, Scott Lurndal wrote:
> red floyd <no.spam@its.invalid> writes:
>>On 10/24/19 1:46 AM, Jorgen Grahn wrote:
...
>>loop:
 
>> for (;;) pause();
 
> raise(SIGSTOP);
 
The exec() solution has one more benefit: it frees up virtual memory.
But we're pretty far offtopic now; I brought it up as a reminder that
platform-specific features are sometimes the best tool for the job.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 24 05:38AM

On Wed, 2019-10-23, Chris M. Thomasson wrote:
> non-recursive mutex twice in the same thread is an error. This can be
> solved multiple ways. The easy way is to create the Supervisor as a
> service/ daemon. Robust mutexs can be used to detect when a process dies.
 
The software (as I understand it) is Unix-specific; standard practice
there is to have parent--child process relationships, and to use the
wait() family of functions to detect when a child dies.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Ian Collins <ian-news@hotmail.com>: Oct 25 05:02PM +1300

On 24/10/2019 18:38, Jorgen Grahn wrote:
 
> The software (as I understand it) is Unix-specific; standard practice
> there is to have parent--child process relationships, and to use the
> wait() family of functions to detect when a child dies.
 
Or simply use the platform's service management framework rather than
reinventing it!
 
--
Ian.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 24 08:46AM

On Wed, 2019-10-23, Frederick Gotham wrote:
>> the job.
 
> I don't want to complicate the Supervisor, and so I'm happy to put
> the gas_monitor process to sleep.
 
In a way you /are/ complicating it already, by stretching the meaning
of "supervise". Especially if there is some kind of heartbeat
mechanism too, but maybe there isn't.
 
If you /really/ want to sleep forever and consume minimal resources on
Unix, the optimal way would be to close all file descriptors, release
anything else which would survive an exec(), and exec() a tiny
'sleep_forever' binary.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
scott@slp53.sl.home (Scott Lurndal): Oct 25 02:33PM


>Or, close all fds, set all signals to SIG_IGN, and run the following
>loop:
 
> for (;;) pause();
 
 
raise(SIGSTOP);
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 25 08:36PM +0100

Hi!
 
The sequel to Google's "quantum supremacy" technological singularity in
the form of "neos" my universal compiler than can compile ANY programming
language is coming soon.
 
https://neos.dev
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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."
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 24 11:06PM -0700

On 10/24/2019 9:53 PM, Bonita Montero wrote:
>>> No, I'm not using ABA-counters.
 
>> Are you embedding any state with a pointer? bit stealing?
 
> No.
 
Interesting. Are you "pinning" with the CAS? or does that fall to
locking? Fwiw, I do like my hashed locks on pointer addresses. It can do
many things, meta data makes it powerful in certain scenarios, also meta
data in the pointer address itself can effect the hash function, fun
times... Also, there is no need to lock the root. I remember you saying
how my work would always have to lock the head when updating the double
linked list wrt grabbing a LRU cache item. It can use lock-free here.
Eluding the lock. Here is a pure lock-free version wrt a singly linked
list. I am going to add the ability to delete from this:
 
https://groups.google.com/d/topic/comp.lang.c++/7U_Zjb7qj98/discussion
 
This is dynamic in nature. However, a LRU is easier because once its
full, it does not need to grow. It just replaces the LRU.
 
Not sure if I have to double link it or not. It might be a fun challenge
to keep it a single linked list.
 
Not sure if I want to use hashed locking, or go for pure lock-free.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 24 01:14PM -0700

On 10/24/2019 1:13 PM, Chris M. Thomasson wrote:
>>> have to restart, or unroll if you will?
 
>> No, I'm not using ABA-counters.
 
> Are you embedding any state with a pointer? bit stealing?
 
It can be fun to align pointers on a large boundary, and use that extra
space for meta data.
Bonita Montero <Bonita.Montero@gmail.com>: Oct 25 06:53AM +0200

>> No, I'm not using ABA-counters.
 
> Are you embedding any state with a pointer? bit stealing?
 
No.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 24 12:19AM +0100

On 23/10/2019 23:15, Keith Thompson wrote:
> means that the elements will have the same storage duration as the
> std::array object itself. (That's why the number of elements in
> a std::array has to be known at compile time.)
 
Wrong. std::string usually employs the "small string optimization" whereby
small strings are allocated within the object itself. I have also created
a "vecarray" container that does a similar thing for vectors.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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."
Paavo Helde <myfirstname@osa.pri.ee>: Oct 24 09:49PM +0300

On 24.10.2019 21:15, Soviet_Mario wrote:
> I was just considering that one could not always have the full storage
> (lifetime) control they expect.
> I tend to think too much in a C-like mindshape surely
 
What makes you think that? Are you maybe afraid that any dynamically
allocated pieces in a static std::string object might somehow have
shorter lifetime than the std::string object itself? That cannot be,
this would ruin all invariants.
 
Or more probably, maybe you think that the lifetime of a static
std::string object has already begun before the program start, when it
maybe occupies some bytes in some data section of the executable on the
disk? No, it isn't, in C++ the lifetime of an object with a non-trivial
constructor begins when its initialization is complete. This only
happens at run-time.
Paavo Helde <myfirstname@osa.pri.ee>: Oct 24 05:21PM +0300

On 24.10.2019 16:58, Öö Tiib wrote:
 
> assert(s.length() == strlen(s.c_str()));
 
> ... does not hold. So one byte is needed for length of
> short string and other is needed for zero terminator.
 
Right, thanks for the correction!
 
Storing the length separately would also mean that it's not needed to
calculate it as if by strlen() each time when needed (although strlen()
should also by very fast on such small strings).
Juha Nieminen <nospam@thanks.invalid>: Oct 24 07:49AM


> The small_vector has also preallocated capacity in it but can
> grow over that using an allocator:
> <https://www.boost.org/doc/libs/1_71_0/doc/html/boost/container/small_vector.html>
 
I am talking about an allocator (usable with any standard library container),
not a std::vector replacement.
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.

Tuesday, October 29, 2019

Digest for comp.lang.c++@googlegroups.com - 5 updates in 1 topic

scott@slp53.sl.home (Scott Lurndal): Oct 29 12:12AM


> __attribute__((always_inline))
 
>pretty much everywhere. Then I intend to use every form of optimisation there is, both at compile time and at link time.
 
>The level of security is 'airport'. I can't tell you exactly what I'm doing, but suffice to say I'm trying to secure something that could fall into the wrong hands.
 
 
If you're (1) talking about it here, and (2) taking advice from the internet
you are in way over your head.
Frederick Gotham <cauldwell.thomas@gmail.com>: Oct 29 03:26AM -0700

On Tuesday, October 29, 2019 at 12:12:41 AM UTC, Scott Lurndal wrote:
 
> If you're (1) talking about it here, and (2) taking advice from the internet
> you are in way over your head.
 
 
I'd agree with you if I didn't know already how a good skilled hacker will go about trying to figure out what my program does.
David Brown <david.brown@hesbynett.no>: Oct 29 01:59PM +0100

On 29/10/2019 11:26, Frederick Gotham wrote:
>> internet you are in way over your head.
 
> I'd agree with you if I didn't know already how a good skilled hacker
> will go about trying to figure out what my program does.
 
If you are working on code which may be targeted by groups with
significant financial or political motivation, significant resources,
and insignificant moral scruples, then Scott is right - you show that
you are /way/ over your head by posting about it. Such groups will have
no problem tracing you, whether your name is Frederick Gotham or Thomas
Cauldwell, and will have no problem persuading you to reveal the secrets
of your code. They don't need to de-compile it - there are faster,
cheaper and more reliable methods when the know who wrote it.
 
And if your code is not going to be targeted by such resourceful groups,
then your obfuscation is a waste of time, and more likely to introduce
errors in your code than help protect it.
 
 
For security, you keep the /key/ secret - not the code or the design of
the lock. You make it secure enough that the cheapest way to break the
coding is by burglary - then you stop well before the cheapest method
becomes rubber hose cryptoanalysis. And you certainly don't advertise
what you are doing - that significantly reduces the cost of the rubber
hose cryptoanalysis.
"Öö Tiib" <ootiib@hot.ee>: Oct 29 07:38AM -0700

On Tuesday, 29 October 2019 15:00:07 UTC+2, David Brown wrote:
> Cauldwell, and will have no problem persuading you to reveal the secrets
> of your code. They don't need to de-compile it - there are faster,
> cheaper and more reliable methods when the know who wrote it.
 
It seems that you guys take yet another attempt of this author of
doing something that he claims isn't trolling too seriously. He did
likely read from somewhere that the security experts have rejected
this approach as far back as 1851 as illusionary. For example there:
<https://en.wikipedia.org/wiki/Security_through_obscurity>
So he pretends implementing it and then read replies for "lulz" or
"keks" (or what those being deliberately grotesque say about it).
Frederick Gotham <cauldwell.thomas@gmail.com>: Oct 29 09:25AM -0700

On Tuesday, October 29, 2019 at 2:38:36 PM UTC, Öö Tiib wrote:
 
> <https://en.wikipedia.org/wiki/Security_through_obscurity>
> So he pretends implementing it and then read replies for "lulz" or
> "keks" (or what those being deliberately grotesque say about it).
 
 
You still don't know what I'm doing. Because I haven't told you.
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.

Monday, October 28, 2019

Digest for comp.lang.c++@googlegroups.com - 3 updates in 1 topic

Juha Nieminen <nospam@thanks.invalid>: Oct 28 07:17AM

>> went to commit the changes to a repository, but the commit failed
>> because the ".a" file was too big.
 
> So don't do that. There's seldom a need to commit generated files to SCM.
 
It might not be generated code. Sometimes third-party libraries (especially
closed-source, or semi-closed-source ones) may be distributed in binary
form. Or sometimes the static library may indeed be built from the project
files themselves, but this might take a very long time (like hours), and
it might be convenient for other members of a project not to have to do that.
 
Of course there are alternatives even in the first case (other than just
putting instructions that tell other team members where to download the
library and how to install it in the project directories), for example
by using some kind of build script that automatically downloads the
library and puts it in the proper place. But it can become complicated.
Frederick Gotham <cauldwell.thomas@gmail.com>: Oct 28 01:55AM -0700

On Friday, October 25, 2019 at 4:20:56 PM UTC+1, David Brown wrote:
 
> any other kind of obfuscation would make a measurable difference - and
> yet you still have clear and maintainable source code. (You might also
> want to disable RTTI.)
 
 
I'm taking apart the library and using
 
__attribute__((always_inline))
 
pretty much everywhere. Then I intend to use every form of optimisation there is, both at compile time and at link time.
 
The level of security is 'airport'. I can't tell you exactly what I'm doing, but suffice to say I'm trying to secure something that could fall into the wrong hands.
 
I'm compiling my program and running it through two different decompilers, and then also I will do stuff like monitor the processes and file system while my program's running. And of course a simple hexdump for the static duration data.
 
A team of hackers paid by a government can try to reverse-engineer my project, but I will have changed everything by the time they figure it out (if they ever do).
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 28 09:57PM

On Mon, 2019-10-28, Frederick Gotham wrote:
 
> __attribute__((always_inline))
 
> pretty much everywhere. Then I intend to use every form of
> optimisation there is, both at compile time and at link time.
 
I think his point is, if you enable link-time-optimization, you don't
have to do all those other complicated things.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
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.

Digest for comp.programming.threads@googlegroups.com - 1 update in 1 topic

aminer68@gmail.com: Oct 27 08:47AM -0700

Hello,
 
 
More political philosophy about Democracy and Dictatorship..
 
I think i am like a wise man type of person, so now i will do
more political philosophy about Democracy and Dictatorship..
 
I think dictatorship gives more importance to the Elites than
the ordinary people, because it says that the Elites are "smart",
but the deficiency of dictatorship is how to escape the local maximum
in efficiency towards global maximum in efficiency(like in Artificial intelligence) if there is "corruption" of governance and corruption of governance can also be seen as lack of "efficiency" in governing, this is the problem with dictatorship, but Democracy gives also more importance to the Elites than ordinary people, but Democracy can escape corruption of governance and corruption of governance can also be seen as lack of "efficiency" in governing, but in Democracy we need to have a competent governance and the people have to be educated efficiently so that to be Democracy that works correctly, so now you are noticing that efficient education is the one that gives importance to Pedagogy, this is why i said the following about Pedagogy:
 
 
Now today i will do political philosophy about Pedagogy..
 
Can we ask the question of: What must be an efficient Pedagogy today?,
i think that we have to notice that the exponential progress
and the law of accelerating returns are influencing Pedagogy,
because today we have to be more efficient at learning,
because i think that the level of sophistication of today
is much more than the past and i think that this has
as a cause that we have to be much more sophisticated than
the past to be able to be efficient learning, i think that this is
the "first" requirement of today Pedagogy, and more than that
we have to define the other main parts of what is it to be efficient learning, i mean what are the main parts of "efficient learning" that have a great importance ? take for example choosing the right tools for
learning , so the first question of how to choose the right tools for learning is to know how to choose the right tools, not only that but to be able for the tool to be the right tool, the learning of the right tool must be made more "easier", now you are noticing
that the parts of efficient learning are becoming more clear,
this is why i said before in my political philosophy
the following that permits you to understand more what i am saying:
 
What is happening in my brain ?
 
I will speak more about me so that you understand my way of doing since
it is also like my philosophy, to be more smart you have to be capable
of reducing efficiently "complexity" so that to be efficient and so that
to be more successful, but how can you do it ? you have to be able
to know about the steps that guides you into the right direction,
first i will speak about my way so that you understand me better,
first step you have to be able to "prioritize" efficiently, because
to be able to be successful you have to prioritize, so look for example
at me, i have decided to "study" more and to study more "efficiently" so that to be more successful, but this is not "sufficient" to know, because to be able to be efficient at reducing complexity you have to be able to be efficiently selective of your knowledge, and this efficiently "selective" has to adhere in its turn to the process of being efficient at reducing "complexity", so you have to be able to select "efficiently" "efficient" knowledge that is more "easy" to learn so that to reduce complexity, thus you have to be able to ask "questions" to this or that right persons to be able to be efficient at selecting your "knowledge", next step you have to be "tenacity" at studying efficiently and you have to study more and more and you have to ask questions to your professors and next step after you have been able to learn more and more you have to be able at being efficient at "reusability" of your efficient knowledge and this is a very important step , so don't neglect efficient "reusability" of your knowledge, this is also the steps that i have followed and i have also used my "smartness" to be more efficient.
 
 
 
Thank you,
Amine Moulay Ramdane.
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.programming.threads+unsubscribe@googlegroups.com.

Sunday, October 27, 2019

Digest for comp.lang.c++@googlegroups.com - 2 updates in 1 topic

Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Oct 27 12:24AM +0100

On Sat, 26 Oct 2019 15:43:35 -0700 (PDT)
 
> so can I understand it like this?:
 
> 1. the obj_guard get set in __cxa_guard_release(&obj_guard), this MUST (WHY?) happen after the initialize_the_object(). If not then we are facing the same problem in double-checking-lock: one thread holds the lock, and reorder the initialization and guard assignment, makes another thread waiting on line 1 incorrectly returns too eariler.
 
> 2.after the obj_guard has been set, even another thread can't immediately see this update, it just go inside the needless lock/unlock, and this only happens the first few times.
 
If you look at the code you will see that __cxa_guard_acquire() checks
initializerHasRun() again after it has acquired the mutex. So all is
fine - locking and then unlocking a mutex has acquire and release
semantics and so forces an ordering, even in a case where a race has
occurred with respect to the original check of initializerHasRun()
outside the mutex.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Oct 27 12:44AM +0100

On Sun, 27 Oct 2019 00:24:15 +0100
> semantics and so forces an ordering, even in a case where a race has
> occurred with respect to the original check of initializerHasRun()
> outside the mutex.
 
Actually on looking further at the code it does seem to suffer from the
traditional double checked locking problem in that a second thread could
assume initialization by the first thread before it has in fact
occurred.
 
Presumably either there is something else which deals with that
problem or the compiler, knowing its platform (which is presumably
x86/64 in this case), has calculated that this cannot in practice occur
with its total store ordering memory model.
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.

Friday, October 25, 2019

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

Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 25 03:38PM

On Thu, 2019-10-24, David Brown wrote:
...
 
> (My money is still on the fishing term - it fits the usage very
> accurately, and is confirmed by people who have used Usenet pretty much
> since its conception.)
 
The fishing term, boosted by the mythological creatures. I bet a less
catchy (pun unintended) fishing term wouldn't have become so popular.
 
> Rather than argue further, I recommend you take a couple of hours break
> from Usenet and watch this film. It is time well spent!
 
> <https://en.wikipedia.org/wiki/Trollhunter>
 
Haven't seen it, but this one is nice, after a fashion:
 
https://en.wikipedia.org/wiki/Border_(2018_Swedish_film)
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Keith Thompson <kst-u@mib.org>: Oct 25 12:03PM -0700

> hours, but that's far less harmful than what you've been doing for a
> few years (including your personal email follow-up's).
 
> With that said, I don't think you realise what you're doing.
 
Since you haven't responded to my email, I'm going to assume that
you're not interested in explaining further. Feel free to email
me if you want to discuss this. Meanwhile, I'll just ignore your
vague insults.
 
Everyone, please don't increase the signal-to-noise ratio by posting
further about this here. Anyone who insists on doing so will have
to change the followup headers.
 
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Real Troll <Real.Troll@Trolls.com>: Oct 25 04:50PM -0400

On 25/10/2019 20:03, Keith Thompson wrote:
 
> Everyone, please don't increase the signal-to-noise ratio by posting
> further about this here. Anyone who insists on doing so will have
> to change the followup headers.
 
People wants to discuss the meaning of Troll so where else can they
discuss this?
 
Follow up to alt.idiots
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 25 03:18PM

On Fri, 2019-10-25, Frederick Gotham wrote:
 
> My program would be too easy to reverse-engineer if I linked the
> library dynamically, so I'm linking it statically and obfuscating it
> as best I can.
 
I'll not comment on obscurity as a technique for security, but what
you write is orthogonal to what Ian Collins wrote. You don't have to
commit libfoo.a binaries to SCM in order to link statically.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
David Brown <david.brown@hesbynett.no>: Oct 25 05:20PM +0200

On 25/10/2019 15:31, Frederick Gotham wrote:
> product, and so after I produce my binary executables and libraries,
> I run them through a decompiler and try to see how difficult it would
> be to reverse-engineer.
 
My initial thoughts are that obfuscating your code is a bad idea, a
misunderstanding of what is important for security, and even if it was a
good idea, then it does not sound like a good way to achieve this. My
initial thoughts may be wrong, as I don't know anything more than the
short paragraph above, but "security by obscurity" is rarely a good idea.
 
> My program would be too easy to reverse-engineer if I linked the
> library dynamically, so I'm linking it statically and obfuscating it
> as best I can.
 
My recommendation would be to avoid the library altogether - certainly
do not consider it a separate item to be produced and checked into an
SCM (the clue is in the name - "Source Control Manager").
 
Rather, you should consider using link-time optimisation. With
link-time optimisation, high compiler optimisation levels, no debugging
information, careful control of elf symbol visibility, and stripped
executables, your generated code will be incomprehensible. I doubt if
any other kind of obfuscation would make a measurable difference - and
yet you still have clear and maintainable source code. (You might also
want to disable RTTI.)
Vir Campestris <vir.campestris@invalid.invalid>: Oct 25 09:36PM +0100

On 25/10/2019 16:18, Jorgen Grahn wrote:
 
> I'll not comment on obscurity as a technique for security, but what
> you write is orthogonal to what Ian Collins wrote. You don't have to
> commit libfoo.a binaries to SCM in order to link statically.
 
Put the sources in the SCM. You'll need them next time you do a rebuild.
 
And your security will last until two things happen:
- You protect something of sufficient importance
- About 3 more weeks pass.
 
Been there, done that, got the tee shirt. We were making several
releases a year. Luckily security of a few weeks was saleable.
 
Andy
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 25 08:36PM +0100

Hi!
 
The sequel to Google's "quantum supremacy" technological singularity in
the form of "neos" my universal compiler than can compile ANY programming
language is coming soon.
 
https://neos.dev
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"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."
David Brown <david.brown@hesbynett.no>: Oct 25 05:11PM +0200

On 25/10/2019 13:11, Juha Nieminen wrote:
>> want to advertise your commercial company, do it elsewhere.
 
> To be completely honest, I think you are being a bit too harsh,
> probably based on his past behavior in this newsgroup.
 
As I understand it (and I hope he'll correct any mistakes I make), he is
running a company based on software services, including this
"middleware". He does not charge any money for this serialisation
library or the use of his "online generator", but is presumably hoping
that people who use it will pay for other development services. He has
offered sponsorship money and time resources to anyone using the
middleware - this is clearly a business prospect, with the expectation
that the user will pay for other services or at least provide a
reference as advertising for other customers.
 
His post is therefore an unsolicited commercial post - spam.
 
If one of the more helpful posters in the group were to make a small,
one-off announcement of a new and exciting product they had made, I
think many people would not object. But a substantial proportion of
Brian's posts are spam like this, or direct requests for other people to
support his commercial work with reviews, suggestions, and other help -
often such spam hijacks other people's threads. (I am quite happy with
his on-topic posts and discussions about C++.)
 
No, I don't think I am being too harsh - and yes, this is because of his
past behaviour in this newsgroup.
 
 
>> have to offer heavy bribes to have any chance of getting a single user,
>> then you should be questioning the business sense of the project.)
 
> But you may have a point there.
 
My advice here was given sincerely. I don't think it is right for him
to post spam in this group, but I am still happy to give suggestions to
help his business.
Keith Thompson <kst-u@mib.org>: Oct 25 11:47AM -0700

David Brown <david.brown@hesbynett.no> writes:
[...]
> His post is therefore an unsolicited commercial post - spam.
[...]
 
Spam needn't be commercial. (This is a small quibble, not affecting
your main point.)
 
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 25 04:07PM

On Fri, 2019-10-25, Scott Lurndal wrote:
> red floyd <no.spam@its.invalid> writes:
>>On 10/24/19 1:46 AM, Jorgen Grahn wrote:
...
>>loop:
 
>> for (;;) pause();
 
> raise(SIGSTOP);
 
The exec() solution has one more benefit: it frees up virtual memory.
But we're pretty far offtopic now; I brought it up as a reminder that
platform-specific features are sometimes the best tool for the job.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
scott@slp53.sl.home (Scott Lurndal): Oct 25 04:22PM


>>> for (;;) pause();
 
>> raise(SIGSTOP);
 
>The exec() solution has one more benefit: it frees up virtual memory.
 
Although the only overhead associated with virtual memory is the
page tables. The OS can always reclaim the physical memory by
swapping out dirty pages and replacing clean pages owned by the
SIGSTOP'd process.
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.