Skip to content

Instantly share code, notes, and snippets.

View abelmcelroy's full-sized avatar

Abel McElroy abelmcelroy

  • MA
View GitHub Profile
function KNN(kSize){
this.kSize = kSize;
this.points = [];
}
KNN.prototype.train = function(set){
this.points = this.points.concat(set)
}
KNN.prototype._distance =function(p1,p2){
@abelmcelroy
abelmcelroy / calcs.py
Created September 12, 2017 23:26
small library of useful computational functions
import random
import math
import itertools
import numpy
import CryptoSolver as CS
import fractions
class Ten_Twentyfour(object):
def __init__(self,array):
self.A = array
def Print(self):
@abelmcelroy
abelmcelroy / crypto.py
Created September 12, 2017 23:24
Cryptogram Solver
import itertools
import re
def permutations(code):
if len(code)==1:
return [code]
perms=permutations(code[1:])
char=code[0]
result=[]
for perm in perms: