Skip to content

Instantly share code, notes, and snippets.

View eob's full-sized avatar

Ted Benson eob

View GitHub Profile
@eob
eob / Polynomial Fitting
Created April 22, 2014 02:14
Polynomial Fitting
from scipy.optimize import curve_fit
from collections import Counter, defaultdict
import numpy as np
import time
def f(xss, a, b, c, d, e, f):
"""
Polynomial function up to order 5
"""
ret = []
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML with an alias" />
<title>CTS Example: Loading HTML with an alias</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading JS" />
<title>CTS Example: Loading JS</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@js http://code.jquery.com/jquery-1.10.1.js;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading CSS" />
<title>CTS Example: Loading CSS</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@css http://getbootstrap.com/2.3.2/assets/css/bootstrap.css;
CTS.Parser = {
/* Parses a forrest (externally linked) CTS sheet.
*
* Args:
* - spec: the spec to parse
* - format: the format which encodes the spec
* - fromUrl: the url which loaded the spec
*
* Returns:
var test = function() {
return "This is a test!";
}
@eob
eob / gist:5688792
Last active December 17, 2015 23:19
# In resource-controller.js
ResourceController = function(provider) {
this.a = 1;
};
ResourceController.prototype.printA = function(req, res) {
res.send(typeof this.a);
};