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
int t = 0; | |
void setup() { | |
Serial.begin(38400); | |
} | |
void loop() { | |
double a = sin(t / 100.0); | |
double b = cos(t / 110.0); | |
double c = sin(t / 50.0) + 1.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
// | |
// Allows highlighting of code blocks in Nunjucks template. | |
// https://mozilla.github.io/nunjucks/api.html#custom-tags | |
// | |
const nunjucks = require('nunjucks'); | |
const hljs = require('highlight.js'); | |
function HighlightJsExtension() { | |
this.tags = ['highlightjs']; |
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
""" | |
Detect markers in image and display results | |
""" | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import ndimage | |
from skimage import io | |
from skimage import morphology |
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
""" | |
Detect markers in image and display results | |
""" | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import ndimage | |
from skimage import io | |
from skimage import morphology |
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
# python3 | |
# based on https://raspberrypi.stackexchange.com/questions/58871/pi-camera-v2-fast-full-sensor-capture-mode-with-downsampling/58941#58941 | |
import time | |
import picamera | |
import numpy as np | |
from PIL import Image | |
RECORD_TIME = 5 # number of seconds to record | |
WRITE_IMAGES = False |
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
Test gist |
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
# python3 | |
# based on https://raspberrypi.stackexchange.com/questions/58871/pi-camera-v2-fast-full-sensor-capture-mode-with-downsampling/58941#58941 | |
import time | |
import picamera | |
import numpy as np | |
from PIL import Image | |
RESOLUTION = (1640, 1232) | |
# Calculate the actual image size in the stream (accounting for rounding |
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
""" | |
Example program that retrieves sink speed for first 100 meetbouten. | |
First fetches ids using list endpoint and calls detail endpoint for each id. | |
p.s. A meetbout is a physical screw on the outside of a building which is used to determine the "sink" rate of the | |
structure. | |
""" | |
import logging | |
import json | |
import sys |
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
""" | |
Asyncio pipeline example program that retrieves sink speed for first 100 meetbouten. | |
First fetches ids using list endpoint and calls detail endpoint for each id. | |
p.s. A meetbout is a physical screw on the outside of a building which is used to determine the "sink" rate of the | |
structure. | |
""" | |
import asyncio | |
import json | |
import random |
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
""" | |
Example program for asyncio pipeline with concurrent stages. | |
Program takes string as input and converts it to upper case. | |
An overview of the stages: | |
step B-1 | |
step A -> step B-2 -> step C | |
step B-3 |
NewerOlder