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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import json | |
| import signal | |
| import subprocess | |
| import sys | |
| from datetime import datetime | |
| from os import environ, utime |
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 numpy as np | |
| import cv2 | |
| im = cv2.imread('button1.jpg') | |
| hsv_img = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) | |
| kernel = np.ones((5,5),np.uint8) | |
| edges = cv2.morphologyEx(hsv_img, cv2.MORPH_GRADIENT, kernel) | |
| ret, thresh = cv2.threshold(edges,0,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU) | |
| cv2.imshow("Show", thresh) | |
| cv2.waitKey() |
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 imaplib | |
| import re | |
| import datetime | |
| from os import system, environ | |
| def process(client): | |
| rv, data = client.search(None, 'ALL') | |
| # print rv, data | |
| emails = data[0].split() |
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
| 06-26 17:23:44.592 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ <--- HTTP 200 https://share1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountByName (446ms) | |
| 06-26 17:23:44.592 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ Cache-Control: private | |
| 06-26 17:23:44.592 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ Content-Length: 38 | |
| 06-26 17:23:44.592 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ Content-Type: application/json; charset=utf-8 | |
| 06-26 17:23:44.592 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ Server: Microsoft-IIS/8.5 | |
| 06-26 17:23:44.593 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ X-AspNet-Version: 4.0.30319 | |
| 06-26 17:23:44.593 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ Date: Fri, 26 Jun 2015 22:23:44 GMT | |
| 06-26 17:23:44.593 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ OkHttp-Selected-Protocol: http/1.1 | |
| 06-26 17:23:44.593 12955-32136/com.eveningoutpost.dexdrip D/SHAREREST﹕ OkHttp-Sent-Millis: 1435357424491 | |
| 06-26 17:23:44.593 |
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
| fun ViewManager.appBarLayout(init: AppBarLayout.() -> Unit = {}) = | |
| __dslAddView({ AppBarLayout(it) }, init, this) | |
| fun ViewManager.collapsingToolbarLayout(init: CollapsingToolbarLayout.() -> Unit = {}) = | |
| __dslAddView({ CollapsingToolbarLayout(it) }, init, this) | |
| fun ViewManager.coordinatorLayout(init: CoordinatorLayout.() -> Unit = {}) = | |
| __dslAddView({ CoordinatorLayout(it) }, init, this) | |
| fun ViewManager.floatingActionButton(init: FloatingActionButton.() -> Unit = {}) = |
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 dateutil.parser | |
| from scipy import stats | |
| from scipy.stats import norm | |
| from numpy import percentile | |
| import math | |
| values = [] | |
| hour_buckets = {} | |
| for hour in range(0,24): | |
| hour_buckets[hour] = [] |
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
| option java_package = "com.nightscout.core.model"; | |
| option java_outer_classname = "Treatment"; | |
| // This is a naive conversion of NightScout's current treatments to protocol buffers | |
| message Treatment { | |
| optional EventType event_type = 1; | |
| optional string entered_by = 2; | |
| required string created_at = 3; |
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
| #!/usr/bin/env python | |
| # replace MONGO_URI with your own nightscout mongo URI | |
| MONGO_URI = 'mongodb://nightscout.example.com:1234/' | |
| import dexcom_reader.readdata | |
| import time | |
| from serial.serialutil import SerialException | |
| from datetime import datetime, date | |
| from pymongo import MongoClient | |
| mongo_client = MongoClient(MONGO_URI) |
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
| function iobCalc(treatment, time) { | |
| var dia=profile.dia; | |
| var scalefactor = 1; | |
| var peak; | |
| if (dia == 3) { | |
| peak=75; | |
| } else { | |
| // console.warn('DIA of ' + dia + ' not supported'); | |
| peak = 75; |