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 <stdio.h> | |
#include <math.h> | |
/* 有理数型 */ | |
struct Rational | |
{ | |
int numer; /* 分子 */ | |
int denom; /* 分母 */ | |
}; | |
typedef struct Rational Rational; |
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
/* | |
HSPによるライフゲームサンプル | |
参考文献: | |
『C言語による最新アルゴリズム辞典』奥村晴彦著/技術評論社 | |
『人工生命の世界』服部桂/オーム社 | |
*/ | |
#define ScreenX 160 | |
#define ScreenY 120 |
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 | |
# coding: utf-8 | |
if [ $# -gt 0 ]; then | |
for file in “$@” | |
do | |
if [ -f “$file” -a -s “$file” ]; then | |
# Get file extention | |
ext=`basename “$file” | sed ‘s/^.*\.\(.*\)$/\1/gi’`; | |
if [ “$file” == $ext ] ; then |
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
$indent = 2 | |
class Array; | |
def nest; self[0] end | |
def nest=(val); self[0]=val end | |
def value; self[1] end | |
def value=(val); self[1]=val end | |
def comment; self[2] end | |
def comment=(val); self[2]=val end | |
end |
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
; ookiihou wo kaesu max kansuu | |
defun ooki (x y) | |
if (> x y) | |
x | |
y | |
; fibonacchi suu wo kaesu | |
defun fib (n) | |
if (< n 2) | |
n |
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
; ookiihou wo kaesu max kansuu | |
(defun ooki (x y) | |
(if (> x y) | |
x | |
y)) | |
; fibonacchi suu wo kaesu | |
(defun fib (n) | |
(if (< n 2) | |
n |
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/ruby | |
# coding: utf-8 | |
ts = {} | |
as = [] | |
(`chasen source.txt`).each_line do |line| | |
as.push line.split(/\t/)[0] | |
end |
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/python | |
# coding: utf-8 | |
import numpy as np | |
import cv2 | |
from matplotlib import pyplot as plt | |
img_left = cv2.imread("l.jpg",0) | |
img_right = cv2.imread("r.jpg",0) | |
img_left = cv2.GaussianBlur(cv2.equalizeHist(img_left), (3,3), 0) | |
img_right = cv2.GaussianBlur(cv2.equalizeHist(img_right) ,(3,3), 0) |
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
q = np.array([ | |
[1, 0, 0, -width/2], | |
[0, 1, 0, -height/2], | |
[0, 0, 0, focal_length], | |
[0, 0, -1/tx, 0] | |
]) | |
_points, _colors = calc_point_cloud(image, disp, q) | |
points = list(_points) | |
colors = list(_colors) |
OlderNewer