Friday, March 17, 2017

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

kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 12:52AM -0700

hi,
The issue i am facing is i am trying to remove element from deque when a certain condition is met from different threads and i enlcosing the whole thing in lock.it works for some steps but after that when i removing elements in later steps i get segmentation fault .What could be the probable reasons for this kind of issues ?
Thanks,
Kushal
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:10AM -0700

This part of the code leads to seg fault
for (auto it = msgContnr->begin(); it != msgContnr->end();) {
if ((it->get()->get_opcode() == PUBLISH) && (it->get()->get_msg_id() == msg_id) &&
(it->get()->get_sockfd() == new_fd)) {
it = msgContnr->erase(it);
// break;
}
}
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:12AM -0700

Here i am pushing some object into the deque and then according to the condition met i am erasing that element through the iterator.In some post in stackoverflow i read that this may be due to some invalid referencing but how do i use it correctly then ?
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:13AM -0700

To be more clear i am doing his operation from differen threads and thus the deque is accessible to all the threads running simultaneously
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:55AM -0700

hi,
i read this post in stackoverflow but i really couldnt really follow why i would get invalid iterator
http://stackoverflow.com/questions/2874441/deleting-elements-from-stl-set-while-iterating
Paavo Helde <myfirstname@osa.pri.ee>: Mar 17 04:49PM +0200

On 17.03.2017 9:52, kushal bhattacharya wrote:
> enlcosing the whole thing in lock.it works for some steps but after
> that when i removing elements in later steps i get segmentation fault
 
> .What could be the probable reasons for this kind of issues ?
 
You have a bug in your multithread locking code. For example, a lock
might be missing in the code part which reads the deque.
Manfred <invalid@invalid.add>: Mar 17 02:23AM +0100

On 3/16/2017 8:25 PM, peter koch wrote:
> Den onsdag den 15. marts 2017 kl. 17.07.04 UTC+1 skrev bitrex:
<snip>
>> If anyone could elaborate I'd appreciate it...
 
> Read the documentation - see eg. cppreference.com.
> nothrow could give significant performance improvements, in particular on move constructors when operating on containers. As an example, moving elements in a std::vector becomes much faster if its elements are cheap to move compared to assign and the move constructors are nothrow.
 
True, but I would note that in the case of move constructors this is not
only a performance issue.
When, thanks to noexcept, a move constructor is called instead of a copy
constructor, this is also a change in semantics.
Paavo Helde <myfirstname@osa.pri.ee>: Mar 17 04:45PM +0200

On 17.03.2017 3:23, Manfred wrote:
> only a performance issue.
> When, thanks to noexcept, a move constructor is called instead of a copy
> constructor, this is also a change in semantics.
 
There is a special clause in the standard (12.8/31) allowing the
compiler to elide any copy and move constructors, even if they have side
effects. Any program whose semantics depend on these things called or
not called is thus extremely fragile.
leigh.v.johnston@googlemail.com: Mar 17 05:10AM -0700

... until he stops spamming this newsgroup with his bullshit religious posts.
 
/Leigh
David Brown <david.brown@hesbynett.no>: Mar 17 01:28PM +0100

> ... until he stops spamming this newsgroup with his bullshit religious posts.
 
<rant>
 
There seems to be a lot of animosity from some people in this group.
 
It strikes me as perfectly reasonable to reply to on-topic posts,
regardless of who posts them or what other kinds of posts they make.
 
It is usually a bad idea to respond to off-topic posts. (I know I've
been guilty of that - so have most people.)
 
If you are unable to contain your desires for making off-topic posts
(whether it be about your god or your sausages), please keep it within a
single thread, and make such posts as rarely as you can.
 
And if you don't like such off-topic threads, then just kill/ignore the
thread. Everyone knows that Rick can't help posting religious stuff,
Brian can't help whining when someone uses a naughty word, and Leigh
can't help provoking both of them given half a chance. No amount of
persuasion is going to make them change their ways. With Thunderbird,
you just press "K" to ignore the thread, or "shift-K" to ignore the
sub-thread. Other newsreaders will have similar capabilities.
 
 
</rant>
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 05:41AM -0700

am really sorry about this but its true that this is some thing irritating
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 06:33AM -0700

> ... until he stops spamming this newsgroup with his .. religious posts.
 
Do you know why it bothers you so much, Leigh? Because you know deep
down that these things are not being taught by me, but are being taught
through me by God, and He is also confirming them in your core being.
 
It is the same for all people who reject God:
 
http://biblehub.com/john/3-20.htm
20 For every one that doeth evil hateth the light, neither cometh
to the light, lest his deeds should be reproved.
 
You desire your sin more than you desire to be saved. It also means
God's judgment remains upon you.
 
Thank you,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Mar 17 02:35PM +0100

On 17/03/17 13:41, kushal bhattacharya wrote:
> am really sorry about this but its true that this is some thing irritating
 
Kushal, I know you want to make posts with questions about C++ in this
group. But you have a great deal to learn about Usenet and
communication in general, making it somewhat ironic for you to be making
such complaints. I suspect that some people here automatically ignore
/your/ posts, because your posting style irritates them. And that is a
shame, since you clearly want to discuss C++.
 
Let me give you some suggestions that will help you get more help from
this group.
 
 
It is clear that English is not your first language, but you handle it
well. It's fair enough to make some mistakes in grammar or spelling as
long as your meaning is clear. But make the effort to get basic grammar
and structure correct - use capital letters at the beginning of
sentences and for "I", and use punctuation and spacing appropriately.
 
Google groups is a very poor interface for Usenet. I strongly recommend
getting a proper newsserver account and a proper newsreader program.
There are many available - a popular free server is
"news.eternal-september.org", and Thunderbird is a fine newsreader
client for Linux and Windows. It will make it faster and easier for you
to read the group, and much easier for you to make posts that follow
Usenet standards.
 
Use correct quoting of articles when you follow-up, and make sure that
attributions (i.e., who wrote what) are correct. This can be done with
Google groups, but is far easier with a proper Usenet client.
 
When writing questions and posts, remember that no one else can guess
details such as what OS you are targeting, what tools you are using, or
anything else that might be relevant. Give more information, and it
will be easier for people to help.
 
Try to reduce your problems to a minimal piece of code that can be
compiled and still shows the same problem. Often this exercise itself
is enough to help you find your own solution. But if not, it means that
others can see everything they need to understand the code and perhaps
try it themselves to help you out. If it is a compile-time issue, make
use of the online compiler at https://gcc.godbolt.org/ - if people can
cut-and-paste your code to that site, it is far easier to try it out.
 
If you find that no one is replying to your posts, then it is likely
that your question is poorly written. If you make several replies to
your own post, there is a good chance that people will just assume you
are another one of those annoying posters who treats a Usenet group as a
sort of blog where they talk to themselves. This is especially true
with repeated posts in a short time. You should probably think through
the problem a bit more, re-phrase the issue and write a clearer and more
considered post rather than having to keep adding new information.
 
 
Hopefully, these tips will help you help yourself.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:25AM -0700

please dont post any ritualistic posts in this group perhaps only programming reated issues or posts are welcome here
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 04:43AM -0700

kushal bhattacharya, you misunderstand the purpose of my posts.
 
http://biblehub.com/kjv/matthew/28.htm
http://biblehub.com/kjv/acts/4-19.htm
 
18 And Jesus came and spake unto them, saying, All power
is given unto me in heaven and in earth.
19 Go ye therefore, and teach all nations, baptizing them in
the name of the Father, and of the Son, and of the Holy Ghost:
20 Teaching them to observe all things whatsoever I have
commanded you: and, lo, I am with you alway, even unto the end
of the world. Amen.
 
It is about your eternal soul, not rituals.
 
