Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 python | |
# Note, updated version of | |
# https://github.com/ipython/ipython-in-depth/blob/master/tools/nbmerge.py | |
""" | |
usage: | |
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb | |
""" | |
import io |
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
fname=$1 | |
dims="180x120" | |
convert "$fname" -resize "$dims^" -gravity center -crop "$dims+0+0" +repage "$fname" |
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 | |
from skimage.morphology import disk | |
N = 5 | |
fig, axes = plt.subplots(1, N, figsize=(16, 3)) | |
for n, ax in enumerate(axes): | |
np1 = n + 1 | |
ax.imshow(np.pad(disk(np1), N-n, 'constant'), interpolation='nearest') | |
c = plt.Circle((np1 + N - n, np1 + N - n), radius=np1, fill=False, lw=4, color='b') |
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
classdef Vec < handle | |
%VEC An efficient expandable array class | |
% Vec tries to emulate the behind-the-scenes array doubling behavior of the Vector class from Java. | |
properties(SetAccess = private, GetAccess = private) | |
ptr = 0 | |
data = [] | |
end | |
properties(Dependent) |
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
% params | |
interval = 10; | |
f = 2800; | |
fs = 8192; | |
dur = 2; | |
% Generate waveforms | |
t = 0:1/fs:dur; | |
tone = sin(2 * pi * f * t); |
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 bokeh.layouts import widgetbox, column | |
from bokeh.models.widgets import RangeSlider | |
from bokeh.models.ranges import Range | |
from bokeh.plotting import figure, curdoc | |
range_slider = RangeSlider(start=0, end=10, range=(1,9), step=.1, title="Stuff") | |
p = figure(x_range=range_slider.range) | |
p.line(x=range(10), y=[x**2 for x in range(10)]) |
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
#!/bin/bash | |
for fn in *; | |
do mv "$fn" "${fn//$1/$2}"; | |
done; |
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
quantities_unicode = True |
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 sympy as sp | |
def eliminate(system, symbols): | |
"""Eliminates given variables from a system of equations. | |
Args: | |
system: List of SymPy equations. | |
symbols: List of SymPy symbols to eliminate. Must be shorter than list of equations. | |
Returns: |