Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.scatter import ScatterPlane
class Viewport(ScatterPlane):
def __init__(self, **kwargs):
kwargs.setdefault('size', (1920, 1080))
kwargs.setdefault('size_hint', (None, None))
kwargs.setdefault('do_scale', False)
@tansey
tansey / gist:1375526
Created November 18, 2011 03:40
Linear regression in C#
/// <summary>
/// Fits a line to a collection of (x,y) points.
/// </summary>
/// <param name="xVals">The x-axis values.</param>
/// <param name="yVals">The y-axis values.</param>
/// <param name="inclusiveStart">The inclusive inclusiveStart index.</param>
/// <param name="exclusiveEnd">The exclusive exclusiveEnd index.</param>
/// <param name="rsquared">The r^2 value of the line.</param>
/// <param name="yintercept">The y-intercept value of the line (i.e. y = ax + b, yintercept is b).</param>
/// <param name="slope">The slop of the line (i.e. y = ax + b, slope is a).</param>