This file contains hidden or 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 subprocess as sp | |
import os | |
def ogg(fin, fout): | |
p1 = sp.Popen(["ffmpeg", "-loglevel", "error", "-i", fin, "-f", "flac", "-"], stdout=sp.PIPE) | |
p2 = sp.Popen(["oggenc", "-Q", "-q", "5", "-", "-o", fout], stdin=p1.stdout, stdout=sp.PIPE) | |
p1.stdout.close() | |
p2.communicate() | |
ret = p1.poll() or p2.poll() | |
return ret |
This file contains hidden or 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
// C port of http://ldesoras.free.fr/prod.html#src_hiir | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <errno.h> | |
const double PI = 3.1415926535897932384626433832795; | |
void | |
compute_transition_param(double *kp, double *qp, double transition) |
This file contains hidden or 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
__root: &__root_t0x4004f960 | |
_G: *__root_t0x4004f960 | |
_VERSION: Lua 5.1 | |
arg: &arg_t0x40055cc8 | |
"-1": luajit | |
0: run.lua | |
assert: fbuiltin#2 | |
bit: &bit_t0x40054d58 | |
arshift: fbuiltin#70 | |
band: fbuiltin#73 |
This file contains hidden or 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
# (product name, unit weight) | |
# D'Addario stock via http://www.daddario.com/upload/tension_chart_13934.pdf | |
# Circle K String stock http://circlekstrings.com/CKSIMAGES/UnitWeightChart130105.pdf | |
# string names don't necessarily match up with their actual product names | |
daddario_plain_steel = ( | |
('DAPL007' , .00001085), | |
('DAPL008' , .00001418), |
This file contains hidden or 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
@ECHO OFF | |
set input=%1 | |
set output="%~p1%~n1.fdk.mp4" | |
REM any of these can be commented out | |
set trim=start=0:duration=41 | |
set scale=640:480 | |
set aspect=4:3 | |
set volume=24dB | |
This file contains hidden or 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 | |
shopt -s expand_aliases | |
input="phdump2.txt" | |
# matches ascii, fullwidth punctuation, | |
# and various japanese character blocks | |
regex='[\t\x{20}-\x{7E}\x{4E00}-\x{9FAF}\x{3000}-\x{30FF}\x{FF00}-\x{FFEF}]+' | |
# adds UTF-8 BOM |
This file contains hidden or 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
local mt = getmetatable(_G) | |
if mt == nil then | |
mt = {} | |
setmetatable(_G, mt) | |
end | |
mt.__declared = {} | |
function mt.__newindex(t, n, v) | |
if not mt.__declared[n] then | |
local info = debug.getinfo(2, "S") | |
if info and info.what ~= "main" and info.what ~= "C" then |
This file contains hidden or 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
#CFLAGS = -ggdb -Wall | |
CFLAGS = -Ofast -Wall | |
install: all | |
cp zadis /usr/bin/zadis | |
all: | |
$(CC) $(CFLAGS) -o zadis adis.c | |
clean: |
This file contains hidden or 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
from retry import retry | |
import requests, requests.exceptions | |
class StatusCodeError(Exception): | |
def __init__(self, code, url): | |
self.code = code | |
self.url = url | |
def __str__(self): | |
return 'request for {} returned status code {}'.format(self.url, self.code) |
This file contains hidden or 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 numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.signal as sig | |
# optionally, use an alternate style for plotting. | |
# this reconfigures colors, fonts, padding, etc. | |
# i personally prefer the look of ggplot, but the contrast is generally worse. | |
plt.style.use('ggplot') | |
# create log-spaced points from 20 to 20480 Hz. |