Skip to content

Instantly share code, notes, and snippets.

View amboar's full-sized avatar

Andrew Jeffery amboar

View GitHub Profile
@amboar
amboar / write_all.tla
Last active October 4, 2022 12:43
libmctp serial binding mctp_write_all() specification
----------------------------- MODULE write_all -----------------------------
EXTENDS Integers, TLC, Sequences
CONSTANT L
VARIABLE wrote, remaining, result
vars == << wrote, remaining, result >>
write_errors == { -11, -9, -89, -122, -14, -27, -4, -22, -5, -28, -1, -32 }
@amboar
amboar / README.md
Last active June 8, 2022 08:39
String Clustering Performance

String Clustering with Python (and C)

I became interested in string clustering through developing fpos, a set of Python scripts for graphing my spending habits. In a clear failure of research I missed the existance of libraries like:

# 1 2 3 4 5 6 7 8 9 10 11
+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
SGPMCK ... | | | | | | | | | | | | | | | | | | | | | ...
+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
+---+ +-----------------------------------+
SGPMLD ... | | ...
+---+
@amboar
amboar / esa
Created May 26, 2019 06:25
Evolutionary Seating Arrangement
#!/usr/bin/env python3
import toml
import argparse
from random import randint, sample, choice, shuffle
from collections import namedtuple
from itertools import islice
Guest = namedtuple("Guest", "name, requires, wants")
Table = namedtuple("Table", "capacity, guests")
#!/usr/bin/python3
from collections import namedtuple, deque
from datetime import datetime, timedelta
import argparse
import csv
from fpos import core
from fpos.groups import DynamicGroups
Transaction = namedtuple("Transaction", "date, amount, description, category")
@amboar
amboar / palmetto-gpios.py
Created September 2, 2016 03:36
Dump Palmetto GPIO hog devicetree nodes
#!/usr/bin/python3
import sys
from collections import namedtuple
GpioRegsetConfig = namedtuple("GpioRegsetConfig", "banks value direction")
banks = ( "ABCD", "EFGH" )
broken = (

Keybase proof

I hereby claim:

  • I am amboar on github.
  • I am amboar (https://keybase.io/amboar) on keybase.
  • I have a public key whose fingerprint is AAFD 5B76 5525 F289 7A47 6913 9D1D 9F38 0EE4 B4F9

To claim this, I am signing this object: