Friday, June 30, 2017

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

rami18 <coco@coco.com>: Jun 29 01:24PM -0400

Hello.......
 
 
Deep-Learning Networks Rival Human Vision
 
Read more here:
 
https://www.scientificamerican.com/article/deep-learning-networks-rival-human-vision1/
 
 
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.

Thursday, June 29, 2017

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

"Öö Tiib" <ootiib@hot.ee>: Jun 28 04:51PM -0700


> C++ is known for its zero-overhead abstraction. I'm trying to figure
> out if there's something I'm doing wrong or if the compilers I've tried
> are not able to provide abstraction for free in this area.
 
Huh? I felt I asked why you aim for size over speed, you tell something
that is not from this world.
 
Zero overhead? That means C++ produces ideal assembler? You misunderstood.
It is zero overhead principle ... aim ... goal. Actual compilers can not
translate code into ideal assembler. There is always some overhead.
Now even if there was a super compiler then the ideally short assembler
for most algorithms has some speed overhead compared to ideally fast
assembler for same algorithm (that has some size overhead). So zero
overhead in both senses would be still simply impossible.
 
So why you value size over speed?
woodbrian77@gmail.com: Jun 28 06:50PM -0700

On Wednesday, June 28, 2017 at 6:52:12 PM UTC-5, Öö Tiib wrote:
> > are not able to provide abstraction for free in this area.
 
> Huh? I felt I asked why you aim for size over speed, you tell something
> that is not from this world.
 
There's a link between size and speed:
 
int main (){return SUCCESS;}
 
 
 
> Zero overhead? That means C++ produces ideal assembler? You misunderstood.
> It is zero overhead principle ... aim ... goal. Actual compilers can not
> translate code into ideal assembler. There is always some overhead.
 
The question is if there's unnecessary overhead.
 
This is quote from earlier in the thread:
"And further: What you do use, you couldn't hand code any better."
 
In one case, my use of variadic templates yields larger results from
compilers than if I don't use variadics. But in two other cases, compilers
appear to produce better results.
 
Supporting both options as you suggested earlier would be a headache
for me. I don't have resources to support lots of options right now.
Rebbe Nachman said, "All the world is just a narrow bridge -- the most
important thing is not to be afraid." I have to figure out one of these
options to use for the time being. Is Russia attacking Ukraine with
cyberattacks? Rebbe Nachman was from Ukraine if I remember right.
 
> assembler for same algorithm (that has some size overhead). So zero
> overhead in both senses would be still simply impossible.
 
> So why you value size over speed?
 
Maybe someone with g++ 7.2 or clang 5 could build the two
approaches and report the results.
 
 
Brian
Ebenezer Enterprises - If you like bread, you should
love the Ukraine -- its the bread basket of the world.
 
http://webEbenezer.net
Gareth Owen <gwowen@gmail.com>: Jun 29 06:20AM +0100


> There's a link between size and speed:
 
> int main (){return SUCCESS;}
 
There is. But it sure isn't smaller == faster.
Ian Collins <ian-news@hotmail.com>: Jun 29 05:47PM +1200

> cd onwards
> make example
 
> Then post here what the two sizes are. Thanks.
 
The code doesn't compile with Clang5 (or at least the library it uses)
 
In file included from ./SendBuffer.hh:2:
./ErrorWords.hh:30:13: error: no matching member function for call to
'append'
whatStr.append(s);
~~~~~~~~^~~~~~
 
...
 
Also string_view is still in std::experimental.
 
--
Ian
"Öö Tiib" <ootiib@hot.ee>: Jun 29 06:25AM -0700


> > Huh? I felt I asked why you aim for size over speed, you tell something
> > that is not from this world.
 
> There's a link between size and speed:
 
There is very rough correlation but no relation.
 
 
> int main (){return SUCCESS;}
 
Programs that do nothing useful are not what we
discuss I hope.
 
> > It is zero overhead principle ... aim ... goal. Actual compilers can not
> > translate code into ideal assembler. There is always some overhead.
 
> The question is if there's unnecessary overhead.
 
Yes, non-ideal assembler has always some unnecessary overhead.
 
> This is quote from earlier in the thread:
> "And further: What you do use, you couldn't hand code any better."
 
That is again principle, the goal to pursue, the philosophy how to go,
not something that actual C++ compilers have somehow magically
achieved already.
 
> appear to produce better results.
 
> Supporting both options as you suggested earlier would be a headache
> for me. I don't have resources to support lots of options right now.
 
The cheapest is just to do nothing if you ask that from me.

> important thing is not to be afraid." I have to figure out one of these
> options to use for the time being. Is Russia attacking Ukraine with
> cyberattacks? Rebbe Nachman was from Ukraine if I remember right.
 
To my knowledge current cryptoworm (where Ukraine got lot of damage)
seem modified versions of EternalBlue and EternalRomance. Those two are
exploits from bigger set of hacking tools that were developed by the
National Security Agency of United States Department of Defence and that
last year leaked onto the Internet by hackers. Microsoft has already
patched the holes of those exploits but unfortunately in countries like
Ukraine and Russia there are significant usage of pirated versions of
Windows. Anyway it sounds like nonsense to accuse Russians of those
worms.
 
 
> > So why you value size over speed?
 
> Maybe someone with g++ 7.2 or clang 5 could build the two
> approaches and report the results.
 
So ... why you ignore speed?
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Jun 29 04:19PM +0100

On Wed, 28 Jun 2017 18:50:40 -0700 (PDT)
> There's a link between size and speed:
 
> int main (){return SUCCESS;}
 
Your argument seems to be that faced with two binaries compiled from
the same source code which are of different size, the smaller one is
going to be the faster.
 
However, some speed optimizations such as loop unrolling will increase
binary size, but run faster. There is often a size and speed trade off
to be made. For example, with gcc code compiled with -Os will be
smaller than code compiled with -O2, but is likely to run slower: -Os
contains most of -O2 except those optimizations which increase code
size, and includes some addition code size reducing options.
 
If small binary size is more important to you than speed, the first
thing to do is to use -Os optimization. But you need to question
yourself why you prefer small size to speed.
woodbrian77@gmail.com: Jun 29 10:45AM -0700

On Thursday, June 29, 2017 at 12:47:39 AM UTC-5, Ian Collins wrote:
> ~~~~~~~~^~~~~~
 
> ...
 
> Also string_view is still in std::experimental.
 
I think that's the problem. On FreeBSD (TrueOS) with
clang 4 it builds fine. String_view isn't in experimental
for clang 4. Thanks for the info.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
woodbrian77@gmail.com: Jun 29 03:03PM -0700

On Thursday, June 29, 2017 at 10:20:02 AM UTC-5, Chris Vine wrote:
 
> If small binary size is more important to you than speed, the first
> thing to do is to use -Os optimization. But you need to question
> yourself why you prefer small size to speed.
 
 
If the transformation I made produced larger results in all
cases, I'd probably give up on the variadic option. But
in two cases, the compilers seemed to handle it well and in
one case not. That's my basis for hoping that the third case
is an aberration and eventually can be straightened out.
 
 
 
Brian
Ebenezer Enterprises - "Do not be conformed to this world, but
be transformed by the renewing of your mind." Romans 12:2
 
http://webEbenezer.net
Manfred <noname@invalid.add>: Jun 29 06:47PM +0200

On 6/13/2017 12:57 AM, Stefan Ram wrote:
> the interface and a region for the implementation:
 
> int f( int x ) /* interface */
> { const x; return 2 * x; } /* implementation */
 
The ancient (and still valid) C syntax comes to mind:
int f( x )
const int x;
{
return 2 * x;
}
 
(the syntax is valid C11, where the 'const' part only applies to modern
C, while the identifier-list syntax dates back from the beginning of time)
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, June 28, 2017

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

woodbrian77@gmail.com: Jun 27 08:06PM -0700

On Tuesday, June 27, 2017 at 5:12:01 PM UTC-5, Öö Tiib wrote:
 
> When you are not sure what is better then it can be that neither is
> better. For example it can be different per project what is better.
> On such cases it may make sense to add optional choice.
 
 
If I could find a compiler that does better than g++ 7.1.1, g++ 8.0.0
and clang 4.0.0, that would be encouraging.
 
If someone who has clang 5 installed would try to build the example
programs :
 
git clone https://github.com/Ebenezer-group/onwards.git
cd onwards
make example
 
That will build two executables and it runs the size command on
them. Take note of the size of the text segment of the executable
called :send_example."
 
Now do the same thing for the variadic version:
 
git clone https://bitbucket.org/woodbrian/onwards.git
cd onwards
make example
 
Then post here what the two sizes are. Thanks.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
"Öö Tiib" <ootiib@hot.ee>: Jun 27 11:10PM -0700


