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 cv2 | |
from threading import Thread | |
import datetime | |
class WebcamVideoStream: | |
def __init__(self, src, width, height): | |
# initialize the video camera stream and read the first frame | |
# from the stream | |
self.stream = cv2.VideoCapture(src) | |
self.stream.set(cv2.CAP_PROP_FRAME_WIDTH, width) | |
self.stream.set(cv2.CAP_PROP_FRAME_HEIGHT, height) |
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 numpy | |
import numpy as np | |
from PIL import Image | |
from PyV4L2Camera.camera import Camera | |
from PyV4L2Camera.controls import ControlIDs | |
camera = Camera('/dev/video0', 1280, 720) | |
controls = camera.get_controls() |
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 cv2 | |
cap = cv2.VideoCapture() | |
# cap.open(2, apiPreference=cv2.CAP_V4L2) | |
cap.open(2) | |
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G')) | |
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) | |
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) | |
cap.set(cv2.CAP_PROP_FPS, 30.0) |
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
/* | |
Author:Jack-Cui | |
Blog:http://blog.csdn.net/c406495762 | |
Time:25 May 2017 | |
*/ | |
#include <unistd.h> | |
#include <error.h> | |
#include <errno.h> | |
#include <fcntl.h> |
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
{"lastUpload":"2020-03-15T07:04:40.067Z","extensionVersion":"v3.4.3"} |
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
# install LSP | |
pip install -U jupyterlab | |
pip install jupyter-lsp | |
jupyter labextension install @krassowski/jupyterlab-lsp | |
pip install 'python-language-server[all]' | |
# install Vim | |
jupyter labextension install jupyterlab_vim | |
# install ipywidgets |
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
curl -sL install-node.now.sh/lts -o node_lts.sh | |
sudo bash node_lts.sh | |
sudo rm -rf node_lts.sh |
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 numpy as np | |
import pandas as pd | |
import pandas_gbq | |
sql = """ | |
WITH | |
raw AS ( | |
SELECT | |
DISTINCT USER_ID, | |
SPLIT(Campaign_Name,"_")[safe_OFFSET(0)] AS campaign_id, |
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
class DBMongo{ | |
constructor(url){ | |
this.url = url | |
this.MongoClient = require('mongodb').MongoClient; | |
} | |
createcollection(clt="hardware", dbase="mydb"){ | |
this.MongoClient.connect(this.url, function(err, db){ | |
if(err) throw err; | |
var dbo = db.db(dbase) |
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
{ | |
// | |
// EDITOR CONFIG | |
// | |
"editor.fontSize": 12, | |
"editor.lineHeight": 0, | |
"editor.lineNumbers": true, | |
"editor.tabSize": 4, | |
OlderNewer