« first day (2364 days earlier)      last day (2583 days later) » 
00:00 - 13:0013:00 - 00:00

1:01 PM
vault boy is my go to picture to say a sarcastic "ok" on company IM
 
Xeo
49
Q: If statement vs if-else statement, which is faster?

Julien__I argued with a friend the other day about those two snippets. Which is faster and why ? value = 5; if (condition) { value = 6; } and: if (condition) { value = 6; } else { value = 5; } What if value is a matrix ? Note: I know that value = condition ? 6 : 5; exists and I expect ...

...
 
garbage question, relatively decent answer
 
user1804599
duplicate of optimisation 101
 
1:22 PM
aaaaaaaaaaugh
this is like Rapptz and Alex all over again
but worse
oh well
@rightfold How are you this morning, milleniumbug?
 
:36506239 what did you do?
 
@R.MartinhoFernandes ok, send me a picture of your garden
what do you need me to analyze?
I have also an interest in botany
:D
 
@nbro There's no garden. It's all in transition pots atm.
 
no garden, no kindergarden :D maybe only for "genes"
 
@nbro a hobo next door is heavily interested in colonoscopy, would you like to help him out with his latest research?
 
1:31 PM
@JohanLarsson decided to treat rightfold as milleniumbug until she changes her avatar
 
@login_not_failed it just a matter of opinions what's interesting and what's not
 
nwp
I made a rule that member objects should always end in {/*stuff*/} in the declaration so everything is properly initialized, but it doesn't work for incomplete types (and when using initializing functions private to the .cpp).
 
@nbro that's what you've been explicitly told before, yet you are insisting that your topic is relevant
 
everything ends up to be subjective
even mathematics
imagine the earth without humans, how would it be?
 
nwp
1:36 PM
@nbro in that case your opinion is the only thing that matters, facts are irrelevant, there is no need to talk to people
 
right, yes, YOU are imagining
yooooou!
subject
IVE
 
imagine real mathematics, outside of your uni program and assignments…
 
Ven
hey can you stop with that "1 word per message"
 
@login_not_failed insisting?
not really
I was describing your behaviour
with respect to the behaviour I thought you should have as cs
 
@nbro At first I thought telkitty said this.
7
 
1:39 PM
You found me, you found me lying on the floor. Surrounded. Surrounded.
@rightfold I don't think single countries can be as politically relevant alone as they are when they are together.
A UK alone seems so irrelevant in the world political sphere
 
nwp
This challenge could make a pedant quite dishappy... — Spratty 4 hours ago
 
Now imagine a USE that competes with USA in the political scenario.
Don't you feel happier?
 
@Shoe But the sun never sets!
 
I'm not sure I get the reference :(
 
@Shoe british empire is large enough that the sun is always up somewhere in it
 
nwp
1:51 PM
The phrase "the empire on which the sun never sets" has been used with variations to describe certain global empires that were so extensive that there was always at least one part of their territory that was in daylight. It was originally used for the Spanish Empire, mainly in the 16th and 17th centuries. In more recent times, it was used for the British Empire, mainly in the 19th and early 20th centuries. During this period, the British Empire reached a territorial size larger than that of any other empire in history. Georg Büchmann traces the idea to a speech in Herodotus' Histories, made by...
 
lol
 
nwp
I almost deleted mine too :D
 
It doesn't seem surprising that Trump wants the EU to be dismantled if you follow that reasoning.
 
nwp
@Shoe what reasoning? sunlight envy?
 
1:54 PM
@nwp Fear of a USE
 
nwp
I don't think he worries about things that take longer than 8 years to develop.
 
Obama was probably in favour because he cared about getting a stronger ally.
 
@nwp He worries about things that don't develop!
 
user1804599
"U"SE would be a cultural disaster.
 
@Xeo ermagad
@R.MartinhoFernandes So, you admit you have a pot garden.
@nbro of the garten variety, surely
 
2:41 PM
@sehe I started writing an IoC framework yesterday.
Not sure it will be more than a prototype.
 
hello
 
guise, what's the lounge approved syntax to write a reference to a pointer?
some_type*& var vs some_type *& var?
 
you want to start a whitespace flamewar?
 
user1804599
> I felt immediately challenged
 
user1804599
2:48 PM
LOL
 
nwp
@Rerito Some_type *&var obviously!!!11
 
@rightfold Isn't it illegal to burn cash?
> don't
I think
 
@Shoe Don't ask why I need it, it's the inhouse policy to allocate stuff
 
Probably ptr<some_type>& though
With template <typename Type> using ptr = Type*;
 
there are also golden standards like some_t* &var and some_t * & var :D
 
2:51 PM
Or something equivalent.
 
Rather than doing some_ptr* get_stuff(), we must do int get_stuff(some_ptr*&)
 
nwp
@Rerito right, you are the poor soul who is putting up with VS2010
 
@nwp And stupid coding standards as you can see as well
 
I'd use a pointer to a pointer
 
nwp
the correct solution is to agree on a .clang-format file and force everyone to use it on everything, but I'm sure that is too much of a dependency or it doesn't work because clang has no clue how to parse your code or the senior dev doesn't like it
 
2:54 PM
@nwp Or you can't get it altogether using a company approved process
@ratchetfreak This is dead serious, for example, the lounge approved formatting for const refs is some_type const&, not some_type const & or even worse const some_type&
 
@Rerito Yep, c'est fait.
 
@DavidLinden @paullewismoney @HMRCgovuk Why the need to confirm you're not currently living with the other parent?… https://twitter.com/i/web/status/849913012140085248
I don't get it
 
Ah, moi c'est trop tard je ne pourrai malheureusement pas contribuer à l'élection de la première présidente française
 
How would you avoid people filing that while still living together (and never actually been raped) in order to play the system?
 
@Rerito Y'a pas de date limite pour les procurations, tant que ta commune reçoit la procuration à temps.
 
2:58 PM
@SpongyFruitcake J'ai personne dans la commune en question, mon frère a shotgun la seule personne à qui je pouvais la demander
 
@Shoe Could we please avoid the topic of rape? It's kind of insensitive to mention this.
 
No
 
@JohanLarsson CLR?
@JohanLarsson The best kind of exercise
@Shoe Me neither, frankly.
@Shoe Anyhoops. That same form has 2 more parts to be filled by certified medical/support personnel. So, there's that.
 
Oh ok, I see
 
It's a legal thing. The applicant /has/ to personally state these things, the word of a counselor is not enough.
 
3:02 PM
@Shoe Please avoid this topic lest I have to flag you for mentioning topics that may trigger people.
Much appreciated.
 
PHP!
void***!
 
Because void** was not enough?
 
C-style casts!
 
user1804599
 
@rightfold such a gross ignorance!
 
3:14 PM
@rightfold beans and olives are also not vegetables
 
@login_not_failed You never met LRIO
 
@sehe nope
am I missing something not knowing him?
 
nwp
imagine rightfold on speed
 
this would lead to a very rapid chat spam at least; probably with furious comments
 
@login_not_failed And a lot of great ideas roaming in chat
 
3:36 PM
0
A: Fast 1/X division (reciprocal)

user3398381Blah, blah, blah... I hear a lot of lazy people, probably voted for Trump (excuse the politics). This should do it with a number of pre-unrolled newton iterations's evaluated as a Horner polynomial which uses fused-multiply accumulate operations most modern day CPU's execute in a single Clk cycl...

> Blah, blah, blah... I hear a lot of lazy people, probably voted for Trump (excuse the politics).
Looks like someone who disagrees with something on the internet and proceeds to talk shit about everyone. lol
 
lmao
 
@sehe who?
 
user1804599
3:55 PM
 
Ven
dont.
 
@fredoverflow finally got around to starting that video :(
 
4:11 PM
@rightfold what's wrong?
There is a culinary and a biology definition of "vegetable". Tomatoes are vegetables on both.
 
Ell
4:25 PM
@R.MartinhoFernandes what is the definition and where did you get a from?
 
Which one?
The biology one covers the entire plant kingdom. The culinary one is mostly arbitrary
In the culinary sense, fruits aren't vegetables and tomatoes aren't fruits. In the biological sense, fruits are vegetables and tomatoes are fruits. Either way, tomatoes are vegetables.
Afaik the only people who get triggered are those who use vegetable as "culinary vegetables except for biology fruits". They're clearly idiots.
 
user1804599
@R.MartinhoFernandes its a meme hth
 
Ell
4:42 PM
@R.MartinhoFernandes either
AFAIK there isn't one for vegetables
Which is why tomatoes are fruits and vegetables :D
 
user1804599
4:52 PM
lol, "object-disoriented programming"
 
@R.MartinhoFernandes I don't know about "triggered", but this has come up in courts at least once. Fruits were subject to a tariff, but vegetables weren't (or maybe just the rates were different). So, they argued in court over whether tomatoes were fruits or vegetables (FWIW, at least in the case I know about, the court agreed with you, so in the US tomatoes are legally vegetables).
 
5:13 PM
@rightfold ODP, with many layers of abstraction distraction.
 
kay's object oriented programming
 
5:25 PM
woof
@R.MartinhoFernandes The culinary definition and biological definitions both make sense, but randomly mixing the two does not sound like it will go well
 
5:48 PM
@Puppy Only pedants mix the two, since it's usually obvious from context which domain you're talking about.
 
Now for the day's "Please help me write a crappy virus" question:
0
Q: Code Caving (writing assembly instructions to another processes memory in c++)

SkyLuvvHi I tried looking this up online, but have only come across ways to accomplish this through DLLs. I have an executable program that calls VirtualAllocEx() and should overwrite the target processes memory with a jmp to the allocated memory region using the returned address from VirtualAllocEx(). ...

 
> I'm voting to close this question as off-topic because it's too shady.
 
6:06 PM
@Mysticial The sole comfort being that what he's talking about is so obvious that any anti-virus that was worth anything at all would see it coming from a mile away, so to speak, and stop it dead before it got anywhere.
 
6:18 PM
room topic changed to Lounge<C++>: Study Shows: Python Programmers React.js Better [c++] [c++11] [c++14] [c++17] [c++-faq]
 
5 hours ago, by milleniumbug
try JS chat, they React better
 
@Puppy Did you just explain the joke?
 
I have no idea what the joke was
so I'll have to go with "no"
 
@JerryCoffin I presume virus scanners make exceptions for major compilers/debuggers?
I remember when Windows Defender kept deleting the Intel emulator that I downloaded. It didn't like the JIT that it had in it.
 
@EtiennedeMartel real pedants would ask about the context. Only idiots mix them.
 
6:29 PM
good job SO
 
12
Q: It's a bird... it's a plane... it's... hero text?

Anthony NeaceMeta Stack Overflow is currently showing the following text on the main page, above the 'Top Questions' header: docsHero.RenderPartial(Html); storyHero.RenderPartial(Html); Screenshot:

 
@thecoshman What video, and why are you sad?
 
Use React noob. — Puppy 6 secs ago
 
how do you use a "React noob"?
 
7:00 PM
@Mysticial I'd assume so, but I don't use AV, so I can't really say for sure. Years ago at work I was compiling, running tests, then (if it passed) copying the result to a stored drive. The AV they had would immediately restore the old binary unless I deleted the old one, waited a few minutes (exact time uncertain) then copied in the new one.
 
@JerryCoffin lol
 
Oops--s/stored/shared/
 
@fredoverflow the Kotlin 1.1 vid... you sent it ages ago :P
 
Ven
8:28 PM
@rightfold
 
8:59 PM
> looping on a volatile variable
> P.S: Please do not lecture me on why not to use this, the real code that uses this hack does so for a (complex-to-explain) reason.
 
Holy shit question dump spam hell. What's going on? lol
 
user1804599
9:43 PM
@Ven XD i still get promotional emails from MF
 
10:46 PM
There's this logical fallacy I once read about but can't remember its name. It happens when striving for a perfect score in one aspect of the whole leading to disproportionate time spent on that one thing.
The result is that other aspects don't get enough attention.
No Child Left Behind comes to mind.
Or, i.e striving for 100% code coverage.
 
11:01 PM
@SpongyFruitcake if only you had ever had a chance to meet Cicada. She was hot.
 
cake is sweet
 
@StackedCrooked Same here. So I end up doing integration tests and targeted unit tests.
A lot of anticipating what is likely to go wrong and where the fragile code is. Unit test those specifically. Fuck everything else and move on.
 
And for integration tests, I typically have automated integration test runners. Basically run the same test with a gazillion different input parameters. Throw it on one of my many boxes that I have sitting around and forget about it.
Come back a week later to see what blew up.
As a bonus, it also tells me if my hardware is unstable.
 
Do you aim to test all combinations of parameters. Or do you randomize?
 
11:10 PM
Some are exhaustive up to certain limits. Others are done pseudo-randomly. (in a reproducible way)
Ever since I switch to my Ryzen box for everyday tasks, that released my 8-core Haswell box with 128 GB of ram. And it's been running 100% for past week running a set of long overdue tests.
And I want them finished before the weather warms up since I'd need to pay to warm the place anyway, and I might as well make some of that kill two birds.
 
Hehe.
 
That last time I ran these tests was November of 2015. And it took about 4 weeks.
This time I expect it to take 6 - 8 weeks since there's more of them and they've become exhaustive.
 
@Mysticial ...and somewhat exhausting. :-)
 
