threejs is awesome
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
<body> | |
<style> | |
.square-box { | |
width: 33%; | |
height: 0; | |
padding-top: 33%; | |
position: absolute; | |
right: 20px; | |
top: 20px; | |
} |
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
<div class="container"> | |
<video class="input_video"></video> | |
<div class="canvas-container"> | |
<canvas class="output_canvas" width="1280px" height="720px"> | |
</canvas> | |
</div> | |
<div class="loading"> | |
<div class="spinner"></div> | |
<div class="message"> | |
Loading |
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
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
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
// Shannon entropy in bits per symbol. | |
function entropy(str) { | |
const len = str.length | |
// Build a frequency map from the string. | |
const frequencies = Array.from(str) | |
.reduce((freq, c) => (freq[c] = (freq[c] || 0) + 1) && freq, {}) | |
// Sum the frequency of each character. | |
return Object.values(frequencies) |
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 | |
for f in *.wav; do ffmpeg -i "$f" -ab 320k "${f%.wav}.mp3"; done | |
#run this script on an scheduled cron job or from the command line. | |
#to run this script from the command line, open your terminal & cd into your folder of WAVs like so: 'cd myfolder'. hit return. | |
#now type 'sh FFmpeg-batch-convert-wavs-to-mp3s.sh'. hit return to run the script & watch the magic. | |
#all converted MP3s will be placed in the same directory as the original WAVs. |
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 | |
import time | |
import math | |
import numpy as np | |
capture = cv2.VideoCapture(0) | |
print capture.get(cv2.CAP_PROP_FPS) | |
t = 100 | |
w = 640.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
// To prepare a Google Spreadsheet for this: | |
// make sure the spreadsheet has been published to web (FILE >> PUBLISH TO WEB), which is NOT the same as sharing to web | |
// To use in a different script: | |
// 1) include "using Google.GData.Client;" | |
// 2) include "using Google.GData.Spreadsheets;" | |
// 3) call "GDocService.GetSpreadsheet( string spreadsheetKey );", see DebugTest section for sample usage | |
using UnityEngine; | |
using System.Collections; |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.VR; // you always need this to use special VR functions | |
public class VRUtility : MonoBehaviour { | |
// Use this for initialization | |
public void Start () { | |
// set render quality to 50%, sacrificing visual quality for higher FPS |
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
//***************************************************************************** | |
/// @file | |
/// @brief | |
/// Arduino SmartThings Shield LED Example | |
//***************************************************************************** | |
#include <SoftwareSerial.h> //TODO need to set due to some weird wire language linker, should we absorb this whole library into smartthings | |
#include <SmartThings.h> | |
#define PIN_THING_RX 3 |
NewerOlder