> If I could find a compiler that does better than g++ 7.1.1, g++ 8.0.0
> and clang 4.0.0, that would be encouraging.
 
You measure "better" with size of executable generated by compiler?
But that is not so important about software. Most important is that
it is doing correct things. Then it is important that it is easy to
use. Then it is important that it performs well. Size of executable
is later in list typically.
woodbrian77@gmail.com: Jun 28 08:17AM -0700

On Wednesday, June 28, 2017 at 1:10:35 AM UTC-5, Öö Tiib wrote:
> it is doing correct things. Then it is important that it is easy to
> use. Then it is important that it performs well. Size of executable
> is later in list typically.
 
C++ is known for its zero-overhead abstraction. I'm trying to figure
out if there's something I'm doing wrong or if the compilers I've tried
are not able to provide abstraction for free in this area.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Daniel <danielaparker@gmail.com>: Jun 28 09:14AM -0700


> C++ is known for its zero-overhead abstraction.
 
Hardly. Except in trivial cases, copying a value or a ref count is generally more expensive than copying a reference in a language with gc. Move isn't zero overhead either. The complexity of C++ presents a challenge to optimizers, in some cases the possibility of aliasing gives the edge to FORTRAN. And then there's streams ...
 
Daniel
David Brown <david.brown@hesbynett.no>: Jun 28 06:42PM +0200


> C++ is known for its zero-overhead abstraction. I'm trying to figure
> out if there's something I'm doing wrong or if the compilers I've tried
> are not able to provide abstraction for free in this area.
 
C++ is known for getting close to zero overhead from features you don't
use - but that is /speed/ overhead. There is plenty of overhead in code
size. For example, implementations strive to make exceptions free in
terms of speed when they are not thrown - but doing so means adding
quite a bit to the code size.
 
For most uses, code size is not a serious issue. Speed /might/ be an
issue, depending on the usage.
woodbrian77@gmail.com: Jun 28 09:47AM -0700

On Wednesday, June 28, 2017 at 11:14:39 AM UTC-5, Daniel wrote:
> On Wednesday, June 28, 2017 at 11:18:21 AM UTC-4, woodb...@gmail.com wrote:
 
> > C++ is known for its zero-overhead abstraction.
 
> Hardly. Except in trivial cases, copying a value or a ref count is generally more expensive than copying a reference in a language with gc. Move isn't zero overhead either. The complexity of C++ presents a challenge to optimizers, in some cases the possibility of aliasing gives the edge to FORTRAN. And then there's streams ...
 
The following quote is from this page:
http://blog.felipe.rs/2014/09/23/c-plus-plus-variadic-templates/
 
"C++'s strength mostly comes from the zero-cost abstractions it provides.
Stroustrup explains what it means in the C++ papers:
 
In general, C++ implementations obey the zero-overhead principle: What you
don't use, you don't pay for [Stroustrup, 1994]. And further: What you do use,
you couldn't hand code any better."
 
I'm having a problem with the last part of that statement.
 
I don't think anyone claims moving can/should be free.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jun 28 02:32PM

On Sun, 2017-06-11, Adam Badura wrote:
...
>> > PS 2 Why are you using "const" for non-reference function arguments?
 
[Alf]
> disadvantages objectively". So I would be grateful if you could
> direct me to some sources or explain them yourself (although maybe a
> separate thread would be better for this?).
 
He explained it briefly above: "constrains what can change ...".
 
One example:
 
void foo(const int n)
{
assert(n != 0);
... long and complicated logic
}
 
You can read the rest of foo() knowing that n!=0. That becomes an
invariant. And if you accidentally try to change it, you get a
compilation error.
 
And if you use that idiom consistently, it means when you see
 
void foo(int n) { ... }
 
you can conclude that you probably modify n somewhere in the function,
or it would have been const.
 
/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.

Tuesday, June 27, 2017

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

woodbrian77@gmail.com: Jun 27 11:32AM -0700

Shalom
 
In an edit to this post:
 
https://codereview.stackexchange.com/questions/166573/messaging-and-serialization-library
 
, I added links to both versions of the code. Would someone take a look and
let me know what they think?
 
 
Brian
Ebenezer Enterprises - Enjoying programming again.
http://webEbenezer.net
"Öö Tiib" <ootiib@hot.ee>: Jun 27 01:27PM -0700


> https://codereview.stackexchange.com/questions/166573/messaging-and-serialization-library
 
> , I added links to both versions of the code. Would someone take a look and
> let me know what they think?
 
