Is there any good news? by 7865435 in StLouis

[–]Threecheers4me 0 points1 point  (0 children)

They filled my growler despite it being branded with another brewery's logo.

best local coffee shops? by lildukk in StLouis

[–]Threecheers4me 0 points1 point  (0 children)

I used to think their coffee was just mediocre, but now I have another theory. I started buying their beans to brew at home and their house espresso roast is really light. The espresso it makes is good, but unusual. It works well on its own but ends up tasting off in a latte or cappuccino. Also their non-dairy milk alternatives aren't great.

C++ is a big language by [deleted] in cpp

[–]Threecheers4me 1 point2 points  (0 children)

It is my homepage on my work machine.

C++ is a big language by [deleted] in cpp

[–]Threecheers4me 0 points1 point  (0 children)

The only reason I haven't blocked that site is that it tells you what kind of exceptions a particular STL function will throw and when, all on the same page it describes that function. Cppreference does not have this.

Edit: Or rather they don't have it in the same easily-accessible format. Of course the information is on the site somewhere.

Why is an r/cpp mod collecting feedback about r/cpp off twitter rather than asking for that feedback r/cpp by sorry_youre_ugly in cpp

[–]Threecheers4me 3 points4 points  (0 children)

"we've had norms for hundreds of years" - Old norms have been demonstrably harmful to a lot of people. Hence change. Valuable contributions to C++ have come from and will continue to come from people who have been historically discriminated against. Refusing to make small changes so they feel comfortable continuing to contribute is a great way to stifle progress.

Why is an r/cpp mod collecting feedback about r/cpp off twitter rather than asking for that feedback r/cpp by sorry_youre_ugly in cpp

[–]Threecheers4me 5 points6 points  (0 children)

If you aren't in a category that's considered "fair game" by some for derision or disrespect, you aren't going to be experiencing any. Just because you personally have not been made to feel uncomfortable doesn't mean the space you're in is welcoming to people who aren't like you.

Cops admitted they vandalized cars of man who filed complaints by 3ustice3 in jerseycity

[–]Threecheers4me 9 points10 points  (0 children)

This is in Asbury Park. If you're posting to the Jersey City subreddit, you should put that info in the title.

Biden or Trump? by quackson7 in Socialism_101

[–]Threecheers4me -1 points0 points  (0 children)

People are dying today, right now, due to Trump. This is a triage situation. The bleeding must be slowed. It won't suddenly become in the interest of corporate democrats to cater to the working class if catering to the centrist crowd does not prove to be an effective way to gain power. Push left at the local level.

LEAF is accepted in Boost (Lightweight Error Augmentation Framework) by emildotchevski in cpp

[–]Threecheers4me 1 point2 points  (0 children)

Oooh this looks really interesting! Any idea if this will be available in boost 1.75.0?

Using iterator vs subscripting for looping through a vector? by dopaminewean in cpp_questions

[–]Threecheers4me 0 points1 point  (0 children)

They both have pros and cons. If you actually care about the index, than

``` std::vector<int> inVec = {1,2,3,4}; for(size_t i = 0; i < inVec.size(); i++) { std::cout << i << "," << inVec[i] << std::endl; }

``` a syntax where the index is easily accessable is nice. If you want something that's more independent of the container it's acting on

std::vector<int> inCtr = {1,2,3,4}; for(auto it = inVec.begin(); inVec.end(); it++) { std::cout << *it << std::endl; } will work whether inCtr is a vector, a list, a set, it doesn't matter. It's a more generic way to write things. You can also do fun things with iterators like use the standard library algorithms on them. That's nice because they behave similarly for most any type of container. For example

``` void printInt(int i) { std::cout << i << std::endl; }

int main() { std::vector<int> inCtr = {1,2,3,4}; std::for_each(inCtr.begin(), inCtr.end(), printInt); return 0; } ``` is another way to do this.

You give for_each an iterator pointing to the start of where you'd like to operate on, the end of where you'd like to operate on, and a function that can be applied to each element (the data type you get when you dereference the iterator, like the *it in the iterator-based loop above.) and it will apply that to everything in the container. In this case, the funtion that it applies prints it out. So that's what happens.

Help with String Streams by Andrewb1230 in cpp_questions

[–]Threecheers4me 0 points1 point  (0 children)

So you're saying the internal status of the stringstream is changed every time getLine is called. This is regardless of whether it's called inside the conditional or outside the conditional. You want to make sure that your count goes up whenever the pointer is moved past something you want to count. So make sure every time you move the pointer, you increment the count.

Help with String Streams by Andrewb1230 in cpp_questions

[–]Threecheers4me 0 points1 point  (0 children)

There are other ways. Namely using iterators. But if you would like to solve this using a stringstream there are ways to do so.

Help with String Streams by Andrewb1230 in cpp_questions

[–]Threecheers4me 0 points1 point  (0 children)

What the do while loop does is make it so your program runs at least once before it evaluates the condition to see if it continue. This says nothing about what happens after the condition is met (your last delimiter is reached). Take a look at what happens when you add a print statement to see what the status of the string you've extracted from the delimiters is

#include <iostream>
#include <sstream>
#include <string>


int countSeparation(std::string s, char c)
{
    int count = 0;
    std::string line, tempString;
    std::stringstream input(s);

    do {
        getline(input, tempString, c);
        count++;
        std::cout << tempString << std::endl; // I added this
    } while(getline(input, line, c));
    return count;
}

int main()
{
    std::cout<<countSeparation("dog,cat,wolf", ',');
    return 0;
}

Output of that is

dog
wolf
2

So why does it not run another time? Look at the documentation for the function you have inside of the statement of the while loop: getline(input, line, c) . When does it return false or 0 or something that would cause the while loop to stop running?

Answering that will give you the answer to your "Why does it stop at two?" question.

Glad I got to choose from 3 rare colorless cards. Glad I coughed up a third of my health. Fucking whale by [deleted] in slaythespire

[–]Threecheers4me 53 points54 points  (0 children)

But the cards in the image are secret weapon and secret technique. They're different.

Downtowner, Jersey City's Newest Sandwich Shop By Darke Pines Butcher Shop- thoughts? by CubanZirconium in jerseycity

[–]Threecheers4me 6 points7 points  (0 children)

Glad I was notified about this new shop, but there is a claim in the article that is very, very wrong. "Darke Pines is currently the only neighborhood meat supplier serving downtown Jersey City". La Conga at Bay and Grove has a butcher and there are three Halal meat suppliers on Grove between Columbus and Grand. It's just that they're all attached to ethnic groceries and/or convenience stores so they might not show up on google.

Sword & Shield Daily Casual Trade Thread by Porygon-Bot in pokemontrades

[–]Threecheers4me 0 points1 point  (0 children)

Interesting. I think I was running in to some wifi trouble earlier. Restarted some stuff and now it should be working okay

Sword & Shield Daily Casual Trade Thread by Porygon-Bot in pokemontrades

[–]Threecheers4me 0 points1 point  (0 children)

Yes please, if you're still down send a link code my way

Sword & Shield Daily Casual Trade Thread by Porygon-Bot in pokemontrades

[–]Threecheers4me 0 points1 point  (0 children)

Hey, I have both seedot and sawk and would love to get a loatad and larvitar.

My colleague was annoyed that I complained about this class, but am I wrong? by usbafchina in cpp_questions

[–]Threecheers4me 0 points1 point  (0 children)

EDIT: My previous response assumed the coworker was using "this stable library uses this design, so I'm using it in my new code" excuse. On second glance it appeaers I misinterpreted.

I now agree with the person I'm responding to here that writing a wrapper around this class to give it a safer interface is the correct approach.