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
SSH TUNNELING | |
ssh -f -L 3000:talk.google.com:5222 home -N | |
I was able to send my Google Talk traffic encrypted through the firewall back to my server at home and then out to Google. All I had to do was reconfigure my Jabber client to use localhost as the server and the port 3000 that I had configured. |
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
## Corey Chivers, 2012 ## | |
sim_bayes<-function(p=0.5,N=100,y_lim=20,a_a=2,a_b=10,b_a=8,b_b=3) | |
{ | |
## Simulate outcomes in advance | |
outcomes<-sample(1:0,N,prob=c(p,1-p),replace=TRUE) | |
success<-cumsum(outcomes) | |
for(frame in 1:N) | |
{ | |
png(paste("plots/",1000+frame,".png",sep="")) |
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 scipy as sp | |
from scipy import optimize as opt | |
def nnlr(X, y, C): | |
""" | |
Non-negative Logistic Regression with L2 regularizer | |
""" | |
def lr_cost(X, y, theta, C): | |
m = len(y) | |
return (1./m) * (sp.dot(-y, sp.log(sigmoid(sp.dot(X, theta)))) \ |
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 | |
class MEHMM(object): | |
def __init__(self, initialProb, transProb): | |
self.N = initialProb.shape[0] | |
self.initialProb = initialProb | |
self.transProb = transProb | |
assert self.initialProb.shape == (self.N, ) | |
assert self.transProb.shape == (self.N, self.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
import numpy as np | |
class HMM(object): | |
def __init__(self, initialProb, transProb, obsProb): | |
self.N = initialProb.shape[0] | |
self.initialProb = initialProb | |
self.transProb = transProb | |
self.obsProb = obsProb | |
assert self.initialProb.shape == (self.N, 1) | |
assert self.transProb.shape == (self.N, self.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
<html> | |
<head> | |
<!-- Load the d3 library. --> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> | |
<style> | |
body { font-family: "Open Sans"; } | |
text.stateID { dominant-baseline: middle; text-anchor: middle; } | |
</style> | |
</head> |
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
"""Kernel K-means""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from sklearn.base import BaseEstimator, ClusterMixin | |
from sklearn.metrics.pairwise import pairwise_kernels | |
from sklearn.utils import check_random_state |
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
""" | |
NMF by coordinate descent, designed for sparse data (without missing values) | |
""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
import scipy.sparse as sp | |
import numba |
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
""" | |
Scanner: match text to generate tokens. | |
Adam Blinkinsop <blinks@acm.org> | |
First, construct a scanner with the tokens you'd like to match described as | |
keyword arguments, using Python-syntax regular expressions. | |
WARNING: Group syntax in these expressions has an undefined effect. | |
>>> simple = Scan(ID=r'\w+') | |
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
Verifying that +xboard is my blockchain ID. https://onename.com/xboard |
OlderNewer