Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /usr/bin/env python
"""Add a line to docstring in front of code samples if necessary
The SymPy documentation automatically converts code samples in docstrings to
blocks that can be run in SymPy Live. But many of the docstrings throughout
the project follow text, which means that these code samples are not
recognized. So not only can they not be run in SymPy Live, but they are
converted to `<p>` paragraphs, which means that the formatting is not
preserved, and it's all run together on line.
Traceback (most recent call last):
File "/home/me/.continuum/anaconda/envs/numba21/lib/python3.4/site-packages/llvmlite/ir/instructions.py", line 471, in __init__
typ = typ.elements[i]
AttributeError: 'DoubleType' object has no attribute 'elements'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/me/.continuum/anaconda/envs/numba21/lib/python3.4/site-packages/numba/lowering.py", line 196, in lower_block
self.lower_inst(inst)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moble
moble / AddDirToNames.py
Last active December 16, 2015 06:28
Add '.dir' to the end of every group in the root of an h5 file
#! /usr/bin/env python
import sys
import h5py
for filename in sys.argv[1:] :
with h5py.File(filename, 'r+') as f :
for group in list(f) :
f[group+'.dir'] = f[group]
del(f[group])
"""
Example showing buggy behavior in matplotlib's z-ordering for 3D objects
This example draws a sphere of radius 0.9, and a ring around it at radius 1.0. The ring should therefore be completely
outside of the sphere, and when viewed from above should be completely visible. However, depending on the elevation of the
viewpoint, the ring becomes hidden. In particular, the default elevation shows this problem. However, any elevation of
48.02450 and above seems to work just fine, but anything below that doesn't work.
"""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moble
moble / unconda.sh
Created September 1, 2016 16:01
Bash function wrapper to temporarily remove anaconda/bin from the PATH
unconda () {
local usage="Usage: unconda [-h|--help] [--path /path/to/anaconda/bin] cmd [cmd_args...]
Remove anaconda/bin from PATH and run a command
Options:
-h,--help: Print this message and exit
--path dir: Additional directory to try to remove from PATH
By default, this function tries to remove three possible directories from PATH:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.