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
void spwm(int freq, int pin, int spd) { | |
digitalWrite(pin, HIGH); | |
delayMicroseconds(spd * freq); | |
digitalWrite(pin, LOW); | |
delayMicroseconds(spd * (255 - freq)); | |
} | |
int delay = 15; | |
void loop() { |
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
.lib | |
*.cpp.o | |
tinysensor.ino.bin | |
tinysensor.ino.elf | |
tinysensor.eep |
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
.lib | |
*.cpp.o | |
*.ino.bin | |
*.ino.elf | |
*.eep | |
.*.swp |
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
date,time,sys,dia,pulse | |
2019-02-09,15:17:44,129,86,69 | |
2019-02-09,08:48:58,120,84,63 | |
2019-02-08,19:29:04,116,78,71 | |
bp <- read.csv(file="/tmp/x.csv", header=TRUE, sep=",") | |
bp$date = as.Date(bp$date) | |
n = nrow(bp) | |
bq <- bp[order(bp$date, bp$time),] | |
matplot(bq, type="p", xaxt="n") |
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
#define MAX 5 | |
Semaphore forks[MAX]; | |
byte ids = 1; | |
byte leds[] = { 5, 6, 7, 8, 9 }; | |
void eating(byte id) { | |
digitalWrite(leds[id], HIGH); | |
Tasks::delay(1 + random(MAX * 100)); | |
digitalWrite(leds[id], LOW); | |
} |
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/env python | |
import sys | |
import string | |
# while lines are hashed as-is into a map where values are | |
# sets of indices. | |
def hash_whole(hashes, idx, s): | |
h = hash(s) | |
if not h in hashes: |
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 | |
PATH=/usr/local/bin:$PATH | |
WEMO=wemo | |
HOST=iot | |
CLIENT=wemo_mqtt | |
STAT=stat/wemo/power | |
CMND=cmnd/wemo/power | |
. wemo_functions.sh |
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 | |
PATH=/usr/local/bin:$PATH | |
WEMO=wemo | |
. wemo_functions.sh | |
case $# in | |
0) | |
wemo_get $WEMO |
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 numpy as np | |
# Predicts the label based on the sum of the observations with tolerance around 0 | |
# | |
# ('Training accuracy for prediction +1:', 0.64809384164222872) | |
# ('Training accuracy for prediction -1:', 0.37745098039215685) | |
# ('Training accuracy for prediction 0:', 0.3524945770065076) | |
# | |
# Grader Score: 44.29% |
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 sys | |
import os.path | |
import numpy as np | |
import collections | |
import util | |
USAGE = "%s <test data folder> <spam folder> <ham folder>" | |
def get_counts(file_list): |
NewerOlder