Monday, October 8, 2018

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

Paul <pepstein5@gmail.com>: Oct 08 03:07PM -0700

The below code contains a definition
std::priority_queue<int, std::vector<int>, std::greater<int> > q2;
 
and another definition
std::priority_queue<int, std::vector<int>, decltype(cmp)> q3(cmp);

I don't understand why these definitions have different forms?
I would expect either
std::priority_queue<int, std::vector<int>, std::greater<int> > q2;
std::priority_queue<int, std::vector<int>, decltype(cmp)> q3;
 
or
std::priority_queue<int, std::vector<int>, std::greater<int> > q2(std::greater<int>);
std::priority_queue<int, std::vector<int>, decltype(cmp)> q3(cmp);
 
As written, there doesn't seem to be consistent syntax between the two
definitions.
 
Thank you,
 
Paul
 
 
#include <functional>
#include <queue>
#include <vector>
#include <iostream>

template<typename T> void print_queue(T& q) {
while(!q.empty()) {
std::cout << q.top() << " ";
q.pop();
}
std::cout << '\n';
}

int main() {
std::priority_queue<int> q;

for(int n : {1,8,5,6,3,4,0,9,7,2})
q.push(n);

print_queue(q);

std::priority_queue<int, std::vector<int>, std::greater<int> > q2;

for(int n : {1,8,5,6,3,4,0,9,7,2})
q2.push(n);

print_queue(q2);

// Using lambda to compare elements.
auto cmp = [](int left, int right) { return (left ^ 1) < (right ^ 1);};
std::priority_queue<int, std::vector<int>, decltype(cmp)> q3(cmp);

for(int n : {1,8,5,6,3,4,0,9,7,2})
q3.push(n);

print_queue(q3);

}
"Öö Tiib" <ootiib@hot.ee>: Oct 08 03:23PM -0700

On Tuesday, 9 October 2018 01:07:40 UTC+3, Paul wrote:
> definitions.
 
> Thank you,
 
> Paul
 
 
The standard library is not made for your idea of symmetry and beauty but
for usefulness.
 
Default-constructed std::greater<int> does compare two ints so that
constructor argument may be omitted. Default-constructed lambda with
two int patrameters that returns bool however does not make sense,
so there you must pass actual lambda of that type to priority
queue's constructor.
 
 
 
ram@zedat.fu-berlin.de (Stefan Ram): Oct 08 07:51PM

I wrote:
 
for( i = ::operation::SUM; true; ++i )
 
where the type of »i« is
 
enum class operation { NUL, SUM, DIF, MUL, DIV };
 
. My intention is that »i« has the value of »operation::SUM«,
then »operation:DIF«, then »operation::MUL« and so on.
 
The compiler is telling me:
 
no match for 'operator++' (operand type is 'operation')
 
. So, I can't enumerate an enum? Why is it called "enum", then?
Well, what is the usual way to do this then?
ram@zedat.fu-berlin.de (Stefan Ram): Oct 08 09:36PM

>How would a possibly built in operator++ enumerate those?
 
Oh, I see. Thanks!
 
(In the meantime, the enumeration has evolved into an array
of member function pointers ...
 
::std::array a
{ &::binary::sum, &::binary::dif, &::binary::mul, &::binary::div };
 
)
Bo Persson <bop@gmb.dk>: Oct 08 11:19PM +0200

On 2018-10-08 21:51, Stefan Ram wrote:
 
> no match for 'operator++' (operand type is 'operation')
 
> . So, I can't enumerate an enum? Why is it called "enum", then?
> Well, what is the usual way to do this then?
 
The usual way is to write an operator++ overload that does what you want.
 
Note that in the general case, it is not required for the enum values to
be consecutive.
 
An enum class could also be a bitmask type, like std::filesystem::perms
 
https://en.cppreference.com/w/cpp/filesystem/perms
 
How would a possibly built in operator++ enumerate those?
 
 
Bo Persson
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Oct 08 09:19PM +0100

Flibble is back! Brought to you by GigaNews!
 
On a more serious note I have reached an agreement with GigaNews not to
violate their TOS/AUP again; it's just a shame that a certain bigoted
homophobic misogynistic egregious cunt won't stop violating the TOS/AUP of
his Usenet provider(s).
 
/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."
scott@slp53.sl.home (Scott Lurndal): Oct 08 06:06PM


