Skip to content

Instantly share code, notes, and snippets.

View dusenberrymw's full-sized avatar

Mike Dusenberry dusenberrymw

View GitHub Profile
import numpy as np
# the function
def f_of_x(X, w):
n,d = X.shape
X_dot_w = np.dot(X,w)
y = np.zeros(n)
# the inner product randomly goes through a sin
# or a cos
cos_flag = np.random.randn(n) < 0.0
@dusenberrymw
dusenberrymw / gist:99afd048e93629d02c8d0b48fdebebad
Last active April 5, 2018 23:01 — forked from tonyc/gist:1384523
Using strace, lsof, pyflame, and flamegraph.pl

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)