-
Signed or Unsigned
C has always permitted comparisons between any integer type, and C++ follows its lead. Comparing signed types to signed types is straightforward: you sign extend the smaller type. Likewise, when comparing unsigned types to unsigned types, you zero extend. When comparing signed and unsigned types, the rules are less clear. The C standard specifies a…
-
Superbugs
Increasing antibiotic resistance in bacteria is a nice demonstration of: The speed and effectiveness of evolutionary change. The Law of Unintended Consequences The danger of hospitals Antibiotics are in effect poisons that don’t happen to affect humans, typically because they interfere with bacterial cell walls that our cells don’t have. It doesn’t take long in…
-
Synthetic Food
In the modern industrial food system, a cow is a chemical factory which converts corn into beef or milk. This is inefficient and unsafe in several different ways. Cows can not be maintained in sterile environments, so E. coli and other bacteria from their feces can contaminate the meat. Cows evolved to eat grass, so…
-
Thread Sanitizer
I recently ran the gold linker under Thread Sanitizer. It’s a nice plugin for Valgrind which looks for race conditions in multi-threaded programs. To describe it briefly, it builds Happens-Before relationships based on mutex operations and warns when it notices a write and a read/write to the same memory location without a Happens-Before relationship. This…
-
Biophilia
E.O. Wilson’s notion of biophilia, which is slightly different from closely related to the newer idea of evolutionary psychology, posits that humans can not be healthy without some access to the natural world. The argument basically amounts to saying that we have evolved in a world which is not completely under human control, and we…