01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140
Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.
[Laughter]
# simple script to print the current time in bcd | |
import time | |
def digit_to_bcd(num: int) -> list: | |
''' | |
Convert a single decimal digit (0-9) to a 4-bit BCD. | |
Return a list of booleans, each item is a bit. | |
''' | |
if 0 <= num <= 9: |
FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.