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
# Setup pi (Raspbian Stretch Lite 2018-03-13) | |
sudo apt update -y | |
sudo apt upgrade -y | |
sudo apt autoremove -y | |
sudo apt install git -y | |
# Install Nodejs | |
cd ~ | |
wget https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-armv6l.tar.xz | |
tar -xvf node* |
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
#!/usr/bin/sudo bash | |
# This script finds, downloads and installs the latest version of nodejs for linux x64. | |
# This script is designed to be safe to rerun. | |
sudo -v | |
VERSION="$(wget -q -O- https://nodejs.org/dist/latest/ | \ | |
grep -o -E "node-v[0-9]+\.[0-9]\.[0-9]-linux-x64" | \ | |
head -n1)" | |
echo Installing $VERSION\.\.\. | |
wget -q https://nodejs.org/dist/latest/$VERSION\.tar\.gz -P /tmp |
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
const input = process.argv[2]; | |
const test = process.argv[3]; | |
if (!input) { | |
console.log('Missing input and test string'); | |
console.log('Usage: node minimum-edit-distance.js <input> <test>'); | |
process.exit(1); | |
} | |
if (!test) { | |
console.log('Missing test string') | |
console.log('Usage: node minimum-edit-distance.js <input> <test>'); |
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
const { exec } = require('child_process'); | |
const express = require('express'); | |
const app = express(); | |
const port = 3000 | |
const commandVisible = 'echo "hello Visible!"' | |
const commandIR = 'echo "hello IR!"' | |
app.get('/visible', (req, res) => { |
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
# From https://stackoverflow.com/questions/27805077/display-io-stream-from-raspberry-pi-camera-as-video-in-pygame | |
import picamera | |
import pygame | |
import io | |
# Init pygame | |
pygame.init() | |
screen = pygame.display.set_mode((320,240)) | |
# Init camera |
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
# From https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor/raspberry-pi-thermal-camera | |
import os | |
import math | |
import time | |
import busio | |
import board | |
import numpy as np | |
import pygame |
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
#!/bin/bash | |
sudo apt update -y | |
sudo apt upgrade -y | |
sudo apt remove nodejs -y | |
sudo apt autoremove -y | |
sudo apt install gedit nano -y | |
# install NodeJs | |
cd ~ | |
wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-arm64.tar.gz | |
tar -xvf node-v8.9.4-linux-arm64.tar.gz |
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
// Chris Woodle, HackNYU2019 | |
// Send an 'S' to toggle a servo open and closed | |
// Refrences: | |
// https://www.arduino.cc/en/tutorial/sweep | |
// https://www.arduino.cc/en/serial/read | |
const char SIGNAL = 'S'; | |
#include <Servo.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
function [th] = specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee) | |
% | |
% specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee) | |
% | |
% function to compute a spectrogram | |
% | |
% winlgh = window length in samples - 400 | |
% framerate = frame rate in num frames per second - 200 | |
% sampling_rate = samples/sec - 16000 | |
% wavedir = directory of the nist files - 'd:/TIMIT/TRAIN/DR1/MCPM0' |
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
function [th] = specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee) | |
% | |
% specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee) | |
% | |
% function to compute a spectrogram | |
% | |
% winlgh = window length in samples - 400 | |
% framerate = frame rate in num frames per second - 200 | |
% sampling_rate = samples/sec - 16000 | |
% wavedir = directory of the nist files - 'd:/TIMIT/TRAIN/DR1/MCPM0' |
OlderNewer