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/sh | |
# | |
# This is a xelatex engine for TeXnicle. | |
# | |
# It runs xelatex the desired number of times, optionally running bibtex after the first run. | |
# | |
# <support>nCompile,doBibtex</support> | |
# | |
# xelatex.engine | |
# TeXnicle |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?PHP | |
// 全角英数字と全角スペースを半角に変換 | |
$input_term = mb_convert_kana($input_term, 'as', 'UTF-8'); | |
// 連続する半角スペースを1つの半角スペースへ | |
$input_term = preg_replace('/\s+/', ' ', $input_term); |
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 urllib | |
import json | |
NUM = 1 | |
url = 'https://www.hogehoge.com?' | |
params = { | |
'param1':'para', | |
'param2':'para', | |
} | |
f = open('hogehoge.json','w') |
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 urllib | |
from BeautifulSoup import BeautifulStoneSoup | |
NUM = 1 | |
url = 'http://www.hogehoge.com?' | |
params = { | |
'param1':'para', | |
'param2': 'para' | |
} |
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 MySQLdb | |
connector = MySQLdb.connect(host="localhost", db="dbname", user="user", passwd="paswd", charset="utf8") | |
cursor = connector.cursor() | |
cursor.execute("select * from table limit 100") | |
result = cursor.fetchall() | |
if len(result) == 0: | |
print("no arecords. exit.") | |
cursor.close() |
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 | |
lzos=*.lzo | |
for LZO in ${lzos} | |
do | |
echo ${LZO} | |
lzop -x ${LZO} | |
rm `echo ${LZO%.*}'.*'` | |
done |
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 java:7-jre | |
# grab gosu for easy step-down from root | |
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | |
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ | |
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ | |
&& gpg --verify /usr/local/bin/gosu.asc \ | |
&& rm /usr/local/bin/gosu.asc \ | |
&& chmod +x /usr/local/bin/gosu |
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 sys | |
import numpy as np | |
VALID_COLUMNS = [] | |
def main(): | |
inputfile = sys.argv[1] | |
outputfile = sys.argv[2] | |
valid_columns_csv = sys.argv[3] |
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 numpy as np | |
import caffe | |
PROTOTEXT = "VGG_FACE_deploy.prototxt" | |
CAFFEMODEL = "VGG_FACE.caffemodel" | |
IMG_PATH = "ma_images/" | |
IMG_FILES = os.listdir(IMG_PATH) | |
OUTPUT_FILE = "train.csv" | |
#OUTPUT_FILE = "test.csv" |