« first day (3239 days earlier)      last day (1724 days later) » 

12:14 AM
How am i doing, out of 144 lambda functions I mis converted 5 from excel to python
 
@LoïcFaure-Lacroix When did Excel start to include Lambdas?
 
never hence the conversion from excel to python
I mean converted formulas to lambda
I went the hard way and renamed all the column cell numbers to actual variable names
 
@LoïcFaure-Lacroix Ah, I see. And here I was ready to get excited that MS had done some major updating to Excel's macros and such. Oh well, it's not like I actually use Excel or anything.
 
1:08 AM
@Mysticial lololololololololol
the littering comment was just so good xD
 
 
2 hours later…
2:45 AM
Scientist wins top award for using your data to make you pay your tax
Lemme put a bunch of flowers in front of the tombstone on science.
 
@TelKitty does that include all the companies that pay no taxes.
 
From the article apparently not.
 
 
3 hours later…
5:31 AM
Since Australia produces 50+% of world's licit poppy straw that is later refined into opiates, I am tempted to become a poppy farmer. What if I let cows chew on poppy plants and produce 'morphine flavoured milk?'
On second thought, no one should do that because it's animal cruelty.
 
 
1 hour later…
7:01 AM
@TelKitty I would prefer your Australian opioid cows milk over the tramadol flooding this country csis.org/npfp/dangerous-opioid-india
 
 
5 hours later…
12:11 PM
constinit has been implemented in GCC 10
The warnings for the deprecations linked to volatile too
 
@Rick It's not super popular, it's a chain but not like a big thing, we have McDonalds here too
 
Greggs seems to have some interesting products
The cajun chocken bakes look super tasty
 
12:26 PM
@Morwenn deprecations linked to volatile?
 
@Borgleader A whole bunch of places where volatile was legal were deprecated
The goal is to only keep the valid & safe use cases in the long run
 
@Borgleader basically almost all the really dumb uses of volatile
 
@Morwenn Examples?
 
@Puppy volatile-qualified member functions
Also operator+= and friends on volatile types because most of the time they can introduce an issue due to performing a read and a write
 
1:05 PM
@Morwenn was there ever a valid use for this?
 
1:22 PM
@Mgetz I have seen one or two people claiming they could/would use this
 
@Morwenn ok, but how?
and what would that solve?
 
But volatile behaviour as a type qualifier just mimicked that of const because it looked similar enough
@Mgetz fuck if I know
 
2:05 PM
Is it possible to have an array with defines + values?
and base another define on the array count?
 
@Roland_dfa What do you mean by "define"?
 
#define fc01
 
what does "base another define on the array count" mean?
 
2:21 PM
new #define with sizeof(array) as value
 
@PeterT nothing good I fear
 
@Roland_dfa this is missing a whole lot of context but what you're saying sounds more like a job for some constexpr or template stuff, rather than macros
 
keep in mind that #define is token replacement and little else, so any #define foo(arr) sizeof(arr) is going to expand foo(bar) to sizeof(bar)
 
I mean you can do "#define something sizeof(arr)" just fine but it sounds like the next thing you want to do is "#define macro2 MYVAR##something" which would not help you
 
int array[]{ 1,1,1,1 };
int x = sizeof(array) / sizeof(int);
#define FCMAX x;
this works fine
 
2:32 PM
right, but
int array[]{ 1,1,1,1};
const int FCMAX = sizeof(array)/sizeof(int)
also works
 
nwp
Use std::size instead of sizeof array / sizeof *array. The latter does the wrong thing with pointers.
 
or better yet use std::array
 
 
2 hours later…
4:47 PM
@nwp Excellent point. If you really need to support old compilers, you can still do the job reasonably well on your own: template <class T, std::size_t N> std::size_t size(T (&)[N]) { return N; }. Simply won't compile if you try to pass a pointer.
@PeterT Even in C you do do the job better than this. #define size(array) (sizeof(array) / sizeof(array[0])) This way it works for arrays of arbitrary type, not just int.
 
5:38 PM
In practice constinit won't solve static initialization order initialization problems because it can only be used for the most boring of types. But it will lead to better job security, and confustifated code when people use it to annotate their static ints.
 
@Mikhail I guess that doesn't surprise me a whole lot. I glanced at it enough to recognize that its basic intent wasn't one I cared much about, and never spent time looking at the details to figure out how well it would do things I didn't care much about.
 
 
1 hour later…
7:01 PM
But still no strong types :-)
 
Good evening!
I've been reading the standard lately..
 
@iksemyonov you have my condolences
it's really not for general reading
 
@Mgetz Haha, indeed. But I was looking for answers to fundamental questions. So here is one
Compare 3.9.1.3 in 2011 and 2014 (I'm referring to seemingly the final versions, for I've been able to download them)
> The signed and unsigned integer types shall satisfy the constraints given in the C standard, section 5.2.4.2.1.
This is missing in 2011
Is it a mistake or is it placed elsewhere?
It looks like a really important note
 
7:22 PM
@Mgetz see above ^
Is it worth to ask a complete stack overflow question for this?
 
7:33 PM
@iksemyonov check the defects
 
@Mgetz I've been able to find open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html where point 483 mentions this, but it's against c++2003
 
@iksemyonov remember that C++ also changed integer semantics to basically acknowledge that the entire world is twos complement, C hasn't yet
 
@Mgetz Can you recall where 2's complement is in the standard exactly? Because that's pretty much what I've been looking for
@Mgetz Also, in c++2014, there is the link to 5.2.4.2, which describes all the three representations of signed integers, doesn't that contradict your statement in a way?
 
@iksemyonov I'm not part of the committee i go off what the people that pay more attention say like @Morwenn
 
@Mgetz Ok, fair. See, I've been coding a solution to a small toy problem, a simple packet parser
And I came across the need to finally understand signed and unsigned numbers, conversions and operations on them, and it seems to be a rabbit hole
 
7:48 PM
Yes, there are now three (and only three) representations for integers: ones complement, twos complement, and signed magnitude. Previously, if you wanted to implement C++ on a machine using excess-4 balanced ternary representation, you could do that.
Do note, however, that even on a machine with different representation, most conversions involving unsigned still need to act roughly as if you had a 2's complement representation. For example, converting -1 to unsigned will always yield the largest unsigned value. With 2's complement, those both have all bits set. Using another representation, it might have to manipulate bits to get the right result.
 
@JerryCoffin Thanks! Still, first things first: what can you say about the missing link to 5.2.4.2.1 in c++2011? Does that change anything?
 
@iksemyonov It turns what had been a practical fact for decades into an actual requirement. Little practical difference though, unless you deal with some ancient (and even then fairly fringe) architectures.
 
8:03 PM
@JerryCoffin Ok, so it's de jure vs de facto, in a sense.
Now as far as your second note goes, are you referring to 4.7 Intergral conversions?
Where the behavior is described in terms of the values, not representations?
 
@iksemyonov Exactly.
@iksemyonov I haven't actually looked up that part of things in years, so I don't remember section numbers any more.
@iksemyonov Yeah, if memory serves, the phrasing is something like "congruent to the source value modulo 2^N, where N is the width of the destination" (but as I said, I haven't looked in years, so my wording could be a bit wrong).
 
8:35 PM
very interesting the FCLK stuff, that could have a huge impact on y-cruncher
 
9:02 PM
@JerryCoffin Is "congruent" a mathematical term in this context? I know what "congruent triangles" means, but applied to integers, it makes little sense to me.
Does it have to do with modular arithmetic?
 
9:17 PM
@iksemyonov Yes. "Congruent to X" basically means "the remainder when divided by X". When you deal with negative number, congruent (at least normally) means you "move" it into the range 0..X-1, so if your remainder was negative, add X to get a positive number.
 
9:31 PM
@iksemyonov get a life :-)
 
9:59 PM
@Mikhail starred :p
 
10:09 PM
Actually, more like "get a c++ job"
 
10:24 PM
"wow I get to work at Microsoft on the C++ compiler", turns out to be VS Code front end work in Javascript
 
@Mikhail UI in JavaScript and code generation in C++ seem like practically the same thing, at least to me...
 
10:52 PM
@JerryCoffin the latter is easier. for it's written in c++
 
11:30 PM
@iksemyonov All executes on the same processor, so the differences are obviously insignificant.
Personally, I prefer to code in good, portable, ISO-standard Malbolge, but I realize that in the end it's no different from any other programming language.
 
I've found that a higher ISO helps when working in the fast pace world of Javascript front-end development
 

« first day (3239 days earlier)      last day (1724 days later) »