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
/* | |
* PlushBot/Lilypad Zelda Frog | |
* | |
* Basic Lilypad circuit with a light sensor, a piezo, and some LEDs. | |
* This is a modified version of the example sketch that just played the scale. | |
* Now it plays the ending theme from the original Legend of Zelda, complete with a bass line. | |
* | |
* Video of the complete circuit (but half-finished PlushBot) in action: | |
* http://www.youtube.com/watch?v=JyAL9HSyIVM | |
*/ |
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 os, sys, numpy, PIL | |
from PIL import Image | |
# Build list of source video clips from arguments | |
clips = [] | |
for i in range(1,len(sys.argv),2): | |
path = sys.argv[i] | |
offset = sys.argv[i+1] | |
filename, ext = path.split('.') | |
clip = { 'path': path, |
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
/** | |
* Generate a "pretty" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range) | |
* Based on R's "pretty" function: | |
* https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c | |
* Arguments: | |
* range (required) :: Two-element array representing the range for the ticks to cover | |
* n (optional) :: A "target" number of ticks; will not necessarily be the number of ticks you get (default: 5) | |
* internal_only (optional) :: Boolean for whether to only return ticks inside the provided range (default: false) | |
*/ | |
function pretty(range, n, internal_only){ |
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 solution(std::vector<int> &A, std::vector<int> &B) | |
{ | |
std::map<int, int> disjoints; | |
for (std::size_t i = 0; i < A.size(); ++i) | |
{ | |
auto it = disjoints.lower_bound(B[i]); | |
if (it == disjoints.end()) | |
{ | |
disjoints.emplace(A[i], B[i]); |
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/python | |
import string, os | |
START_FILE_PATH = "start.pp3" | |
END_FILE_PATH = "end.pp3" | |
RAW_FILES_DIR = "raw" | |
# Load the contents of the start and end PP3 files (equal line numbers enforced!) |
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 'typeface-source-sans-pro'; | |
import { createMuiTheme, responsiveFontSizes } from '@material-ui/core/styles'; | |
// Values defined here are based on the NEON Style Guide. | |
// See all customizable Material UI theme keys here: | |
// https://material-ui.com/customization/default-theme/#explore | |
const PALETTES = { | |
PRIMARY: { |