This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- How easy is it to convert between two "obviously" equivalent | |
-- definitions? This file contains an example of doing this, | |
-- for two definitions of the typical "finite set of size n", | |
-- that is, the set {0, 1, 2, 3, ..., n-1}. | |
---------------------------------------------------------------- | |
-- Core library definition. | |
---------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Replace the line marked 'TODO' with your solution, then compile by running: | |
; | |
; nasm aoc2021-day01a.nasm && chmod +x aoc2021-day01a | |
; | |
; to generate a static elf binary which should work on x86-64 linux. | |
; You can see what happens instruction-by-instruction with gdb, by running: | |
; | |
; gdb aoc2021-day01a | |
; | |
; and then using the gdb commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tactic | |
/-! | |
# The canonical Ramsey theorem | |
-/ | |
/-! | |
### Vocabulary | |
-/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
CSI escape sequence filter, implemented as a codec. | |
Should be usable for writing to a file using: | |
>>> import csi_filter | |
>>> csi_filter.register() | |
>>> some_file = open('some_file', 'w', encoding='csi_filter') | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""View a tsv in less with suitable tabstops""" | |
import itertools | |
from pathlib import Path | |
import os | |
def tabline(tsv: Path) -> str: | |
"""Compute a suitable tabline for `less --tabs`""" | |
max_widths = [] |