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 subprocess | |
### for reference, the output of v4l2-ctl -d /dev/video1 -l (helpful for min/max/defaults) | |
# brightness (int) : min=0 max=255 step=1 default=128 value=128 | |
# contrast (int) : min=0 max=255 step=1 default=128 value=128 | |
# saturation (int) : min=0 max=255 step=1 default=128 value=128 | |
# white_balance_temperature_auto (bool) : default=1 value=1 | |
# gain (int) : min=0 max=255 step=1 default=0 value=0 | |
# power_line_frequency (menu) : min=0 max=2 default=2 value=2 |
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
#include "FastLED.h" | |
#define REDPIN 5 | |
#define GREENPIN 6 | |
#define BLUEPIN 3 | |
// blend() below can take two CRGB or CHSV colors | |
// CRGB color1 = CRGB(255, 0, 0); | |
// CRGB color2 = CRGB(0, 0, 255); |
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 datetime | |
import pandas as pd | |
import os | |
import re | |
import subprocess | |
import time | |
### assumes you have run: | |
# cd path/mobility-report-data-extractor |
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 pandas as pd | |
def data_weighted_kmeans(df, x_val, y_val, wt_val=None, k=1, centers=None, max_iters=100): | |
"""Revised version of the code found here, allowing the use of a data frame instead of a list of dicts. | |
- https://github.com/leapingllamas/medium_posts/observation_weighted_kmeans | |
Re-citing original code referenced by leapingllamas github above: | |
- http://people.sc.fsu.edu/~jburkardt/m_src/kmeans/kmeans.html | |
- http://people.sc.fsu.edu/~jburkardt/m_src/kmeans/kmeans_w_03.m | |
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 pandas as pd | |
import itertools | |
df = pd.DataFrame({'group': ['a', 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b'], | |
'date': [0, 1, 1, 1, 1, 2, 3, 4, 4], | |
'old': [1, 8, 2, 2, 5, 5, 4, 10, 7], | |
'new': [2, 5, 5, 8, 2, 4, 7, 1, 10]}) | |
print(df) | |
### jumbled: the `new` value of a row is not the same as the next row's `old` value | |
# group date old new |
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 json | |
import os | |
import re | |
import requests | |
import subprocess | |
import time | |
import urllib | |
import yaml | |
### uncommment / fill in the below |
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
// every second, we copy all LED values forward one pixel | |
EVERY_N_MILLISECONDS(1000) | |
{ | |
for(int i=NUM_LEDS-1; i>0; i--) | |
{ | |
leds[i] = leds[i-1] | |
} | |
leds[0] = CRGB(0, 0, 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
unredir-if-possible = false; | |
opacity-rule = ["70:class_g = 'URxvt'"]; | |
fade-in-step = 0.02; | |
fade-out-step = 0.02; | |
fade-delta = 2; | |
inactive-dim = 0.1; | |
shadow = true; | |
shadow-radius = 7; | |
shadow-offset-x = -7; | |
shadow-offset-y = -7; |
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
font pango:Hack 10 | |
hide_edge_borders both | |
for_window [class="^.*"] border pixel 1 | |
for_window [class=".*"] title_format " %title" | |
gaps inner 15 | |
gaps outer 10 | |
set $mod Mod4 | |
floating_modifier $mod |
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 dash | |
from dash.dependencies import Input, Output, Event, State | |
import dash_core_components as dcc | |
import dash_html_components as html | |
app = dash.Dash() | |
app.config.supress_callback_exceptions = True | |
app.css.append_css({'external_url': 'https://codepen.io/chriddyp/pen/bWLwgP.css'}) |
NewerOlder