Skip to content

Instantly share code, notes, and snippets.

View hardbyte's full-sized avatar

Brian Thorne hardbyte

View GitHub Profile
@hardbyte
hardbyte / Rolling FFT
Created July 7, 2013 22:43
Frequency analysis of fast changing data.
import numpy as np
from collections import deque
import time
import threading
import matplotlib.pyplot as plt
def rollingFFT(s, n, dt):
fy = np.fft.fft(s)
# Frequencies associated with each samples
@hardbyte
hardbyte / Streaming Pickle
Created July 9, 2013 05:50
Streaming pickle implementation for efficiently serializing and de-serializing an iterable
"""Streaming pickle implementation for efficiently serializing and
de-serializing an iterable (e.g., list)
Created on 2010-06-19 by Philip Guo
http://code.google.com/p/streaming-pickle/
Modified by Brian Thorne 2013 to add base64 encoding to support
python3 bytearray and the like.
"""
@hardbyte
hardbyte / README.md
Last active April 22, 2018 13:24
PCA with D3js
We couldn’t find that file to show.
@hardbyte
hardbyte / index.html
Created July 14, 2014 05:59
K-means with D3js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">

Keybase proof

I hereby claim:

  • I am hardbyte on github.
  • I am hardbyte (https://keybase.io/hardbyte) on keybase.
  • I have a public key whose fingerprint is E49A A499 5C2B 735C CB01 EA5E 22AD F3BF C183 47DE

To claim this, I am signing this object:

@hardbyte
hardbyte / cansqlquery.py
Created March 17, 2017 23:47
Simple example access of sql database of can frames.
import sqlite3
import numpy as np
logfile = "output.db"
conn = sqlite3.connect(logfile)
c = conn.cursor()
c.execute("SELECT COUNT() FROM messages")
import phe as paillier
import numpy as np
import pickle
class SecretKey():
def __init__(self,sk):
self.sk = sk
def decrypt(self,x):
@hardbyte
hardbyte / StatefulPrime.java
Last active October 26, 2017 03:15
Statefull Akka Prime Example
package com.lightbend.akka.sample;
import akka.actor.*;
public class StatefulPrime {
static class IsPrimeActor extends AbstractLoggingActor {
// Define the actor protocol
static class IsPrimeRequest {
@hardbyte
hardbyte / StatelessPrime.java
Created October 26, 2017 03:10
Stateless Akka Prime Example
package com.lightbend.akka.sample;
import akka.actor.AbstractLoggingActor;
import akka.actor.Props;
import java.util.HashMap;
import java.util.Map;
class StatelessPrime {
@hardbyte
hardbyte / UntypedSimplePrime.java
Created October 26, 2017 03:34
Untyped Simple Prime Akka example
package com.lightbend.akka.sample;
import akka.actor.Props;
import akka.actor.UntypedAbstractActor;
class UntyptedSimplePrime {
static class IsPrimeActor extends UntypedAbstractActor {
// Define the messages