Skip to content

Instantly share code, notes, and snippets.

Thomas Kluyver takluyver

Block or report user

Report or block takluyver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@takluyver
takluyver / cache_format_options.py
Created Aug 27, 2019
Karabo data cache format experimentation
View cache_format_options.py
import json
import h5py
import numpy as np
def read_json(path):
with open(path) as f:
loaded_data = json.load(f)
res = {}
for info in loaded_data:
@takluyver
takluyver / VDS issue.ipynb
Created Apr 9, 2019
HDF5 virtual dataset access issue
View VDS issue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takluyver
takluyver / atomicity_issue_pull.py
Created Dec 7, 2018
Pyzmq multipart atomicity issue
View atomicity_issue_pull.py
import os
from time import monotonic
import zmq
# Set up a PULL socket
ctx = zmq.Context()
sock = ctx.socket(zmq.PULL)
sock.set_hwm(1)
sock.connect("tcp://127.0.0.1:8541")
@takluyver
takluyver / pull.py
Created Dec 7, 2018
ZMQ push/pull HWM experiment
View pull.py
import zmq
# Set up the socket
ctx = zmq.Context()
sock = ctx.socket(zmq.PULL)
sock.set_hwm(1)
sock.setsockopt(zmq.RCVBUF, 16 * 1024)
sock.connect("tcp://127.0.0.1:8541")
print("RCVHWM", sock.getsockopt(zmq.RCVHWM))
@takluyver
takluyver / Twitter archive.ipynb
Created Aug 4, 2018
Inspecting archived tweets
View Twitter archive.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View github-py.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Wide tables.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takluyver
takluyver / html_resource_stuffer.py
Created Jan 19, 2018
Stuff JS and CSS into an HTML file
View html_resource_stuffer.py
"""Fetch JS & CSS referenced from the web, and stuff it into the HTML."""
import lxml.html
import requests
IN_FILE = "Using Nbconvert.slides.html"
OUT_FILE = "Using Nbconvert.slides.stuffed.html"
document = lxml.html.parse(IN_FILE)
You can’t perform that action at this time.