A Pen by Victor Condino on CodePen.
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 | |
from math import pi, log | |
import pylab | |
from scipy import fft, ifft | |
from scipy.optimize import curve_fit | |
i = 10000 | |
x = np.linspace(0, 3.5 * pi, i) | |
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 * | |
np.random.randn(i)) |
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jul 30 18:55:13 2014 | |
Just intonation classes for music theory experiments in Python | |
""" | |
from __future__ import division, print_function | |
from fractions import gcd as _gcd | |
from fractions import Fraction |
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
package com.example.bluetooth2; | |
import android.bluetooth.*; | |
import android.os.*; | |
import android.util.*; | |
import java.io.*; | |
import java.lang.reflect.*; | |
import java.util.*; | |
abstract public class BluetoothSerialThread extends Thread | |
{ |
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
/* | |
* Copyright (C) 2007 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file has been truncated, but you can view the full file.
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
function GOCR(image){ | |
Module = { | |
arguments: ['-i', 'in.pnm', '-f', 'UTF8'] | |
} | |
if(image.getContext) image = image.getContext('2d'); | |
if(image.getImageData) image = image.getImageData(0, 0, image.canvas.width, image.canvas.height); | |
// if(image.data){ | |
var width = image.width, height = image.height; | |
var header = "P5\n" + width + " " + height + "\n255\n"; |
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
#!/usr/bin/python | |
import pyudev | |
import select | |
import functools | |
import re | |
import os | |
import codecs | |
fds = {} | |
devs = {} |
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 inspect | |
from functools import wraps | |
def privatemethod(func): | |
"""decorator for making an instance method private by dispatching on whether the name 'self' in the local namespace of the calling frame is a reference to the same object as the first positional argument (the self argument when invoking an instance method.) the decorated function will have a 'public' member which is a decorator for specifying an alternate implementation to dispatch calls from outside of the instance.""" | |
pubfunc = None | |
privfunc = func | |
@wraps(func) | |
def func_wrapper(*args, **kwargs): |
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
from contextlib import contextmanager | |
import pyudev | |
from select import select | |
import threading | |
import select, os, queue, socket | |
class PollableQueue(queue.Queue): | |
def __init__(self): | |
super().__init__() | |
# Create a pair of connected sockets |
OlderNewer