Skip to content

Instantly share code, notes, and snippets.

View wkentaro's full-sized avatar

Kentaro Wada wkentaro

View GitHub Profile
@wkentaro
wkentaro / basic_linux.md
Last active August 29, 2015 14:05
Introduction of Linux (Reference Links)
@wkentaro
wkentaro / Makefile
Created October 13, 2014 04:31
OpenCV Makefile
CC :=g++
CFLAGS :=`pkg-config opencv --cflags` `pkg-config opencv --libs`
LDFLAGS :=
SOURCES :=$(wildcard *.cpp)
EXECUTABLE :=$(SOURCES:.cpp=)
all:$(EXECUTABLE)
$(EXECUTABLE):$(SOURCES)
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@
@wkentaro
wkentaro / file0.txt
Last active August 29, 2015 14:07
Python+Matplotlibでプロットアニメーションを作成する ref: http://qiita.com/greeeenkew/items/128ceb1965731b6ef34c
import numpy
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import mpl_toolkits.mplot3d.axes3d as p3
def plot_3D_animation(X, Y, Z, n_frame=None,
xlim=None, ylim=None, zlim=None,
step=None, saveanime=None, show=True):
"""3D plotting animation"""
fig = plt.figure()
@wkentaro
wkentaro / binary-tape.py
Created October 22, 2014 13:15
code festa samples
#-*- coding: utf-8 -*-
# binary-tape.py
# handle inputs
T = int(raw_input())
N, S = [], []
for i in xrange(T):
N.append(int(raw_input()))
S.append(raw_input())
@wkentaro
wkentaro / kensho.py
Last active August 29, 2015 14:08
20141026 atcoder sample
a = int(raw_input())
n_snacks = a
n_students = int(raw_input())
while (n_snacks % n_students) != 0:
n_snacks += 1
print (n_snacks - a)
#include <iostream>
int main()
{
std::cout << "Hello, World!";
}
@wkentaro
wkentaro / main.py
Created November 13, 2014 23:46
Get images from url.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# main.py
import sys
from PIL import Image
import requests
from io import BytesIO
f = open('image_urls.txt', 'rb')
rows = f.readlines()
@wkentaro
wkentaro / Makefile
Last active August 19, 2023 13:33
Makefile to compile all c files in the directories
CC :=gcc
CPP :=g++
LDFLAGS :=
C_SOURCES :=$(wildcard *.c)
C_EXECUTABLE :=$(C_SOURCES:.c=)
CPP_SOURCES :=$(wildcard *.cpp)
CPP_EXECUTABLE :=$(CPP_SOURCES:.cpp=)
all:$(C_EXECUTABLE) $(CPP_EXECUTABLE)
@wkentaro
wkentaro / multi2.py
Created January 14, 2015 18:29
perfect multi cmdline refreshing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# multi2.py
# author: Kentaro Wada <www.kentaro.wada@gmail.com>
import curses
import time
def report_progress(filename, progress):
"""progress: 0-10"""
@wkentaro
wkentaro / only_object.py
Created January 18, 2015 14:37
get only object from cropping and making background transparent
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Get only object in a image by making
the white background transparent.
"""
__author__ = 'www.kentaro.wada@gmail.com (Kentaro Wada)'