Tuesday, September 23, 2014

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

comp.lang.c++@googlegroups.com Google Groups
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 23 11:08AM -0700

Think about what this means...
 
The last thing Jesus commanded before He was taken, tried, and falsely
sentenced to death, was a new commandment. He commanded that we Love
one another (as He Loved us). Who wouldn't want people to love you?
And for you to love people? Love is wonderful. Peaceful. Helpful.
All things right and true. And this was Jesus' new commandment.
 
When He was taken, He didn't fight back. In fact, He commanded that
Peter put down his sword.
 
When He was here, He taught all men everywhere the ways of God. He
led people out of sin and sinful behaviors. He showed people God
manifest in the flesh. He healed their sicknesses. Raised the dead.
Cleansed them of sin.
 
Why do people hate that? Why do people hate Jesus? Why do they hate
the Truth? It is for one reason only: they are children not of Christ,
but are children of the anti-Christ. They are not children of God, but
are children of the devil. And as such, they do what their father does.
If they were of God they would do those things God did, and commands.
 
I can't say it more clearly. If you will not hear the Truth, then
you stand already, right now, as you "live" and breathe, eternally
condemned to a fiery Hell, the second Death. You are condemned to
that place because you will not come out and hear Him. You will not
come out and humble yourself and ask forgiveness and be saved. You
will only instead stay where you are, desiring more of what you think
you already know, as the One who desires deeply to forgive you watches
as you throw everything away out of pride, sin, rebellion, and
falseness.
 
But if you WILL hear the Truth, then you will come to Jesus, repent,
and ask forgiveness, and He will forgive you and save you from that
fiery end by His Sovereign Power, restoring you instead to the right
relationship with God that was desired from the beginning.
 
It is only sin, and the deadly effect of sin operating in your life,
and your embracing that sin instead of the Truth, which will keep you
from salvation. And the way out of that sin is to ask God for help.
To turn away from your sin. To repent. To ask the One who can
forgive you to forgive you. He will, because He is Love. They had
to invent a new word to describe His Love. The word "Agape" was new
to the Greek language when they were describing the Love of Jesus
for His creation.
 
Everybody makes this choice continually by the things in their life.
You make the right choice. Humble yourself and ask Him for forgiveness.
He will hear you, and forgive you. It's why He came, for the name "Jesus"
literally means "God who saves," in the same way the name Shoemaker
means "one who makes shoes."
 
Trust in Him. Ask for forgiveness and be saved. It's never too late
until you die, and none of us know in what day, hour, or minute our
death will come. Ask today. Ask right now. Ask Him to save you too.
 
In love... to each of you... because of Him. Peace.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 07:39PM +0100

On 23/09/2014 19:08, Rick C. Hodgin wrote:
> Think about what this means...
 
> The last thing Jesus commanded before He was taken, tried, and falsely
> sentenced to death, was a new commandment. He commanded that we Love
 
[snip]
 
Evolution is proof that Jesus, if he existed at all, was just another
ignorant human being. Your god doesn't exist mate; deal with it.
 
/Flibble
Christopher Pisz <nospam@notanaddress.com>: Sep 23 02:42PM -0500

On 9/23/2014 1:39 PM, Mr Flibble wrote:
 
> Evolution is proof that Jesus, if he existed at all, was just another
> ignorant human being. Your god doesn't exist mate; deal with it.
 
> /Flibble
 
 
Great, here we go again with comp.lang.c++.theology. Can you guys at
least put (OT) in your topic if you are going to do that argument all
over again.
 
I'm embarrassed to be Christian sometimes when I see others that cannot
even write a paragraph without it having to contain a religious
reference. Stop baiting people. You can talk about programming without
having to write a full testimony each time.
 
and Fibble...well, yea, just put (OT) in your topic if you cannot resist
the urge to argue evolution without a point again.
Dombo <dombo@disposable.invalid>: Sep 23 09:46PM +0200

Op 23-Sep-14 20:08, Rick C. Hodgin schreef:
> until you die, and none of us know in what day, hour, or minute our
> death will come. Ask today. Ask right now. Ask Him to save you too.
 
> In love... to each of you... because of Him. Peace.
 
Christianity, the belief that a cosmic Jewish Zombie who was his own
father can make you live forever if you symbolically eat his flesh and
telepathically tell him you accept him as your master, so he can remove
an evil force from your soul that is present in humanity because a
rib-woman was convinced by a talking snake to eat from a magical
tree...Yeah makes perfect sense.
Ian Collins <ian-news@hotmail.com>: Sep 24 08:23AM +1200

Rick C. Hodgin wrote:
> Think about what this means...
 
