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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="tf.min.js"></script> | |
</head> | |
<body> | |
</body> | |
<script> | |
const LEARNING_RATE = 0.07; |
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
const UNDEF = 'undefined'; | |
const alpha = 2; | |
const beta = .5; | |
/* Utility */ | |
const createArray = (x, y) => { | |
let r = []; | |
if (typeof x !== UNDEF && typeof y !== UNDEF) { | |
for (let i=0; i < x; i++) { | |
r.push(createArray(y)); |
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
################################################################## | |
# Get count of predicates | |
################################################################## | |
SELECT ?p (COUNT(?o) AS ?cnt) | |
WHERE { ?s ?p ?o } | |
GROUP BY ?p | |
ORDER BY DESC(?cnt) | |
################################################################## |
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
#!/usr/bin/env bash | |
PLAYER_ID=$1 | |
IDX=${PLAYER_ID:0:1} | |
URL="https://www.baseball-reference.com/players/${IDX}/${PLAYER_ID}.shtml" | |
echo "$URL" | |
curl ${URL} | grep "og:image" | egrep -o "http.*((jpg)|(png))" | xargs curl -o ${PLAYER_ID} | |
sips -s format jpeg ${PLAYER_ID} --out ${PLAYER_ID}.jpg |
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 os | |
os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" | |
import tensorflow as tf | |
import numpy as np | |
## TODO | |
## - Move learning rate | |
## - Save model, restore model | |
class NNModel(): |
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
const express = require('express') | |
const app = express() | |
const proxy = require('express-http-proxy') | |
app.use('/', proxy('proxy-destination.com')) | |
app.listen(3000, function () { | |
console.log('Example app listening on port 3000!') | |
}) |
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
[ | |
{ | |
"cmd": "ssh -D9002 proxy-something.lalala.com", | |
"des": "SOCK5 Proxy to proxy-something" | |
}, | |
{ | |
"cmd": "ssh -D9003 proxy-something-else.lalala.com", | |
"des": "SOCK5 Proxy to hproxy-dev" | |
}, | |
{ |
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
library(parallel) | |
library(background) | |
cache = new.env(); | |
cache[["t"]] <- "f" | |
#* @get /set | |
set <- function() { |
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
// Based on: https://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient | |
static PCC(x, y) { | |
let n = x.length; | |
let sum_xy = 0; | |
let sum_x2 = 0; | |
let sum_y2 = 0; | |
let meanx = 0, meany = 0; | |
for (let i=0; i < n; i++) { | |
sum_xy += x[i]*y[i]; | |
sum_x2 += x[i]*x[i]; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
#div1 { | |
width: 500px; | |
height: 500px; | |
background: #CCC; | |
} |