Skip to content

Instantly share code, notes, and snippets.

View colmex's full-sized avatar

Luis Hernandez colmex

View GitHub Profile

Keybase proof

I hereby claim:

  • I am colmex on github.
  • I am luisfmh (https://keybase.io/luisfmh) on keybase.
  • I have a public key ASALLFzMSqR1DacioNqjsnSwoNNe0Qhvf2XNx5uGJfLKvQo

To claim this, I am signing this object:

package me.dontenvy.videotest;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraDevice;
import scipy.sparse as sp
import numpy as np
def random_walk_transition_probability(n, p):
keys = p.keys()
m = 2*max(max(keys),abs(min(keys)))*n+1 # max(max(keys),abs(min(keys))) finds the largest step in the probability array
A = sp.csr_matrix((m, m))
for key in keys:
A += sp.diags(p[key]*np.ones(m-abs(key)), key)
x = np.zeros((m,1))
p = {0: 0.5135135135135135, 1: 0.013513513513513514, 2: 0.04054054054054054, 5: 0.006756756756756757, 6: 0.013513513513513514, 7: 0.013513513513513514, 8: 0.006756756756756757, 11: 0.006756756756756757, 12: 0.006756756756756757, 16: 0.013513513513513514, 18: 0.006756756756756757, 19: 0.006756756756756757, 23: 0.006756756756756757, 25: 0.006756756756756757, 26: 0.006756756756756757, 27: 0.006756756756756757, 28: 0.013513513513513514, 32: 0.006756756756756757, 34: 0.013513513513513514, 35: 0.013513513513513514, 46: 0.006756756756756757, -75: 0.006756756756756757, 55: 0.006756756756756757, -70: 0.006756756756756757, 66: 0.013513513513513514, -2: 0.013513513513513514, -51: 0.006756756756756757, -35: 0.006756756756756757, -34: 0.006756756756756757, -31: 0.006756756756756757, -28: 0.006756756756756757, -25: 0.006756756756756757, -24: 0.006756756756756757, -22: 0.006756756756756757, -21: 0.006756756756756757, -18: 0.02702702702702703, -17: 0.013513513513513514, -15: 0.006756756756756757, -12: 0.013513513513513514, -
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/cProfile.py", line 199, in <module>
main()
File "/usr/lib/python2.7/cProfile.py", line 192, in main
runctx(code, globs, None, options.outfile, options.sort)
File "/usr/lib/python2.7/cProfile.py", line 49, in runctx