« first day (3167 days earlier)      last day (1764 days later) » 

12:06 AM
@northerner At least in correct C++ (as opposed to C or C++ with gcc extensions), the size of an array must be a (compile-time) constant, so char var[strlen(whatever)] simply won't work. One obvious possibility would be char var[] = "A long string"; char var2[sizeof(var)]; Note that they both have to be arrays, not pointers, for this to work though.
 
12:17 AM
well that sucks
Thing is I'm calling a function char * mpz_get_str (char *str, int base, const mpz_t op) and need another variable of the same length.
 
And this is in C++? If so, I'd probably do something like std::string foo; foo.resize(strlen(bar)+1);
Alternatively, use std::vector<int8_t> or std::vector<char>
 
Yes C++
 
With vector you can specify the size directly: std::vector<char> foo(strlen(bar) + 1);
 
12:33 AM
Why the +1?
@JerryCoffin
 
@northerner strlen gives you the length of the content of the string, but doesn't include the terminating '\0', so most times you're allocating a size with strlen, you want/need to add one.
 
1:05 AM
@JerryCoffin but since vector is an object I thought a null terminating character isn't necessary?
 
1:48 AM
Depending on how you're using it, it may not be.
 
2:25 AM
So the land purchase for the solar farm has not been finalized, I am already making enquiries on a flock of baby chicks.
Your offer is very cheap
Am I the only one finding this reply hilarious?
 
Also probably not const correct, absolute garbage
In C++ you'd use a map to go from mpz_t to the stringified form, so, std::unordered_map<mpz_t,std::string> or std::unodrered_map<mpz_t,mpz_setting>
 
2:58 AM
lol flagged
 
3:16 AM
@Mikhail and @JerryCoffin aren't your solutions over complicated? Wouldn't char* var2 = (char *) malloc( strlen(var) + 1 ); work?
Is the point you guys are making that C++ should use objects instead of simple/primitive types
 
3:29 AM
@northerner this is not quite a complete comparison though is it? you should take into account the code required to free that memory, too
 
@northerner It would work (for some definition of the word) but I don't see it as any less complicated.
 
4:02 AM
The whole question is offensive, because mpz has a C++ interface with an get_string method. gmplib.org/manual/C_002b_002b-Interface-Integers.html
Function: string mpz_class::get_str (int base = 10)
 
 
5 hours later…
8:45 AM
I am slow today, not sure whether still jet lagged or have permanently become retarded.
 
9:09 AM
Also stayed opposed a glacier, didn't even know until today.
 
 
6 hours later…
3:33 PM
@StackedCrooked what an interesting latest episode of SNK
 
4:21 PM
@ScarletAmaranth Ah. Still need to watch it.
 
go do it :D
imho
the episode revealed more than the entire season :D
 
4:48 PM
Hmm...they've apparently added a new "Lifeboat" badge...
 
lolwut
haha
 
@ScarletAmaranth Yep.
 
they were like
 
@JerryCoffin Looks like it replaces reversal?
 
"here's everything you need to know about titans"
 
4:52 PM
lol
 
ha, I have none of the retired badges.
Looks like they retired tumbleweed as well.
 
@Mysticial Looks like it, yeah. Slightly different requirements, but same general idea.
@Mysticial Never quite understood having a badge for questions nobody cares about. Sort of a consolation prize, I guess?
 
@JerryCoffin yeah. I can see why they got rid of it since it doesn't encourage any positive behavior.
 
@Mysticial I have two reversals (and now, 4 Lifeboats, one of which is for one of the answers that already got a reversal).
 
@JerryCoffin They get awarded retroactively?
So maybe it does walk the question timeline to calculate that score at certain points in time.
 
5:01 PM
@Mysticial Apparently, yeah. All of mine are for old answers (newest are from 2014).
@Mysticial Given its definition, I think it pretty much has to--it requires that the question was at -3 or below when you answered, and later got to at least +3.
Hmmm...and Software Engineering has added a silver "Life Jacket" badge with a similar idea, but lower requirements.
 
Speaking of badges, I have 301 silver and 307 bronze.
That's a difference of 6...
hmm...
 
Enlightened and Guru are really the only mass multi-earnable silver badges that don't come with a bronze version. So those are the only ones that can be used to offset the bronze badges.
 
@Mysticial Either of them would also result in a "Nice Answer" (bronze) though.
 
@JerryCoffin But it gets offset by "Good Answer".
So Nice/Good cancel out. Enlightened/Guru will net + silver.
Which basically means that every answer you post that hits 10 needs to reach 25 or be 1st and accepted. Otherwise it's a net minus.
 
5:18 PM
@Mysticial I guess my slow answers are part of why I have around half as many silver as bronze...
 
@JerryCoffin I admit to doing a lot of FGITW back in the day. :)
115 Enlightened to 216 Nice.
 
@Mysticial My ratio is much more lopsided (147 Enlightened vs. 717 Nice).
Some of that probably isn't being slow, exactly. For a while I only answered questions when I saw answers had been posted, but were clearly wrong.
 
I remember back in the FGITW days. 25 on an answer was basically impossible to hit. And Enlightened was difficult, but doable on a regular basis. You basically had to get on the multicollider (before they changed it) to get to 25 let alone 40 for Guru or 100.
And now we get them passively, lol.
 
@Mysticial Given how much we post on SO, "passively" is about the only way either of us gets much of anything nowadays...
 
Yeah, but it's still funny how I occasionally (passively) get badges that were so hard to get back in the days.
It's probably even harder to actively get badges now than back then.
At least the higher-end badges. (>= Good Answer)
 
5:40 PM
@Mysticial Probably true--I doubt anything stays on the front page more than a few seconds any more.
Ah, it apparently just took a little longer to go through the stats and award Lifejackets, but I just got 10 new silver badges (and, again, the newest answer for which any was awarded is around 5 years old).
 
@JerryCoffin It seems like Life Jacket is something I'd have to have done by chance at least once. Apparently not.
Maybe I really never did answer any negatively voted questions.
 
6:18 PM
@Mysticial I (obviously) answered a fair number of them...
 
6:37 PM
Tough crowd today (well every day in C++ really).

What's wrong with this question?

https://stackoverflow.com/questions/56655002/generating-a-random-uint64-t

I mean one thing that's is that it's not obvious how to do this with <random>, but that's not the question's fault.
 
Maybe I should downvote it first and then answer so I get a badge! jk.
0
A: What are the requirements for the lifejacket badge?

Glorfindel Do I have to answer the question at the moment the score is negative (for example -2) and its score gets improved over the time my answer has been posted? Yes. Do note that your own votes on the question don't count. Does this badge mean: "Hey, you have rescued this question and...

^^ Oh, your own votes don't count. haha
 
That feel when you realize that for DRY reasons, throw std::runtime_error("Not Implemented"); is in your precompiled header
 
7:39 PM
@BeeOnRope I glanced at it. It seemed to me that it was trying to ask at least a couple of separate question. One was about how to use generators. Another was about how to do initialization ("The engine e should remain useful after this (so for example move-constructing into a std::independent_bits_engine doesn't seem like a good idea).") Overall, not terrible, but still somewhat muddled and mostly asking things that should be in the documentation.
 
7:52 PM
@JerryCoffin - it's always a double edged sword for more info vs less info. I added the part about indepednent_bit_engine since that's what I assumed would be the way to adapt one engine to another, but it doesn't seem to have worked. Maybe I would have better luck if I left it out, but in my experience people always demand more info, not less.

I thought it was "obvious" that generating a random number shouldn't destroy the existing engine, but w/o that part no doubt someone would complain that there was a constraint in there I didn't mention.
 
@BeeOnRope Could well be--there are certainly quite a few comments that seem intent on asking for further information that seem (to me) like they're mostly irrelevant to the question at hand.
 
The XY thing has got to be the biggest bane of SO for me. I wish I could check a box that would encourage users to "answer the question as asked" unless for some reason it is impossible: don't speculate on some higher level question instead. Or, at worst, do the speculation after answering the question I asked.

I get it, there are a shitload of terrible questions out there where the user would be helped by answering a different question, but I'd like to opt out of that assumption, forever (yes, I'd miss out on good answers from time to time, but it would be more than compensated by avoidin
 
8:09 PM
The response to XY questions is equally disheartening, for example, I wouldn't mind helping the person with Y. The underlying issue is there is no good way to have a discussion on the SO platform.
 
8:26 PM
@Mysticial - lol
 
9:15 PM
@BeeOnRope I'm less certain about this. When you're 20 minutes into answering a question, and a comment makes it clear that, no, they didn't really care about what they asked, only something comparatively trivial, it's disheartening at best.
 
9:29 PM
Which one do you guys do?
`&& static_cast<const some_base_class*>(this)->item_approx_equals(b)`
or
`&& static_cast<const some_base_class&>(*this)->item_approx_equals(b)`
 
9:45 PM
@Mikhail I'd tend toward the latter as a general rule.
 
why? also the later has a typo (shouldn't be an -> ) but w/e
 
10:20 PM
@JerryCoffin - fair enough, but by taking that tack you are effectively punishing the good askers, who don't pull that, because of the behavior of the bad askers.

You could also protect yourself in other ways, such as starting with smaller answers, but yeah there is no good solution. I don't necessarily *blame* users who try to pick apart questions to get to the "higher reason" since I partly understand why they do it.
 
11:18 PM
@Mikhail Yeah, I'm kibitzing, not compiling. As to why...mostly comes down to a general preference for references over pointers when possible (even a case like this, where it's never visible to the outside world).
@BeeOnRope Nowadays, I essentially punish all the askers by almost never bothering to answer questions.
 
I'm scared that when I write static_cast<const some_base_class&>(*this) it will de-reference the *this pointer, which might cause a copy of the object to materialize. Somewhat an irrational fear...
 
@Mikhail Certainly shouldn't cause any copying.
 
Fear of unsafe behaviour is normal in C++. It's like your hobby is ocean swim and you spend good part of your time swim in the ocean, and your fear a shark would materialize in your nearby water.
If you want to be safe, don't swim in the ocean and don't use C++.
 
@TelKitty I don't fear unsafe behavior in C++. I revel in it!
 
11:35 PM
@JerryCoffin Will you consider yourself a well paid stuntman (in software development)?
Wait, I have just asked a flawed question ... kinda.
 

« first day (3167 days earlier)      last day (1764 days later) »