Skip to content

Instantly share code, notes, and snippets.

@turnersr
turnersr / rs.py
Created April 29, 2014 04:17
Single-pass, parallel statistics algorithms for mean, variance, and standard deviation
class RunningStat(object):
"""
Based on ideas presented in
1. Numerically Stable, Single-Pass, Parallel Statistics Algorithms - http://www.janinebennett.org/index_files/ParallelStatisticsAlgorithms.pdf
2. Accurately computing running variance - http://www.johndcook.com/standard_deviation.html
"""
def __init__(self):
self.m_n = 0
self.m_oldM = 0
@turnersr
turnersr / Cargo.toml
Created May 17, 2019 20:59 — forked from jcdyer/Cargo.toml
Updated for v 0.12.0
[package]
name = "edge"
version = "0.1.0"
authors = ["J. Cliff Dyer <jcd@sdf.org>"]
[dependencies]
indradb = "0.12.0"
indradb-lib = "0.12.0"
serde_json = "*"
uuid = "*"
@turnersr
turnersr / lettest.ml
Created January 3, 2019 21:58
Let test
let test_eval_basic_block_formula ctxt =
let open Bap.Std in
let open Bap_primus.Std in
let open Monads.Std in
let module Machine = struct
type 'a m = 'a
include Primus.Machine.Make(Monad.Ident)
end in
@turnersr
turnersr / 2d_heat_equation.py
Created October 24, 2014 22:49
Solution to 2d heat equation
# coding: utf-8
# In[1]:
get_ipython().magic(u'pylab inline')
# In[3]:
#include <android/log.h>
#include <jni.h>
#include <binder/Binder.h>
#include <binder/Parcel.h>
#include <binder/IServiceManager.h>
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@turnersr
turnersr / rep_finder.ipynb
Last active April 7, 2017 02:53
Gven a binary stream, try to find repeating values by considering the frequency and autocorrelation of different n-bit string parsings of binary data stream
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@turnersr
turnersr / x86_counts.txt
Created March 29, 2017 01:11
x86 counts for up to 4 byte grams
This file has been truncated, but you can view the full file.
450c8b 9984
fffe 998
f783 998
f304 998
c60fac 998
89c60fac 998
848c 998
46ff 998
4220 998
3d0508 998
@turnersr
turnersr / arm_counts
Created March 29, 2017 01:00
Distribution up to 4 byte grams for ARM 32
This file has been truncated, but you can view the full file.
0020a0e3 9990
e10800a0 999
9de509 999
8de530 999
54e2 999
2930 999
0c1094 999
0be54430 999
01007040 999
ca 9982
@turnersr
turnersr / estimate_pilots.ipynb
Last active March 22, 2017 03:09
Estimating Pilots given CP and number of subcarriers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.