Skip to content

Instantly share code, notes, and snippets.

View bryan-lunt's full-sized avatar

Bryan Lunt bryan-lunt

  • Department of Computer Science, UC San Diego
  • Urbana, Illinois
View GitHub Profile
@bryan-lunt
bryan-lunt / NodeBoxMend.py
Created February 2, 2015 19:03
Mandelbrot Set generators in Python
window = (500,500)
mwindow = ((-1,1),(-1,1))
size(window[0],window[1])
pinf = float("inf")
ninf = float("-inf")
def isBad(x):
return x != x or x == pinf or x == ninf
def inMend(z,c):
@bryan-lunt
bryan-lunt / HID.cpp
Last active August 29, 2015 14:23
Arduino HID altered to handle joysticks. ( I took the files from here and merged their changes with the newer Arduino headers. http://www.imaginaryindustries.com/blog/?p=80 )
/* Copyright (c) 2011, Peter Barrett
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted, provided that the
** above copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
@bryan-lunt
bryan-lunt / z_KerasSequence-try_reverse.py
Created February 15, 2016 18:21
Test Keras.io reverse recurrences
# coding: utf-8
# In[1]:
get_ipython().magic(u'matplotlib inline')
# In[2]:
@bryan-lunt
bryan-lunt / ffsget.py
Created February 24, 2016 16:40
Getter for FlyFactorSurvey data
#!/usr/bin/env python
import BeautifulSoup as BS
import argparse
parser = argparse.ArgumentParser()
args, other = parser.parse_known_args()
@bryan-lunt
bryan-lunt / noise_injector.py
Created February 26, 2016 17:22
Noise Injection
#!/usr/bin/env python
import argparse
from gemstat.matrix import *
import sys
import scipy as S
parser = argparse.ArgumentParser()
@bryan-lunt
bryan-lunt / flow_grid_layout.py
Created March 8, 2017 18:12
Simple Flow Layout for matplotlib
class FigHolder(object):
"""Base class for all the figure holders we might implement."""
def __init__(self, thefig):
self.fig = thefig
def add_subplot(self):
pass
def show(self):
self.fig.tight_layout()
@bryan-lunt
bryan-lunt / bezier_curves.py
Created March 26, 2017 00:59 — forked from astrojuanlu/bezier_curves.py
Interactive Bézier curves with Python using just matplotlib.
import matplotlib
matplotlib.use('webagg')
import numpy as np
from scipy.special import binom
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
\documentclass[12pt]{amsart}
\usepackage{geometry} % see geometry.pdf on how to lay out the page. There's lots.
\geometry{a4paper} % or letter or a5paper or ... etc
% \geometry{landscape} % rotated page geometry
% See the ``Article customise'' template for come common customisations
\title{An example of using bibtex}
\author{Bryan Lunt}
\date{2017-6-20} % delete this line to display the current date
@bryan-lunt
bryan-lunt / MPI_benchmark_example
Created December 25, 2018 15:09 — forked from mdavezac/ MPI_benchmark_example
google/benchmark example with MPI
# for gist naming purposes
@bryan-lunt
bryan-lunt / sieve.cpp
Created February 7, 2019 21:56
Sieve of Eratosthenese
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <random>
#include <omp.h>