Skip to content

Instantly share code, notes, and snippets.

View takluyver's full-sized avatar

Thomas Kluyver takluyver

View GitHub Profile
@takluyver
takluyver / ipy_jupyter_components.svg
Created April 22, 2015 19:09
Jupyter and IPython components
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takluyver
takluyver / backslash.md
Last active August 29, 2015 14:22
UK keyboard layout on US keyboard -add backslash

I set up US physical keyboards with a UK layout, because I can type without looking at the keys. But the key for backslash is missing. This is how I remap it to AltGr+Z.

Edit /usr/share/X11/xkb/symbols/gb. In the extd section, add this line:

    key <AB01>  { [  z,                  Z,       backslash,        bar ] };

Also, change dead_grave to grave near the top of this section to fix backticks. Save the file.

@takluyver
takluyver / gist:887333
Created March 25, 2011 18:28
IPython Qtconsole Windows ls traceback
C:\python\external\ipython>ipython-qtconsole
Starting the kernel at pid: 2216
XREP Channel on port 4380
PUB Channel on port 4381
REQ Channel on port 4382
Heartbeat REP Channel on port 4383
To connect another client to this kernel, use:
-e --xreq 4380 --sub 4381 --rep 4382 --hb 4383
---------------------------------------------------------------------------
@takluyver
takluyver / gist:914402
Created April 11, 2011 21:35
IPython pylabtools test error
======================================================================
ERROR: test (IPython.lib.tests.test_pylabtools.test_figure_to_svg)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/thomas/Code/virtualenvs/ipy-trunk/lib/python2.6/site-packages/IPython/testing/_paramtestpy2.py", line 53, in run_parametric
testgen.next()
File "/home/thomas/Code/virtualenvs/ipy-trunk/lib/python2.6/site-packages/IPython/lib/tests/test_pylabtools.py", line 49, in test_figure_to_svg
fig, ax = plt.subplots()
AttributeError: 'module' object has no attribute 'subplots'
@takluyver
takluyver / gist:954331
Created May 3, 2011 21:44
IPython test failure - Python 2.7
======================================================================
FAIL: Test the IPython runner.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/thomas/Code/virtualenvs/ipy-trunk/lib/python2.7/site-packages/IPython/lib/tests/test_irunner.py", line 130, in testIPython
self._test_runner(runner,source,output)
File "/home/thomas/Code/virtualenvs/ipy-trunk/lib/python2.7/site-packages/IPython/lib/tests/test_irunner.py", line 57, in _test_runner
mismatch)
AssertionError: Number of mismatched lines: 1
'Number of mismatched lines: 1' = self._formatMessage('Number of mismatched lines: 1', "%s is not true" % safe_repr(False))
@takluyver
takluyver / gist:985716
Created May 22, 2011 18:04
rpy2 test failures with Python 3.2
thomas@thomas-desktop:~$ python3 -m rpy2.tests
.E...Traceback (most recent call last):
File "/tmp/tmpm66dxe.py", line 4, in <module>
import rpy2.rinterface as ri
File "/usr/local/lib/python3.2/dist-packages/rpy2/rinterface/__init__.py", line 79, in <module>
from rpy2.rinterface._rinterface import *
ImportError: No module named _rinterface
......../usr/local/lib/python3.2/dist-packages/rpy2/rinterface/tests/test_EmbeddedR.py:324: DeprecationWarning: Please use assertEqual instead.
self.assertEquals("Doesn't work.", str(sys.last_value))
.......................................................................................F....................................................................................................................................................................F...............................................
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only">
<info>
<title>Trends Journals</title>
<id>http://www.zotero.org/styles/trends-journal</id>
<link href="http://www.zotero.org/styles/trends-journal" rel="self"/>
<author>
<name>Adam Zeilinger</name>
<email>arzeilinger@gmail.com</email>
</author>
@takluyver
takluyver / gist:1101890
Created July 23, 2011 21:14
Get issues from JSON API
import json
from urllib import urlopen
def get_issues(project="ipython/ipython/", state="open"):
f = urlopen("http://github.com/api/v2/json/issues/list/%s%s" % (project, state))
return json.load(f)['issues']
def _parse_datetime(s):
"""Parse dates in the format returned by the Github API"""
return datetime.strptime(s.rpartition(")[0], ")
@takluyver
takluyver / gist:1118181
Created August 1, 2011 14:06
IPython.parallel test failures
iptest IPython.parallel
..............................................................FSSSSSSSSSS.................................F
======================================================================
FAIL: test graceful handling of engine death (balanced)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/thomas/code/virtualenvs/ipy-trunk/lib/python2.7/site-packages/IPython/parallel/tests/test_lbview.py", line 44, in test_z_crash_task
self.assertRaisesRemote(error.EngineError, ar.get, 10)
File "/home/thomas/code/virtualenvs/ipy-trunk/lib/python2.7/site-packages/IPython/parallel/tests/clienttest.py", line 109, in assertRaisesRemote
self.assertEquals(etype.__name__, e.ename, "Should have raised %r, but raised %r"%(etype.__name__, e.ename))
@takluyver
takluyver / gist:1118000
Created August 1, 2011 11:49
IPython crash traceback
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
KeyboardInterrupt Python 2.6.6: /home/ben/dev/ve/ticket-manager/bin/python
Mon Aug 1 12:21:42 2011
A problem occured executing Python code. Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/usr/lib/python2.6/atexit.pyc in _run_exitfuncs()