Skip to content

Instantly share code, notes, and snippets.

View jpace121's full-sized avatar

jpace121

View GitHub Profile
class _ThreadRead_(threading.Thread):
def __init__(self,serial):
threading.Thread.__init__(self)
self.stop_event = threading.Event()
self.data = []
def run(self):
"""run is the function ran by the thread"""
# set up here
void setup() {
//Start serial.
Serial.begin(9600);
Serial.flush();
}
void loop() {
char input;
//int inc = 0;
;Figure out why this is wierd. AKA this is bad lisp.
((lambda () ;or use progn?
(setf in_rev (let
((Total_length 2.05)
(Total_revs 35.5))
(/ Total_length Total_revs)
))
(setf rpm 600)
(setf in_min (* in_rev rpm))
def tobin(data, width=8):
data_str = bin(data & (2**width-1))[2:].zfill(width)
return data_str
#!/usr/bin/env python
from subprocess import call
import os
cc = "clang"
cpp = "clang++"
options = ["-Wall", "-Wextra"]
libs = []
def main():
@jpace121
jpace121 / bootstrap.sh
Last active August 29, 2015 14:05
Vagrant bootstrap dev environment.
echo '==== Installing dynamism pre-reqs'
apt-get update
apt-get install -y build-essential
apt-get install -y git
apt-get install -y mercurial
apt-get install -y clang
apt-get install -y python-numpy python-scipy
apt-get install -y gcc-multilib
apt-get install -y g++-multilib
apt-get install -y python-dev
pandoc --mathjax -s -f markdown+tex_math_dollars -t html -o pandocMath.html pandocMath.md
@jpace121
jpace121 / .tmux.conf
Last active November 3, 2016 22:37
My .tmux.conf from my ciscor vagrant box.
unbind C-b
set -g prefix 'C-\'
bind 'C-\' send-prefix
setw -g mode-keys vi
bind-key -r k select-pane -U
bind-key -r j select-pane -D
bind-key -r h select-pane -L
bind-key -r l select-pane -R
@jpace121
jpace121 / .vimrc
Created November 22, 2013 04:50
My .vimrc for my mac Assumes set nocompatitible
syntax on
set autoindent
set tabstop=4
set backspace=indent,eol,start
execute pathogen#infect()
syntax on
"filetype plugin indent on"
set background=dark
function [ output_args ] = MechSys89( input_args )
%Promblem 8-9
B = [0;0;0;1];
A = [ 1 1 1 1; 3 4 5 6; 6 12 20 30; .25^3 .25^4 .25^5 .25^6];
C = A\B;
C = [0;0;0;C]; %'cause C(1) and stuff don't exist
beta = 180;
s = @(t) C(3)*(t/beta)^3+C(4)*(t/beta)^4+C(5)*(t/beta)^5+C(6)*(t/beta)^6;