It means you are being rude by being off topic.
 
Usenet has it's own set of (largely unwritten) rules which have evolved
to minimise trolling and other noise. One of those rules is to stay on
topic. Follow it and people will respect you, ignore it and you will
end up in kill files and be ignored by those who can help you.
 
Stick to C++ here, preach elsewhere.
 
--
Ian Collins
drew@furrfu.invalid (Drew Lawson): Sep 23 09:17PM

In article <e5605492-c3f8-4b55-b7b5-d01c51e3a85d@googlegroups.com>
>is the truth, and the anti-Christ spirit is that which drives the
>deceived person from within. People are either the children of God,
>or they are children of the devil.
 
[tweet] Red flag on the cross-bearing team.
 
If you are going to insist on going biblical on everything, then
you will have to remember that (in that reference) everything was
created by god, nothing by the devil. The devil lacks the power
to create, so he cannot create children.
 
God created it all -- liars, sodomites, politicians, disco, cable
news, ebola, anthrax. Oh, and Hell. Can't forget that god created
Hell. And only god sends people there.
 
In earlier centuries, christian theologians embraced that god created
all the bad things too. It is the only way to reconcile the fluffy
god with the "rain fire on sinners" god, and also with the "send
bears to dismember children" god.
 
I have no problem with having belief, but I find it hard to respect
the groups who say, "Here is the Book of Absolute Truth. Only read
the pages that I marked."
 
--
Drew Lawson While they all shake hands
and draw their lines in the sand
and forget about the mess they've made
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 23 02:23PM -0700

On Tuesday, September 23, 2014 4:23:46 PM UTC-4, Ian Collins wrote:
> Stick to C++ here, preach elsewhere.
 
There's something afoot. I don't know what it is, but it is evident.
So many Christians on Facebook are posting about those things which
are core to a Christian's life and focus, a turning away from the
things of this world, and a focus on the way Jesus calls us to live.
 
A chasm is forming between the professed believers, and the true
believers. The true believers are being moved from within to speak,
and to change the things in their lives which need changing. It's
a call toward holiness, toward service unto God.
 
It is very powerful. Really something. Palpable even.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 10:29PM +0100

On 23/09/2014 22:23, Rick C. Hodgin wrote:
> and to change the things in their lives which need changing. It's
> a call toward holiness, toward service unto God.
 
> It is very powerful. Really something. Palpable even.
 
You have already forgotten what I have taught you. Again: evolution is
proof that your god, Jesus, doesn't exist.
 
/Flibble
Christopher Pisz <nospam@notanaddress.com>: Sep 23 04:41PM -0500

On 9/23/2014 4:23 PM, Rick C. Hodgin wrote:
> and to change the things in their lives which need changing. It's
> a call toward holiness, toward service unto God.
 
> It is very powerful. Really something. Palpable even.
 
True belief is not the same as fanaticism, not even close. Did Jesus
chase the pharisees around saying, "But guys, I love you. Comeon guys.
Hey guys. I know you don't want to hear it, but..." "shush
Jesus'..."Guys, but, guys!"
 
No.
 
He spoke his piece, they rejected it, and that was that. He spent His
time teaching those who came to Him to hear it, not those who told Him
to shut up after every sentence. You preach to people who are willing to
hear it, not people whom you will end up arguing with for 75+ threads
and in the end have both walk away just pissed off at each other even
more than when they started.
 
Everyone rants on Facebook, it's nothing new. I can count 100+ New Age
posts a day too, or 100+ political posts. All I want, is to see a video
or two with a monkey in it.
 
I think you'll find that you will have a _much_ larger impact when you
observe more and talk less. When the opportunity presents itself, and
God will present it to you, that is when you give your life story and
testimony, rather than every single sentence to every single person you
ever interact with. The latter will just get you ignored rather than
sought out.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Sep 23 06:01PM

On Tue, 2014-09-23, Hongliang Wang wrote:
> printf(ERROR_01, file_name);
> exit(1);
> }
 
Why do you do that? The code would be much clearer (and easier to
translate to better C++) if it said something like:
 
/* source.c */
if (error) {
printf("Unable to open file: '%s'\n", file_name);
exit(1);
}
 
One valid reason to keep the actual text apart is if you need to
support different languages (i18n), but as I understand it there are
standard techniques for doing that if it is really needed -- if that
is what you're doing, ask specifically about that.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Paavo Helde <myfirstname@osa.pri.ee>: Sep 23 01:22PM -0500

Hongliang Wang <loudking@gmail.com> wrote in
> printf(ERROR_01, file_name);
> exit(1);
> }
 
