Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Run MathJax in Github or Bitbucket | |
// @namespace http://www.mathjax.org/ | |
// @description Runs MathJax on any page in github.com or bitbucket.org | |
// @include http://github.com/* | |
// @include https://github.com/* | |
// @include http://bitbucket.org/* | |
// @include https://bitbucket.org/* | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = ''' | |
from random import Random | |
from itertools import izip | |
import numpy as np | |
length = 1000 | |
random = Random() | |
A_new = np.array([random.random() for _ in xrange(length)]) | |
A_old = np.array([random.random() for _ in xrange(length)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Python.h> | |
//Normally #include "arrayobject.h" should be sufficient. I need to fix my includes. | |
#include "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h" | |
/* | |
* Convolution method. | |
*/ | |
static PyObject* convolve(PyObject* self, PyObject* args) | |
{ | |
PyArrayObject *vec1, *vec2, *conv; //The python object proxies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.signal as signal | |
import matplotlib.pyplot as plt | |
import math | |
import datetime | |
from matplotlib.font_manager import FontProperties | |
def convolveoriginal(x, y): | |
''' | |
The original algorithm from http://www.physics.rutgers.edu/~masud/computing/WPark_recipes_in_python.html. |
NewerOlder