Skip to content

Instantly share code, notes, and snippets.

💻
🐍 💨

Jim Crist-Harif jcrist

💻
🐍 💨
Block or report user

Report or block jcrist

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
@jcrist
jcrist / matmul.ipynb
Created Aug 16, 2019
Benchmarking matmul implementations on small matrices
View matmul.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcrist
jcrist / Dockerfile
Last active May 6, 2019
Hadoop Pseudodistributed Skein debugging
View Dockerfile
FROM ubuntu:xenial
RUN apt-get update && \
apt-get install -y -q curl bzip2 git && \
rm -rf /var/lib/apt/lists/*
# Install CDH5 in a single node: Pseudo Distributed
# Docs: https://www.cloudera.com/documentation/enterprise/5-6-x/topics/cdh_qs_yarn_pseudo.html
ADD cloudera.pref /etc/apt/preferences.d/cloudera.pref
RUN curl -s https://archive.cloudera.com/cdh5/ubuntu/xenial/amd64/cdh/archive.key | apt-key add - && \
@jcrist
jcrist / github-remote-add.sh
Created Apr 30, 2019
Add a remote github user account for the current repo
View github-remote-add.sh
function github-remote-add () {
case $1 in
""|--help|-h)
echo "Usage: github-remote-add USERNAME"
return 1
;;
esac
local root=`git rev-parse --show-toplevel`;
if [ $? -ne 0 ]; then
echo "Not in a git directory"
@jcrist
jcrist / bench.py
Last active Dec 6, 2019
Vaex String benchmarks, updated with dask fixes
View bench.py
import vaex
import numpy as np
import dask.dataframe as dd
import dask
import dask.distributed
import json
import os
import time
import argparse
import multiprocessing
@jcrist
jcrist / sparse_demo.ipynb
Created Oct 12, 2018
Sparse Tensor Decomposition with Tensorly
View sparse_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View switch.py
_cache = {}
def case(x):
if x not in _cache:
_cache[x] = type("Case", (Exception,), {})
return _cache[x]
def switch(x):
@jcrist
jcrist / bench.py
Created Jul 26, 2017
Benchmark Blackscholes
View bench.py
import argparse
from timeit import default_timer
from collections import namedtuple
import numpy as np
import dask.array as da
from dask.threaded import get
from scipy.special import erf
@jcrist
jcrist / set_cell.py
Last active May 26, 2017
Solution to Joe Jevnik's awful puzzle
View set_cell.py
import platform
import ctypes
print("Implementation: %s" % platform.python_implementation())
def cell_set(cell, target):
offset = 2 if platform.python_implementation() == 'PyPy' else 4
def inner():
@jcrist
jcrist / bench.py
Created Apr 26, 2017
Benchmark distributed joblib for random forests
View bench.py
from __future__ import division, print_function
from time import time
import numpy as np
from sklearn.datasets import fetch_covtype
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
from sklearn.metrics import zero_one_loss
from sklearn.utils import check_array
@jcrist
jcrist / vis.py
Created Mar 15, 2017
Simple visualization of dask graph pipelines.
View vis.py
import os
import graphviz
from dask.optimize import key_split
from dask.dot import _get_display_cls
from dask.core import get_dependencies
def node_key(s):
if isinstance(s, tuple):
You can’t perform that action at this time.