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 timeit | |
#from line_profiler_pycharm import profile | |
from collections import deque | |
from queue import PriorityQueue # minheap | |
from typing import * | |
import unittest | |
import timeit | |
# MyPy type aliases |
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
# References: | |
# file:///C:/Users/Lenovo/Downloads/vaszil_forditok.pdf | |
# Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman - Compilers - Principles, Techniques, and Tools-Pearson_Addison Wesley (2006).pdf | |
from textwrap import dedent | |
import string | |
from collections import defaultdict | |
import z3 | |
from itertools import combinations |
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 nix-shell | |
#! nix-shell -p gdb psmisc fzf -i bash | |
# Workaround gnome-shell disabling Eval by injecting js with gdb; no need to restart or poke the GUI! | |
# https://askubuntu.com/questions/1201849/invoking-gnome-show-applications-from-command-line | |
# https://askubuntu.com/questions/1412130/dbus-calls-to-gnome-shell-dont-work-under-ubuntu-22-04 | |
#TODO clean this up | |
#TODO extend this to load plugins at runtime? (well, unneeded once you have Eval access I guess, because you can then use it like lg.) |
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 bash | |
set -euo pipefail #NOTE I use a lot of functions and apparently -e is useless with functions? | |
#TODO simplify this back down by separating the render functionality | |
#TODO port to tcl? | |
# =========== utilities =========== # | |
# (root) -> () |