Skip to content

Instantly share code, notes, and snippets.

View certik's full-sized avatar

Ondřej Čertík certik

View GitHub Profile
@certik
certik / gist:4393833
Created December 28, 2012 01:55 — forked from anonymous/gist:4393819
NumPy 1.7.x
$ python print_coercion_tables.py
can cast
X ? b h i l q p B H I L Q P e f d g F D G S U V O M m
? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
b 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1
h 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1
i 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1
l 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1
q 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1
p 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1
@certik
certik / gist:3363539
Created August 15, 2012 20:51
Matplotlib failure on Mac
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/Users/ondrej/numpy/bootstrap/lib/python2.5/site-packages/numpy/core/include -I. -I/Users/ondrej/numpy/bootstrap/lib/python2.5/site-packages/numpy/core/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/ft2font.cpp -o build/temp.macosx-10.5-i386-2.5/src/ft2font.o
In file included from src/ft2font.h:16,
from src/ft2font.cpp:3In file included from src/ft2font.h:16,
from src/ft2font.cpp:3:
:
<!-- SceneJS library -->
<script src="scenejs.js"></script>
<!-- JSON airplane model -->
<script src="airplane-model.js"></script>
<!-- WebGL canvas -->
import sys
from IPython.kernel import client
mec = client.MultiEngineClient()
mec.get_ids()
def fails():
e = 1/0
mec.push_function(dict(fails=fails))
try:
print mec.execute('fails()')
except: