Skip to content

Instantly share code, notes, and snippets.

View t-uda's full-sized avatar

Tomoki UDA t-uda

  • AIMR, Tohoku University
  • Sendai
  • X @t_uda
View GitHub Profile
@t-uda
t-uda / file2.txt
Created April 25, 2014 14:53
switch(true) イディオム考察 ref: http://qiita.com/t_uda/items/1969e09a970d71e4cfd6
もし条件 condition が成り立つならば hoge する.
@t-uda
t-uda / file1.txt
Created June 15, 2012 15:22
boost::numeric::interval<int>(0): C++ Boost 区間演算ライブラリ 概要 ref: http://qiita.com/items/7712671389e016d24df6
$ g++ hello-interval.cpp -o hello-interval
$ ./hello-interval
[-1,2]
@t-uda
t-uda / output-for-test-interval-arith-RxR.txt
Created June 16, 2012 16:59
boost::numeric::interval<int>(1): C++ Boost 区間演算ライブラリ 四則演算と基本的な関数 ref: http://qiita.com/items/e4f554b8af864b638a6d
a = 1.7
b = 3.3
a + b = [5,5]w(8.88178e-16)
a - b = [-1.6,-1.6]w(0)
a * b = [5.61,5.61]w(8.88178e-16)
a / b = [0.515152,0.515152]w(1.11022e-16)
" 表示行単位で上下移動するように
nnoremap j gj
nnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
" 逆に普通の行単位で移動したい時のために逆の map も設定しておく
nnoremap gj j
nnoremap gk k
@t-uda
t-uda / .gitconfig
Created June 22, 2012 12:53
.gitconfig で他のファイルを include ref: http://qiita.com/items/c3fd33604c3888e64868
[include]
path = .gitconfig.local
@t-uda
t-uda / bad-newenvironment-lstlisting.tex
Created June 23, 2012 15:05
lstlisting の新しい環境を定義する \lstnewenvironment ref: http://qiita.com/items/a971b925fc6526d324c1
\documentclass{article}
\usepackage{listings}
\lstset{language=C++}
\newenvironment{C++}{\begin{lstlisting}}{\end{lstlisting}}
\begin{document}
\begin{C++}
#include <iostream>
int main () {
<html>
<head>
<style>v\:oval { behavior:url(#default#VML); display:inline-block }</style>
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(document).submit(function () {});
$('oval').click();
})
@t-uda
t-uda / .zshenv
Created August 1, 2012 16:17
zsh global alias でエラー出力だけを楽々パイプする ref: http://qiita.com/items/986235bd1879692e54a1
alias -g L="|& $PAGER"
alias -g E='2>&1 > /dev/null'
@t-uda
t-uda / MY_HOME
Created August 12, 2012 06:24
Debian で WPA-PSK(AES) 方式で無線接続 - NetworkManager 編 ref: http://qiita.com/items/42e96c2daa2ca932f7e3
[connection]
id=MY_HOME
uuid=***-***-***-***-***
type=802-11-wireless
[802-11-wireless]
ssid=MY_HOME
mode=infrastructure
mac-address=**:**:**:**:**:**
security=802-11-wireless-security
@t-uda
t-uda / file1.sh
Created August 12, 2012 08:45
boost::numeric::interval<int>(3): C++ Boost 区間演算ライブラリ 超越関数 ref: http://qiita.com/items/e08ca64b318917e6d4ab
$ g++ test-interval-transc-error.cpp
In file included from /usr/include/boost/numeric/interval.hpp:30:0,
from test-interval-transc-error.cpp:2:
/usr/include/boost/numeric/interval/transc.hpp: In function ‘boost::numeric::interval<T, Policies> boost::numeric::exp(const boost::numeric::interval<T, Policies>&) [with T = double, Policies = boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >]’:
test-interval-transc-error.cpp:12:30: instantiated from here
/usr/include/boost/numeric/interval/transc.hpp:34:64: error: ‘boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >::rounding’ has no member named ‘exp_down’
/usr/include/boost/numeric/interval/transc.hpp:34:64: error: ‘boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double