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
\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}
@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;
#!/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: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>
@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 ...
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: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):
\documentclass[twocolumn,oneside,a4paper]{jarticle}
% ERROR
% \usepackage[dvipdfm]{graphicx}
\usepackage[dvipdfm]{graphicx}
\usepackage{amsmath,amssymb}
\title{ほげほげを用いたふがふが推定}
\author{へのへのもへじ}
\date{\today}
@denkiwakame
denkiwakame / gist:ddfc8bbc8a6d99ef3a87
Last active August 29, 2015 14:03
雑カメ制御
#include "FlyCapture2.h"
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <vector>
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"