Thank you,
Rick C. Hodgin
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 05:42AM -0700

sorry could you please help me out in my post i really need help from you guys
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 05:53AM -0700

On Friday, March 17, 2017 at 8:42:45 AM UTC-4, kushal bhattacharya wrote:
> sorry could you please help me out in my post i really need help from you guys
 
Has anyone ever taught you about God? About sin? About punishment
for sin? About Jesus coming to the Earth to save us from that
punishment?
 
It is these things I teach about because they are the only way to
have eternal life (to be forgiven of our sin, putting us in right
standing before a Holy God).
 
Thank you,
Rick C. Hodgin
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 06:30AM -0700

ok i get it man
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:21AM -0700

exactly man please dont post anything crappy
Ramine <toto@toto.net>: Mar 16 08:37PM -0400

Hello....
 
 
Usefulness is the cause to creating new jobs.
 
if you say for example: 2 + 2 = 4
 
If you know that and you are not conscious from where it come from,
this is also usefulness that can create new jobs, because computer
programming is not just computer programming, it's also verification
and validation (V&V) and it's debugging and it's becoming a consultant
that brings directives or efficient experience , so it is why usefulness
is the way also to creating new jobs, and this is why i have
worked as a consultant to bring my experience to the team,
this is how it works also in operational research, i have done
also operational research and operational research can have this
same property ... and since i have accumulated knowledge in
operational research and mathematics and informatics and
since i have invented many new algorithms and softwares,
i am more apt at making the team more efficient in doing
parallel programming and more efficient at bringing my experience.
 
Knowledge sets your perception..
 
When you set the tree of the causes and consequences right, you will
set your perception more correctly, and knowing the consequences
from the tree allows you mostly to define more correctly the things,
this is mandatory in political philosophy, and to be able to
find the causes and consequences we use mathematical statistics
like finding mathematical correlations and search for the causes, so
political philosophy that has founded itself on mathematical
statistics is like doing science, but how do we define usefulness ?
usefulness is the cause to creating new jobs, so computer programming
for example can by more experience attain a higher degree of quality
that don't use programming , but just be the director that manage
more correctly software projects and that sets its perception correctly,
but we have to enlarge our view by noticing that new jobs can be created
from the fact that you have invented new algorithms like i have invented
many new algorithms, and this can be profitable because you can create a
new job as a consultant by using your new algorithms
and your new experience that you have accumulated by designing
and implementing those new algorithms and new softwares as i have done
it, so be optimistic and realize with me that usefulness that creates
jobs also comes from this reality that you have been able to invente
many new algorithms and softwares...
 
Is what you see what you see ?
 
This question is very important..
 
Seing is like doing science or like inventing smart algorithms,
you have to know the prerequisites to be able to see correctly,
and that's the same prerequisites for science, you have for example
to do mathematical correlations but that's not sufficient, because is
a strong correlation a cause ? no, it can be many variables that causes
the cause, so you have to search for the truth, that means you have to
search for those variables that are the cause, this is how works
perception and this is how works inventing efficient algorithms,
and this is how works science, you have to accumulate efficient
knowledge to be able to find the truth to be able to see correctly
and think correctly, this is how works intelligence also, to get smarter
is the same as to setting your perception right, you have
to accumulate efficient knowledge to become smarter, this is
how i have done it to become smarter. this is as magical, because
when you will set your perception right you will notice
that it is as magical, it is the same when you get smarter.
 
And is computer programming a science ?
 
It is like emulating a software...
 
Efficient and disciplined computer programming with mathematics and
efficient rules and efficient methods is more intelligence and high
quality that is the goal of science, science also uses intelligence to
attain a higher degree of quality, it's by analogy like emulating
softwares, since the goal that is a higher degree of quality is attained
by efficient and disciplined computer programming , so efficient and
disciplined computer programming is like doing science.
 
 
Thank you,
Amine Moulay Ramdane.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 03:19AM -0700

please shut the crap man
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 17 02:22AM +0100

