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
""" %chain - IPython magic to inspect and move along exception chains. | |
JD Smith (2022) | |
Chained exceptions are associated with the messages: | |
"During handling of the above exception, another exception occurred" | |
"The above exception was the direct cause of the following exception" | |
and post-mortem debugging (%debug) by default can only examine the |
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
/__pycache__ | |
/llog |
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
# Forked from nathanielatom, updated to work with typescript and bokeh==1.3.4 | |
from bokeh.layouts import column, layout | |
from bokeh.models import CustomJS, Model, LayoutDOM | |
from bokeh.document import Document | |
from bokeh.models.widgets import Button, Slider, Toggle | |
from bokeh.core.properties import Instance, String | |
from bokeh.io import save, output_file, show | |
from bokeh.util.compiler import TypeScript | |
from fontawesome.fontawesome_icon import FontAwesomeIcon as Icon | |
# Requires https://github.com/bokeh/bokeh/tree/master/examples/custom/font-awesome |
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
# gradients based on http://bsou.io/posts/color-gradients-with-python | |
def hex_to_RGB(hex): | |
''' "#FFFFFF" -> [255,255,255] ''' | |
# Pass 16 to the integer function for change of base | |
return [int(hex[i:i+2], 16) for i in range(1,6,2)] | |
def RGB_to_hex(RGB): | |
''' [255,255,255] -> "#FFFFFF" ''' |
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
bkdoc = Bokeh._.values( Bokeh.index )[0].model.document |
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
$ cat fix-dropbox.sh | |
#!/bin/bash | |
# XXX: use at your own risk - do not run without understanding this first! | |
exit 1 | |
# safety directory | |
BACKUP='/tmp/fix-dropbox/' | |
# TODO: detect or pick manually... |
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 | |
rawpoints = np.array( | |
[[2500, 0.15, 12], | |
[1200, 0.65, 20], | |
[6200, 0.35, 19]] | |
) | |
# Scale the rawpoints array so that each "column" is | |
# normalized to the same scale |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Translated from a MATLAB script (which also includes C-weighting, octave | |
and one-third-octave digital filters). | |
Author: Christophe Couvreur, Faculte Polytechnique de Mons (Belgium) | |
[email protected] | |
Last modification: Aug. 20, 1997, 10:00am. | |
BSD license |