In C++ errors should be reported via exceptions, the sooner you adapt to
this the better. Exit(1) (or 'return EXIT_FAILURE;') should reside only
in the catch handler in main().
 
When using exceptions, any error message has to be composed dynamically
in memory. In C++ there are several ways to do this type-safely and
without any buffer overflow dangers: direct string concatenation, string
streams, and also printf-style formatting utilities like boost.format.
 
About putting format strings in a separate header file - I still don't
get why these are considered useful, even in C. In simple programs it
just complicates the things, and for real i18n and such one needs much
more than that.
 
hth
Paavo
scott@slp53.sl.home (Scott Lurndal): Sep 23 08:13PM


>In C++ errors should be reported via exceptions, the sooner you adapt to
>this the better. Exit(1) (or 'return EXIT_FAILURE;') should reside only
>in the catch handler in main().
 
Frankly nonsense. Fix the error when it occurs, if possible. If not
possible to fix in place (i.e. ask for a new filename if the old one
couldn't be opened), log the message and terminate gracefully.
Ian Collins <ian-news@hotmail.com>: Sep 24 08:27AM +1200

Scott Lurndal wrote:
 
> Frankly nonsense. Fix the error when it occurs, if possible. If not
> possible to fix in place (i.e. ask for a new filename if the old one
> couldn't be opened), log the message and terminate gracefully.
 
log the message and terminate gracefully in the catch handler in main()...
 
--
Ian Collins
Ian Collins <ian-news@hotmail.com>: Sep 24 08:37AM +1200

Ian Collins wrote:
>> possible to fix in place (i.e. ask for a new filename if the old one
>> couldn't be opened), log the message and terminate gracefully.
 
> log the message and terminate gracefully in the catch handler in main()...
 
Flippancy aside, the missing file case is a good example of an
appropriate use of an exception. In one context it might be a fatal
error while in another it might not. The function opening the file
doesn't necessarily know which.
 
--
Ian Collins
Dombo <dombo@disposable.invalid>: Sep 23 10:42PM +0200

Op 23-Sep-14 22:13, Scott Lurndal schreef:
 
> Frankly nonsense. Fix the error when it occurs, if possible. If not
> possible to fix in place (i.e. ask for a new filename if the old one
> couldn't be opened), log the message and terminate gracefully.
 
I have once had to deal with library that did that, and that basically
disqualified that library for use in our application because terminating
when an error was encountered was no acceptable for that application. In
non-trivial programs the point where the error condition is detected is
usually not right place to determine how the error condition should be
handled. Instead it should be escalated to higher levels which do have
sufficient context to properly handle the error condition. It is not
surprising that most popular programming languages conceived the last 20
years or so all have support for exceptions.
Dombo <dombo@disposable.invalid>: Sep 23 10:47PM +0200

Op 23-Sep-14 15:59, Hongliang Wang schreef:
 
> Now I move to C++ but it seems that cout does not support %s thing.
 
> So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
> Thanks in advance.
 
You might consider using a library like C++ Format or Boost.Format which
support format strings like printf() but also are type safe, which
printf() is not.
Lynn McGuire <lmc@winsim.com>: Sep 23 03:54PM -0500

On 9/23/2014 8:59 AM, Hongliang Wang wrote:
 
> Now I move to C++ but it seems that cout does not support %s thing.
 
> So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
> Thanks in advance.
 
This is the way that we use to create note, warning
and error messages. By using a std::string, you can
use variable typing in your error message.
 
std:string msg = "ERROR: blah blah blah";
msg += ", number: " + asString (errorNumber);
printf ("%s", msg.c_str ());
 
Lynn
Paavo Helde <myfirstname@osa.pri.ee>: Sep 23 04:15PM -0500

scott@slp53.sl.home (Scott Lurndal) wrote in news:FvkUv.350614$8G3.201829
 
> Frankly nonsense. Fix the error when it occurs, if possible. If not
> possible to fix in place (i.e. ask for a new filename if the old one
> couldn't be opened), log the message and terminate gracefully.
 
This does not scale beyond simple command-line utilities. C++ is used for
other things, too. Do you seriously mean a web server should terminate
gracefully when somebody sends in an invalid URL?
 
OTOH, throwing an exception and terminating gracefully in main works fine
in simple command-line utilities.
 
Cheers
Paavo
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 10:24PM +0100

On 23/09/2014 21:13, Scott Lurndal wrote:
 
> Frankly nonsense. Fix the error when it occurs, if possible. If not
> possible to fix in place (i.e. ask for a new filename if the old one
> couldn't be opened), log the message and terminate gracefully.
 
What you just said is nonsense mate. Manually returning and/or
translating error codes up the call stack is an ancient way of doing
things. In C++ prefer exceptions to error codes.
 
/Flibble
Andreas Dehmel <blackhole.8.zarquon42@spamgourmet.com>: Sep 23 08:04PM +0200

On Mon, 22 Sep 2014 20:18:32 -0700
> if(defWork.recVal >= uuu)
> defVect.erase(vIter+iii);
> }
 
 
Modifying the size of a vector may invalidate all iterators pointing to
it, so of course your code has a high likelihood of crashing. Furthermore,
even if you rewrote it to use indices rather than iterators and got
the iteration logic right, that code would degrade into quadratic
complexity because a single erase in a vector is already O(N). A much
better approch is to iterate from start to finish and copy all elements
you want to keep so they'll all end up at the start, then after the
iteration truncate the vector to its new size; this is O(N) no matter
how much you erase. So basically (untested)
 
for (vIter = defVect.begin(), vDest = vIter; vIter != defVect.end(); ++vIter)
{
if (!deletePredicate(*vIter))
{
*vDest = *vIter;
++vDest;
}
}
defVect.erase(vDest, defVect.end());
 
 
Alternatively, use e.g. a list where simultaneous iteration and insertion/
deletion is legal.
 
 
 
Andreas
--
Dr. Andreas Dehmel Ceterum censeo
FLIPME(ed.enilno-t@nouqraz) Microsoft esse delendam
http://www.zarquon.homepage.t-online.de (Cato the Much Younger)
peter koch <peter.koch.larsen@gmail.com>: Sep 23 11:23AM -0700

Den tirsdag den 23. september 2014 05.19.21 UTC+2 skrev MikeCopeland:
> if(defWork.recVal >= uuu)
> defVect.erase(vIter+iii);
> }
 
I would partition the vector (look up partition/stable_partition), do a delete on the erasable items (all in the end of the vector) and finally do an erase of the last elements. Only one loop left. Probably you will not be able to get it more efficient than that.
 
/Peter
MikeCopeland <mrc2323@cox.net>: Sep 23 02:22PM -0700

In article <td532atp38u5mnkaera91abipjuquq69g6@4ax.com>,
schwarzb@dqel.com says...
 
> > "iii" is used within the for loop to point to the offset of the
item
> >been "vIter.begin()+iii". My bad... 8<{{
> > Your post helped me see that. <sigh>
 
> I assume you meant defVect.begin()+iii.
 
Yes. I posted that (error) late at night when my brain had mostly
gone to sleep. 8<{{
 
> If that is what you want to do, then Ian's post shows you how without
> bothering with the offset. Note that defVect.begin()+iii and vIter
> both point to the same element.
 
Which works just fine. Thanks both!
 
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
"Öö Tiib" <ootiib@hot.ee>: Sep 23 12:18PM -0700

On Tuesday, 23 September 2014 10:23:11 UTC+3, markus wrote:
> On Windows wchar_t, char16_t and unsigned short/uint16_t all use the
> same underlying type uint16_t. According the C++11 standard they are all
> distinct types.
 
"Windows" is series of operating systems. It does not deal with C++
fundamental types and typedefs. Did you mean some particular version
of some particular C++ compiler targeting some particular version of
Windows?
 
 
> From what I can tell, this does violate the aliasing rules. Am I
> missing something? Do GCC/Visual C++ make some special guarantees that
> this will work?
 
Casting between different unsigned integral types is one of few things
that is quite fully well defined in C++ standard. Did you mean that
non-'char' pointers are somewhere taken and type-punned and then used
in mix in Qt and Firefox source code?
Paavo Helde <myfirstname@osa.pri.ee>: Sep 23 02:21PM -0500


> From what I can tell, this does violate the aliasing rules. Am I
> missing something? Do GCC/Visual C++ make some special guarantees that
> this will work?
 
This is interesting. g++ 4.6 on Linux issues type pun warnings between 4-
byte wchar_t and uint32_t, but is silent for 2 byte wchar_t (achieved via -
fshort-wchar flag) and uint16_t. Is there indeed some special case for 16-
bit data, in addition to 8-bit?
 
Cheers
Paavo
Paavo Helde <myfirstname@osa.pri.ee>: Sep 23 01:04AM -0500

MikeCopeland <mrc2323@cox.net> wrote in
> fact upgraded my compiler...TWICE! I converted to MSVS10, and
> recently have been using MSVS13. (I trust that's a bit more "with
> it", and I hope my problems are more realistic...)
 
Good for you! You will hopefully get binary literals with MSVS15 or such!
 
Cheers
Paavo
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: