Wednesday, April 4, 2018

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

"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Apr 04 05:37AM -0700

On Saturday, March 31, 2018 at 2:51:08 PM UTC-4, Andrey Karpov wrote:
> A new version of the PVS-Studio analyzer 6.23 is working under macOS, which allows you to check the projects written in C and C++. Our team decided to perform a XNU Kernel check to coincide it with this event. https://www.viva64.com/en/b/0566/
 
I've used your PVS-Studio add-in for Visual Studio now for a couple
days and am thoroughly impressed. I think it's a fantastic tool and
I would highly recommend it to people to use to improve their source
code. It found some very obscure bugs in my code. And I do believe
I've found where it reported one false positive.
 
The product is too pricey in my opinion. I think you're missing out
on a much larger user base by targeting only $720/year per person.
For small projects that's too much.
 
I would like to buy a license for $240 first year, and renew each year
for $120.
 
I would be willing to pay that fee to receive a hobbled version of
your product, such that it allowed me to only use PVS-Studio once per
day, and only during a single session in Visual Studio, with maybe
only three analyze cycles allowed per day (analyze, fix, re-analyze,
fix, re-analyze, fix, done for the day). You could still keep the
full $720 version available for full anytime use, but sell the hobbled
version for less.
 
My opinion. I think you'd reach many more users with a lower price
point. You'd also be helping many more projects achieve fewer bugs,
which in turn helps all of the users of those products.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 04 01:57PM +0100

On 04/04/2018 13:37, Rick C. Hodgin wrote:
 
> My opinion. I think you'd reach many more users with a lower price
> point. You'd also be helping many more projects achieve fewer bugs,
> which in turn helps all of the users of those products.
 
Pretentious cockwomble.
 
/Flibble
 
--
"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."
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Apr 04 06:57AM -0700

On Wednesday, April 4, 2018 at 8:58:16 AM UTC-4, Mr Flibble wrote:
> Pretentious .. .
 
I'm trying to improve Andrey Karpov's product and business model.
I'm offering my opinion and advice toward that end. He's free to
disregard it, but I am trying to make things better for more
people, Leigh.
 
What are you trying to do with these personal-insult-laden replies
of yours?
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 04 03:10PM +0100

On 04/04/2018 14:57, Rick C. Hodgin wrote:
> people, Leigh.
 
> What are you trying to do with these personal-insult-laden replies
> of yours?
 
I am pointing out your self rightious self importance when you think you
can suggest (dictate) a price for someone else's work. You are indeed a
fucktarded pretentious cockwomble.
 
/Flibble
 
 
--
"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."
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Apr 04 07:22AM -0700

On Wednesday, April 4, 2018 at 10:10:49 AM UTC-4, Mr Flibble wrote:
 
> I am pointing out your self rightious self importance when you think you
> can suggest (dictate) a price for someone else's work. You are indeed a
> .. pretentious .. .
 
I am not self righteous or self important. And I do not dictate.
I indicate what I, as a consumer, am willing to pay given my products
and customers.
 
I truly think it's a fantastic tool. On my ~35K line relatively new
app, it found 59 major issues and 1 false positive. The major issues
varied from conditions where the if.. and else.. code blocks were
identical, but those were mainly identical due to debug blocks which
were commented out, as well as me validating a parameter twice, which
is mostly due to refactoring and forgetting to take out the prior
validation, to a handful of legitimate bugs. The one false positive
I really can't figure out. I don't see how it reports or concludes
what it has because it's not evident from source code.
 
As I say, he's free to disregard my input. I would still recommend
his tool for others to use. And, for what it's worth, Leigh, I
would still recommend people to use your excellent GUI framework.
 
-----
You have a very wrong opinion and view of me. It's colored by your
personal hatred of God, and the teachings I have to people regarding
their sin. You think of me as something negative when I am teaching
people that which they need to have eternal life. Someday you will
understand.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 04 06:53PM +0100

On 04/04/2018 15:22, Rick C. Hodgin wrote:
[snip]
 
> You have a very wrong opinion and view of me. It's colored by your
> personal hatred of God, and the teachings I have to people regarding
> their sin.
 
I don't hate God because I know God doesn't exist. Speed of light mate.
 
/Flibble
 
--
"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."
Daniel <danielaparker@gmail.com>: Apr 04 02:27PM -0700

On Wednesday, April 4, 2018 at 10:22:12 AM UTC-4, Rick C. Hodgin wrote:
 
> It's colored by your personal hatred of God
 
That makes about as much sense as would someone suggesting you hated Zeus or Thor or Viracocha :-)
 
Best regards,
Daniel
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 04 07:16AM

On Tue, 2018-04-03, Jorgen Grahn wrote:
> On Tue, 2018-04-03, alessio211734 wrote:
...
 
