Skip to content

Instantly share code, notes, and snippets.

View heatmap_from_camera.py
# 2nd July 2020
import numpy as np
import cv2
# use it if you wonna write video or ffmpeg
# from skvideo.io import FFmpegWriter
start = 1
duration = 10
fps = '30'
View heatmap_from_camera.py
# 2nd July 2020
import numpy as np
import cv2
# use it if you wonna write video or ffmpeg
# from skvideo.io import FFmpegWriter
start = 1
duration = 10
fps = '30'
@QPeiran
QPeiran / push_data.js
Created May 8, 2020
Push data from "monitor sheet"
View push_data.js
//
function extractInfo()
{
var current_sheet = SpreadsheetApp.openById("<MonitorSheetID>").getSheetByName("Monitor");
var array = []
for (var i = 2; i < 101; i++)
{
var value = current_sheet.getRange(i, 5).getValue();
if (value)
{
@QPeiran
QPeiran / validation.js
Created May 1, 2019
2 selection situations validation
View validation.js
//two pharse random -- 2/3
var A = ["R","R"], B = ["R","B"], C = ["B","B"];
var count = 0, result_ball1_red = 0, result_ball1and2_red = 0, result_ball1red_ball2blue = 0, result_ball1_blue = 0, result_ball1and2_blue = 0, result_ball1blue_ball1red = 0;
var randomBoxNumber, randomBallNumber, FirstBall, SecondBall;
for (count = 1; count <= 1000000; count++)
{
randomBoxNumber = Math.floor(Math.random() * 3 ) + 1;