The noise level in clc++ is increasing again.
 
I use Thunderbird to access the newsgroup. It's not exactly clear to a
new user how to do that. So, in Windows
 
1. In Thunderbird right click your mail account (e.g.
yourname@gmail.com), or Local Folders, and choose Settings. This
is one way to get to Thunderbird's well hidden Account Settings
dialog.
 
2. In the Account Actions drop down list (at bottom left in my TB)
choose Add Other Account. Up pops a dialog where the only choice
is Newsgroup Account. So why not say that up front and save a
step? Because it's obfuscated, with a view towards removal.
 
3. Fill in name and email address. If you want to use a non-existent
mail address, use the domain `.invalid.com`, e.g.
`mickey@invalid.com`. This is all about what will be presented in
your messages, not how you identify vis-a-vis newsgroup server.
 
4. In the next page you have to specify an NNTP server. I use
Eternal September. It's free but you have to register. Ideally
that should be done before this step, but you can just register
(with that server or some other) via your browser.
 
5. There are some more steps but they don't involve hidden things.
When you get things up and running, with access to clc++, simply
select some message that you would like to not see, and in the TB
main menu choose "Message -> Create filter from message". Voila.
 
Cheers & hth.,
 
- Alf
Ramine <toto@toto.net>: Mar 16 08:54PM -0400

Hello......
 
About the essence of beautifulness..
 
You will say that beautifulness is good..
 
But if you are not as beautiful as the other, like arabs are not as
beautiful as white europeans, you can still enhance yourself by
executing rules like computers execute instructions to make
yourself more beautiful and/or more disciplined and/or more compassion
and/or love, by knowing that love and/or compassion and/or beautifulness
is the result/output also of executing rules without being compassion
or/and without being love and/or without being beautifulness is a kind
of discipline that must be learned by all, because this discipline can
solve many of our problems.
 
We have to set right our perception..
 
And you have to relearn how to walk right..
 
What says to me rationality and logic and measure ?
 
That compassion can be virility, because compassion gets us more
organized because neglecting compassion cause violence and extremism
that make our society unstable and less optimized , so tuning
compassion right with social services to people to avoid violence and
extremisme is also more stability and more power , so this compassion is
virility.
 
And in economy taking into account consumer confidence index , we have
to be more disciplined with compassion and respect towards others
like arabs and africans to not hurt our economy , this is the essence
of usefulness that sets right optimization and that sets also immigration.
 
So you have to be more disciplined in your thinking with more
rationality and logic and meaure to set it right.
 
About rationality and logic and measure..
 
As you have noticed i am doing political philosophy here using the tools
of philosophy that are rationality and logic and measure, but
i have learned a wisdom from that, that political philosophy must be
taken as a science, because the tools of philosophy that are rationality
and logic and measure are called "more science", and i have
learned another wisdom from my work on political philosophy is
that you have to be patient with political philosophy like
being patient with science, because in political philosophy you are
going step by step and layer by layer incrementally to attain the
goal to set your perception right, so you have to be patient to
wait for your perception to be set right, it is like doing science.
 
About hate..
 
I think some of you are still immature..
 
Because hating arabs and hating africans is not scientific,
you have to know that economy today is not just nationalism,
it is also companies like Boeing and Intel and many many others selling
to arabs and to africans, so you have to know how to tune compassion and
respect towards arabs and africans to not hurt consumer confidence index
and to not hurt economy, this is also science, and arabs and africans
also must know how to tune compassion and respect to attract more
investment and to be able to think bigger taking into account consumer
confidence index also.
 
Thinking bigger...
 
The weakness of neo-nazis and far-right like ideologies is that they don't
think bigger..
 
Economy today is thinking also bigger..
 
