- Jesus Christ The Bastard - 5 Updates
- Breaking out of nested loops - 16 Updates
- extracting substrings from a string - 2 Updates
- PVS-Studio analyzer for embedded-developers - 1 Update
- readsome() vs. fread() - 1 Update
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Feb 28 03:26PM -0800 On 2/28/2018 2:06 PM, Rick C. Hodgin wrote: >>> and shake you back and forth screaming into your thinking: WAKE UP!! WAKE UP!! >>> WAKE UP!! >> Is that a threat? If we ever meet, please do not try to grab me. [...] |
"Öö Tiib" <ootiib@hot.ee>: Feb 28 03:32PM -0800 On Thursday, 1 March 2018 01:27:20 UTC+2, Chris M. Thomasson wrote: > >> Is that a threat? > If we ever meet, please do not try to grab me. > [...] Please, it is not nice to tease kooky people. For him he is under grace of his god and others are servants of his bizarre devils and demons. So anything you tell him just feeds his lunacy and makes him to spew more of those curses and promises of eternal hellfire and pain. It must be there are more amusing things to do. |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 01 04:07AM -0800 On Wednesday, February 28, 2018 at 6:32:51 PM UTC-5, Öö Tiib wrote: > demons. So anything you tell him just feeds his lunacy and makes > him to spew more of those curses and promises of eternal hellfire > and pain. It must be there are more amusing things to do. Öö Tiib, I do not ask you to trust ME. I'm one man. I can make mistakes, not always be all I should be, etc. I ask you to: 1) Seek the truth 2) Read/study the Bible (specifically New Testament) 3) Go and talk to other Christians, born again people in local churches in your area. Ask THEM about Jesus. Inquire personally. Find out for yourself if these things I spend so much time teaching on are really true or not. There's a whole new life and understanding out there, Öö Tiib. Check and see for yourself if that claim is true. Begin with this question: "Have I ever sinned?" When you realize the answer is "yes," then you must go and see about the rest. -- Rick C. Hodgin |
bitrex <bitrex@de.lete.earthlink.net>: Mar 01 07:51AM -0500 On 02/28/2018 10:15 AM, Rick C. Hodgin wrote: >> assembly of the LORD." -- Deuteronomy 23:2 >> Jesus Christ was himself illegitimate as his Father was not married to >> the whore Mary. <snip> Deuteronomy 23:2 refers to the "Assembly of the Lord" in the context of the social and religious orders of the Israelite nations; it refers to an (earthly) governing council that adjudicated various matters regarding the social and religious happenings in a Jewish community. It's basically saying no one of illegitimate birth could be a Pharisee; as far as I know Jesus never was one or a member of any Hebrew religious governing council so not entirely sure how the passage is relevant. The Old Testament has a lot of verses regarding the laws and customs of men that have little to do with "spiritual issues." <snip> |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 01 05:10AM -0800 On Thursday, March 1, 2018 at 7:51:51 AM UTC-5, bitrex wrote: > > by forces bent on hiding what it teaches, and for a very good reason ... because > > it is the word of God and it speaks the truth. Those forces do not want people > > to know the truth because the truth WILL set them free: Indeed. In all of our seeking we are to gain a true understanding. The Bible teaches us to seek earnestly, and in all our seeking get a true and right understanding in wisdom: https://www.biblegateway.com/passage/?search=Proverbs+4%3A5-9&version=KJV 5 Get wisdom, get understanding: forget it not; neither decline from the words of my mouth. 6 Forsake her not, and she shall preserve thee: love her, and she shall keep thee. 7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding. 8 Exalt her, and she shall promote thee: she shall bring thee to honour, when thou dost embrace her. 9 She shall give to thine head an ornament of grace: a crown of glory shall she deliver to thee. There are many who think they know what the Bible teaches on sin, judgment, condemnation, damnation, who Jesus is, and are able to, therefore, conclude things other than that which the Bible teaches. Those "thinkings" about the Bible do not always align with the teachings of the Bible. As such, each of us is called to seek the truth and get a true and right understanding. I point everyone to: 1) Seek the truth 2) Read/study the Bible (especially the New Testament, as we are now living post-Pentecost, post-Jesus-on-the-cross, and this current age is different than that given to the Jews in the Old Testament) 3) Go and talk to other Christians, born again people in your local churches, those there in your area. Be sure to ask for "born again" Christians. And TEST THEM! Satan is very deceptive, cunning, clever, and he can fool people with ease. Say a little prayer before you go as well asking, "Lord, I don't know for sure if you're real or not, but if you are I want to know the truth, and if you are then I ask you to lead me to the truth and protect me from falseness." If you are a true truth-seeker, God will hear your prayer and lead you in ways that you will later recount with your mouth hanging open in amazement. God is greater than the enemy of this world who is at work against us all. God is able to subdue that enemy in our lives, and give us space and occasion to come to know Jesus as Savior and Lord. It is the culmination of that which Jesus did at the cross at work in each of our lives. Jesus Himself did the hard part on the cross, and now He stands at the door of each of our minds and He knocks. He wants to come in and sup with us, as we also sup with Him. He wants to be a part of our lives, and for everyone who takes the slightest step in His direction, He's there to guide and move and direct us to the rest. Consider these things. Do not discount them summarily. Think on them. Do it when you are alone, in silence, no distractions ... just you and your thoughts there in the quiet peace. Seek to know if God is real from that place. Satan likes to keep you distracted, so if you don't usually have "quiet time" like that, then make some. Take a purposeful moment and turn off all the noises, go into your quiet space, go to that place where you can be alone for a few moments and ask yourself these questions in your heart. Ask if you 1) Really do have sin? 2) Really do need Jesus? 3) God will answer you with a still small voice in your heart, and it will be notably different from other voices you have heard. Hunger is a certain type of voice. A thought entering into your mind is another kind of voice. A pain in your shoulder is another kind of voice, etc. But the voice of the Lord carries with it a distinctness that you will implicitly know ... because He made you, and put that natural ability to know within you. Seek the truth. Inquire earnestly. Do not relent until you have it in your sights and are approaching it. Do this, and God will do the rest. I love each of you ... and I teach you the truth. Go and see if I am truly teaching you the truth or not. Do not assume. Know. -- Rick C. Hodgin |
JiiPee <no@notvalid.com>: Mar 01 12:55AM |for(inti =0;i <m;i++){for(intj =0;j <n;j++){if(some condition){// Do something and break...gotoafterLoop;// Breaks out of both loops}}}afterLoop: I googled and this seems to be manys preferably way. I have this often. How would you break nested loops? Somebody said Substroup said this is ok. | |
JiiPee <no@notvalid.com>: Mar 01 12:57AM Sorry first message was a mess, so reposting it: for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (some condition) { // Do something and break... goto afterLoop; // Breaks out of both loops } } } afterLoop: I googled and this seems to be manys preferably way. I have this often. How would you break nested loops? Somebody said Substroup said this is ok. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 01 02:08AM +0100 On 01.03.2018 01:57, JiiPee wrote: > afterLoop: > I googled and this seems to be manys preferably way. I have this often. > How would you break nested loops? Somebody said Substroup said this is ok. `return` is nice. `throw` can also do the job but would be both counter-idiomatic (contra-idiomatic? what?) and inefficient. void foo() { for( int i = 0; i < m; ++i ) for( int j = 0; j < n; ++j ) { if( some_condition ) { return; } } } void bar() { preamble(); foo(); more_stuff(); } Cheers!, - Alf |
JiiPee <no@notvalid.com>: Mar 01 01:12AM On 01/03/2018 01:08, Alf P. Steinbach wrote: > foo(); > more_stuff(); > } Ok, so you move the for loop into its own function. And I see some use lambdas. But then if you are using a lot of variables in that loop you would need to pass them. Lets say it uses 10 variables... wouldnt it be a bit difficult to pass all 10 parameters into this function? Also the for loop now is not in the place where the action is... isnt it better the loop is there where it should be? How about lambda? |
Ian Collins <ian-news@hotmail.com>: Mar 01 02:21PM +1300 On 03/01/2018 02:12 PM, JiiPee wrote: >> foo(); >> more_stuff(); >> } Posting a mess again.... > Ok, so you move the for loop into its own function. And I see some use > lambdas. Where? > But then if you are using a lot of variables in that loop you > would need to pass them. Lets say it uses 10 variables... wouldnt it be > a bit difficult to pass all 10 parameters into this function? Encapsulate the functions an variables in an object. > Also the > for loop now is not in the place where the action is... isnt it better > the loop is there where it should be? Where's that? > How about lambda? ? -- Ian. |
JiiPee <no@notvalid.com>: Mar 01 01:52AM On 01/03/2018 01:21, Ian Collins wrote: >> for loop now is not in the place where the action is... isnt it better >> the loop is there where it should be? > Where's that? like: // some code // for-loops // more code now its a bit beneficial if the for loop action can be seen in the section "// for-loops". If that is replaced by a function then you cannot see what the for loop is doing unless you scroll and find that for loop function. |
Christiano <christiano@engineer.com>: Feb 28 11:00PM -0300 On 02/28/2018 21:57, JiiPee wrote: > afterLoop: > I googled and this seems to be manys preferably way. I have this often. > How would you break nested loops? Somebody said Substroup said this is ok. I thought of something like: for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (some condition) { // Do something and break... i=m; break; } } } But that does not seem like an elegant solution. Alf's solution unfortunately puts it in another function. |
JiiPee <no@notvalid.com>: Mar 01 02:10AM On 01/03/2018 02:00, Christiano wrote: > } > But that does not seem like an elegant solution. Alf's solution > unfortunately puts it in another function. ok but what if you have 4 loops nested? Then would become a bit difficult to set those indexes. |
Christiano <christiano@engineer.com>: Feb 28 11:21PM -0300 On 02/28/2018 23:10, JiiPee wrote: >> unfortunately puts it in another function. > ok but what if you have 4 loops nested? Then would become a bit > difficult to set those indexes. Yes.. you would have to assign (n-1) times (i, j, k, ...) before the break statement, where n is the number of loops. And the solution with goto seems very simple. |
Bo Persson <bop@gmb.dk>: Mar 01 03:35AM +0100 On 2018-03-01 03:10, JiiPee wrote: >> unfortunately puts it in another function. > ok but what if you have 4 loops nested? Then would become a bit > difficult to set those indexes. Come on now! If you have 4 nested loops using 10 different variables, how are we going to know their values after the goto? Using a goto will be the smaller problem and refactoring this into several functions seems like an even better solution than for a smaller loop. Bo Persson |
Ian Collins <ian-news@hotmail.com>: Mar 01 03:36PM +1300 On 03/01/2018 02:52 PM, JiiPee wrote: > section "// for-loops". If that is replaced by a function then you > cannot see what the for loop is doing unless you scroll and find that > for loop function. If you give the function a sensible name, it won't matter. -- Ian. |
woodbrian77@gmail.com: Feb 28 07:22PM -0800 On Wednesday, February 28, 2018 at 7:08:47 PM UTC-6, Alf P. Steinbach wrote: > `return` is nice. > `throw` can also do the job but would be both counter-idiomatic > (contra-idiomatic? what?) and inefficient. Merriam-Webster has this: Synonyms of idiomatic individual, individualized, particular, patented, peculiar, personal, personalized, private, privy, separate, singular, subjective, unique ------------------------------------------------- It would be dubious to use a throw in that case. Brian Ebenezer Enterprises - In G-d we trust. http://webEbenezer.net |
Jorgen Grahn <grahn+nntp@snipabacken.se>: Mar 01 06:44AM On Thu, 2018-03-01, JiiPee wrote: ... > ok but what if you have 4 loops nested? Then would become a bit > difficult to set those indexes. Four nested loops, a need to break from the inner one, 10 variables involved ... I think you're making the mistake of inventing the worst possible case, and then looking for a general solution for everything. I'd look for a solution in a concrete real-life case instead. And I cannot even remember last time I had to solve this. My gut feeling is that splitting out a helper function was the right, readable solution that time. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
"Öö Tiib" <ootiib@hot.ee>: Feb 28 10:49PM -0800 On Thursday, 1 March 2018 04:11:04 UTC+2, JiiPee wrote: > > unfortunately puts it in another function. > ok but what if you have 4 loops nested? Then would become a bit > difficult to set those indexes. Note that algorithm with 4 loops nested has O(m*n*o*p) time complexity. If these loop over anything of significance then such brute force loop may take literally ages and so setting indexes is likely smallest of difficulties with it. Actual difficulty is usually that one should start to think at that spot. |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Mar 01 10:38AM On Wed, 28 Feb 2018 19:22:29 -0800 (PST) > personalized, private, privy, separate, singular, subjective, unique > ------------------------------------------------- > It would be dubious to use a throw in that case. In case Alf gets confused by your posting, you need to get a better dictionary since that is not the meaning of the word in English. In this context it means something characteristic of or appropriate to a particular field of endeavour. "Idiomatic English" is english as spoken colloquially by a native speaker. In this case "counter-idiomatic" means an approach to the use of exceptions which is not commonly adopted by those experienced in writing C++ programs. Which was his intended meaning. It would not be "dubious" at all to throw exceptions in cases where it is idiomatic to do so. You might want to think twice where it is counter-idiomatic however. (I put "dubious" in quotes because that is a counter-idiomatic use of the word in English.) |
guy.tristram@gmail.com: Mar 01 03:09AM -0800 On Thursday, March 1, 2018 at 1:21:47 AM UTC, Ian Collins wrote: > On 03/01/2018 02:12 PM, JiiPee wrote: [snip] > > Ok, so you move the for loop into its own function. And I see some use > > lambdas. > Where? something like: [&](){ for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (condition) return; } } }(); |
Christiano <christiano@engineer.com>: Feb 28 10:49PM -0300 On 02/28/2018 16:28, Paavo Helde wrote: >> standard C++ (11+ allowed) or boost (C++ standard preferred) >> Idealy would be to have only a single pass through the string. > Take a look at <regex>: http://en.cppreference.com/w/cpp/regex I would use regex as well. |
Ralf Goertz <me@myprovider.invalid>: Mar 01 10:05AM +0100 Am Wed, 28 Feb 2018 21:37:57 +0000 (UTC) > too complicated. The regex is going to look really ugly considering > all the optional parts. >> protocol://[username:password@]host[:port]/db Hm, ugliness is in the eye of the beholder [quick & dirty]: #include <iostream> #include <regex> #include <string> using namespace std; int main() { string test[]= {"http://testhost.dom/rest", "http://user@testhost.dom/rest", "http://user@testhost.dom:1234/rest", "http://user:passwd@testhost.dom:4353/rest", "http://user:passwd@testhost.dom/rest"}; string url_string("([^:]+)://((([^:@]+)(:([^@]+))?@))?([^:/]+)(:([0-9]+))?/(.+)"); regex url(url_string); cout<<"The regex "<<url_string<<endl<<endl; for (auto &s:test) { smatch sm; auto matches=regex_match(s,sm,url); if (!matches) { cout<<"doesn't match "<<s<<endl; } else { cout<<"matches "<<s<<endl; cout<<"Protokoll: "<<sm[1]<<endl; cout<<"User: "<<sm[4]<<endl; cout<<"Password: "<<sm[6]<<endl; cout<<"Host: "<<sm[7]<<endl; cout<<"Port: "<<sm[9]<<endl; cout<<"File: "<<sm[10]<<endl<<endl; } } } Of course, care must be taken if user and/or password contain one of the special characters. |
Andrey Karpov <karpov2007@gmail.com>: Mar 01 12:25AM -0800 PVS-Studio is a static code analyzer that detects errors and potential vulnerabilities in programs written in C, C++, and C#. In the new version of the PVS-Studio analyzer 6.22 our team finalized the infrastructure for checking the embedded projects of the following type: 1. Support of ARM Compiler 5 and ARM Compiler 6 was introduced as a part of the environment Keil uVision 5. 2. Support of ARM 5 and ARM 6 compilers was introduced as a part of the environment Keil DS-MDK. 3. And also IAR C/C++ Compiler for ARM as a part of the environment IAR Embedded Workbench. You can download the demo version of PVS-Studio here: https://www.viva64.com/en/pvs-studio-download-linux/ We understand that many projects for embedded systems are small and it will prove to be impractical to buy a license. That's why, we provide the option of free license, details of which can be found in the article "How to use PVS-Studio for Free" - https://www.viva64.com/en/b/0457/ . The great advantage of our free license option is the ability to use it not only in open, but also in closed projects. |
woodbrian77@gmail.com: Feb 28 08:01PM -0800 On Wednesday, February 28, 2018 at 5:36:51 AM UTC-6, Jorgen Grahn wrote: > again. The documentation in Stroustrup's book isn't enough, not for > me anyway. > ISTR that James Kanze had a web page on the subject. That sounds right. Yawn. Brian Ebenezer Enterprises - Enjoying programming again. 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:
Post a Comment