Skip to content

Instantly share code, notes, and snippets.

View JonnoFTW's full-sized avatar
⚔️
Fighting off bugs with a sword 🤺

Jonathan Mackenzie JonnoFTW

⚔️
Fighting off bugs with a sword 🤺
View GitHub Profile
import numpy as np
np.seterr(all='ignore')
results = set()
base_dmg = 117
rapier_dmg = 320
bfs_dmg = 55
dae_dmg = 81
bf_cleave = 0.35
dae_chance = 1 - 0.3
dae_multiplier = 2.2
import requests
import shutil
divids = ['101', '102', '103', '104', '105', '106', '107', '108', '109', '111', '112', '113', '114', '115', '117',
'118', '119', '120', '121', '122', '124', '125', '126', '127', '128', '130', '131', '132', '133', '134',
'135', '136', '137', '138', '139', '140', '144', '145', '146', '148', '149', '150', '151', '152', '153',
'155', '156', '157', '158', '159', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169',
'170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '180', '182', '183', '185', '186',
'187', '188', '189', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '200', '201',
'203', '204', '205', '207', '208', '209', '210', '211', '212', '213', '214', '215', '216', '217', '218',
@JonnoFTW
JonnoFTW / image.py
Created June 17, 2016 12:02
Lane number extraction
import cv2
import numpy as np
def captch_ex(orig_image, iterations, dx, dy, thresh_min):
img = orig_image.copy()
# remove red teal and green colors
img[np.where((img == [255, 255, 127]).all(axis=2))] = np.array([255, 255, 255])
img[np.where((img == [0, 0, 255]).all(axis=2))] = np.array([0, 0, 0])
img[np.where((img == [0, 127, 0]).all(axis=2))] = np.array([0, 0, 0])
img2gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(img2gray, thresh_min, 255, cv2.THRESH_BINARY)
@JonnoFTW
JonnoFTW / -
Created December 17, 2015 04:52
10.30.0.159
@JonnoFTW
JonnoFTW / airodump-mod.c
Created December 17, 2015 00:55
Deleting items in airodump
void enqueue_stations() {
struct ST_info *st_cur;
struct ST_info *st_next;
st_cur = G.st_1st;
st_next = NULL;
while(st_cur != NULL)
{
st_next = st_cur->next;
// if we haven't seen the device in the last 10 seconds
C:\Users\Jonathan\Documents\GitHub\htm-over-http\test [master +1 ~0 -0 !]> python .\hotgym.py
Feed the data from rec-center-hourly.csv into the
htm REST API and compare the results with the
standard results provided in the tutorial
Made model 25b22f16-196a-4fcf-af5a-1c5d9939df03
{'timestamp': 1277994600, 'kw_energy_consumption': '21.2'}
{u'likelihood': 0.5, u'anomaly_score': 1.0, u'prediction': 21.2}
{'timestamp': 1277998200, 'kw_energy_consumption': '16.4'}
2015-12-08T11:14:06.872092+00:00 heroku[router]: at=info method=GET path="/create/kw_energy_consumption" host=morning-meadow-1412.herokuapp.com request_id=5851ad11-5abd-4d10-aab0-5524f5ab8d08 fwd="121.45.152.138" dyno=web.1 connect=1ms service=156ms status=500 bytes=269
2015-12-08T11:14:06.863757+00:00 app[web.1]: ERROR:com.numenta.nupic.tools.configuration_base:Error while parsing configuration file: None.
2015-12-08T11:14:06.863762+00:00 app[web.1]: Traceback (most recent call last):
2015-12-08T11:14:06.863764+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/nupic/support/configuration_base.py", line 338, in _readConfigFile
2015-12-08T11:14:06.863764+00:00 app[web.1]: " variable %r, which is not defined" % (varname))
2015-12-08T11:14:06.863765+00:00 app[web.1]: RuntimeError: Attempting to use the value of the environment variable 'USER', which is not defined
2015-12-08T11:14:06.867657+00:00 app[web.1]: ERR: Unable to create region Classifier of type CLAClassifierRegion [/home/t
@JonnoFTW
JonnoFTW / -
Created December 8, 2015 05:10
10.30.0.177
public class BST<T extends Comparable<? super T>> {
private Node root;
private int size = 0;
public void insert(T value) {
root = insert(value,root);
}
/**
@JonnoFTW
JonnoFTW / LaTeX template
Created November 24, 2014 11:16
Basic template I use for LaTeX documents
\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{a4wide}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{url}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[T1]{fontenc}