Skip to content

Instantly share code, notes, and snippets.

View decode-solution.py
#!/usr/bin/python3
# Usage: $ generate-sat.py k l i n
#
# Generates a DIMACS CNF file that's satisfiable iff there's a
# cross-intersecting set system with m(k,l,i) = n.
#
# Let {(A_i, B_i}} (1 <= i <= n) be a set pair system. An i-cross-intersecting
# system has #(A_i intersect B_j) = 1 when i != j and 0 when i = j.
#
View extract-code.py
#!/usr/bin/python3
# Usage: extract-code.py <cnf-file> <sat-solver-output-file>
import re
import sys
def strip_cnf_mapping(filename):
# lines look like 'c var 1 == 000001 chosen'
mapping = {}
@aaw
aaw / live_logs.json
Created Feb 2, 2015
Kibana config for a live, queryable view of logs
View live_logs.json
{
"title": "Live Logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,