Welcome to the days of imaginery latest model demand creation only for you to spend more in tokens to build a bucklist apps with zero MMR by end of year
@ai_for_success His time passed, it won't be him, his contribution pushed the realization of AGI forward, but the promised land ain't his to explore, it is some else's
PIDs get recycled, pidfds don't.
If you kill() a PID you saved twenty minutes ago, you might be signaling an entirely different process.
a pidfd is a stable handle to that specific process even after PID reuse.
one of those linux features that feels obvious the moment you learn it.
the binary search you memorized is probably wrong
Jon Bentley published a binary search in Programming Pearls after proving it correct and testing it
the bug survived for nearly 20 years
Joshua Bloch later discovered the exact same bug in the binary search implementation he wrote for the JDK
a 1988 study found correct binary search in only 5 of 20 textbooks
the bug only triggers on arrays with 2^30 or more elements
the problem appears when computing the midpoint
mid = (low + high) / 2 can overflow on very large arrays
the fix is simple: mid = low + (high - low) / 2
in C the overflow gives you an array index out of bounds with unpredictable results in Java it throws ArrayIndexOutOfBoundsException
the same bug affected mergesort and countless other divide and conquer algorithms