Skip to content

Instantly share code, notes, and snippets.

Prototype version 15
Found device 138a:0097
This device is supported
step 1
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01
0010 00 00 c9 96 88 91 45 a1 00 23 00 00 00 00 01 00
@mo271
mo271 / get_milp.sage
Created May 23, 2018 13:46
This construct the integer program for a tiling problem; it can be easily adapted to exact covers, and allowing reuse of tiles
def milp(self, solver=None):
tiles = {}
for P in self.pieces():
tiles[P.frozenset()] = [Q.frozenset() for Q in P.isometric_copies(self._box, orientation_preserving=not(self._reflection))]
p = MixedIntegerLinearProgram(solver=solver)
x = p.new_variable(binary=True)
for i in self.space():
p.add_constraint(p.sum(x[T, P] for T in tiles for P in tiles[T] if i in P) <= 1)
for T in tiles:
@mo271
mo271 / txt
Created August 28, 2018 08:26
x^48 - 1008*x^46 + 403128*x^44 - 87692448*x^42 + 12008348040*x^40 - 1120658189376*x^38 + 74545764373344*x^36 - 3606531729475968*x^34 + 129269831646915312*x^32 - 4164949576246842880*x^30 + 141942516961279104768*x^28 - 6079710008497542226944*x^26 + 171029843453720580773632*x^24 - 10734215529571167885035520*x^22 + 119485611963873574006938624*x^20 - 7158961249326434415489593344*x^18 + 223410229304763643888886542080*x^16 + 1665579124457906626567818989568*x^14 + 360289207228162192431513880221696*x^12 + 4138484064890644161343737472278528*x^10 + 152548694458573411883645969649469440*x^8 + 1581691619429822432587864824950079488*x^6 + 6289231802234486775557087083681996800*x^4 + 12513023795837806250674990759664713728*x^2 + 16204114268229804228795137561699028992
@mo271
mo271 / 000test.md
Last active December 14, 2020 20:36
html test
@mo271
mo271 / 000index.md
Last active January 5, 2021 11:14
Compare 25%, 50% and full jpg
import tactic
import tactic.gptf
import data.nat.prime
import data.nat.parity
import algebra.divisibility
import algebra.big_operators
import data.set.finite
import number_theory.bernoulli
import data.finset
import data.finset.basic
@mo271
mo271 / bees.md
Last active April 28, 2021 06:24
large jxl
We couldn’t find that file to show.
@mo271
mo271 / latex_test.md
Last active May 20, 2022 08:46
Testing mathjax latex rendering in github

The Basel Problem:

$$\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}.$$

Some commutative diagram:

$$\require{AMScd} \begin{CD} K(X) @>{ch}>> H(X;\mathbb Q);\ @VVV @VVV \

@mo271
mo271 / README.md
Last active June 7, 2022 13:36
jpeg decoding comparison