This file contains 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 base64 as b64 | |
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
from ipywidgets import interact, interactive, fixed | |
from IPython.display import Image, display | |
import ipywidgets as widgets | |
from itertools import tee, izip | |
WINDOW_SIZE = 41 # size of window to use when computing averages. Endpoint images outside |
This file contains 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 base64 as b64 | |
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
from ipywidgets import interact, interactive, fixed | |
from IPython.display import Image, display | |
import ipywidgets as widgets | |
def convert_media_to_image(media): | |
arr = np.asarray(bytearray(b64.b64decode(media["__data__"])), dtype=np.uint8) |
This file contains 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
%matplotlib inline | |
import matplotlib.pyplot as plt | |
from datetime import timedelta | |
from bson import ObjectId | |
import seaborn as sns | |
sns.set_style('whitegrid') | |
from itertools import cycle | |
cyclic_palette = cycle(sns.color_palette()) | |
values = [] | |
X = [ObjectId(oid).generation_time for oid, rec in data][:40] |
This file contains 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 gevent | |
import urllib2 | |
image_url = "http://manage.hdrelay.com/snapshot/ee489921-1004-45df-9634-0fa96543dabf?size=710x425&f=30000" | |
polling_interval = "31" | |
def stream(): | |
while True: | |
msg = {"media_url": image_url} | |
msg["polling_interval"] = float(polling_interval) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href= | |
"http://js.arcgis.com/3.14/esri/css/esri.css"> | |
<link rel="stylesheet" type="text/css" href= | |
"https://rawgit.com/benheb/legend/master/legend.css"> |
This file contains 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
{ | |
"item": { | |
"title": "New Map", | |
"snippet": "Census Blocks", | |
"extent": [ | |
[ | |
-124.86249999996639, | |
-42.233197141816774 | |
], | |
[ |
This file contains 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
#!/bin/sh | |
"exec" "twxec" "-e" "rand_ints()" "$0" "$@" | |
import random | |
import gevent | |
def rand_ints(): | |
while True: | |
value = random.randint({{number minval}}, {{number maxval}} + 1) |
NewerOlder