This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 tensorflow as tf | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import random | |
| from tensorflow.examples.tutorials.mnist import input_data | |
| mnist = input_data.read_data_sets("./MNIST/", one_hot=True) | |
| tf.reset_default_graph() |
This file contains hidden or 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
| { | |
| "name": "jslib-test", | |
| "version": "1.0.0", | |
| "description": "Testing library packaging", | |
| "main": "dist/cjs/main.js", | |
| "module": "dist/esm/index.js", | |
| "scripts": { | |
| "build": "rollup -c", | |
| "dev": "rollup -c -w" | |
| }, |
This file contains hidden or 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
| class Heap { | |
| constructor(maxsize) { | |
| this.size = 0; | |
| this.maxsize = maxsize; | |
| this.data = [this.maxsize + 1]; | |
| } | |
| getParent(index) { return Math.round( index / 2); } | |
| getLeftChild(index) { return 2 * index; } | |
| getRightChild(index) { return 2 * index + 1; } |