Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
foreach my $item (keys %ENV) {
print "$item => $ENV{$item}\n";
}
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Dumper;
use Text::CSV_XS;
binmode STDOUT, ":utf8";
my $csv = Text::CSV_XS->new({binary=>1});
# Dashのチートシートを作成するファイルの書き方メモ・翻訳
# 元サンプルコード https://github.com/Kapeli/cheatset#readme
cheatsheet do
title 'サンプル' # リストに表示される名前
docset_file_name 'Sample' # ファイル名
keyword 'sample' # キーワード
introduction 'イカしたチートシート'# MarkdownやHTMLでも可
@akimacho
akimacho / gist:0a443b4be96aa7725c8f
Created March 1, 2015 00:53
Ocaml処理系のインストール
$ brew install ocaml
@akimacho
akimacho / Ocaml_ready
Created March 1, 2015 01:40
1.3準備
# "あ" ;;
- : string = "\164\162"
LANG=en_US.ISO8859-1 ocaml
OCaml version 4.02.1
# "あ" ;;
- : string = "あ"
#
@akimacho
akimacho / practice02
Created March 1, 2015 03:27
第2章練習問題
(* --- 問題2.1 --- *)
# 7 - 3 * 4 ;;
- : int = -5
(* 乗除算の順序は交換可能だが整数型なので *)
(* 7 / 2 は 3と評価ので,以下の2式の結果は異なる *)
# 7 / 2 * 2 ;;
- : int = 6
# 7 * 2 / 2 ;;
- : int = 7
(* --- 問題2.2 --- *)
# 1.0 /. infinity ;;
- : float = 0.
@akimacho
akimacho / prac_03
Last active August 29, 2015 14:16
第3章練習問題
(* --- 問題3.1 --- *)
# let e = 2.7182 ;;
val e : float = 2.7182
# let positive = e > 0.0 ;;
val positive : bool = true
# let seconds_of_day = 60 * 60 * 24 ;;
val seconds_of_day : int = 86400
(* みょうがだにと読む *)
(* 著者が所属するお茶の水女子大学に近いからか *)
# let name = "茗荷谷駅" ;;
# let t1 x = x + 1 ;;
val t1 : int -> int = <fun>
# let t2 x = x + 2 ;;
val t2 : int -> int = <fun>
# let t3 x = x + 3 ;;
val t3 : int -> int = <fun>
# t1 t2 t3 5 ;;
Error: This function has type int -> int
It is applied to too many arguments; maybe you forgot a `;'.
# t1 (t2 (t3 5)) ;;