Skip to content

Instantly share code, notes, and snippets.

@westoshy
westoshy / Calibration.matlab
Created January 31, 2017 22:09
MATLAB Computer Vision Toolboxのサンプル(キャリブレーションと3次元ビジョン)
%#
%# title: Calibration.m
%# brief: キャリブレーションされていないステレオイメージの平行化
%#
%# url: https://jp.mathworks.com/help/vision/examples/uncalibrated-stereo-image-rectification.html
%#
I1 = imread('yellowstone_left.png');
I2 = imread('yellowstone_right.png');
@westoshy
westoshy / SetPlotArea.vbs
Last active April 10, 2017 13:31
Excel VBA便利関数
' アクティブなシート内のChartObjectのプロットエリアを選択中のものと揃える
Sub SetPlotArea()
Dim cht As ChartObject
For Each cht In ActiveSheet.ChartObjects
With ActiveChart.PlotArea
cht.Chart.PlotArea.Left = .Left
cht.Chart.PlotArea.Top = .Top
cht.Chart.PlotArea.Width = .Width
cht.Chart.PlotArea.Height = .Height
@westoshy
westoshy / rename.ps1
Created January 28, 2017 14:31
PowerShel便利ツール
# ファイル名の先頭3文字にリネームする
ls | % {$NewName = $_.BaseName.substring(0, 3} + ".txt"; mv $_.Name $NewName }
@westoshy
westoshy / ga.cpp
Last active May 4, 2018 04:39
遺伝的アルゴリズム
#include "./Gene.hpp"
#include "./individual.hpp"
#include "./GeneticOperator.hpp"
#include "./GA.hpp"
void GA::selectCrossoverMethod(GA::CrossoverMethod type)
{
switch(type) {
case ONE_POINT:
@westoshy
westoshy / _制御シミュレーション手法.md
Last active May 4, 2018 04:42
制御シミュレーション手法

制御シミュレーション手法

はじめに

制御シミュレーションに関するプログラムです。 プロジェクトはbitbucketに置いてあります。

プロジェクトファイル

@westoshy
westoshy / 正規表現.md
Created August 9, 2016 21:35
正規表現
  • 空白の除去

:%s/\s+//g

@westoshy
westoshy / filelist.py
Created July 16, 2016 12:47
指定ディレクトリ内のファイル一覧を取得する
import sys
import os
if __name__ == "__main__":
argvs = sys.argv
argc = len(argvs)
if argc != 2:
print("Usage: # python {0} dirname".format(argvs[0]))
@westoshy
westoshy / ContourQuiver.m
Created May 14, 2016 11:42
MATLABグラフィック
%
[X,Y] = meshgrid(-2:0.2:2);
Z = X .* exp(-X.^2 - Y.^2);
contour(X,Y,Z,10)
@westoshy
westoshy / Astar.cpp
Created April 3, 2016 13:17
A*アルゴリズム
// Astar.cpp
// http://en.wikipedia.org/wiki/A*
// Compiler: Dev-C++ 4.9.9.2
// FB - 201012256
#include <iostream>
#include <iomanip>
#include <queue>
#include <string>
#include <math.h>
#include <ctime>
@westoshy
westoshy / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console