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
#/bin/bash | |
set -e | |
[ ${#@} -ne 2 ] && { | |
echo "Usage : $0 measurement_time(sec) bandwidth[|K|M](bps)" | |
echo "---" | |
echo "You also need to put 'hosts' file which contains target IPs." | |
exit 1 | |
} |
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
#include <opencv2/core/core.hpp> | |
#include <opencv2/opencv.hpp> | |
#include <iostream> | |
using namespace std; | |
using namespace cv; | |
void show(Mat *img){ | |
cout << "Width " << img->cols << " / Height " << img->rows << endl; | |
imshow("Image", *img); |
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,re | |
from functools import reduce | |
def stroll(topdir,no_root=[],yes_root=[],no_path=[],yes_path=[],no_file=[],yes_file=[],sortby=os.path.basename,reverse=False,ignorecase=True): | |
T=True | |
F=False | |
I=ignorecase | |
no_root.append("\..") |
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
#include <iostream> | |
#include <algorithm> | |
#include <iterator> | |
#include <sys/stat.h> | |
#include <dirent.h> | |
#include <queue> | |
#include <regex> | |
namespace stroll { |
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
from collections import defaultdict | |
def init(data): | |
if isinstance(data, dict): | |
for key1, val1 in data.items(): | |
if isinstance(val1, dict): | |
for key2, val2 in val1.items(): | |
if isinstance(val2, dict): | |
for key3, val3 in val2.items(): |
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
# coding: utf-8 | |
import csv | |
import urllib3 | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from matplotlib.font_manager import FontProperties | |
import pandas as pd |
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 java.lang.reflect.Constructor; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Field; | |
import sun.misc.Unsafe; | |
class S { | |
private void privatePrintS () { System.out.println("This is in S."); }; | |
public void publicPrintS () { System.out.println("This is in S."); }; | |
} |
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
git clone https://github.com/python/cpython | |
cd cpython | |
git pull | |
export $(grep ^PACKAGE_VERSION= configure)) | |
./configure --prefix=$HOME/.pyenv/versions/$PACKAGE_VERSION | |
make | |
make test | |
make install | |
ln -s $HOME/.pyenv/versions/$PACKAGE_VERSION/bin/python3 $HOME/.pyenv/versions/$PACKAGE_VERSION/bin/python | |
pyenv rehash |
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 pandas as pd | |
import numpy as np | |
from collections import defaultdict | |
df1 = pd.DataFrame({"col1":[0,1,2,3],"col2":[4,5,6,7],"col3":[8,9,10,11]},index=["idx1","idx2","idx3","idx4"]) | |
print("df1") | |
print(df1,end="\n\n") | |
df2 = pd.DataFrame([[0,4,8],[1,5,9],[2,6,10],[3,7,11]],index=["idx1","idx2","idx3","idx4"],columns=["col1","col2","col3"]) |
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
from tensorflow.examples.tutorials.mnist import input_data | |
# one_hot is for multiclass classification | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
import tensorflow as tf | |
# Input | |
# 784 = 28 x 28 | |
# Mini batch size is not fixed here | |
x = tf.placeholder(tf.float32, [None,784]) |