Sunday, December 25, 2016

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

Juha Nieminen <nospam@thanks.invalid>: Dec 20 07:18AM

> So qsort is 40% slower than merge sort on a linked list eh Gareth
> matey?. So I was correct. 40. %. slower.
 
Your problem is that you don't understand what asymptotic complexity
and the big-O notation mean.
 
Your claim was about the asymptotic complexity of quicksort on
linked lists, not on absolute speed (ie. in practice the constant
factor in terms of computational complexity).
 
In addition to that, you weren't comparing quicksort on linked
lists to merge sort on linked lists. You were comparing quicksort
on linked lists to quicksort on random access arrays (and claiming
that the former is worse in terms of asymptotic complexity). It's
useless to now cling onto those quicksort vs mergesort numbers,
because that wasn't your original claim, nor what people objected to.
Juha Nieminen <nospam@thanks.invalid>: Dec 21 07:08AM

> just that worst case complexity was more likely.
 
No, he didn't claim that.
Gareth Owen <gwowen@gmail.com>: Dec 21 08:54PM

>>> just that worst case complexity was more likely.
 
>> No, he didn't claim that.
 
> Yes, he did.
 
He claimed both. They're equally wrong.
legalize+jeeves@mail.xmission.com (Richard): Dec 21 06:43PM

[Please do not mail me a copy of your followup]
 
Marcel Mueller <news.5.maazl@spamgourmet.org> spake the secret code
 
>As always it depends. For general purpose use the standard containers
>are just fine. For spacial cases individual implementations often
>perform better.
 
...and this isn't unique to C++.
 
C# and Java have standard general containers. Performance gains can
be made by switching to custom containers that are specific to your
use case.
--
"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>
ram@zedat.fu-berlin.de (Stefan Ram): Dec 20 10:37PM

The new C++ primer says that the new library containers are
faster than ever and perform as well or better than
everything one can hope to write oneself.
 
Chandler Carruth used to say in 2014 that all the ::std::
containers have such hindering requirements that one can use
only ::std::vector when one cares for efficiency, but in
2016 he says that because of the impossibility of the
small-size optimization even ::std::vector is unusable when
one wants efficient code. He than describes clang's fast
"SmallVector" implementation, while someone from Facebook
explains how they made facebook much faster by replacing
::std::string with their fbstring, which uses a very
efficient small-string representation.
Popping mad <rainbow@colition.gov>: Dec 21 08:48PM

:(
 
I don't know. I'm very confused about the behavior of this test program I've been right.
I'm trying to move date by worker threads from one blob of memory to another and the debugger
is saying that the pointers beg and canvas_index is jumping 10 bytes between this two lines
 
for(int i = 0; i < 10;i++)
{
t[i] = std::thread([this]{ readin(beg, canvas_index); });
 
and I'm not sure why. I lost the concurrency somewhere, but can't seem to figure out what I did wrong
 
 
#include <iostream>
#include <thread>
#include <mutex>
std::mutex medco;
std::mutex master;
 
namespace testing{
std::thread t[10];
class PIC
{
public:
PIC():beg{&source[0]}
{
canvas_index = canvas;
std::cout << "Testing Source" << std::endl;
for(int i = 0; i<100; i++)
{
std::cout << i << " " << source[i] << std::endl ;
}
for(int i = 0; i < 10;i++)
{
t[i] = std::thread([this]{ readin(beg, canvas_index); });
std::cerr << i << ": Making a thread" << std::endl;
sync_canvas_and_input();
}
};
 
void sync_canvas_and_input()
{
std::cout << "**LOCKING**" << std::endl;
std::lock_guard<std::mutex> turn(medco);
beg += 10;
canvas_index += 10;
}

~PIC()
{
std::cerr << "In the destructor" << std::endl;
for(int i=0; i<10; i++)
{
t[i].join();
std::cerr << i << ": Joining a thread" << std::endl;
}
 
};
void readin(char * start, char * loc_canvas_index)
{
for( int i = 9; i>=0; i-- )
{
*loc_canvas_index = start[i];
std::cerr << i << ": Copy " << start[i] << std::endl;
std::cerr << i << ": Copied to loc_canvas_index " << reinterpret_cast<char>(*loc_canvas_index) << std::endl;
loc_canvas_index++;
}
Popping mad <rainbow@colition.gov>: Dec 21 11:16AM

Why is canvas_index not being assigned properly in the initiation list
unless I do an assignment inside the backets
 
 
/*
*
=====================================================================================
*
* Filename: test.cpp
*
* Description: Threading Experiment
*
* Version: 1.0
* Created: 12/18/2016 12:46:51 PM
* Revision: none
* Compiler: gcc
*
* Author: Ruben Safir (mn), ruben@mrbrklyn.com
* Company: NYLXS Inc
*
*
=====================================================================================
*/
 
#include <iostream>
#include <thread>
 
namespace testing{
std::thread t[10];
class PIC
{
public:
PIC():beg{&source[0]}, end{&source[99]} , canvas_index
{canvas}
{

canvas_index = canvas;
for(int i = 0; i < 10;i++)
{
t[i] = std::thread([this]{ readin(beg); }
);
std::cout << i << ": Making a thread" <<
std::endl;
beg += 10;
}
};

~PIC()
{
std::cout << "In the destructor" << std::endl;
for(int i=0; i<10; i++)
{
t[i].join();
std::cout << i << ": Joining a thread" <<
std::endl;
}
 
};
void readin(char * start)
{
for( int i = 0; i<10; i++ )
{
*canvas_index = *start;
std::cout << i << ": Copy " <<
reinterpret_cast<char>(*start) << std::endl;
std::cout << i << ": Copied to
canvas_index " << reinterpret_cast<char>(*canvas_index) << std::endl;
canvas_index++;
start++;
}
 
};
 
char * get_canvas()
{
return canvas;
}
 
private:
char * beg;
char * end;
char * canvas_index;
char * canvas = new char[100];
char source[100] = {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'
};
//int index;
};
}//end namespace
 
int main(int argc, char** argv)
{
testing::PIC fido;
for(int i = 0; i<100;i++)
{
std::cout << i << " Canvas Position " << fido.get_canvas()
[i] << std::endl;
}
 
return 0;
}
Jeff-Relf.Me <@.>: Dec 25 01:39PM -0800

Mr Flibble <flibble@i42.co.uk>: Dec 25 09:40PM

On 25/12/2016 21:39, Jeff-Relf.Me wrote:
> My C++ Coding Style: http://Jeff-Relf.Me/cStyle.HTM
 
Who cares?
 
/Flibble
Ian Collins <ian-news@hotmail.com>: Dec 26 10:53AM +1300

On 12/26/16 10:40 AM, Mr Flibble wrote:
> On 25/12/2016 21:39, Jeff-Relf.Me wrote:
>> My C++ Coding Style: http://Jeff-Relf.Me/cStyle.HTM
 
> Who cares?
 
It's a piss take...
 
--
Ian
Jeff-Relf.Me <@.>: Dec 25 02:44PM -0800

"Poraty the poltroon" <LOL_IMA_POSTER@gmail.com>: Dec 25 02:46PM -0800

Looks like the ideal guide for fucktards such as yourself.
"Jens Müller" <ich@tessarakt.de>: Dec 25 09:46PM +0100

On 23.12.2016 01:33, Stefan Ram wrote:
 
> o size and alignment
> o set of valid values
> o set of permitted operations
 
[...]
 
> struct A { int x; };
> struct B { int x; };
 
> A and B now agree in everything on his slide,
 
No, they don't. The permitted operations are different. It's just not
very visible because the different operations are compiler-generated.
Mr Flibble <flibble@i42.co.uk>: Dec 25 09:41PM

On 23/12/2016 00:33, Stefan Ram wrote:
> Dan Sacks asked (in the context of C and C++), »What's a data
> type?«.
 
Simple question, simple answer: in C++ a type is that which an object is
an instance of; an object doesn't have to be an instance of a class
type: an 'int' variable is also an object.
 
/Flibble
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 24 04:03PM -0800

On Saturday, December 24, 2016 at 5:37:35 PM UTC-5, ruben safir wrote:
> > [...]
 
> > Feliz Navidad!
 
> I seriously dislike Christians and consider them a threat to my family.
 
There are no Christians anywhere who are a threat to your family. There
are, however, lots of people doing bad things who call themselves by that
name "Christian," but if you look to the Bible to how Christians are
supposed to be ... you'll find that anyone who is a threat to your family
is not a Christian, but is following after the enemy of this world.
 
Christians would sooner die themselves than hurt another.
 
> everything they are involved with with evangelizing. Troll a tech news
> group is just another form of intimidating Jews from participating in
> social circles. It is disgusting and ugly.
 
The things you mention here are indeed disgusting and ugly, but they
are not the things Jesus Christ taught, nor are they the things real
born again Christians do.
 
You can learn for yourself by reading the Bible and seeking out the
fullness of the matter with your own eyes, and your own mind. You'll
find there's an enemy at work in this world trying to fool you into
summarily rejecting Jesus Christ, Christians, and eternal salvation
in Him, solely on the basis of those evil things people who call
themselves by that name do, when in fact they do not really relate
back to anything Christ taught.
 
If you seek the truth out fully ... you'll find the truth. Seek the
truth, ruben.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Dec 24 08:42PM -0600

> truth, ruben.
 
> Best regards,
> Rick C. Hodgin
 
Yes because your religion is correct and his religion is incorrect! It is
so obvious to me now! How could I have been so stupid thinking all
religions are incorrect!!! What a fool I must have looked!!!
 
/Flibble
Popping mad <rainbow@colition.gov>: Dec 25 02:58AM

On Sat, 24 Dec 2016 20:42:13 -0600, Mr Flibble wrote:
 
> ou can learn for yourself by reading the Bible an
 
You can't even read your own Bible, let alone understand the Tanach.
Your just blood thirsty. Your Chiristian, your blood thirsty. It is a
historical fact and your trying to intimidate me, but it won't work.
Your fascist blood thirsty religion will not get my family. You will not
enslave our people. Our people will remain Christian FREE and saved.
 
Christians are all going straight to hell. It says so right in the bible
that you can't even read.
Popping mad <rainbow@colition.gov>: Dec 25 02:59AM

On Sat, 24 Dec 2016 20:42:13 -0600, Mr Flibble wrote:
 
> If you seek the truth out fully
 
 
Truth, you celebrate the Death of Jews and you wouldn't be happy until we
are all dead. Your a rebel against God and a sinner and will go straight
to hell with all the other Christians.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 24 07:49PM -0800

On Saturday, December 24, 2016 at 9:42:34 PM UTC-5, Mr Flibble wrote:
 
> Yes because your religion is correct and his religion is incorrect! It is
> so obvious to me now! How could I have been so stupid thinking all
> religions are incorrect!!! What a fool I must have looked!!!
 
Yes, Leigh. But I invite you to personally test my claim. And I do
not ask you to take MY word for it. I ask you to take YOUR OWN word
for it after you personally investigate the matter.
 
Best regards,
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 24 08:01PM -0800

On Saturday, December 24, 2016 at 9:59:34 PM UTC-5, Popping mad wrote:
 
> Truth, you celebrate the Death of Jews and you wouldn't be happy until we
> are all dead. Your a rebel against God and a sinner and will go straight
> to hell with all the other Christians.
 
I have no idea where you get your information, but you are in all ways
wrong about this. Christians are brothers to the Jews. We do not kill
Jews. We do not hate Jews. We remember that it is written that God will
bless those that bless the nation which came through Abraham, and He will
curse those which curse that nation (Genesis 12:3).
 
No. Christian do not in any way, shape, or form, hate any Jews.
 
-----
The Jews are God's chosen nation. The Bible is very clear that
salvation is from the Jews (John 4:22).
 
I have no qualm against the Jews at all. But the fact is they are
blinded right now. And the god of this age (Satan) has blinded the
rest of the people (2 Corinthians 4:4). But God Himself blinded the
Jews because they rejected Him (Romans 11:7-8). But, in the end-most
times, which we are in now ever since Israel became a nation again in
1948, thusly fulfilling prophecy that in one day Israel would become
a nation again, He will soon open their eyes to see Him as Savior and
Lord, and the remnant will be saved.
 
It is a glorious day that's coming. And the great city, named New
Jerusalem, will be coming down from Heaven, bearing the name of His
Earthly nation's true capital city.
 
-----
The enemy of this world works very hard to dirty the name of Christ,
and of His followers, because from Christ, and from those things His
true followers teach, follow salvation. If that enemy can make things
related to Christ and Christians look so bad, as by tempting sinful
men and women to do heinous things under the name of Christ, then so
many will take a casual glance in the direction of true salvation,
and see those heinous things, and conclude within themselves, "Nope!
Not for me. I want no part of THAT!" But the fact is, THAT is not
Jesus Christ. It is the enemy and his lies and deception.
 
It's why you must seek out the truth. When you do, you will find it,
and He will uncover the lies of the enemy before your very eyes.
 
Best regards,
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 24 08:33PM -0800

If you want to know what Jesus is like, and what He calls us to be, watch
the movie, "The Encounter 2010" and the TV Series "The Encounter" 2016 on
pureflix.com:
 
The Encounter Movie 2010
http://www.pureflix.com/videos/400337475852/watch
 
The Encounter TV Series 2016
http://www.pureflix.com/series?name=The+Encounter
 
He has compassion for those who acknowledge their sin. He has forgiveness
for those who acknowledge their sin. He has eternal life to restore us to
once our sin is taken away.
 
Death has no sting upon those who come to Him and say, "Lord, forgive me,
a sinner."
 
The Christian walk is a walk of submission to God, and in service to Him
and His Kingdom ... even here upon the Earth ("Thy Kingdom, Thy will be
done, on Earth as it is in Heaven..." Matthew 6:9-13).
 
Jesus is love. It is the enemy who is hate and war and fighting and
death. Jesus is life, even life eternal.
 
Best regards,
Rick C. Hodgin
"Öö Tiib" <ootiib@hot.ee>: Dec 25 04:32AM -0800

On Sunday, 25 December 2016 04:59:34 UTC+2, Popping mad wrote:
> On Sat, 24 Dec 2016 20:42:13 -0600, Mr Flibble wrote:
 
> > If you seek the truth out fully
 
Where Mr Flibble wrote that?
 
 
> Truth, you celebrate the Death of Jews and you wouldn't be happy until we
> are all dead. Your a rebel against God and a sinner and will go straight
> to hell with all the other Christians.
 
Above is a good example of written groundless defamation. People
like ruben, do not have any decency nor pride left. They take mouthful
of shit and spit it at world. As result our world is full of shit and
bad smell from mouth of those people.
Mr Flibble <flibble@i42.co.uk>: Dec 25 04:16PM

On 25/12/2016 02:58, Popping mad wrote:
> enslave our people. Our people will remain Christian FREE and saved.
 
> Christians are all going straight to hell. It says so right in the bible
> that you can't even read.
 
I did not write that: your newsreader is broken and/or learn to use it
properly.
 
/Flibble
Mr Flibble <flibble@i42.co.uk>: Dec 25 04:17PM

On 25/12/2016 02:59, Popping mad wrote:
 
> Truth, you celebrate the Death of Jews and you wouldn't be happy until we
> are all dead. Your a rebel against God and a sinner and will go straight
> to hell with all the other Christians.
 
I did not write that: your newsreader is broken and/or learn to use it
properly.
 
/Flibble
woodbrian77@gmail.com: Dec 24 04:54PM -0800

Previously I had this line:
::std::unique_ptr<cmw_request> request(::new cmw_request(localbuf));
 
After getting C++ 2014 compilers, I wrote it like this:
auto request=::std::make_unique<cmw_request>(localbuf);
 
I was watching Mark Isaacson's talk here:
https://www.youtube.com/watch?v=-ctgSbEfRxU
. (You can watch it from https://duckduckgo.com if you want.)
He talks about parameter type deduction for constructors
shortly after the two minute mark.
 
So I'm wondering if this is going to be valid C++ 2017 code:
 
::std::unique_ptr<cmw_request> request(localbuf);
 
It doesn't compile with clang++ 3.8.1.
 
And I was trying to find an online C++ compiler that has
support for C++ 2017, but only found support for C++ 2014
and earlier. Could someone point me to a site that has that?
Thanks in advance.
 
 
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
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: