- Windows / Mac OS X
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
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 $@ |
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 | |
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() |
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 -*- | |
# 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()) |
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
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) |
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> | |
int main() | |
{ | |
std::cout << "Hello, World!"; | |
} |
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
#! /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() |
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
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) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# multi2.py | |
# author: Kentaro Wada <[email protected]> | |
import curses | |
import time | |
def report_progress(filename, progress): | |
"""progress: 0-10""" |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
""" | |
Get only object in a image by making | |
the white background transparent. | |
""" | |
__author__ = '[email protected] (Kentaro Wada)' |
OlderNewer