Hacking Washing Machines [video]
media.ccc.de222 pointsby clausecker49 comments
if err != nil { return err; }
is an antipattern. Not because it's verbose, but because you are supposed to handle the error, not pass it right through, in most cases. 10010000 = A
01100110 = B
00001001 = M1 = ~A & ~B
00101010 = M2 = M1 + (A << 1) + 1
00100010 = M3 = M2 & ~M1
Note that this code treats newlines as non-spaces, meaning if a line comprises only spaces, the terminating NL character is returned. You can have it treat newlines as spaces (meaning a line of all spaces is not a match) by computing M4 = M3 & ~A.