Skip to content

Instantly share code, notes, and snippets.

View moorepants's full-sized avatar

Jason K. Moore moorepants

View GitHub Profile
@moorepants
moorepants / test_upload_tagged_photos.py
Created August 19, 2013 02:21
Image uploader for localwikis.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from upload_tagged_photos import ImageUploader
def TestUploadWiki():
url = "http://clevelandwiki.org/api/"
user_name = raw_input("What is your username?")
api_key = getpassword("What is your api_key?")
@moorepants
moorepants / walking_control.ipynb
Created August 21, 2013 03:15
Work on identifying a simple control model for walking.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moorepants
moorepants / fast_fourier.m
Last active December 21, 2015 13:09
Example of an FFT computation and plotting.
function [frequency, amplitude] = fast_fourier(time, signal, sample_rate, varargin)
% function [frequency, amplitude] = fast_fourier(time, signal, sample_rate, varargin)
%
% Parameter
% =========
% time : double, size: 1 x n
% The time vector.
% signal : double, size: 1 x n
% The signal as a function of time.
% sample_rate : double, size 1 x 1
@moorepants
moorepants / control_solver_example.ipynb
Created August 22, 2013 18:55
Example of using the SimpleControlSolver in DynamicistToolKit.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moorepants
moorepants / butterworth_nyquist.py
Last active December 23, 2015 06:49
Fixed Bode magnitude x values in the plot (corrected the units) and cleaned up the plot a bit.
"""This script makes a plot showing the the difference in filtering a signal
with a Butterworth filter if you select the digital cutoff frequency ratio
with respect to incorrect Nyquist frequency values. The cutoff frequency for
digital filters should be `cutoff/nyquist` where the `cutoff` is the desired
cutoff frequency for the filter and `nyquist` is the Nyquist frequency of
the data you are filtering, i.e. half the sample rate."""
from numpy import sin, cos, pi, array, absolute, ones, log10, linspace
from numpy.random import normal
from scipy.signal import butter, freqz, filtfilt
@moorepants
moorepants / sympy_print_error.ipynb
Last active December 31, 2015 04:08
An IPython notebook which displays odd SymPy printing for dictionaries.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moorepants
moorepants / gist:7974682
Created December 15, 2013 15:59
New behavior of IPython printing for PR 2683
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@moorepants
moorepants / vector_printing.ipynb
Created January 29, 2014 21:57
Show's vector printing on Windows for sympy in the notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moorepants
moorepants / two_link.txt
Last active August 29, 2015 13:56
Timing results for integrating a 2D 2 link pendulum on a cart.