You want code review?
 
From afar looks fine. Closer look reveals too lot of function overloads
named "Marshal" for my taste.
 
Correctness I can't evaluate without knowing requirements to your code.
 
I also do not have actual data to profile your code. Everything being
named "Marshal" would likely make profiling more annoying than usual.
 
What else you would like to know?
woodbrian77@gmail.com: Jun 27 02:43PM -0700

On Tuesday, June 27, 2017 at 3:27:53 PM UTC-5, Öö Tiib wrote:
 
> Correctness I can't evaluate without knowing requirements to your code.
 
> I also do not have actual data to profile your code. Everything being
> named "Marshal" would likely make profiling more annoying than usual.
 
In the original version there are six functions called "Marshal".
I think this is a tame use of overloading.
 
> What else you would like to know?
 
I'm not sure whether to stick with the version that's more
verbose, but that compilers tolerate better, or to switch to
the version that uses variadics.
 
From a code generation perspective, I'd like to use the variadics
version as it's easier to generate since it's less verbose. But if
compilers aren't ready for it, it may be pushing things too much.
 
 
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
"Öö Tiib" <ootiib@hot.ee>: Jun 27 03:11PM -0700


> From a code generation perspective, I'd like to use the variadics
> version as it's easier to generate since it's less verbose. But if
> compilers aren't ready for it, it may be pushing things too much.
 
When you are not sure what is better then it can be that neither is
better. For example it can be different per project what is better.
On such cases it may make sense to add optional choice.
scott.a.mayo@gmail.com: Jun 27 09:05AM -0700

I'm checking to see if my understanding of C++ is correct. I've run into problems compiling code under g++ and I'm trying to decide if the problem is mine or g++'s. This wasn't supposed to be complicated...
 
In a header, I have a templated class as a parent class. Relevant excerpts:
 
template<int Size_>
class Buffer {
public:
.....
bool overflowed_; //public
....};
 
//And then I want to base off it with:
 
template<int Size_>
class OutputBuffer : public Buffer<Size_>
{
public:
....
 
OutputBuffer() : Buffer<Size_>() { }
....
void doSomething() { if (overflowed_) {....} } //problems!
};
 
This looks straightforward to me. But for g++ at least, overflowed_, and every other reference to any function or data in Buffer, apparently needs to be qualified with Buffer<Size_>::. This seems especially odd for overflowed_, which doesn't participate in the parameterization of the parent's template. But that shouldn't matter. It's a parent class with public members and it should not matter that it's also templated.
 
Note the compile isn't failing on an instantiation. It fails as soon as the compiler parses the header, before any instantiation is attempted.
 
This makes no sense to me. OutputBuffer is based on a type, and the type is specified by the parent class syntax " : public Buffer<Size_>". When the time comes to instantiate, that parent class will have a definitive definition, but even before that, it seems to be that C++ specifies that the compiler has enough visibility into the subclass to know exactly what I'm referring to. The parent class should be "specified enough" at that point.
 
Other compilers have accepted this, so now I'm trying to determine if this is my problem or g++'s. I can work around it by adding Buffer<Size_>:: everywhere, but that's not how subclassing is supposed to work. (Note I can't avoid g++ - eventually this code is going to a platform where it's likely g++ or nothing.)
 
Insight into why C++ doesn't promise what I want, is welcome. This has messed with my understanding of how templates work.
Paavo Helde <myfirstname@osa.pri.ee>: Jun 27 08:15PM +0300

> void doSomething() { if (overflowed_) {....} } //problems!
> };
 
> This looks straightforward to me. But for g++ at least, overflowed_, and every other reference to any function or data in Buffer, apparently needs to be qualified with Buffer<Size_>::. This seems especially odd for overflowed_, which doesn't participate in the parameterization of the parent's template. But that shouldn't matter. It's a parent class with public members and it should not matter that it's also templated.
 
The idiomatic way to fix this is:
 
void doSomething() { if (this->overflowed_) {....} }
 
See
 
https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members
 
In short, there is no problem with gcc here, but there is a problem with
either your code or possibly with the C++ standard itself if the FAQ
needs to contain such usage warnings as "This might hurt your head!"
"Öö Tiib" <ootiib@hot.ee>: Jun 27 10:47AM -0700

On Tuesday, 27 June 2017 20:15:29 UTC+3, Paavo Helde wrote:
 