At work I've been working on a TCP stack for a few years. The code has gotten pretty large and I'm finding myself afraid to refactor because this often led to subtle bugs.
I really need a more exhaustive test suite covering a large set of weird things than can happen on the wire.
 
@JerryCoffin The "exhausting" ones are actually the manual tests where I'm actually computing constants. Right now I don't have a script to automatically compute all the constants to various # of digits.
I do for ram-only computations. But not for swap mode - since the settings change depending on which machine I'm running on.
So I still do them manually.
@StackedCrooked I think your task is harder since it's inherently asynchronous.
Whereas the stuff in my pi program (despite being parallelized) is relatively deterministic.
 
11:22 PM
Part of it is that errors can often stay unnoticed for a long time. They occasionally cause minor drops in the TCP performance but you don't notice because you performance drops happen all the time due to changing network conditions.
 
@Mysticial ...not to mention being robust, even if you receive something that shouldn't be possible/isn't allowed.
 
Yeah. In my case, I have control of all the inputs. The only external inputs are stupid stuff like the # of digits and the amount of memory (which are clipped to a range), output paths (which are sanitized), and input files (which are semi-sanitized).
 
I once had a variable that needed to grow exponentially over time. However, due to an implicit narrowing conversion it was actually rotating the uint32_t spectrum at high speeds. I only discovered that when extended TCP graphs became a feature.
The result on performance was occasional dips.
 
lol
 
Without those graphs it would probably have remained unnoticed for much longer.
 
11:26 PM
Also, "variables that grow exponentially over time" tends to not scale well.
 
cwnd = Max(cwnd, cwnd + 1, cubic); // Max function that uses std::common_type on its arguments. However, cubic is double and cwnd is uint32_t.
So common_type becomes double and this is stored back in the uint32_t.
The graph looked pretty crazy.
 
@StackedCrooked Oh. I get that kind of bugs. I've learned to test the simplest of things. Like:
    { // parallell section
        int cores = std::thread::hardware_concurrency(); // IMPORTANT: converts to signed!
        cores = std::max(1, cores - 4);
        xxx::threads::executors::fixed_pool_executor local ("Remount", cores);

        // ...
Guess what the bug lurking might have been
 
cores < 4 ?
 
Well. And then the bug.
 
Oh wait. That's fine.
 
11:32 PM
@Mysticial Depends only on how fast it grows
 
It grows cubically over time. However, it's capped to max uint32_t. (Normally)
 
@StackedCrooked Yeah. I was anticipating that :) But std::max/std::min are the worst to use correctly. Especially when confusing the colloquial English semantics and things like unsigned contamination
 
Oh. You used min instead of max :)
 
Nah.
That's what I usually do, though :)
 