> int expand = foo(expand);
 
> i.e. you use expand before it has been defined. I'm not sure what the
> workaround would be, but I suspect that's the error.
 
I got no complaints, but based on Ben's later response the analysis
above seems to be incorrect.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
alessio211734 <alessio211734@yahoo.it>: Apr 04 02:24AM -0700

Il giorno mercoledì 4 aprile 2018 09:16:58 UTC+2, Jorgen Grahn ha scritto:
> >> So can I use lambda and recursion? I use visual studio 2015.
 
> > I note that your code is similar to
 
> > int expand = foo(expand);
 
 
I declare the lambda before and work: post my new code
 
std::function<void(CMeshO::VertexPointer vp, std::vector<CMeshO::VertexPointer> & region)> expand;
expand = [&](CMeshO::VertexPointer vp, std::vector<CMeshO::VertexPointer> & region)->void {
std::vector<CMeshO::VertexPointer> nearVerts;
MeshProcessing::nearVertex(vp, nearVerts);
vp->SetS();
for (auto v : nearVerts)
{
if (!v->IsS())
{
if (v->P().Y() > vp->P().Y())
{
region.push_back(v);
expand(v, region);
};
}
};
};
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Apr 04 07:35PM +0100

On Wed, 04 Apr 2018 00:03:37 +0100
 
> where the call now becomes f(5, f);
 
> However, switching back to the big picture, if expand is the only
> thing captured, why not write a named function to do this?
 
There was a proposal to add a Y-combinator to the standard library:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0200r0.html .
I don't know what became of it.
 
However, there is a sample implementation which it says can be
implemented in C++11/14 and which might interest you.
 
Chris
Ben Bacarisse <ben.lists@bsb.me.uk>: Apr 04 08:58PM +0100


> On Wed, 04 Apr 2018 00:03:37 +0100
> Ben Bacarisse <ben.lists@bsb.me.uk> wrote:
(About recursive lambdas)
<snip>
> I don't know what became of it.
 
> However, there is a sample implementation which it says can be
> implemented in C++11/14 and which might interest you.
 
Yes, thanks. That was interesting. The document is, in effect, an
extended answer to the OP's question.
 
The proposed "combinator" essentially automates what I was doing with f
and g above and the suggested implementation does indeed work, though I
think it needs C++14.
 
Cutting and pasting the definition from that document, I can write:
 
auto f = std::y_combinator(
[](auto f, int n) -> int { return n < 1 ? 1 : n * f(n-1); }
);
std::cout << f(5) << "\n";
 
though gcc (v6.3 at least) is unable to deduce the type without the
-> int in there.
 
--
Ben.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 04 01:36PM

On Tue, 2018-04-03, Richard wrote:
 
> Your testing alternative is link-time substitution. It's a giant
> PITA, but you can do it if you really dislike abstract interface
> injection.
 
That's an alternative I'd like to investigate. At a previous
workplace we briefly considered it, but didn't know how to go about
it. Noone wanted to link test code into the product by accident, and
so on.
 
Then we introduced testability by dependency injection, and noone was
really happy with the result.
 
(And then we introduced component tests, since we had really well-
defined runtime components, and these were the ones that ended up
catching the bugs.)
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
legalize+jeeves@mail.xmission.com (Richard): Apr 04 03:38PM

[Please do not mail me a copy of your followup]
 
Jorgen Grahn <grahn+nntp@snipabacken.se> spake the secret code
>workplace we briefly considered it, but didn't know how to go about
>it. Noone wanted to link test code into the product by accident, and
>so on.
 
"Test Driven Development for Embedded C" by James Grenning
<https://amzn.to/2EjQaBf> does a good job of explaining how to use link
time substitution.
 
It's also covered by Michael Feathers in "Working Effectively with
Legacy Code" <https://amzn.to/2q5GC8F>
--
"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>
Rosario19 <Ros@invalid.invalid>: Apr 04 08:10AM +0200

On Mon, 02 Apr 2018 19:28:47 +0300, Paavo Helde wrote:
>>part of the language) is the best language?
 
>In my little subset of C++ there are RAII,
 
>exceptions
 
here we are not agree
 
>and templates.
 
>There are no C-style arrays, no C-style raw pointers and no C-style
>strings.
 
here not agree too
they are there with asm code too
 
>This makes it both easier to learn and safer to use.
 
easy and good to lern a pet language without to see the machine...
that pet languages with
the derive that make complex assembly language and cpu operation can
not be good; the result could be code not debuggable at level of cpu
 
>There is no point to have just C with a bit stricter type check if one
>can have a much powerful language without losing anything C can do.
 
RAII automatize all allocation deallocation of object it seems good
possible with something to say when memory is end or something is
wrong in the construction of objs
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: