@lore I love it. I've never looked at Z mod 2 equivalency classes in binary. The 2n class would have binary ending in zero and the 2n + 1 class would have the binary end in one. That's pretty damn interesting.
Superficially it's not that impressive but it does a lot more than it seems to. That's a very good dive into the code and explanation. It's textbook worthy, really.
i posted this little C code riddle earlier. so here's what it does:
1. flip all the bits in the input, so 0 becomes 1 and 1 becomes 0
2. bitwise-AND this with 1, whose binary representation is also 1. this will keep only the last bit of the number and set the rest to 0.
the result can thus only be 0 or 1. if you count in binary:
0 = ...000
1 = ...001
2 = ...010
3 = ...011
4 = ...100
5 = ...101
notice how the last bit keeps flipping for every number?
if the function was just x & 1, this would tell you if the number was odd. but if you flip all the bits before you mask it, it tells you if the number is even.
could also be written as !(x & 1)
@lore Embarrassingly enough I seem to have mostly used something closer to ANSI C or C89. I do recall conditionals being used extensively. Well I guess I'll have to check out Fatboy Slim You've come a long way, Baby.
*/
There's also this dead give away from my code.
/*
@lore That's likely where I got confused. In Mathematics the tilde (~) is used to negate. For a Boolean value we used T or F instead of 0 and 1. This is because they are True or False and the 0 or 1 could imply that they are integers. While {0,1} are a subset of Integers, they are merely place holders and not subject to operations.
Perhaps what confused me the most was that there was no mod 2 operation visible. I do assume at first that it would return two values but I couldn't understand why it would do so.
(See nearly every example of C with return 0 ie it worked or the other numbers from where code failed.)
The more I looked at it, it started to appear to be a weird Comp Sci thing and it did turn into more weird Comp Sci things. I've used C for a while and Cpp until around 4 years ago when Cpp++ really made me hate it.
I'm stumped, it seemingly returns bit flipped X (or negation X) And 1. I don't see what it does and I'm not cheating and compiling it. Assuming that X has the value of 0 it could bit flip to 1 and that's what the result is but I really don't get what the & 1 is doing. Very humbling.
@freemo @Pat @TruthSandwich Zebra F-701 if you can find one. It's nearly all steel and loved by officers working in a jail. It's a bit heavy with a knurled steel grip but it writes very well. It takes the standard Zebra refills or a Fisher Space Pen refill with some modifications.
The ink is very black so I use the very fine point. The ink dries fast enough with the fine point to where I haven't had any issues with smearing.
It's just something about the F-701 that makes it feel well balanced and precise. I believe it was discontinued but came back as a pen for use in medical environments. It's not like the F-301 pens where the plastic grip breaks and the pen is done. Most of the pen is steel with the exception of the click mechanism and interior where it holds the ink.
A refined writing instrument that is durable enough to stab something and go back to writing.
I love a good pen and now you have me considering a pocket protector... burt I also accepted I am a nerd a long time ago :)
@lucifargundam @freemo If you start to display PTSD symptoms don't hesitate to seek help.
@thendrix Perhaps dog body armor would be higher on the list.
Relearning C++ after C++11
@thendrix nothing to see here, move along.
@freemo @trinsec You should be receiving hazard pay so hopefully that will increase the amount of money from the contract. If it doesn't get better I'd highly recommend a vest and NATO helmet. The helmet won't stop bullets but the webbing system instead has great protection against the pressure wave. The vest should help with the pressure wave and possible shrapnel.
Time to swap to a Toughbook and carry a boo-boo kit. In a fucked up way, that sounds very exciting.
@thendrix They also make it difficult for individuals to obtain energetics for legal land blasting. I only needed a little bit of tnt or less RDX to clear a heavily clogged culvert in a swampy area where equipment would not be feasible. NSL finding how to get an explosive permit.
Despite that, tannerite is somehow legal and nearly useless except to shoot at. It could have worked but it was not the approved use of it. I really don't like the fact that I couldn't get a 3ft diameter culvert cleared when the simplest of land blasting could have dislodged the debris.
@lore Zallen {0,1}.
Seemingly the negation of X and 1. Negation of X being the bit flip of the binary number. So it's going to be swapping to truth value and adding a 1 to it. It could return the same value or probably cause a compiler error. The bool is not bitwise but the operation occurs outside the bool.
It's not comfortable code to look at.
@thor I don't have the same experience. My friends usually care more.
@thendrix The government is the real problem here. Cartels are just businesses that are oppressed by shortsighted officials. The US could fix many of its problems by legalizing drugs, firearms and sex work.
These problems are a fantastic way to manipulate the public, secure funding and perhaps get senators to vote a certain way.
@thor Perhaps it's best to enjoy everything in moderation.
@thor Same here.
@thor I hear that in Sweden all crime is illegal.
@Pat @TruthSandwich @freemo To mark themselves?
@TruthSandwich @Pat @freemo As someone who has very similar views to Libertarians, I'm surprised you didn't simply ignore them. It's like voting polls but with attention.