>Last function contains undefined behavior by [expr.mul] "If the second
>operand of / or % is zero the behavior is undefined."
 
>Rest of the functions may compile and run flawlessly.
 
I expect them all to compile and run flawlessly on
most non-embedded processors, they don't
actually _access_ the stack, after all.
 
For example:
 
int main(){ char a[1000000000]; return 0; }
 
00000000004004f0 <main>:
4004f0: 55 push %rbp
4004f1: 48 89 e5 mov %rsp,%rbp
4004f4: 48 81 ec 88 c9 9a 3b sub $0x3b9ac988,%rsp
4004fb: b8 00 00 00 00 mov $0x0,%eax
400500: c9 leaveq
400501: c3 retq
"Öö Tiib" <ootiib@hot.ee>: Oct 08 11:29AM -0700

On Monday, 8 October 2018 21:07:14 UTC+3, Scott Lurndal wrote:
> 4004fb: b8 00 00 00 00 mov $0x0,%eax
> 400500: c9 leaveq
> 400501: c3 retq
 
Good point. Compilers can perhaps even erase that array since the as-is rule.
scott@slp53.sl.home (Scott Lurndal): Oct 08 08:16PM

>> 400500: c9 leaveq
>> 400501: c3 retq
 
>Good point. Compilers can perhaps even erase that array since the as-is rule.
 
Indeed, with -O3 gcc optimizes it away:
 
0000000000400400 <main>:
400400: 31 c0 xor %eax,%eax
400402: c3 retq
400403: 90 nop
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 02:22PM -0400

> Hi,
 
> I have agreed with GigaNews that the Hodgin parody posts will cease however I did remind GigaNews that Hodgin would himself also be in violation of their terms if he was a custom of theirs.
 
FWIW, Leigh, I thought some of your posts were creative, clever,
and funny.
 
I know you can't see Jesus as anything desirable, but if you ever
do someday, you'll look back on these posts of yours and see them
in their true light. It will give you some education and knowledge
about what the Lord went through to save you, what I went through
being a servant of His, and in how many ways you harmed very many
people by your deeds.
 
If you're like me, when you reflect on your actions, they will
bring you to tears as you remember Jesus on that cross dying for
your sin. Watching the movie The Passion of the Christ really
brings it out of you as you see Him bloodied and battered there
upon the cross.
 
I care about you, Leigh. It's the only reason I reach out to you
about Jesus, and why I teach about Him (because of who He is and
what He can do for each of us individually, and personally).
 
He's not a joke or lie. He is our creator, and He's made a way
Home for us even in the midst of our rebellion and sin.
 
--
Rick C. Hodgin
"Öö Tiib" <ootiib@hot.ee>: Oct 08 11:23AM -0700

> Hi,
 
> I have agreed with GigaNews that the Hodgin parody posts will cease however I did remind GigaNews that Hodgin would himself also be in violation of their terms if he was a custom of theirs.
 
His posts are often indistinguishable from parody. For example
that one ... I was really expecting "wasn't me" reply but it was
apparently genuine:
 
! CAlive is to be a holy and sanctified offering unto God.
! It's not arbitrarily written like other software. That would
! be easy, cheap, common.
!
! What CAlive seeks to do is have prayer during development,
! to ask God for help, to do our best in design, not taking
! shortcuts, but fully visiting every need.
!
! CAlive is also a database only. RDC is the true workhorse.
! The data in CAlive's database guides RDC in how to proceed
! through source code.
!
! Holy, God-seeking, The Father honoring, living to serve Jesus
! because their heart's on fire developers will work on CAlive.
! When it is ready, prayed over, has a solemn time of
! reflection and fasting, then it will be released.
 
So Rick is indeed holy and blessed in his mind and whatever he does
is also holy and blessed and saying that he is clearly crazy is blasphemy.
How are grapes gathered from thornbushes, or figs from thistles?
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 02:40PM -0400

On 10/8/2018 2:23 PM, Öö Tiib wrote:
> His posts are often indistinguishable from parody. For example
> that one ... I was really expecting "wasn't me" reply but it was
> apparently genuine:
 
This post you cite here was from me. It was legitimate.
 
 
> So Rick is indeed holy and blessed in his mind and whatever he does
> is also holy and blessed and saying that he is clearly crazy is blasphemy.
> How are grapes gathered from thornbushes, or figs from thistles?
 
People are not holy in and of themselves. They are made holy by
the Lord, and they are called to pursue holiness.
 
The term holy comes from a root word "qodesh" which means in
English: "set apart." It refers generally to a state of being
"apart, set-apart, separate, or sacred."
 
We are instructed in scripture to pursue holiness:
 
https://www.biblegateway.com/passage/?search=Hebrews+12%3A14&version=KJV
 
14 Follow peace with all men, and holiness, without which
no man shall see the Lord:
 
https://www.biblegateway.com/passage/?search=1+Peter+1%3A15-16&version=KJV
 
15 But as he which hath called you is holy, so be ye holy
in all manner of conversation;
16 Because it is written, Be ye holy; for I am holy.
 
The confusion and misunderstanding you have over my actions, Öö
Tiib, come from a lack of understanding over what God calls us to
in this world.
 
You look everywhere and see hypocritical Christians, people living
just like everyone else, doing things just like everyone else, not
being holy, but rather being common and like everyone else.
 
The Bible calls Christians a "peculiar people," with the root word
for peculiar there being another from of that same set apart form,
and not with negative connotations as it might seem to some.
 
We are called to serve the Lord in this world that does not serve
or honor the Lord. We are called to bring all of our labors and
works before Him so that we are walking in this world individually
as we should, as well as in the things we pursue.
 
When my family and I watch TV, we do something called "whiteboxing"
the material. This involves getting the content on DVD, transfer-
ring to a computer with DVD-to-MP4 style of converter, and then we
go in and edit the content down to remove anything that's inappro-
priate, including language, clothing, dialogue, topics, etc. It
causes us to have very few movies that we watch, very few shows we
partake of, etc. That's one reason I was so excited about ReBoot:
The Guardian Code. It's one of the best Sci-Fi shows I've ever
seen in general, but it's targeted at younger audiences and is,
therefore, largely clean. Very few scenes to whitebox there.
 
In any event, I seek to serve the Lord with the fulness and rich-
ness of my life. I make mistakes in so doing, but it is my ongoing
desire, and I am getting my ducks in a row the further along I go
in this life, though as I keep mastering more and more things the
enemy steps up with another level of attacks and knocks me down.
 
It's a very difficult life in this world to serve God. There is
an active enemy at work against you, both individually as his own
anti-Christ spirit self, but then he also induces those who are
in sin all around you at every point to be against you.
 
It is only God Himself who keeps that attack at bay, and God does
allow the attacks to come to strengthen us, and to lift us up for
a future purpose.
 
I seek to serve and honor Jesus Christ with the things in my life
because He has saved me at the cross. I was a sinner, lost in sin,
unrepentant, headed to Hell without even knowing ... but one day
He opened my eyes to the truth and revealed to me who I was, who
He is, and what it was I needed: forgiveness of sin.
 
I received that forgiveness, and my heart as been set on Him ever
since. I've tried time and time again to foil my own plans of
serving Him, but He keeps coming back for me, to rescue me from
myself, from the enemy's traps around me, from every obstacle I
have faced to date.
 
God is a good good Father, and His Son is full of compassion,
empathy, and love, enough to cover the sin of some wretch like
me.
 
I seek to honor Him directly by name with my products because
He stood up for me at the cross, and before His Father. I owe
Him everything, and I will continue to serve Him as I go through
this world.
 
--
Rick C. Hodgin
leigh.v.johnston@googlemail.com: Oct 08 12:13PM -0700

On Monday, October 8, 2018 at 7:22:20 PM UTC+1, Rick C. Hodgin wrote:
 
> > I have agreed with GigaNews that the Hodgin parody posts will cease however I did remind GigaNews that Hodgin would himself also be in violation of their terms if he was a custom of theirs.
 
> FWIW, Leigh, I thought some of your posts were creative, clever,
> and funny.
 
I couldn't care less.
 
[vomit snipped]
> your sin. Watching the movie The Passion of the Christ really
> brings it out of you as you see Him bloodied and battered there
> upon the cross.
 
Not likely mate.
 
[more sanctimonious self righteous vomit snipped]
 
It is simple mate: you are a homophobic misogynist bigot who hides behind a book. You are an egregious cunt. Your spam is not welcome here and neither are you.
 
/Leigh
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 03:36PM -0400

> It is simple mate: you are a homophobic misogynist bigot who hides behind a book.
 
I am not homophobic. I am not a misogynist. I am not a bigot.
I am very tolerant of people who hold opposing views to those I
hold. The difference is, I am unyielding in my position on the
things of the Bible because I have come to understand what it
truly means, and not just words on a page, but intent and pur-
pose behind God's plan.
 
And I do not hide behind a book. I teach the things written in
the Bible, which self-explain why they are written that way.
Charles Spurgeon wrote that the Bible is like a lion. You do
not need to defend a lion. You just turn it loose ... it will
defend itself.
 
You are hiding behind your own fears of learning the truth,
Leigh, because you know deep down that if you were to ever in-
vestigate the Bible you'd learn the truth, you'd learn that
you are wrong in your beliefs and thinking today, and you'd
learn what it means to be called onto the carpet by God.
 
I teach you these things because they're true, Leigh. If they
weren't, I wouldn't waste my time.
 
--
Rick C. Hodgin
leigh.v.johnston@googlemail.com: Oct 08 12:53PM -0700

On Monday, October 8, 2018 at 8:36:55 PM UTC+1, Rick C. Hodgin wrote:
[snip]
 
Reported as abuse to Google as hate speech.
 
/Leigh
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 04:02PM -0400

> On Monday, October 8, 2018 at 8:36:55 PM UTC+1, Rick C. Hodgin wrote:
> [snip]
 
> Reported as abuse to Google as hate speech.
 
Hate speech, Leigh?
 
https://www.merriam-webster.com/dictionary/hate%20speech
 
: speech expressing hatred of a particular group of people.
: speech that is intended to insult, offend, or intimidate
a person because of some trait (as race, religion, sexual
orientation, national origin, or disability)
 
Where, in anything I've said, is that criteria met?
 
My goals in teaching everyone about Christ is education, to
learn the state of their soul before God, and their need to
ask forgiveness from God for their sin.
 
That is not hate speech. It is life and love speech, even
eternal life and eternal love speech.
 
--
Rick C. Hodgin
leigh.v.johnston@googlemail.com: Oct 08 01:14PM -0700

On Monday, October 8, 2018 at 9:02:24 PM UTC+1, Rick C. Hodgin wrote:
> ask forgiveness from God for their sin.
 
> That is not hate speech. It is life and love speech, even
> eternal life and eternal love speech.

You have made homophobic and misogynist posts on multiple occasions.
 
Just fuck off will you you horrible little man?
 
/Leigh
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 02:08PM -0400

On 10/8/2018 1:32 PM, Jorgen Grahn wrote:
>> from someone who is not me.
 
> Done! Although if they ignore reports by the immediate victim, they
> might ignore mine, too.
 
 
Thank you, Jorgen, and everyone else who contacted GigaNews as
well. It seems there has now been movement. We'll see in time.
 
--
Rick C. Hodgin
gazelle@shell.xmission.com (Kenny McCormack): Oct 08 06:17PM

In article <ppg6fe$f31$1@dont-email.me>,
>> might ignore mine, too.
 
>Thank you, Jorgen, and everyone else who contacted GigaNews as
>well. It seems there has now been movement. We'll see in time.
 
How many days until Leigh finds a new posting host to use?
 
He could use whichever one you're using. They don't seem to care at all
what their users do.
 
--
Kenny, I'll ask you to stop using quotes of mine as taglines.
 
- Rick C Hodgin -
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Oct 08 02:26PM -0400

On 10/8/2018 2:17 PM, Kenny McCormack wrote:
> How many days until Leigh finds a new posting host to use?
 
> He could use whichever one you're using. They don't seem to care at all
> what their users do.
 
 
All of the other hosts that have come up to date where people have
impersonated me by name and email address have honored my request
to have those posts filtered out. It hasn't even been an issue.
The request was made one time and they replied effectively, "done."
This forced people like Peter Cheung to post using a different
email address at least, which then clearly differentiated his posts
from my own.
 
GigaNews was the only news provider that had not acted.
 
I don't mind if Leigh wants to post using a similar email and/or
name like "Rick C. Hoggins" or whatever other close name he can
find. But, to post using my exact identity is the thing I take
issue with. He's directly disparaging my name, and it is not only
wrong, if he lived in the U.S. it would be illegal and I would be
able to take legal action.
 
--
Rick C. Hodgin
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: