« first day (3224 days earlier)      last day (1718 days later) » 

12:17 AM
I keep getting a headache after working for six hours. I need to work like 10 a day. What do I do?
 
12:35 AM
Hiking? Jogging? Alcohol? If you want long term effect, maybe keep a pet.
A beloved pet will absorb all your leftover time like a sponge.
 
 
3 hours later…
3:36 AM
@JerryCoffin in order for one to carpe Diem one must first be equipped with the tools to do so, and the use of carpe Diemin in this scene has all the subtlety of a bulldozer . The video says more by what it never mentions. That these kids are the cream of the crop being instructed in the best of fitness, math, science, and literature by an elite institution. What else are they doing there other than preparing to conquer the world.
 
4:03 AM
 
 
6 hours later…
9:47 AM
Link's Awakening would be very interesting if you didn't restart it x)
Where's the island? Nowhere, you woke up years ago, it was an illusion you dreamt so that you wouldn't have to suffer adult life so soon
Welcome to the real world motherfuckers
Also the windfish was killed by the Japanese for research purpose
 
Jos
10:41 AM
Hello guys I'm a cPP noob, Can I ask my doubts here?
 
if you have specific C++ questions then the questions and answers channel might be a better place
 
Jos
10:57 AM
I want to ask about wrong cpp practice that i've been following
 
Idk, I'm not a mod, I'd say just ask your question.
 
Jos
for(int i=0;i<a.length()-2;++i){
ans = max(ans,mp1[i+1] - mp1[i]-1);
}
Here, mp1 is a map of std::map<int,int>
and a is a string of length 1.
But during debugging, I found that the loop was getting executed twice or thrice
Then I did this:

int x = a.length();


for(int i=0;i<x-2;++i){
ans = max(ans,mp1[i+1] - mp1[i]-1);
}
 
.length() returns an unsigned value, if you enable compiler warnings then the compiler should've warned about the signed/unsigned comparison
 
Jos
And suddenly it worked well.

The loop didn't execute at all which I expected.
yes. What is the right way to loop through the stringlength-2 in this case?

Because .length() return std::size_t.
 
11:13 AM
I don't think there's a "right way", it's a question of preference
 
Jos
But, since a.length() returns size_t, this must be wrong.
 
well yes the first thing you posted was wrong
 
Jos
What according to you should I do to iterate in the right manner?
 
and like I said the compiler would give you a warning there if you enabled sufficient warnings
 
Jos
@PeterT yes. but I'm asking how to make this right?
 
11:16 AM
you posted one solution youself already
 
Jos
So, you mean size_t got typecasted to int?
 
yes, that's what you did
 
Jos
Well, I might be wrong. That's why i am asking you to correct me.
why didn't it get type-casted inside the for loop : for(int i=0;i<a.length()-2;++i)
 
it did get type-casted, but the wrong way around, in "i<a.length()-2" the "2" was made unsigned and the "i" was casted to unsigned
 
