fiction / / 10 min read

What is a quine?

q=chr(34)*3 s='q=chr(34)*3\ns={2!r}\na="""{0}"""\nb="""{1}"""\nprint(s.format(a,b,s))' a=""" A quine is... I just woke up from a nightmare.

algorithms / / 4 min read

Fractional Nested Sets: Solving a 30-Year-Old Tree Problem with Floats

The Problem with Nested Sets If you've ever stored a tree in a relational database, you've probably encountered the Modified Preorder Tree Traversal (MPTT) pattern — also known as nested sets. It's Joe Celko's classic: every node gets a lft and rgt integer,