
ALT A "database alignment chart". The horizontal axis judges items based on how they're accessed, and the vertical one judges items on what they contain. The items are: Must be queryable with a query language, must contain digital data: PostgresSQL is a database Must be queryable with a query language, must contain information: A library is a database Must be queryable with a query language, can contain anything: Battleship is a database Must be queryable with a language, must contain digital data: Excel is a database Must be queryable with a language, must contain information: A senior engineer is a database Must be queryable with any language, can contain anything: Subway checkout counter is a database Queryable in any way, must contain digital information: Dwarf Fortress is a database Queryable in any way, must contain information: A file cabinet is a database Queryable in any way, can contain anything: A fridge is a database

ALT /* * This returns a constant expression while determining if an argument is * a constant expression, most importantly without evaluating the argument. * Glory to Martin Uecker <[email protected]> */ #define __is_constexpr(x) \ (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))

ALT > #define ICE_P(x) (sizeof(int) == sizeof(*(1 ? ((void*)((x) * 0l)) : (int*)1))) Ok, so I can see that (void *)((x)*0l)) turns into NULL when x is an ICE. Fine. So with a constant, we have sizeof( 1 ? NULL : (int *) 1) and the rule is that if one of the sides of a ternary operation with pointers is NULL, the end result is the other type (int *). So yes, the above returns 'sizeof(int)'. And if it is *not* an ICE that first pointer is still of type '(void *)', but it is not NULL. And yes, the type conversion rules for a ternary op with two non-NULL pointers is different, and it now returns "void *". So now the end result is (sizeof(*(void *)(x)), which on gcc is generally *different* from 'int'.

ALT a debugging manifesto 1. inspect, don't squash try to fix the bug (crossed out) understand what happened (yes, smiley faces and stars) 2. check your assumptions person (thinking): "wait, how do I know that's true?" 3. being stuck is temporary person (thinking): "I will never figure this out!" ... 2 minutes later.... person (thinking): "well, I haven't tried X..." 4. don't go it alone person (speaking to other person): "hey, have you seen this problem before?" 5. trust nobody and nothing person (thinking): this library can't be buggy... OR CAN IT??? 6. there's always a reason computer: "computers are always logical, even when it doesn't feel that way" 7. build your toolkit person (holding toolkit): "wow, the CSS inspector makes debugging SO MUCH EASIER" 8. it can be an adventure person (talking, with cute bug next to them): "you wouldn't BELIEVE the weird bug I found" by @b0rk @omarieclaire, more like this at https://wizardzines.com


































