Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import argparse
import subprocess
import pathlib
parser = argparse.ArgumentParser("Concatenate and encode movies")
parser.add_argument("infiles", nargs='+',
type=argparse.FileType('r'),
help='Files to encode')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@alchemyst
alchemyst / Weight loss.ipynb
Created August 9, 2019 14:56
Weight loss notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alchemyst
alchemyst / error_logging.py
Created September 23, 2018 12:05
Error loging decorator
import logging
import sys
import functools
logging.basicConfig(level=logging.DEBUG)
LOGGER = logging
def log_if_exception(message):
def decorator(function):
@alchemyst
alchemyst / spreadsheet.py
Created December 18, 2017 13:41
Spreadsheet in 100 lines of Python
#!/usr/bin/env python
import tkinter as tk
import math
import re
from collections import ChainMap
Nrows = 5
Ncols = 5
@alchemyst
alchemyst / multiprogress.py
Created August 22, 2017 04:56
Multi-segment progress bar proof of concept
#!/usr/bin/env python
import tkinter as tk
import time
import random
Nsegments = 100
class Application(tk.Frame):
def __init__(self, master=None):
@alchemyst
alchemyst / compare.py
Last active October 4, 2016 18:05 — forked from sschnug/compare.py
Comparison of different approaches for SO-question https://goo.gl/MjADHs
import numpy as np
import time
from scipy.optimize import minimize, nnls
from cvxpy import *
np.random.seed(1)
""" Test-data generator """
def create_test_data(samples, features, noise, loc=10, scale=2.5):
m = np.random.normal(loc=loc, scale=scale, size=(samples, features))

README is empty

@alchemyst
alchemyst / ar.py
Created November 10, 2013 15:40
Generate lagged AR data
N = 1000
h = 5
y = numpy.random.randn(N)
x = numpy.zeros_like(y)
for i in range(h, len(y)):
x[i] = x[i-1] + y[i - h]