> > This looks straightforward to me. But for g++ at least, overflowed_, and every other reference to any function or data in Buffer, apparently needs to be qualified with Buffer<Size_>::. This seems especially odd for overflowed_, which doesn't participate in the parameterization of the parent's template. But that shouldn't matter. It's a parent class with public members and it should not matter that it's also templated.
 
> The idiomatic way to fix this is:
 
> void doSomething() { if (this->overflowed_) {....} }
 
Other way to fix this is to bring the member into scope:
 
using Buffer<Size_>::overflowed_;
 
void doSomething() { if (overflowed_) {....} }
 
> In short, there is no problem with gcc here, but there is a problem with
> either your code or possibly with the C++ standard itself if the FAQ
> needs to contain such usage warnings as "This might hurt your head!"
 
Simpler is just to live with yet another gotcha that
standard requires name overflowed_ to be looked-up in a
base classes, but not in dependent templates of base classes and
to hope that it makes life easier for compiler-makers somehow.
scott.a.mayo@gmail.com: Jun 27 10:51AM -0700

On Tuesday, June 27, 2017 at 1:15:29 PM UTC-4, Paavo Helde wrote:
...
 
> In short, there is no problem with gcc here, but there is a problem with
> either your code or possibly with the C++ standard itself if the FAQ
> needs to contain such usage warnings as "This might hurt your head!"
 
Wow. Yes it worked. I've never come across a situation where this-> was required anywhere. Live and learn, thanks.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jun 27 08:02PM +0200

> parameterization of the parent's template. But that shouldn't matter.
> It's a parent class with public members and it should not matter that
> it's also templated.
 
 
It matters because the `Buffer` class can be specialized for some
template parameter values, and those specialization will not necessarily
have the `overflowed_` member, or whatever.
 
We say that these expressions /depend/ on the template parameters.
 
A good way to deal with it is to add
 
using Base = Buffer<Size_>;
using Base::overflowed_;
 
Or you can qualify each usage, which is at odds with the principle of
not repeating yourself needlessly.
 
Visual C++ is more lenient because it follows the pre-standard single
phase template parsing rules (disclaimer: I no longer remember the
details of this, I'd have to look it up). I.e. g++ is more conforming
and hence, IMO., more impractical. For I can't remember any single
occasion where this required nonsense verbosity has saved my code from
being incompatible with a nasty specialization of a base class template.
 
 
 
 
> [snip]
 
Cheers & hth.,
 
- Alf
scott@slp53.sl.home (Scott Lurndal): Jun 27 06:08PM

>> either your code or possibly with the C++ standard itself if the FAQ
>> needs to contain such usage warnings as "This might hurt your head!"
 
>Wow. Yes it worked. I've never come across a situation where this-> was required anywhere. Live and learn, thanks.
 
Another place where this-> is required is with member function pointers:
 
e.g.
 
bool (c_processor::*op_insn)(struct _op *);
 
...
 
// Process the instruction
failed = (this->*opp->op_insn)(opp);
legalize+jeeves@mail.xmission.com (Richard): Jun 27 07:18PM

[Please do not mail me a copy of your followup]
 
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> spake the secret code
> using Base::overflowed_;
 
>Or you can qualify each usage, which is at odds with the principle of
>not repeating yourself needlessly.
 
I like this as the minimal change needed to resolve the problem. Can
we do better?
 
What if we move everything that isn't dependent on the template
parameters into a separate base class? This would be a base class
of Buffer<N>:
 
class BufferBase
{
public:
bool overflowed_;
// ...
};
 
template <int Size_>
class Buffer : public BufferBase
{
// ...
};
 
I like this better because it disambiguates the references to
overflowed_ without any using statements in derived classes. It also
clearly separates everything that depends on template parameters from
everything that doesn't which I think makes for a cleaner design.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
legalize+jeeves@mail.xmission.com (Richard): Jun 27 07:18PM

[Please do not mail me a copy of your followup]
 
scott.a.mayo@gmail.com spake the secret code
 
>Wow. Yes it worked. I've never come across a situation where this-> was
>required anywhere. Live and learn, thanks.
 
It isn't required, it is simply one way (of several) to resolve the
ambiguity.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
"Öö Tiib" <ootiib@hot.ee>: Jun 26 11:28PM -0700

On Tuesday, 27 June 2017 00:36:09 UTC+3, Real Troll wrote:
 
> Either you meant: gullible
> or you meant: quibble
 
> Which is it Andy?
 
It is just a play with words. Behaving immature and silly may amuse
but does not unfortunately bring childhood back.
scott.a.mayo@gmail.com: Jun 27 09:17AM -0700

On Monday, June 12, 2017 at 4:59:10 PM UTC-4, gwowen wrote:
> CancellableTimer IS A Timer, so it'd be nice if I could extend Timer in
> this way.
 
> What am I missing?
 
Ignoring all the discussion of LSP this and quibble that, you've already worked out that the destructor in the base class runs regardless. What you're missing is that subclasses generally restrict behaviour, they don't extend it. (That's an exaggeration, but it holds in this case.) Your base class should be CancellableTimer; and if you want a Timer that can't be accidentally cancelled (which you reasonably might), make a subclass that hides the cancellation mechanism. Virtual functions will help.
ram@zedat.fu-berlin.de (Stefan Ram): Jun 27 04:15PM

>overflowed_, and every other reference to any function or
>data in Buffer, apparently needs to be qualified with
>Buffer<Size_>::
 
struct board_type : public ::std::vector< position_type >
{
using ::std::vector< position_type >::vector;
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jun 27 11:19AM

On Mon, 2017-06-12, Adam Badura wrote:
>> interface, it doesn't matter at all to a caller, and so the C++ rules
>> make the following two declarations exactly equivalent, denoting the
>> same function, with the same function type:
...
> (declaration split from definition) you skip the const on
> declaration and have it on definition only? Or for the consistency
> you have it always?
 
"A foolish consistency is the hobgoblin of little minds."
I prefer to have the const only where it carries meaning:
 
void foo(int n);
void foo(const int n) { ... }
 
I think that's how most people do it.
 
/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.

Monday, June 26, 2017

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

Vir Campestris <vir.campestris@invalid.invalid>: Jun 26 09:43PM +0100

On 25/06/2017 23:26, Daniel wrote:
> On Saturday, June 24, 2017 at 10:39:21 AM UTC-4, Mr Flibble wrote:
 
>> Nope.
 
> Mr Flibble, likes to qluibble.
 
That's qulibble.
 
(sorry, couldn't resist :) )
Andy
Real Troll <Real.Troll@Trolls.com>: Jun 26 05:33PM -0400

On 26/06/2017 21:43, Vir Campestris wrote:
 
> That's qulibble.
 
> (sorry, couldn't resist :) )
> Andy
 
Still doesn't look right to me!!
 
Either you meant: gullible
or you meant: quibble
 
Which is it Andy?
"Fred.Zwarts" <F.Zwarts@KVI.nl>: Jun 26 10:01AM +0200

"Jorgen Grahn" schreef in bericht
news:slrnok6rgg.10sr.grahn+nntp@frailea.sa.invalid...
 
>(I'm not affected myself, but it's always good to "anchor" a
>discussion like the one above in an official bug report.)
 
>/Jorgen
 
I found it here:
"Jorgen Grahn" schreef in bericht
news:slrnok6rgg.10sr.grahn+nntp@frailea.sa.invalid...
 
>(I'm not affected myself, but it's always good to "anchor" a
>discussion like the one above in an official bug report.)
 
>/Jorgen
 
I found it here:
https://stackoverflow.com/questions/19463602/compiling-multithread-code-with-g
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 - 2 updates in 2 topics

rami18 <coco@coco.com>: Jun 25 12:45PM -0400

Hello........
 
 
Artificial Intelligence Helps in Learning How Children Learn
 
Read more here:
 
https://www.scientificamerican.com/article/gopnik-artificial-intelligence-helps-in-learning-how-children-learn/
 
 
Thank you,
Amine Moulay Ramdane.
rami18 <coco@coco.com>: Jun 25 12:39PM -0400

Hello........
 
 
20 Years after Deep Blue: How AI Has Advanced Since Conquering Chess
 
Read more here:
 
https://www.scientificamerican.com/article/20-years-after-deep-blue-how-ai-has-advanced-since-conquering-chess/
 
 
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, June 25, 2017

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

Gareth Owen <gwowen@gmail.com>: Jun 25 05:07PM +0100


> Nope.
 
Don't ever change, Leigh.
David Brown <david.brown@hesbynett.no>: Jun 25 06:48PM +0200

On 24/06/17 17:43, Ben Bacarisse wrote:
 
> Anyway, I'm happy to leave it that you disagree with something in my
> post and anyone who is still reading can pick what it is they think it
> might be.
 
Mr. Flibble doesn't believe in maths beyond primary school level. (I
don't mean he doesn't /understand/ it - I mean he does not believe it
exists, or is useful, or that anyone else can understand and use it.)
 
Trying to talk to him about infinities, groups, non-Euclidean
geometries, etc., is as useful as trying to talk to a young-earther
about fossils.
Gareth Owen <gwowen@gmail.com>: Jun 25 06:49PM +0100


> Trying to talk to him about infinities, groups, non-Euclidean
> geometries, etc., is as useful as trying to talk to a young-earther
> about fossils.
 
Nicely phrased, sir.
Daniel <danielaparker@gmail.com>: Jun 25 03:26PM -0700

On Saturday, June 24, 2017 at 10:39:21 AM UTC-4, Mr Flibble wrote:
 
> Nope.
 
Mr Flibble, likes to qluibble.
Slim Shady <slim@shady.com>: Jun 25 05:07PM +0200

On 2017-06-09 15:51, Rick C. Hodgin wrote:
> specific compiler division or sales division for compilers?
 
> Thank you,
> Rick C. Hodgin
 
You can check this page:
https://software.intel.com/en-us/c-compilers/iss-support
 
There are support options. You can also post a question in the community
forum:
https://software.intel.com/en-us/forums/intel-c-compiler
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 - 5 updates in 5 topics

rami18 <coco@coco.com>: Jun 24 03:16PM -0400

Hello........
 
 
I am white arab from Morocco
 
Morocco's 2nd gastronomy in the world behind France
 
And Oprah Winfrey offers a Moroccan diner to its guests
 
Look at this video:
 
https://www.youtube.com/watch?v=QN7cgTjZ3PI
 
 
Thank you,
Amine Moulay Ramdane.
rami18 <coco@coco.com>: Jun 24 02:23PM -0400

Hello.........
 
 
Designing for Performance by Martin Thompson
 
This video is interesting:
 
https://www.youtube.com/watch?v=03GsLxVdVzU
 
 
Thank you,
Amine Moulay Ramdane.
rami18 <coco@coco.com>: Jun 24 02:12PM -0400

Hello.....
 
 
Martin Thompson – Adventures with concurrent programming in Java
 
Look at this video:
 
https://www.youtube.com/watch?v=lCdqVxz2kzE
 
 
Thank you,
Amine Moulay Ramdane.
rami18 <coco@coco.com>: Jun 24 12:14PM -0400

Hello........
 
 
Teaching Machines to Understand – and Summarize – Privacy Legalese
 
Read more here:
 
https://www.scientificamerican.com/article/teaching-machines-to-understand-and-summarize-privacy-legalese/
 
 
Thank you,
Amine Moulay Ramdane.
rami18 <coco@coco.com>: Jun 24 11:57AM -0400

Hello......
 
 
BMW and Volkswagen Try to Beat Apple and Google at Their Own Game
 
Read more here:
 
https://www.nytimes.com/2017/06/22/automobiles/wheels/driverless-cars-big-data-volkswagen-bmw.html?rref=collection%2Fsectioncollection%2Ftechnology&action=click&contentCollection=technology®ion=stream&module=stream_unit&version=latest&contentPlacement=7&pgtype=sectionfront
 
 
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.

Saturday, June 24, 2017

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

Manfred <noname@invalid.add>: Jun 24 06:24PM +0200

On 06/22/2017 09:07 PM, Tim Rentsch wrote:
> Manfred <noname@invalid.add> writes:
 
>> On 6/20/2017 7:27 PM, Tim Rentsch wrote:
[...]
> separate translation unit (ie, so at least one stack frame is
> needed in either case, rather than functions being expanded
> inline). What can we say about what behavior we might observe?
 
[...]
> machine is concerned, the semantics in the two cases are
> identical. Under the rules laid out in the language standard,
> they are therefore completely interchangeable.
No they are not. Even without practical considerations (which I will
explain below), a formal look already sees clearly that there is a
substantial difference between the two - look at the rules for automatic
storage variables:
In the iterative case the loop body is a block, and storage for
variables declared inside the block is destroyed at the end of the block
/before/ being recreated when re-entering the block.
In the recursive case, storage for variables declared inside the block
(the recursive function body) is destroyed at the end of the block
/after/ recreating new variables by the recursive call (which is inside
the block)
 
So, in terms of the abstract machine there is a substantial difference
between the two solutions in terms of data /storage/: for the the
iterative case it is O(1) and for the recursive case it is O(n)
 
Now, your point is based on the fact that the standard does not dictate
a one to one relationship between storage and memory allocation, in fact
it defines the storage duration as "minimum potential lifetime of the
storage containing the object". But this is because the standard defines
the behaviour of an /abstract/ machine. Real implementations deal with
real memory constraints, and assuming that an implementation will
allocate new storage at each loop is just perverse, and you know it.
 
In fact, a
> or neither is. The issue here is not one of correctness in the
> language but a practical consideration related to quality of
> implementation. Do you see what I mean when I say that?
 
Others have already answered why your statement above is wrong. I will
only add here another comment about language "correctness" (i.e. code
which is legal according to the standard) and code correctness.
 
C++ is not a language which is fool-proof, i.e. if you want to write
correct C++ code, in addition to knowing the language rules, you have to
know what you are doing.
 
It is trivial to understand that, while it is true that code which is
malformed (by the standard's rules) is also incorrect code, it is /not/
true that code which is legal (according to the standard's rules) is
also guaranteed to be correct, in terms of the results it produces.
In this case, code which can result in stack overflow is just wrong,
even if it is syntactically and semantically correct (seems trivial to
me, but appearently it needs saying).
 
[...]
> fact very much the opposite - I am advocating /informed/ use of
> tail recursion, including automated static checks to ensure
> things don't get out of hand.
It depends on what you mean for informed use. Testing is definitely not
enough, and the same applies to static tests (see below), if you do not
also have formal proof of defined and bounded usage of stack space. This
means a formal proof of defined and bounded recursion depth and stack
frame size of each recursion.
 
[...]
> generated assembly to verify there are no recursive calls. It's
> simple to use (one extra line in the makefile), and very effective
> at weeding out bad cases.
This only holds if you are delivering /compiled/ code, but in this case
you are not delivering C++ code, you are delivering a machine executable.
If you are delivering C++ source code, your own check of the compilation
result does not guarantee the same result when your code will be
compiled by your employer or by your customer (possibly with different
compiler settings, or a different version or a different compiler itself
or on a different machine or architecture).
This is expecially true since you are relying on compiler behaviour
which is /not/ dictated by the standard.
 
More complicated algorithms (eg binary
> scan is very good as a first line of defense - ie, most uses of
> recursion can and should be written so they compile into assembly
> that does not recurse.
 
In addition to the above, others have already noted that a maintenance
action on your code might change an iterative compilation into a
recursive compilation (e.g. triggering a destructor call). If and when
this happens, it is still your code's fault, because it is you who wrote
the recursive C++ source.
leigh.v.johnston@googlemail.com: Jun 24 03:41AM -0700

Nonsense. There are not different sizes of infinity if infinities in question are unbounded.
 
/Flibble
Ian Collins <ian-news@hotmail.com>: Jun 24 11:29PM +1200

> Nonsense. There are not different sizes of infinity if infinities in question are unbounded.
 
Who or what are yo replying to?
 
 
--
Ian
Ben Bacarisse <ben.usenet@bsb.me.uk>: Jun 24 03:12PM +0100


> Nonsense. There are not different sizes of infinity if infinities in
> question are unbounded.
 
As a statement in natural language, that's a defensible position. But
if you mean that all pairs of infinite sets can be put into one-to-one
correspondence with each other (the mathematician's meaning of "the same
size"), then that's false. You may choose to define a set theory in
which it is not false, but then you will have (a) a lots of work to do,
and (b) some trouble with things like power sets and real analysis.
 
--
Ben.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jun 24 03:39PM +0100

On 24/06/2017 15:12, Ben Bacarisse wrote:
> size"), then that's false. You may choose to define a set theory in
> which it is not false, but then you will have (a) a lots of work to do,
> and (b) some trouble with things like power sets and real analysis.
 
Nope.
 
/Flibble
Ben Bacarisse <ben.usenet@bsb.me.uk>: Jun 24 04:43PM +0100

>> which it is not false, but then you will have (a) a lots of work to do,
>> and (b) some trouble with things like power sets and real analysis.
 
> Nope.
 
What, /all/ of those statements were wrong? You /don't/ think your
statement was defensible? And you /do/ think every pair of infinite
sets can be bijected? And you /don't/ think you can define a set theory
where that is possible? At the very least, the last two are
contradictory.
 
Anyway, I'm happy to leave it that you disagree with something in my
post and anyone who is still reading can pick what it is they think it
might be.
 
--
Ben.
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.