Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
pandoc -t latex $1 | perl -pe 's/section{/section*{/g;s/\n\n/\par\n/g' | cat head - tail | platex
@MasWag
MasWag / 10-21.md
Created October 20, 2014 12:45
CPU実験5班10-21日のスライド

% Rice班(5班)進捗報告 % % 2014/10/20

先週からの仕様変更

  • 浮動小数点即値
  • serial通信
  • など
@MasWag
MasWag / run.sh
Created November 20, 2014 03:48
simple test launcher.
#!/bin/sh
# please change this variable when test target is changed
tests="fadd_isim i2f_isim"
ERROR_MES="User(VHDL) Code Called Simulation Stop"
NUM=$(echo $tests | wc -w)
PASSED="0"
FAILED="0"
@MasWag
MasWag / cmp_test.vhd
Created December 15, 2014 08:28
比較でnumeric_stdを使うと便利
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity cmp_test is
port (
Q0 : out std_logic;
Q1 : out std_logic);
end entity cmp_test;
@MasWag
MasWag / cancel.gs
Last active August 29, 2015 14:13
ISの休講補講情報を取得してGoogle Calendarに格納するGoogle Apps Script。
/*
The MIT License (MIT)
Copyright (c) 2015 Masaki Waga
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@MasWag
MasWag / crop.sh
Created January 15, 2015 06:48
image magicでslideを切ってzipに固めるscript
#! /bin/bash
if [ $# -lt 1 ]; then
echo "usage: $0 [DIR]";
exit 1;
fi
DIR=$1;
MAX=999;
@MasWag
MasWag / flycheck-vhdl-ghdl.el
Last active August 29, 2015 14:16
flycheck rule of vhdl using ghdl
(flycheck-define-checker vhdl-ghdl
"A VHDL syntax checker using ghdl."
:command ("ghdl" "-s" "--std=93" "--ieee=synopsys" "-fexplicit" source)
:error-patterns
((error line-start (file-name) ":" line ":" column
": " (message) line-end))
:modes vhdl-mode)
(flycheck-set-checker-executable 'vhdl-ghdl)
(add-hook 'vhdl-mode-hook
@MasWag
MasWag / report.latex
Created April 17, 2015 02:53
pandocでluatexを使わないtemplate
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{jsarticle}
\usepackage{multicol}
\setlength{\textheight}{232mm}
\setlength{\topmargin}{4.6truemm}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
$if(graphics)$
\usepackage{graphicx}
\makeatletter
@MasWag
MasWag / Omakefile
Created April 17, 2015 02:56
pandocとplatexでmarkdownからdviを生成するOmakefileの例
PANDOC = pandoc
PANDOC_FLAGS = --template=/home/calros/share/pandoc/report.latex -s
%.tex: %.md
$(PANDOC) $(PANDOC_FLAGS) -o $@ $<
# 生成するPDFの名前 (拡張子は不要)
TARGET = test
# LaTeXコマンド
LATEX = platex
@MasWag
MasWag / play_depth.cpp
Created June 14, 2015 12:39
depth's player
#include <OpenNI.h>
#include <opencv2/opencv.hpp>
#include <vector>
#include <stdexcept>
int main(int argc,char* argv[])
{
try {
openni::Status ret = openni::OpenNI::initialize();
if ( ret != openni::STATUS_OK ) {