- Conservative employees "don't feel safe" - 10 Updates
- Signed unsigned mismatch? - 9 Updates
- On the semantics of a range based for loop, and the violation thereof - 1 Update
- int8_t and char - 1 Update
- On the semantics of a range based for loop, and the violation thereof - 1 Update
- "My CppCon 2018 talk title and abstract" 2018-09-14 by Herb Sutter - 2 Updates
- wxWidgets argh - 1 Update
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 18 04:56PM -0700 On 9/18/2018 3:07 PM, Rick C. Hodgin wrote: >>> No. >> Are you attracted to programming? I am. > David was talking about physical attractions between people. Can all of ones great and good works be totally flushed down the proverbial toilet if they do not adhere to the laws of physical attraction? > And to answer your questions: some days less than others. :-) I know what you mean. :^) |
David Brown <david.brown@hesbynett.no>: Sep 18 10:01PM +0200 On 18/09/18 17:13, Rick C. Hodgin wrote: > word, to not take my word for it. I ask you to go and read it > and examine what it says for yourself to see if what I say is > true. In fact, I insist on it. And yet you tell us again and again that only /your/ interpretations of the Bible are the "right" ones. And you tell us again and again that we should read the Bible until we agree with /your/ interpretations - or apparently we are not reading it properly. Despite your hypocritical denials, you /do/ demand that people trust your ideas and your ideas alone. >> Death is vital to what makes us human. > Death is the result of sin only. No, it is the way of nature. >> Without it, life is pointless. > From the enemy's own mouth. No, from mine. > 6,000 years from creation until now, and that Jesus is returning > to begin his millennial reign of 1,000 years. Equating those 6K > years to six days, and 1K years to one day, we see the pattern. That's fine - except it is fairy tales augmented by totally unsubstantiated fantasy. > But that is not the end of existence. > We are told that after the end of the 7,000 years (the 7th day), > then all judgment for all of mankind for all time will take place. You are not told anything of the sort - not even in the Bible. You invent stuff, or listen to drivel on videos invented by others. |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 04:17PM -0400 On 9/18/2018 4:01 PM, David Brown wrote: >> then all judgment for all of mankind for all time will take place. > You are not told anything of the sort - not even in the Bible. You invent > stuff, or listen to drivel on videos invented by others. Revelation 20: https://www.biblegateway.com/passage/?search=Revelation+20&version=KJV 1 And I saw an angel come down from heaven, having the key of the bottomless pit and a great chain in his hand. 2 And he laid hold on the dragon, that old serpent, which is ==> the Devil, and Satan, and bound him /a thousand years/, 3 And cast him into the bottomless pit, and shut him up, and ==> set a seal upon him, that he should deceive the nations no more, /till the thousand years should be fulfilled/: and after that he must be loosed a little season. 4 And I saw thrones, and they sat upon them, and judgment was given unto them: and I saw the souls of them that were beheaded for the witness of Jesus, and for the word of God, and which had not worshipped the beast, neither his image, neither had received his mark upon their foreheads, or in their hands; and they lived and reigned with Christ a thousand years. ==> 5 But the rest of the dead lived not again until the thousand years were finished. This is the first resurrection. There are two deaths, one of the Earth in the body, but one greater in eternal Hellfire for your soul. There are also two births, one on Earth in the body, but one greater in eternity with your spirit. It has been said: be born once, die twice; be born twice, die once. 6 Blessed and holy is he that hath part in the first resurrection: on such the second death hath no power, but they shall be ==> priests of God and of Christ, and shall reign with him a thousand years. ==> 7 And when the thousand years are expired, Satan shall be loosed out of his prison, 8 And shall go out to deceive the nations which are in the our quarters of the earth, Gog, and Magog, to gather them together to battle: the number of whom is as the sand of the sea. 9 And they went up on the breadth of the earth, and compassed the camp of the saints about, and the beloved city: and fire came down from God out of heaven, and devoured them. 10 And the devil that deceived them was cast into the lake of fire and brimstone, where the beast and the false prophet are, and shall be tormented day and night for ever and ever. The Great White Throne judgment: ==>11 And I saw a great white throne, and him that sat on it, from whose face the earth and the heaven fled away; and there was found no place for them. 12 And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works. 13 And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works. ==>14 And death and hell were cast into the lake of fire. This is the second death. ==>15 And whosoever was not found written in the book of life was cast into the lake of fire. That's you today, David. That's all people who did not have their sin taken away by Jesus Christ. Such a day is only a heartbeat away for each of us, because the Bible says that when we die we essentially go to sleep. Those who died at the time of Christ have been asleep and will wake up the same as the one who died yesterday, or who will die up until the time of the end. For each of them, they close their eyes in this world and go to sleep and wake up not knowing how much time has past. Some will awaken to everlasting life. Some to eternal damnation. In this age we live in, it depends entirely upon what you did with Jesus Christ. You either die with your sin charged to you and you are found guilty. Or you die having asked Jesus to forgive you, so that when He died He died with your sin charged to Him, and you do not die, are not judged, but are alive and will be with God in Heaven forever. This is the born again nature, the spirit new nature of the person who is forgiven by Christ. It is the new life given to those who are redeemed, a type of earnest given for when the full payment is brought to bear on that great and final day after the upcoming 1,000 year reign of Christ comes, save those who enter in to the 1,000 year reign alive as the priests spoken of in verse 6. ----- The forgiveness of sin (or judgment for sin) is dramatized here beginning at 23:33: https://www.youtube.com/watch?v=es7w8G6Q5oc&t=23m33s David, you've said before you don't watch videos. If you do have working eyes, please watch this video and see how our sin is charged against us, or taken from us by Jesus when we ask Him to forgive us. -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 10:23PM -0400 On 9/18/2018 7:56 PM, Chris M. Thomasson wrote: >> David was talking about physical attractions between people. > Can all of ones great and good works be totally flushed down the proverbial > toilet if they do not adhere to the laws of physical attraction? I don't understand your question. >> And to answer your questions: some days less than others. :-) > I know what you mean. :^) My favorite day programming was in 2015. I was online with three developers working on my Visual FreePro, Jr. project. One was in Italy, one in Columbia, and me in USA. We were chatting online, and using something like TeamViewer to communicate with each other when we had issues. I've never felt to interconnected with the whole world before or since. -- Rick C. Hodgin |
Ian Collins <ian-news@hotmail.com>: Sep 19 09:06AM +1200 On 19/09/18 00:38, Rick C. Hodgin wrote: >> and all sorts of >> attractions. > No. There are some things God prohibits us from doing. Here's a challenge for you: Cite a peer reviewed case study of a gay person being "cured" from a recognised journal. No dogma. -- Ian. |
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 18 07:48PM -0700 On 9/18/2018 7:23 PM, Rick C. Hodgin wrote: >> proverbial toilet if they do not adhere to the laws of physical >> attraction? > I don't understand your question. What happens to all of the good works of a gay person after they pass away? Do they all get flushed down the toilet? > when we had issues. > I've never felt to interconnected with the whole world before or > since. Nice. :^) |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 05:27PM -0400 On 9/18/2018 5:06 PM, Ian Collins wrote: > Here's a challenge for you: > Cite a peer reviewed case study of a gay person being "cured" from a > recognised journal. No dogma. This is a classic tool of the enemy, Ian. It's a tool designed to give the individual a way of convincing themselves they've approached the subject with an open mind, but weren't given a satisfactory ex- planation, and therefore they are justified in their mind for fully rejecting the underlying teaching. The truth doesn't work like that. The truth exists as it is, and it must be you who gets up to move to where the truth is, rather than demanding that the truth come to you on your terms. To be part of this world's system, you have to follow the world. Only those who are in pursuit of that worldly system will be brought forward to the limelight. They are the "good ole boys" who "tow the party line" that are brought forward. Those who speak elsewhere or otherwise are not allowed to step forward because the things they speak about are not part of that system. If you are willing to look beyond your "recognized journal" self- imposed limitation, then you can read the experiences people have on their own testimonies: Jesus Christ Saved Me from 27 Years of Homosexuality: https://www.youtube.com/watch?v=aqdQ6_MAH2A Homosexuality as My Identity: https://www.youtube.com/watch?v=K8a5I0yv0Dw From "Christian" to Lesbian to Born Again: https://www.youtube.com/watch?v=KIthbn43x5M Powerful Testimony of Ex Lesbian: https://www.youtube.com/watch?v=TbFt-xAitAg A Journey from a Homosexual Lifestyle to Christ: https://answersingenesis.org/family/homosexuality/journey-from-homosexual-lifestyle-to-christ/ The Bible serves as a light to shine into the darkness of sin. It reveals all sin, not just homosexuality, but it pierces each of us to our core. None of us are immune from sin's effects because there is a powerful enemy of God at work in this world against us. But God is greater, and if we will look toward Him with the smallest inkling of sincerity, He is there to draw us the rest of the way in. It's the parable of the Prodigal Son at work in us once we realize our sin, and that's what the Bible does ... it shows us where we do fail, and it shows us how to be rescued out of our failure: Prodigal Son Parable (see verses 18, 20-24 specifically): https://www.biblegateway.com/passage/?search=Luke+15%3A11-32&version=KJV -- Rick C. Hodgin |
Ian Collins <ian-news@hotmail.com>: Sep 19 09:32AM +1200 On 19/09/18 09:27, Rick C. Hodgin wrote: >> Cite a peer reviewed case study of a gay person being "cured" from a >> recognised journal. No dogma. > This is a classic tool of the enemy, Ian. I said no dogma. People can make whatever unsubstantiated claims they like. -- Ian. |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 11:01PM -0400 On 9/18/2018 10:48 PM, Chris M. Thomasson wrote: >> I don't understand your question. > What happens to all of the good works of a gay person after they pass away? > Do they all get flushed down the toilet? Their impact remains here in the world and God can use their acts and actions for His purposes, but the individual's soul is lost, and none of the works they did on the Earth translate to anything in Heaven. Sin is a binary state. There is only one punishment for sin. It's why it's so crucial for all of us to ask forgiveness, because all of us have sin. Heaven will be filled with full-on sinners who repented and asked Jesus to forgive their sin. Hell will be filled with full-on sinners who did not repent, and who did not ask Jesus to forgive their sin. -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 05:55PM -0400 On 9/18/2018 5:32 PM, Ian Collins wrote: >>> recognised journal. No dogma. >> This is a classic tool of the enemy, Ian. > I said no dogma. People can make whatever unsubstantiated claims they like. I told you: "tool of the enemy" You're falling for his trap: "Come to me on my terms, or I'm outta here, sucka!" That's not how a true pursuit of the truth works. A true pursuit of the truth requires moving from where you are to where truth is. Until you do that, you'll remain deceived. -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 02:48PM -0400 > ... >> Interesting. FWIW, I think the C committee got it wrong. > What a surprise. Wow. Really? Seriously, James ... don't you think they got it wrong too? It seems the UNIX folk thought it was a mistake, as they already had invested code and developer time in the other direction. Of all the places they cater to for the sake of "novice developers?" What kind of place is serious C code for a novice developer? You have to work your way up pretty steadily in ability to be a serious C developer. And I think the promotion of an unsigned type to a larger un- signed type is only natural. I think promoting an un- signed type to a signed type is crazy. It was surely originally set to be unsigned for a reason. I don't even see a good argument for C's logic, other than that's the way some people were doing it. But I think the far better solution would've been to tell them, "Sorry, Charlie." -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 03:09PM -0400 On 9/18/2018 11:18 AM, Rick C. Hodgin wrote: > unsigned char b = 2; > unsigned char c = 2; > uint32_t d = 5; Given that unsigned char translates to an 8-bit unsigned integer, and uint32_t translates to a 32-bit unsigned int- eger, what makes sense to me is this operation: > if (a + b + c > d) Natural order of operation: 01: t1 = a + b 02: t2 = t1 + c 03: t3 = t2 > d Order of operations with promotions injected (u8, u16, u32 = 8-bit, 16-bit, 32-bit unsigned int): // a, b, c all begin as u8 01: t1 = promote a to u16 02: t2 = promote b to u16 03: t3 = t1 + t2 as u16, tagged as a promoted result 04: t4 = promote c to u16 05: t5 = t3 + t4 as u16, tagged as a promoted result 06: t6 = promote t5 to u32 07: t7 = t6 > d as u32 Note: Many of these promotions are done in assembly at the register level, but the operations still remain there as logical step-by-step ops. Optimization logic will factor in here and revise the ops for its needs, such as promoting to u32 rather than u16 as that would be a natural machine word size, etc. Is that not logical? What am I missing? Where would it make more sense to promote a u8 to an s16 or s32 (signed 16-bit or signed 32-bit)? -- Rick C. Hodgin |
Anton Shepelev <anton.txt@gmail.com>: Sep 18 10:41PM +0300 Rick C. Hodgin: > https://godbolt.org > MSVC: > warning C4018: '>': signed/unsigned mismatch Let me impersonate a C guru and quote the standard: If an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int. -- () ascii ribbon campaign -- against html e-mail /\ http://preview.tinyurl.com/qcy6mjc [archived] |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 03:45PM -0400 On 9/18/2018 3:41 PM, Anton Shepelev wrote: > If an int can represent all values of the original type, > the value is converted to an int; otherwise, it is > converted to an unsigned int. What is the logic behind that? You've moved from unsigned to signed for no reason other than it will fit in the positive portion of the signed's range. It was originally unsigned for a reason. Why migrate it to signed without a cast? I honestly consider this a fundamental flaw in C (and C++). -- Rick C. Hodgin |
Anton Shepelev <anton.txt@gmail.com>: Sep 18 10:54PM +0300 Rick C. Hodgin to Anton Shepelev: > > type, the value is converted to an int; otherwise, it > > is converted to an unsigned int. > What is the logic behind that? Would that I knew. > You've moved from unsigned to signed for no reason other > than it will fit in the positive portion of the signed's > range. Indeed. > It was originally unsigned for a reason. Why migrate it > to signed without a cast? Because of the general approach of automatic promotions to simplify and/or unify some things, which complicates and confuses other things. > I honestly consider this a fundamental flaw in C (and > C++). So do I. -- () ascii ribbon campaign -- against html e-mail /\ http://preview.tinyurl.com/qcy6mjc [archived] |
David Brown <david.brown@hesbynett.no>: Sep 18 10:23PM +0200 > ... >> Interesting. FWIW, I think the C committee got it wrong. > What a surprise. I also think it would have been better to preserve signedness for promotion (or even to forgo the concept of promotion altogether). But there were good reasons for either choice, and the decision the committee took is better than no decision. It's not hard to put in a little cast on the few occasions it is needed. |
scott@slp53.sl.home (Scott Lurndal): Sep 18 08:36PM >What is the logic behind that? You've moved from unsigned to >signed for no reason other than it will fit in the positive >portion of the signed's range. James posted the logic (extract from the standard) for you to read, but while you replied to the article, you apparently didn't read it, or you're just trolling again. |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 18 05:29PM -0400 >> James posted the logic (extract from the standard) for you > Actually, I extracted it from the Rationale, not the standard. > The standard is primarily concerned with telling you "what"; the Rationale is intended to tell you "why" - but apparently Rich is still unclear what the reason is, after having read a description of the reason. I can understand disagreeing with the reason, but he shouldn't still be ignorant of what that reason was. I'm not ignorant of what the reason is. I just can't believe that was the decision they made. And I stated I disagree with it. I was surprised by your reply to me, James. I think any person would think the C committee got it wrong (especially in hindsight). -- Rick C. Hodgin |
Bart <bc@freeuk.com>: Sep 18 10:49PM +0100 > The unsigned preserving approach calls for promoting the two > smaller unsigned types to unsigned int. This is a simple rule, > and yields a type which is independent of execution environment. Why wouldn't this also be value preserving? No sign change occurs, and no narrowing. > questionably signed result, whereas the value preserving rules > minimize such confrontations. Thus, the value preserving rules > were considered to be safer for the novice, or unwary, What about the decision to use unsigned for mixed-sign arithmetic (eg. signed * unsigned)? It seems to me this would give rise to more questionable behaviour than that other way. For example, the signed value only needs to be -1, a very common value, for unexpected results to happen. Using signed for mixed-sign arithmetic, things would only start to get funny when the unsigned value was greater than 2147483647 (for 32 bits, and even higher for 64 bits). Somewhat less common that tiny negative numbers. > programmer. After much discussion, the C89 Committee decided in > favor of value preserving rules, despite the fact that the UNIX > C compilers had evolved in the direction of unsigned preserving. Since the affects can be subtle, and may not be seen at all if the results are interpreted in certain ways, it is easy to forget about these rules and to assume C works consistently. And when you find it doesn't, there isn't anything wrong with objecting to that and suggesting C might have got it wrong. So unsigned 16+16 bits is signed, but unsigned 32+32 is unsigned. When int is 32 bits, with probably different results on a different size of int. These are not even of mixed sign. (See chart I posted in clc.) -- bart |
ram@zedat.fu-berlin.de (Stefan Ram): Sep 19 02:45AM >But is that too strange? Having a range-based for loop that mutates the >state of the reader and only allows one go around? Seems to be an Input_iterator. |[An Input_iterator ]is an iterator that we can use only once |to traverse a sequence (forward using ++), reading each |element once only. -- Bjarne Stroustrup For example, an istreambuf_iterator or a directory_iterator is an Input_iterator. Python's iterators can have the same property: main.py list = [ 'a', 'b', 'c' ] reader = iter( list ) print( "0" ) for read in reader: print( ' ', read ) print( "1" ) for read in reader: print( ' ', read ) print( "2" ) transcript 0 a b c 1 2 |
David Brown <david.brown@hesbynett.no>: Sep 18 10:13PM +0200 On 18/09/18 16:34, Ralf Goertz wrote: > second column in <https://en.cppreference.com/w/cpp/types/integer> > always state "typedef". So they must be equal to an existing type like > char, must they not? But how can they then be extended? They can be a typedef to an extended integer type. C compilers are allowed to have additional integer types beyond the main ones (char, short, int long, long long). On at least one platform I know (gcc for the 8-bit AVR), these types are typedef'ed to "int" with gcc extensions giving specific sizes. I don't actually know what different, if any, this makes. (James has given a more detailed and complete answer to your questions.) >> This is an oddity that C++ inherited from C, and unfortunately you are >> stuck with it. > But the C-types could also have been made extended, right? Yes. >> assuming 32-bit int. They are closer than int8_t and uint8_t, but not >> identical. > In what way (other than range of course)? The 16-bit types promote to 32-bit "int" before doing calculations. This can have odd effects. Amongst other things, it means that some operations could have undefined behaviour because they overflow "int", even though you are starting off with "uint16_t" types. > Yes. But I was under the impression that the C++11 standard had done > that for me. And now I wonder why it hadn't. Much ado about (almost) > nothing imho. C++11 has a huge amount in it, and turned C++ into almost a different language from C++03. But the sized integer types are not any different from those in C (and I thought they were part of C++03 as well?). The sized types in <stdint.h> are very, very useful in a range of circumstances. But you have to understand what they are and how they work. |
Daniel <danielaparker@gmail.com>: Sep 18 06:51PM -0700 I have a JSON pull parser, re https://github.com/danielaparker/jsoncons, which sports a GOF style interface, an example being std::string s = std::string s = R"(["one",2,"three"])"; std::istringstream is(s); json_event_reader event_reader(is); for (; event_reader.has_next(); event_reader.next()) { const auto& event = event_reader.current(); switch (event.event_type()) { case json_event_type::string_value: std::cout << event.as<std::string>() << " "; break; case json_event_type::int64_value: case json_event_type::uint64_value: std::cout << event.as<std::string>() << " "; break; } } Output: one 2 three I've thought about adding functions to the reader iterator begin(); iterator end(); where type iterator is an InputIterator which invokes has_next(), next() and current() on the reader, just to be able to write for (const auto& event : event_reader) { switch (event.event_type()) { case json_event_type::string_value: std::cout << event.as<std::string>() << " "; break; case json_event_type::int64_value: case json_event_type::uint64_value: std::cout << event.as<std::string>() << " "; break; } } But is that too strange? Having a range-based for loop that mutates the state of the reader and only allows one go around? Thanks, Daniel |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Sep 19 01:56AM +0200 On 18.09.2018 15:31, Paavo Helde wrote: >> needed it. > Let me guess, this means you have never written a conversion operator > for a class and do not understand why somebody would need one. I'm with "Boltar" on that one. In its day the safe bool idiom was someone's convoluted and intricate way to have a not-so-unsafe implicit conversion to bool so as to be able to write terse but unclear code, e.g. `if( stream )` instead of the more verbose but more clear `if( not stream.in_fail_mode() )`. `explicit` is not the answer. Besides it's a bit of a misnomer, an implicitly invoked `explicit` conversion. Naming it is much better. Cheers!, - Alf |
David Brown <david.brown@hesbynett.no>: Sep 18 10:03PM +0200 >> Polymorphism - function overloading - works on structural typing. >> Concepts work on features. There is a /vast/ difference. > For your example its same end result. You'll need a better one to convince me. I would never be able to convince you - you have already decided that you don't like C++, and in particular you don't like the newer features that you don't understand. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Sep 19 02:05AM +0200 wxTextCtrl(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr) { Init(); Create(parent, id, value, pos, size, style, validator, name); } `Init` is that thing that Bjarne argued at length against in his exception-safety-in-the-standard-library appendix to TCPPL 3, if I recall correctly. The `Create` function returns a boolean, it doesn't throw. The constructor doesn't check the result. And it so happens that even a Microsoft Windows 10 edit control by default is limited to 32K text, so that creation fails with more than that meager amount of text, so that the wxWidgets control silently creates with an invalid state, which some other part of wxWidgets detects LATER ON. :( Cheers!, - Alf |
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:
Post a Comment