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 imutils.video import VideoStream | |
| from datetime import datetime | |
| import imutils | |
| import time | |
| import cv2 | |
| import socket | |
| import paho.mqtt.client as mqtt | |
| import json | |
| import socket |
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 | |
| import time | |
| from PIL import Image | |
| from edgetpu.detection.engine import DetectionEngine | |
| from imutils.video import VideoStream | |
| from utils import get_labels | |
| model = "mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite" | |
| labels = "coco_labels.txt" |
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 paho.mqtt.client as mqtt | |
| import cv2 | |
| import numpy as np | |
| def on_connect(client, userdata, flags, rc): | |
| print("Connected with result code "+str(rc)) | |
| client.subscribe("camera/image") | |
| def on_message(client, userdata, msg): | |
| frame = cv2.imdecode(np.fromstring(msg.payload, dtype='uint8'), -1) |
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 asyncRequest () { | |
| return new Promise((resolve, reject) => { | |
| resolve('resolved with some data'); | |
| //reject('rejected promise'); | |
| //throw new Error('error thrown'); | |
| }); | |
| } | |
| function __(promise) { | |
| return promise |
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
| // fixed compiler version | |
| pragma solidity 0.4.23; | |
| // Contract with owner permissions | |
| contract Ownable { | |
| address internal owner; | |
| constructor() public { | |
| owner = msg.sender; | |
| } |
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
| pragma solidity ^0.4.23; | |
| contract Main{ | |
| IDataProvider dataProvider; | |
| address public owner; | |
| constructor(IDataProvider _dataProvider) public { | |
| owner = msg.sender; | |
| dataProvider = _dataProvider; | |
| } |
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
| //iterate array | |
| const names = ['Tom', 'Dave','Lincoln']; | |
| const iterateNames = names[Symbol.iterator](); | |
| console.log(iterateNames.next()); | |
| //iterate over string | |
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
| //class decorator with no params | |
| function boots(target) { | |
| target.prototype.boots = 'La Sportiva' | |
| } | |
| //class decorator with params | |
| function backpackContents(contents) { | |
| return function(target) { | |
| target.prototype.backPackContents = contents; | |
| } |