This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
data Var = Var Int deriving Eq | |
instance Show Var where | |
show (Var x) = "v" ++ show x | |
data Const = Zero | One deriving Eq | |
instance Show Const where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{jlreq} | |
| |
%% \documentclass{ltjsarticle} | |
%% \usepackage[haranoaji,deluxe]{luatexja-preset} | |
| |
%% \usepackage[uplatex,deluxe]{otf} | |
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry} | |
\usepackage{ascmac} | |
\usepackage{amsmath} | |
\usepackage{amsthm} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define rember-f | |
(lambda (test? a l) | |
(cond | |
((null? l) (quote ())) | |
((test? (car l) a) (rember-f test? a (cdr l))) | |
(else (cons (car l) (rember-f test? a (cdr l))))))) | |
(rember-f = 5 '(6 2 5 3)) | |
(rember-f eq? 'jelly '(jelly beans are good)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define eqan? | |
(lambda (a1 a2) | |
(cond | |
((and (number? a1) (number? a2) (= a1 a2))) | |
((or (number? a1) (number? a2)) #f) | |
(else (eq? a1 a2))))) | |
(eqan? 3 5) | |
(eqan? 3 'hoge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://folk.uio.no/hpl/scripting/doc/gnuplot/Kawano/intro/working.html | |
# gnuplot < graph.plt | |
# sed "s/latency/time/g" graph.plt | gnuplot | |
set term epslatex # color 12 | |
set output "acl_latency.tex" | |
# set output "acl_time.tex" | |
set boxwidth 1 | |
# set key at 6.5,7000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=3 | |
for ((i = 1; i <= 3; ++i)) | |
do | |
sort -n acl_given_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency0 | |
sort -n acl_hikin_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency1 | |
sort -n acl_takeyama_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency2 | |
sort -n acl_sgm_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency3 | |
sort -n acl_swbp_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency4 | |
sort -n acl_proposed_latency${i} | awk '{v[i++]=$1;}END {x=int((i+1)/2); if(x<(i+1)/2) print (v[x-1]+v[x])/2; else print v[x-1];}' >> acl_median_latency5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash - | |
n=5 | |
m=10 | |
# m=1 | |
for (( i = 1; i <= n; i += 1 )) | |
do | |
for (( j = 1; j <= m; j +=1 )) | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## script for experiments | |
#! /bin/bash - | |
n=5 | |
m=10 | |
for (( i = 1; i <= n; i += 1)) | |
do | |
for ((j = 1; j <= m; j += 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- もっと効率の良い実装があるはず... | |
import Data.Char | |
main :: IO () | |
main = putStrLn "Enter a length of element: " | |
>> (readLn :: IO Int) | |
>>= \d -> putStrLn ("graph Lattice" ++ show d ++ " {") | |
>> putStr "\n graph [\n rankdir = BT\n ]\n\n" | |
>> putStrLn ((unlines . concatMap piyo . reverse . mkLattice) d ++ "}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Random.Shuffle | |
import System.Random | |
import System.Environment | |
import Data.List | |
main :: IO () | |
main = | |
getArgs >>= | |
\args -> if 3 /= (length args) | |
then putStrLn "Usage: $ ./mkC1Pmatrix 100 32 randomC1Pmatrix" |
NewerOlder