News for hackers. Stuff that matters.
Re:The Aggregate Magic Algorithms (2015) by Veedrac on Monday June 19, 2017 @10:29AM (#14587210)
These tricks are cool on their own, but they're really neat when you tie them together to solve larger (but still toy) puzzles. Two fun ones I can remember:

https://www.reddit.com/r/programming/comments/4vctor/.../d5x...

https://cs.stackexchange.com/a/74888/16408

The first asked

> Extra-extra credit can be earned for finding an algorithm that takes no more than O(log N) space and no more than O(log N) time, where N is the number you are seeking for.

and the bit magic made it O(1) space and time. The second was on similar lines.

Unfortunately the bit fiddling at my day job tends to be a bit tamer ;).

Re:The Aggregate Magic Algorithms (2015) by Veedrac on Monday June 19, 2017 @04:33PM (#14590224)
A clarification: this isn't to say such tricks are never used in a non-toy environment. There is, for example, this search algorithm I made for a serious purpose:

https://stackoverflow.com/q/40141793/1763356

The bit math is milder, but it still comes in handy.