- start restful api server
postgrest "host=localhost dbname=tnews" -a $(whoami) --schema public
- serve the html
python -m SimpleHTTPServer 8080
// nY(dst_r_from + (0:rows-1), dst_c_from + (0:cols-1), :) = YY(src_r_from + (0:rows-1), src_c_from + (0:cols-1), :); | |
void copy_patch(Mat& nY, const Mat& YY, int dst_r_from, int dst_c_from, int src_r_from, int src_c_from, int rows, int cols) { | |
int row_bytes = cols * YY.channels() * YY.elemSize1(); | |
const uchar* pYY = (const uchar*)YY.data + YY.step[0] * src_r_from + YY.step[1] * src_c_from; | |
uchar* pnY = (uchar*)nY.data + nY.step[0] * dst_r_from + nY.step[1] * dst_c_from; | |
for (int i = 0; i < rows; i++, pnY += nY.step[0], pYY += YY.step[0]) { | |
memcpy(pnY, pYY, row_bytes); | |
} | |
} |
def initialize(args = {}) | |
defaults = { | |
:file_list_cache_dir => 'cache/filelists/', | |
:img_root => 'cache/img/', | |
:sensor_res_img_root => 'cache/srimg/' | |
} | |
defaults.merge(args).each do |attr, val| | |
instance_variable_set("@#{attr}", val) if defaults.has_key?(attr) && (not val.nil?) | |
end if args | |
setup |
select repository_url, repository_language, repository_created_at, repository_description, MAX(repository_watchers) as watches | |
from [githubarchive:github.timeline] | |
where repository_watchers > 20 | |
group each by repository_url, repository_language, repository_created_at, repository_description | |
order by watches desc |
curl -XPUT 'http://localhost:9200/_template/github-watch' -d @github-watch-mappings.json |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
set number | |
set backspace=2 | |
set t_Co=256 | |
set background=dark | |
colorscheme PaperColor |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
// https://github.com/google/google-api-go-client | |
import ( | |
"golang.org/x/net/context" | |
"golang.org/x/oauth2/google" | |
"google.golang.org/api/compute/v1" | |
) | |
func main() { | |
// Use oauth2.NoContext if there isn't a good context to pass in. |
// Based on tutorial here: | |
// https://itp.nyu.edu/physcomp/labs/labs-serial-communication/lab-serial-communication-with-node-js/ | |
// Examples: | |
// node test.js /dev/tty.Makeblock-ELETSPP | |
var serialport = require('serialport'); | |
var SerialPort = serialport.SerialPort; | |
var portName = process.argv[2]; | |
// turn led green |
postgrest "host=localhost dbname=tnews" -a $(whoami) --schema public
python -m SimpleHTTPServer 8080
import numpy as np | |
# A linear function. | |
# Ax = y | |
# Given A and y, solve x. | |
# Standard L2 loss function with l2 regularization. | |
N = 1000 | |
M = 2 | |
A = np.random.random((N, M)) |