I wrote a similar tool[0] a few days back because I wanted a bit more accuracy with timestamp (to measure CPU/idle time) and `ts` occasionally had a deviation of several 10ms. If I knew this, and is accurate enough for me, I might not have written one.
This specific change shall excite many as CC BY-SA 4.0 is one way GPLv3 compatible, but CC BY-SA 3.0 is not. Which means that free software developers can now embedded many Wikimedia contents in their GPLv3 applications. This seems not mentioned in the blog post though.
Incompatibilities between content and code licences has been a perennial problem for FOSS video games. CC-BY-SA-4.0 is an important step in the right direction!
The C standard says: When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded (This is often called ‘‘truncation toward zero’’).
So it should be 0 (as per C standard, not sure what C++ standard says)
int mid(int x, int y) {
return (x/2 + y/2) + (1 & x & y);
}
would be a more readable solution
edit: Actually, this fails on mid(INT_MIN, INT_MAX) and possibly other mixed sign values (returns: -1, expected: 0 (or -1 is okay?), where the precise answer is -0.5)
more edit: The C standard says: When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded (This is often called ‘‘truncation toward zero’’).
What a great book! It was my introduction to 32-bit assembly on Linux. Learning AT&T syntax has both its advantages as well as drawbacks. I've noticed a lot of GNU code uses it, whereas reverse engineering literature loves Intel syntax, which is an interesting cultural difference.
> Why is this even a thing? Maybe I should just go back to buying everything with cash, it's impossible to keep up with all the crap we need to disable or hack around
And some agencies may be more interested in these exclusion databases. So I don't think there is any way to get out of this maze. When you sign up to exclude from a list, you get included in many other.
[0] https://www.sadiqpk.org/projects/tis