Skip to content

Instantly share code, notes, and snippets.

View stevester94's full-sized avatar

Steven Mackey stevester94

View GitHub Profile
double** multiplyMatrices(double** A, int Am, int An, double** B, int Bm, int Bn) {
int i, j, k, l;
double** retAr = create2DDoubleArray(Am, Bn);
if(An != Bm) {
printf("OH FUCK YO\n");
return NULL;
}
@stevester94
stevester94 / entropy.py
Created November 19, 2015 09:23
ECS122A Entropy Calculator for 5.18B
import math
frequencies = {
('blank', 0.183),
('e', 0.102),
('t', 0.077),
('a', 0.068),
('o', 0.059),
('i', 0.058),
('n', 0.055),
@stevester94
stevester94 / codes.txt
Created November 19, 2015 08:58
ECS122 5-18a Codes
_ 111
E 010
T 1100
A 1010
O 1000
I 0111
N 0110
S 0011
H 0001
R 0000
Going to use:
artist familiarity float algorithmic estimation url
artist hotttnesss float algorithmic estimation url
beats start array float result of beat tracking url
danceability float algorithmic estimation
duration float in seconds
end of fade in float seconds at the beginning of the song url
energy float energy from listener point of view
key int key the song is in url
loudness float overall loudness in dB url
@stevester94
stevester94 / calcPlaneNormal.py
Created November 10, 2015 00:25
Calc normal given 3 points, python 3
import math
def calcPlaneNormal(x1, y1, z1, x2, y2, z2, x3, y3, z3):
nx1 = x1 - x2
ny1 = y1 - y2
nz1 = z1 - z2
mag1 = math.sqrt(nx1*nx1 + ny1*ny1 + nz1*nz1)
nx2 = x1 - x3
@stevester94
stevester94 / crns.txt
Created November 9, 2015 21:51
crns for winter 2016
ECN 110B:20706
ECN 134:20741
ECS 152:44031
ECS 193:21237
@stevester94
stevester94 / recMatricTest.m
Created October 15, 2015 22:53
recursive matrix test matlab version
function total = rectest(n, constant, divisibleBy)
if(n <= divisibleBy)
total = constant;
else
total = recTest(n/4, constant, divisibleBy);
total = total + recTest(n/4, constant, divisibleBy);
total = total + recTest(n/4, constant, divisibleBy);
total = total + recTest(n/4, constant, divisibleBy);
end
end
@stevester94
stevester94 / recMatrixTest.py
Created October 15, 2015 03:17
snippet for recursive matrix running times
def recTest(n, constant, divisibleBy):
if n <= divisibleBy:
return constant
else:
total = recTest(n/4, constant, divisibleBy)
total = total + recTest(n/4, constant, divisibleBy)
total = total + recTest(n/4, constant, divisibleBy)
total = total + recTest(n/4, constant, divisibleBy)
return total