Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy import integrate | |
import numpy as np | |
def spring_sys(t, y, m, b, k, F): | |
x, v = y | |
dx = v | |
dv = (F - k * x - b * v) / m | |
return dx, dv | |
def run_sim(x0, v0, m, b, k, F, tend, n): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_svg = function(f){ | |
let c = f.canvas.clone(); | |
let v = new c.default_view({model:c}); | |
f.canvas_view = v; | |
f.force_paint.emit(); | |
return v._ctx.getSerializedSvg(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import time | |
from collections import deque | |
vc = cv2.VideoCapture("rtsp://192.168.0.50:8080/h264_ulaw.sdp") | |
avg_buf = np.zeros((10, 600, 800, 3), float) | |
avg = np.zeros((600, 800, 3), float) | |
index = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph g { | |
graph [ | |
rankdir = "LR" | |
]; | |
node [ | |
fontsize = "16" | |
shape = "ellipse" | |
]; | |
edge [ | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
from bokeh.models import Button, Div | |
from bokeh.layouts import column | |
from bokeh.document import without_document_lock | |
from bokeh.io import curdoc | |
from zmq_subprocess import ZmqSubProcessClient | |
ok_button = Button(label="ok") | |
div = Div() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_quiver(fig, x, y, u, v, scale_uv=None, arrow_size=5): | |
import numpy as np | |
from bokeh.models import ColumnDataSource, CustomJSTransform, CustomJS | |
from bokeh.transform import field | |
x, y, u, v = (np.asanyarray(arr).ravel() for arr in (x, y, u, v)) | |
if scale_uv is None: | |
from scipy.spatial.distance import pdist, squareform | |
mean_dist = np.mean(np.sort(squareform(pdist(np.c_[x, y])), axis=1)[:, 1]) | |
max_len = np.max(np.hypot(u, v)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
from bokeh.application.handlers import code_runner | |
def run(self, module, post_check): | |
import ast | |
if path.exists(self._path): | |
with open(self._path, 'r') as f: | |
source = f.read() |