Skip to content

Instantly share code, notes, and snippets.

@stsievert
stsievert / after_commenting_out
Created October 16, 2014 22:00
myo-python errors
> ipython script.py
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
/Users/scott/Developer/gesture/gesture_mac/python/script.py in <module>()
1
2 import myo
----> 3 myo.init()
4
5 from myo.six import print_
@stsievert
stsievert / macvim-latex-box.md
Last active August 29, 2015 14:10
MacVim and latex-box

Description

I ran into the issue where MacVim could not compile latex files using latex-box under OSX Yosemite. This only occured when opening MacVim the most natural way (at least for me): using Spotlight or double clicking. Opening with the terminal (using mvim etc) gave me no compile errors. There's a related [Github issue].

Fix

To fix this issue, I created a simple Automator workflow that acted as an application and would run mvim on a file received as input. This application

@stsievert
stsievert / cell_tower-save.pickle
Created February 27, 2015 16:12
HW1 for EE5393: Circuits, Computation and Biology
cnumpy.core.multiarray
_reconstruct
p0
(cnumpy
ndarray
p1
(I0
tp2
S'b'
p3
@stsievert
stsievert / .vimrc
Created May 23, 2015 22:23
vim configuration
" REQUIRED INSTALL:
" > brew install macvim --with-cscope --with-lua --HEAD
" lua not required but HEAD required for breakindent
"
" QUICK REFACTOR
" * hover over word, press `*`
" * use :%s//newName/g to replace all occurences
" MARKDOWN PREVIEW
" * <leader>md to open up safari and view it live
" ULTISNIPS
@stsievert
stsievert / SSreset.py
Last active September 25, 2022 11:39
clear all variables/reset for Spyder
from IPython import get_ipython
def __reset__(): get_ipython().magic('reset -sf')
@stsievert
stsievert / generate_cached_times.py
Last active December 18, 2015 18:10
scikit-image PR #1792
# This was run from a notebook (so I could choose which cells to run).
# I have also uploaded the entire notebook as skimage_fftconvolve.ipynb (via a dropbox link)
# Cell 1
from skimage.restoration import richardson_lucy
import numpy as np
from scipy.signal import convolve, fftconvolve
import timeit
%matplotlib inline
@stsievert
stsievert / import_before_parallel_backend.py
Last active September 2, 2016 02:47
Stack trace for using joblib in dask.distributed.Executor.map
---------------------------------------------------------------------------
PicklingError Traceback (most recent call last)
<ipython-input-6-94dad265e0f3> in <module>()
17 # dask.distributed
18 b = e.map(repeated_tests, values)
---> 19 b = e.gather(b)
20 print(b)
/mnt/ws/home/ssievert/anaconda3/lib/python3.5/site-packages/distributed/executor.py in gather(self, futures, errors, maxsize)
@stsievert
stsievert / 2017-09-01.csv
Last active September 1, 2017 20:42
Growing batch size timing
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
,approx_grad,beta,chunks,d,max_iter,n,pointwise_loss,rel_error,seed,sigma,wall_time
0,True,"[-0.33772545 0.23013211 0.33314611 -0.20971334 -0.30575033 0.37405672
-0.0630507 0.18395188 0.12185236 -0.55615217]",2000,10,1,8000000,404087362.5696646,0.5786328175760411,0,7.0,9.872261762619019
1,True,"[-0.48261279 0.32924311 0.34738249 -0.15459457 -0.19415953 0.42306455
-0.17252527 0.05592582 0.15623894 -0.43401917]",2000,10,1,8000000,403110631.53552437,0.5542360022939973,1,7.0,7.958230018615723
2,True,"[-0.38672315 0.18469769 0.28169293 -0.05405629 -0.22192282 0.33552479
-0.11270603 0.00994565 0.1491486 -0.51029152]",2000,10,1,8000000,405328298.33456,0.6073403494210304,2,7.0,7.640789985656738
3,True,"[-0.38046754 0.23782463 0.18564596 -0.18898523 -0.20634251 0.38498398
-0.27994777 0.05463027 0.1997645 -0.4443485 ]",2000,10,1,8000000,405016186.76993334,0.6002291017741715,3,7.0,9.718455076217651
4,True,"[-0.50255132 0.36809792 0.30386753 -0.09045098 -0.10998031 0.2425631
@stsievert
stsievert / keybase.md
Created September 19, 2017 13:37
keybase.md

Keybase proof

I hereby claim:

  • I am stsievert on github.
  • I am stsievert (https://keybase.io/stsievert) on keybase.
  • I have a public key ASBfnKbfyf1tRg6utXGPlw-g_ZQ9otd2-3vDxvpprQ7xfAo

To claim this, I am signing this object:

@stsievert
stsievert / blur-image.ipynb
Created April 1, 2018 01:45
Blur image with box filter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.