dnsmasq and iptable configuration on gateway (raspi)
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/python | |
# | |
# Copyright (C) 2016 Julian Qian | |
# | |
# @file draw_tree.py | |
# @author Julian Qian <[email protected]> | |
# @created 2016-07-11 20:33:56 | |
# | |
""" |
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 numpy as np | |
from matplotlib import pylab as plt | |
#from mpltools import style # uncomment for prettier plots | |
#style.use(['ggplot']) | |
''' | |
function definitions | |
''' | |
# generate all bernoulli rewards ahead of time | |
def generate_bernoulli_bandit_data(num_samples,K): |
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
########################### GTEST | |
# Enable ExternalProject CMake module | |
INCLUDE(ExternalProject) | |
# Set default ExternalProject root directory | |
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/third_party) | |
# Add gtest | |
# http://stackoverflow.com/questions/9689183/cmake-googletest | |
ExternalProject_Add( |
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 | |
# @(#) add_partition.sh Time-stamp: <Julian Qian 2015-06-08 17:10:46> | |
# Copyright 2015 Julian Qian | |
# Author: Julian Qian <[email protected]> | |
# Version: $Id: add_partition.sh,v 0.1 2015-06-08 17:08:46 jqian Exp $ | |
# | |
tables=(php_web_log ) | |
for tbl in ${tables[@]}; |
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 | |
# | |
# Copyright (C) 2016 Julian Qian | |
# | |
# @file clean_hadoop_tmp.sh | |
# @author Julian Qian <[email protected]> | |
# @created 2016-02-23 17:45:55 | |
# | |
hadoop=hadoop |
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 python | |
import numpy as np | |
X = np.array([ [0,0,1],[0,1,1],[1,0,1],[1,1,1] ]) | |
y = np.array([[0,1,1,0]]).T | |
alpha,hidden_dim = (0.5,4) | |
np.random.seed(1) | |
# randomly initialize our weights with mean 0 | |
synapse_0 = 2*np.random.random((3,hidden_dim)) - 1 | |
synapse_1 = 2*np.random.random((hidden_dim,1)) - 1 |
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
[repositories] | |
local | |
#repox-maven: http://127.0.0.1:8078/ | |
#repox-ivy: http://127.0.0.1:8078/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] | |
oschina: http://maven.oschina.net/content/groups/public/ | |
oschina-ivy:http://maven.oschina.net/content/groups/public/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] | |
sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] |
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 python | |
"""A simple web server with rotating file logger | |
""" | |
import logging | |
import logging.handlers | |
import BaseHTTPServer | |
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
// Overlapping Experiment Demo | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class MultiLayerExperiment { | |
private static String byteArrayToHex(byte[] byteArray) { | |
char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', |