Skip to content

Instantly share code, notes, and snippets.

@canimus
canimus / multlin.py
Created June 14, 2016 09:21 — forked from marcelcaraciolo/multlin.py
multivariate linear regression
from numpy import loadtxt, zeros, ones, array, linspace, logspace, mean, std, arange
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from pylab import plot, show, xlabel, ylabel
#Evaluate the linear regression
def feature_normalize(X):
'''
Returns a normalized version of X where

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

public static void main(String[] args) throws IOException {
// Setup firefox binary to start in Xvfb
String Xport = System.getProperty(
"lmportal.xvfb.id", ":1");
final File firefoxPath = new File(System.getProperty(
"lmportal.deploy.firefox.path", "/usr/bin/firefox"));
FirefoxBinary firefoxBinary = new FirefoxBinary(firefoxPath);
firefoxBinary.setEnvironmentProperty("DISPLAY", Xport);
location xxxx {
proxy_pass http://localhost:9000;
proxy_buffering off;
proxy_cache off;
proxy_redirect off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
upstream unicorn {
server unix:/tmp/unicorn.portal.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name secure.example.com;
root /home/user/www/secure.example.com/current/public;
location ^~ /assets/ {
@canimus
canimus / README.md
Created January 20, 2012 19:55 — forked from mbostock/.block
Line Transition

D3’s default path interpolation is the same as its string interpolation: it finds numbers embedded in strings, and interpolates those numbers. So, the default behavior when interpolating two paths is like this:

M x0, y0 L x1, y1 L x2, y2 L x3, y3 
   ↓   ↓    ↓   ↓    ↓   ↓    ↓   ↓
M x0, y1 L x1, y2 L x2, y3 L x3, y4 

For example, the first point ⟨x0,y0⟩ is interpolated to ⟨x0,y1⟩. Since x0 is the same, all you see are the y-values changing (see example)—you don't see the path slide to the left as intended.

What you want to happen here is something like this: