Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cmnord on github.
  • I am cmnord (https://keybase.io/cmnord) on keybase.
  • I have a public key ASDoQv8j9asLAKXPA_4wFUdcgPnQdu4cj_MGH0TFiJRA5Qo

To claim this, I am signing this object:

/*
Controlling LCD position using a potentiometer (variable resistor)
For the 2019 Blueprint Arduino learnathon track
Copyright 2019 HackMIT (Kye Burchard)
*/
// include the library code:
#include <LiquidCrystal.h>
@cmnord
cmnord / group_inferences.py
Created February 21, 2019 21:47
Pseudocode to group inferences into cliques, maximizing probability of true detections.
# Create a single-element clique for each vertex
vertex_to_clique_map = {v: clique(v) for v in graph.vertices}
edges = []
for every pair of colors color1, color2:
for every pair of vertices from color1 and color2 v1, v2:
# if v1 and v2's bounding boxes overlap, they have an edge between them
if v1.bounding_box.overlap(v2.bounding_box):
edges.append(edge(v1, v2))
@cmnord
cmnord / ensemble_prob.py
Created February 21, 2019 21:28
Object detection in ensemble probability calculations.
prob_threat_modelA = 0.4
prob_threat_modelB = 0.5
prob_nonthreat_ensemble = (1 - prob_threat_modelA) * (1 - prob_threat_modelB)
# = (1 - 0.4) * (1 - 0.5)
# = 0.6 * 0.5
# prob_nonthreat_ensemble = 0.3
prob_threat_ensemble = (1 - prob_nonthreat_ensemble)
# = 1 - 0.3
@cmnord
cmnord / chrome_history.py
Last active June 15, 2020 09:13
Chrome browser history analysis
# Based off of https://geekswipe.net/technology/computing/analyze-chromes-browsing-history-with-python/
# Must use python 2
# Close Chrome before running this, or else the database will be locked
import os
import sqlite3
import operator
from collections import OrderedDict
import matplotlib.pyplot as plt