Skip to content

Instantly share code, notes, and snippets.

View denkiwakame's full-sized avatar
:octocat:
Working from home

Mai Nishimura denkiwakame

:octocat:
Working from home
View GitHub Profile
@denkiwakame
denkiwakame / gist:4d07fc3382fc98c83b55
Created August 24, 2014 13:43
watchdog stop() は外からコールしてjoinしないといけなかった
import ParamJsonGenerator
import time
import os,sys
import cgi
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
def DEBUG(msg):
CXX=g++ -std=c++11
BINDIR=bin
SRCDIR=src
OBJDIR=obj
CXXFLAGS=-O2 -MMD -Wall -Wextra -std=c++11
CXXFLAGS+=`pkg-config --cflags opencv`
LDFLAGS=`pkg-config --libs opencv`
LDFLAGS+= -lboost_program_options
@denkiwakame
denkiwakame / gist:7bfd1eeadb2439601722
Created September 16, 2014 14:07
やっつけMatパーサ
// data format
// # camnum
// # setnum
// # sets
// # data xd yd x0 y0 ... xN yN
// 0
// 4
// 1 2 3 4
// xxx xxx xxx xxx xxx xxx xxx xxx
// xxx ...
@denkiwakame
denkiwakame / gist:03844b24c5d2f36be979
Created September 16, 2014 17:47
パースして外部キャリブレーションする
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <regex>
#include <boost/program_options.hpp>
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo [usage] $0 input.pdf output.pdf
exit
fi
set -e
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${2} ${1}
exit
@denkiwakame
denkiwakame / gist:c665e50c85eb4edbd055
Created January 5, 2015 13:22
getline for split
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
std::vector<std::string> split(const std::string& input, char delimiter)
{
std::istringstream stream(input);
std::string field;
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mediabb}[2006/10/26 v1.9 iNOUE Koich! <[email protected]>]
\@ifpackageloaded{graphics}{}{\RequirePackage[dvipdfm]{graphicx}}
\define@key{Gin}{usebb}[true]{\expandafter\let\expandafter\if@usebb\csname if#1\endcsname}
\let\if@usebb\iffalse
\define@key{Gin}{mediaboxonly}[/MediaBox]{\@ifundefined{Gread@find@#1}%
{\def\Gread@rect@box{/MediaBox}\expandafter\let\expandafter\if@Gread@find@only\csname if#1\endcsname}%
{\def\Gread@rect@box{#1}\let\if@Gread@find@only\iftrue}}
\let\if@Gread@find@only\iffalse
\def\Gread@rect@box{/MediaBox}
linestyles = cellstr(char('-',':','-.','--','-',':','-.','--','-',':','-',':',...
'-.','--','-',':','-.','--','-',':','-.'));
MarkerEdgeColors=jet(n); % n is the number of different items you have
Markers=['o','x','+','*','s','d','v','^','<','>','p','h','.',...
'+','*','o','x','^','<','h','.','>','p','s','d','v',...
'o','x','+','*','s','d','v','^','<','>','p','h','.'];
% [...]
@denkiwakame
denkiwakame / gist:f78833a28c91ec83b569
Created February 6, 2015 12:00
mexコンパイル
[status, opencv_incdir] = system('pkg-config --cflags opencv');
[status, opencv_ldflags] = system('pkg-config --libs opencv');
opencv_incdir = opencv_incdir(1:end-3)
opencv_ldflags = opencv_ldflags(1:end-3)
TARGET_FILE='./src/readxml.cpp';
mex_compile_options = sprintf('mex CXX=g++ %s %s %s', opencv_incdir, opencv_ldflags, TARGET_FILE)
eval(mex_compile_options)
@denkiwakame
denkiwakame / gist:d5de263d386a2fc2e7d8
Created March 12, 2015 15:10
includeすればよい
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 13.04.2 ] */
/* [wxMaxima: input start ] */
/*
get_M(_VARS,_F):=block([X,N,r,c,B,y,coeff,flag],
X:_VARS,
f:_F,
N:length(X),
M:[],