@sehe I used to make that mistake all the time. But I got over it. I had to train my mind to translate "min()" to "smallest of the two" and "max" as "largest of the two". (Rather than unconsciously reading it as minstens/maximum)
 
11:36 PM
That. I have trained myself very well to double check and remember the pitfall. Which makes me frequently overcorrect (don't ask how. I think it's semantic dyslexia or something)
@StackedCrooked So, hint: read the comment. Or mentally s/int/auto/
 
@sehe lol
 
@sehe Ah.
 
Of course I didn't even have the separate initialization step. More like auto const cores = max(1, thread::hardware_concurrency() - 4); as is good form :)
 
Oh wait. I also got fooled by the signed/unsigned part.
 
You assigned 4294967293 cores.
 
11:40 PM
Fuck signed integers.
 
↓↓↓↓↓
 
And fuck unsigned integers.
Also fuck floating-point as well.
 
I think I might have spotted the conversion problem ahead of time, but that made me realize the section was worth testing well with various values for hardware_concurrency.
 
I need to check if hardware_concurrency even works properly on Windows with multiple processor groups.
 
I wouldn't know why not. Seems pretty straightforward to spec and test.
 
11:42 PM
That multiple processor group thing - which I fully understand why it exists, makes life absolutely suck for the casual parallel programmer.
 
I suppose it is there to reflect architecture or something (talking without any base)
 
Prior to Win7, Windows only supported up to 64 logical cores. Presumably because the scheduler used 64-bit integers as bitmasks.
To break that limit, they did something different to Linux. Linux uses an array of unsigned longs for a mask that allows all-to-all scheduling.
Windows introduces "Processor Groups" where each group is capped to 64 logical cores using the old scheduler.
Things cannot migrate across groups unless you explicitly set the affinity.
All the old API functions remain "group unaware" and will return only the size of the current group.
 
@Mysticial Why is floating point bad again?
 
So unless the program is "group-aware" it will not even see the other groups (and cores) in the system. So the question is whether hardware_concurrency is group-aware.
@Borgleader Because it leads to a lot of bad SO questions.
 
Someone sent me a few graphs using the TCP for wifi tests with mobile devices. Very lively graphs. In the lab the graphs are more straight lined.
 
11:47 PM
Because of the processor group system in Windows, you can't just spawn a bunch of threads and expect the OS to distribute them across the machine properly.
They will all be locked to a single group. And the programmer is responsible for moving things across groups.
So if you're used to stuff like OpenMP or thread pools, you're basically fucked. OTOH, Intel's libraries are group-aware and they will move things across groups. (not in an optimal manner though)
 
@Mysticial Who needs optimal, when mediocre is still better than 99% of the competition?
 
In the end, what Microsoft is forcing you to do is that if you get the point where there's more than 64 logical cores, you're gonna be in a heavily NUMA system. So all-to-all scheduling isn't gonna scale anyway. So you need to be explicitly about your scheduling.
 
@Mysticial Is this group bound to a subset of the available cores?
 
@StackedCrooked Correct. If you have more than 64 logical cores, Windows will "intelligently" split them up across multiple groups taking into account for the topology of the hardware.
 
@Mysticial Taking it into account...and then splitting it at the worst possible places! ;-)
 
11:51 PM
@JerryCoffin Yep. Right now, my Pi program's thread pool does some sort of "random round-robin" across all the groups. But by default it will use Intel's Cilk Plus since that does it better. (but still not great)
My "far memory" experiment will introduce the concept of a "Compute Region" which will basically mirror the intention of NUMA and Window's Processor Groups.
 
I also tend to use round-robin task assignment to executors. It's not perfect (because some tasks take longer than others) but works pretty well in practice. And it's simple.
 
The configuration inputs have gotten so complicated that I had to build my own system around it.
 
@Mysticial So theres nothing "inherently" wrong with them then? :P
 
So far, that "far memory" experiment has worked out. But I stopped working on in February since I got side-tracked with something else and I was trying to buy my fucking condo.
@Borgleader :)
 
00:00 - 13:0013:00 - 00:00

« first day (2364 days earlier)      last day (2583 days later) »