Jos
11:40 AM
@PeterT Yes, that's the right thing you said and that's why my loop was running like for a whole lot of time.
@PeterT Thanks buddy, for helping and figuring out the problem.
a.length()-2 becomes the max value of unsigned numbers.
 
 
4 hours later…
3:33 PM
I'm trying to declare a random generator as a class function
class foo {
private:
    std::random_device rd;
    int n_rows, n_cols;
    std::mt19937 eng(rd());
    std::uniform_int_distribution<> row_dist(0, n_rows), col_dist(0, n_cols);
But I'm getting function not implemented warnings from my IDE for eng and row_dist and col_dist
When I declare them inside of a function, the IDE doesn't complain
What's up?
 
4:09 PM
@J.L.Louis you don't need to hold on to rd btw and it might actually be bad to do so.
@J.L.Louis you need to pass in the integer width via the type
 
So it's okay to re-initialize everything everytime I need a random value?
 
4:35 PM
@J.L.Louis generally speaking you should consider having a single mt19937 statically per thread
init that once per thread
 
4:51 PM
I'm not using multiple threads
 
5:31 PM
@Mysticial You mentioned bandwidth problems with AMD when running your benchmark. Do you think the new Epyc will fix this?
 
@StackedCrooked No because the compute/bandwidth ratio stays about the same.
Improves only slightly on Epyc due to lower clock speeds.
 
I see.
Too bad.
 
When Zen 1 launched, it already bad at the time. But there wasn't much I could do since there were no obvious optimizations that could be done and Intel's profiling tools don't work as well on AMD.
When Skylake X launched, the combination of lots of cores and AVX512 made the bandwidth bottleneck so large that it was obvious what I had to do.
So I did a couple of intrusive revamps.
 
compress your data? lol
 
Algorithmic
Those revamps significantly pushed back the bottleneck on Skylake. It also had a side-effect of helping Zen 1. But it showed less in the numbers since Zen 1 wasn't that memory bound compared to Skylake X.
Skylake X went from "very memory-bound" to "borderline memory-bound".
Zen 1 went from: "borderline memory-bound" to "not really memory bound".
Zen 2, I predict is now "very memory-bound". But would've have been "stupidly memory-bound" prior to the optimizations I did for Skylake X.
So it's another case of software/hardware cat-and-mouse.
 
5:43 PM
@Mysticial I thought AMD had similar tools?
 
@Mgetz AMD has their own VTune?
 
GPU?
 
tbf this is probably better developer.amd.com/amd-uprof
@Mysticial technically both but I think the one I just linked is better
 
hmm
I'd have to see the ones involving the performance counters.
 
5:49 PM
I remember using versions of both back in the day on a venice AMD64 processor
 
Basic profiling is already doable with VTune on AMD. It's just the performance counters and system-wide stuff (like bandwidth usage) that requires platform-specific drivers.
 
@Mysticial my understanding is that both of the tools i linked should give deeper architecture views
 
 
2 hours later…
8:06 PM
Sort of an odd thing here and I'm not sure where else to address my issue, but I posted a question and within just a minute of it being posted it was flagged as a duplicate, when the question that it was linked to was something I have looked at and wasn't relevant to my actual issue. Can someone look into this for me?
 
 
1 hour later…
9:24 PM
WTF is constinit and conseval?
 
@wilx consteval is kind of what most people really though constexpr would be. Marking a function as constexpr gives the compiler permission to evaluate that function at compile time. conteval doesn't just give permission--it requires compile-time evaluation.
I don't know of a constinit that's part of the language. Going from memory, it may be part of a proposal somebody wrote that's supposed to deal with static order of initialization issues (but I'm not certain of that, and don't remember anything further).
Ah, here we go: at first glance, it looks like my memory actually worked at least sort of correctly for once: gist.github.com/EricWF/128781c188b1a4fca7581e7ea943d58b
 
The language is more and more complicated.
 
9:41 PM
@wilx Yeah--but you can pretty much ignore consteval if you want to. constinit is currently only a proposal, so while it might be interesting to know the possibility is somewhere out there on the horizon, I wouldn't spend much time/effort on it. It might never happen, and even if it does, it's mostly just a way for people implementing iostreams (and similar) to use standardized black magic instead of platform-specific black-magic to make it work. Most have no reason to care.
 
I guess you are right.
 
@wilx I'm tempted to say something extremely conceited sounding like "of course I'm right"--then immediately follow it with something that's obviously wrong...
 
@JerryCoffin :D
 
@wilx I guess maybe I'm finally starting to grow up. When the Lounge was young, I'd have just jumped in and done it without a second thought...
 
@JerryCoffin Well, better later than never. :D
 
9:52 PM
@wilx I dunno. I was kind of hoping for the "never" option. Irresponsibility is so much easier.
 
10:46 PM
The reason for estimate age was because:
Greenland sharks, which only grow 1cm a year, have been known to live for hundreds of years.
The Greenland shark was 5.5 metres long.
Of course this could be a particularly fast growing Greenland shark ...
 
11:06 PM
@TelKitty Do you think it is BS?
 
11:49 PM
@wilx They also carried out radiocarbon dating. Its age was somewhere between 272 and 512 years old according to radiocarbon dating.
So maybe not 500 year old, but most likely to be over 250.
 

« first day (3224 days earlier)      last day (1718 days later) »