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 python | |
import numpy as np | |
import cv2 | |
import sys | |
import scipy.io.wavfile | |
import scipy.signal | |
MIDDLE_RANGE = 2**15 | |
ARBITRARY_MAX_RANGE = 65600 # we use 65600 instead of 65536 so we don't go off the edge |
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
extern crate z3; | |
fn main() { | |
let mut initial_s: Vec<&str> = vec![ | |
" 9 4 ", | |
" 7 6 1 ", | |
"4 58 ", | |
"9 6 85 ", | |
"8 3", | |
" 51 2 9", |
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
SOURCES := $(shell find . -name '*.mmd' -not -path "node_modules") | |
SVGS := $(SOURCES:%.mmd=%.svg) | |
DATEFILE := .last_build.$(shell date +%Y-%m-%d).date | |
MERMAID_CLI := node_modules/.bin/mmdc | |
all: $(MERMAID_CLI) $(SVGS) | |
$(MERMAID_CLI): node_modules | |
node_modules: package.json |
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 python2 | |
from __future__ import print_function, unicode_literals | |
import gps | |
import gps.clienthelpers | |
def get_lat_lon(client): | |
while client.read() == 0: |
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
def stereographic_project(obj): | |
""" | |
Given a 2D xy plane, project it onto a 1 m sphere centered at the origin | |
A point source of light placed at the top of this sphere (z = 1 m) | |
will then cast a shadow that looks the same as the original plane | |
""" | |
for vert in obj.data.vertices: | |
x = vert.co.x | |
y = vert.co.y |
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
""" | |
Bayer Matrix | |
Generate a PNG Bayer Matrix | |
Usage: | |
bayer_matrix <order> [--output=<file>] | |
Options: | |
-h --help Show this screen |
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 pathlib | |
import subprocess | |
import sys | |
REENCODE_EXTENSIONS = {'.flac', '.m4a', '.alac'} | |
COPY_EXTENSIONS = {'.jpg', '.jpeg', '.png', '.mp3', '.opus', '.ogg'} | |
IGNORE_EXTENSIONS = {'.log', '.cue', '.txt'} | |
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
""" | |
caching test/demo | |
first: | |
pip install fastapi aiocache "uvicorn[standard]" | |
""" | |
import asyncio | |
import contextlib | |
import json | |
import logging |