Skip to content

Instantly share code, notes, and snippets.

@xoba
xoba / ScreenShotMain.java
Created November 28, 2011 20:41
phantomjs rendering
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.URLDecoder;
import java.util.LinkedList;
import java.util.List;
@xoba
xoba / yahoo.r
Created January 3, 2012 23:26
loading yahoo finance data directly into R
yahoo <- function(s) read.csv(file=paste('http://ichart.finance.yahoo.com/table.csv?s=',s,'&c=1900&f=2012&g=d',sep=''));
ticker = 'AAPL'
dat = yahoo(ticker);
plot(main=ticker, xlab='date', ylab='close price',
as.Date(dat$Date),dat$Adj.Close,type='l',log='y');
grid();
$(function() {
$('#title').html("sgdmf");
(function() {
var i = [];
i.push("<p>");
i.push("This is a demo of stochastic gradient descent applied to matrix factorization.");
i.push("'lambda' penalizes model complexity (in terms of rank), so");
@xoba
xoba / script.js
Created May 15, 2012 12:19
sgdmf
$(function() {
$('#title').html("sgdmf");
(function() {
var i = [];
i.push("<p>");
i.push("This is a demo of stochastic gradient descent applied to matrix factorization.");
i.push("'lambda' penalizes model complexity (in terms of rank), so");
@xoba
xoba / blas.go
Created June 14, 2013 10:49
how easy it is to use blas from go-lang
// see http://www.netlib.org/clapack/cblas/dgemv.c
package main
/*
#cgo LDFLAGS: -L/usr/lib/libblas -lblas
#include <stdlib.h>
extern void dgemv_(char* trans, int *m, int *n, double *alpha,
double *A, int *lda, double *x, int *incx, double *beta, double *y,
int *incy);
*/
@xoba
xoba / time.go
Created July 12, 2014 11:46
compare local to official us nist government time
package main
import (
"encoding/xml"
"fmt"
"net/http"
"os"
"time"
)