Many companies like Intel and Boeing etc. are thinking bigger,
so they are not thinking just nationalism, because to be able
to think bigger you have to know how to give respect to
arabs and to africans, and giving respect to arabs and to africans can
be also more investment in arab and african countries, and also
as you will notice that economic growth in arab and african
countries is higher than Europeans or American countries,
so you have to know how to capture opportunities in economy
by knowing how to not hurt the consumer confidence index
by not hating arabs or africans and knowing also how to set respect by
investing on other countries..
 
 
Nationalism has to adapt and think bigger !
 
 
What do you think is survival ?
 
Survival is usefulness and it is also compassion and respect, this is
scientific, this is optimization, science is not hating stupidly,
you have to be the director of companies like Intel or Boeing to be able
to understand what i am saying, you are thinking small by hating
stupidly, and thinking small is not survival, you have to think bigger
and being more disciplined at thinking bigger ! you have to know how to
manage yourself and how to manage America ! stupidly hating is not
management and it is not science ! so you have to set your perception
right by listening to science and to wisdom , you are thinking like
optimizing is hating the other ! this is childish behavior of
nationalism of today ! so be capable at thinking bigger ! this
is the standards of today ! we have to think bigger to better
survive ! so don't be childish !
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 16 08:01PM -0400

Hello......
 
 
Knowledge sets your perception..
 
When you set the tree of the causes and consequences right you will
set your perception more correctly, and knowing the consequences
from the tree allows you mostly to define more correctly the things,
this is mandatory in political philosophy, and to be able to
find the causes and consequences we use mathematical statistics
like finding mathematical correlations and search for the causes, so
political philosophy that has founded itself on mathematical
statistics is like doing science, but how do we define usefulness ?
usefulness is the cause to creating new jobs, so computer programming
for example can by more experience attain a higher degree of quality
that don't use programming , but just be the director that manage
more correctly software projects and that sets its perception correctly,
but we have to enlarge our view by noticing that new jobs can be created
from the fact that you have invented new algorithms like i have invented
many new algorithms, and this can be profitable because you can create a
new job as a consultant by using your new algorithms
and your new experience that you have accumulated by designing
and implementing those new algorithms and new softwares as i have done
it, so be optimistic and realize with me that usefulness that creates
jobs also comes from this reality that you have been able to invente
many new algorithms and softwares...
 
Is what you see what you see ?
 
This question is very important..
 
Seing is like doing science or like inventing smart algorithms,
you have to know the prerequisites to be able to see correctly,
and that's the same prerequisites for science, you have for example
to do mathematical correlations but that's not sufficient, because is
a strong correlation a cause ? no, it can be many variables that causes
the cause, so you have to search for the truth, that means you have to
search for those variables that are the cause, this is how works
perception and this is how works inventing efficient algorithms,
and this is how works science, you have to accumulate efficient
knowledge to be able to find the truth to be able to see correctly
and think correctly, this is how works intelligence also, to get smarter
is the same as to setting your perception right, you have
to accumulate efficient knowledge to become smarter, this is
how i have done it to become smarter. this is as magical, because
when you will set your perception right you will notice
that it is as magical, it is the same when you get smarter.
 
And is computer programming a science ?
 
It is like emulating a software...
 
Efficient and disciplined computer programming with mathematics and
efficient rules and efficient methods is more intelligence and high
quality that is the goal of science, science also uses intelligence to
attain a higher degree of quality, it's by analogy like emulating
softwares, since the goal that is a higher degree of quality is attained
by efficient and disciplined computer programming , so efficient and
disciplined computer programming is like doing science.
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 16 07:29PM -0400

Hello.......
 
 
Is computer programming a science ?
 
It is like emulating a software...
 
Efficient and disciplined computer programming with mathematics and
efficient rules and efficient methods is more intelligence and high
quality that is the goal of science, science also uses intelligence to
attain a higher degree of quality, it's by analogy like emulating
softwares, since the goal that is a higher degree of quality is attained
by efficient and disciplined computer programming , so efficient and
disciplined computer programming is like doing science.
 
 
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.lang.c+++unsubscribe@googlegroups.com.

No comments: