Skip to content

Instantly share code, notes, and snippets.

💩
status' OR 1=1; --

Kevin Orr KevOrr

💩
status' OR 1=1; --
  • Tampa, FL
Block or report user

Report or block KevOrr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KevOrr
KevOrr / output.txt
Created Jun 4, 2018
Floating Point Weirdness
View output.txt
f1: 0.707106769084930419921875 f3 04 35 3f
f2: 0.707106769084930419921875 f3 04 35 3f
f3: 0.707106769084930419921875 f3 04 35 3f
d1: 0.707106781186547572737311 cd 3b 7f 66 9e a0 e6 3f
d2: 0.707106781186547461715008 cc 3b 7f 66 9e a0 e6 3f
l1: 0.707106781186547572737311 00 68 de f9 33 f3 04 b5 fe 3f 00 00 00 00 00 00
l2: 0.707106781186547524436104 85 64 de f9 33 f3 04 b5 fe 3f 40 00 00 00 00 00
@KevOrr
KevOrr / baseDown.hs
Created May 15, 2018
Take n largest items Haskell
View baseDown.hs
module CodeWars.Largest (largest) where
import Data.List (sortBy, sort)
import Data.Ord (comparing, Down)
largest :: Ord a => Int -> [a] -> [a]
largest n xs = sort $ take n $ sortBy (comparing Down) xs
-- Line 6 causes compilation error:
-- • Data constructor not in scope: Down :: a -> a0
-- • Perhaps you want to add ‘Down’ to the import list
@KevOrr
KevOrr / SKI.sml
Created Apr 17, 2018
Untyped Lambda Calculus to SKI Combinator Calculus
View SKI.sml
datatype lambdaExpr =
Var of string
| Abs of string * lambdaExpr
| App of lambdaExpr * lambdaExpr;
datatype skiExpr =
S
| K
| I
| SKIApp of skiExpr * skiExpr;
@KevOrr
KevOrr / bintree.hs
Last active Jan 29, 2018
64-deep binary tree
View bintree.hs
data Tree a = Leaf a | Node (Tree a) (Tree a)
data Direction = L | R
make :: Integer -> Tree Int
make 1 = Leaf 0
make n = Node (make (n - 1)) (make (n - 1))
get :: Tree a -> [Direction] -> a
get (Node x _) (L:idxs) = get x idxs
get (Node _ y) (R:idxs) = get y idxs
@KevOrr
KevOrr / Language popularity
Last active Aug 8, 2017
Github Repos reports
View Language popularity
Number of repositories where language is in the top 10 languages used
by that repository by bytes written
Repository count: 178220
id | name | top 10 appearances | top 10 appearances (%)
-----+--------------------------+--------------------+------------------------
1 | JavaScript | 65907 | 36.981%
3 | HTML | 44424 | 24.926%
5 | Shell | 39855 | 22.363%
@KevOrr
KevOrr / 7mNz
Created Aug 7, 2017
dpastes for Github GraphQL API support forum
View 7mNz
query($owner:String!, $name:String!) {
repository(owner: $owner, name: $name) {
stargazers(first: 2, orderBy: {field: STARRED_AT, direction: DESC}) {
nodes {
...userExpand
}
}
}
}
fragment userExpand on User {
View pairwise_search.py
#!/usr/bin/env python3
import re
import operator as op
import itertools as it
import sys
def get_positions(text, patterns_a, patterns_b):
position_lists = [tuple((m.start(),m.end()) for p in ps
for m in re.finditer(p, text, re.IGNORECASE) if m)
@KevOrr
KevOrr / zipfclips.c
Last active Apr 18, 2016
Simulates zipfian behaviors among paperclips
View zipfclips.c
// Simulates zipfian behaviors among paperclips
// Assumes that all paperclips can be selected with equal probability,
// regardless of the chain size each is in.
#include <stdio.h>
#include <stdlib.h>
struct clip {
int id;
struct clip *prev;
View machine_learning_algos.py
#!/usr/bin/env python3
from statistics import mean, stdev
def squared_error_cost(hypothesis, data):
return sum( (hypothesis(point[:-1]) - point[-1])**2 for point in data ) / 2*len(data)
def linear_optimize_gradient_descent(data, args, alpha=.01, max_iters=1000):
"""Takes a sequence of n-tuples, where n-1 is the number of features of the model, and the last index is the output"""
data = [(1,) + tuple(point) for point in data]
View Extra Buttons For Perichat.md
You can’t perform that action at this time.