$ rails g model User
belongs_to
has_one
CGContext context = UIGraphics.GetCurrentContext (); | |
context.InterpolationQuality = CGInterpolationQuality.None; | |
context.TranslateCTM (0, newSize.Height); | |
context.ScaleCTM (1f, -1f); | |
context.DrawImage (new RectangleF (0, 0, newSize.Width, newSize.Height), source.CGImage); | |
var scaledImage = UIGraphics.GetImageFromCurrentImageContext(); |
class SimpleLinearRegression | |
def initialize(xs, ys) | |
@xs, @ys = xs, ys | |
if @xs.length != @ys.length | |
raise "Unbalanced data. xs need to be same length as ys" | |
end | |
end | |
def y_intercept | |
mean(@ys) - (slope * mean(@xs)) |