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
$ cabal install gio | |
Resolving dependencies... | |
[1 of 2] Compiling SetupWrapper ( /tmp/gio-0.12.3-8865/gio-0.12.3/SetupWrapper.hs, /tmp/gio-0.12.3-8865/gio-0.12.3/dist/setup/SetupWrapper.o ) | |
[2 of 2] Compiling Main ( /tmp/gio-0.12.3-8865/gio-0.12.3/Setup.hs, /tmp/gio-0.12.3-8865/gio-0.12.3/dist/setup/Main.o ) | |
Linking /tmp/gio-0.12.3-8865/gio-0.12.3/dist/setup/setup ... | |
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o ) | |
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o ) | |
Linking dist/setup-wrapper/setup ... | |
Configuring gio-0.12.3... | |
Building gio-0.12.3... |
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
-- @see http://d.hatena.ne.jp/wvogel00/20110528/1306599983 | |
-- main = putStr $ unlines $ map show $ map (kuku 1 []) [1..9] | |
kuku :: Int -> [Int] -> Int -> [Int] | |
kuku 9 xs n = xs ++ [9*n] | |
kuku x xs n = kuku (x + 1) (xs ++ [n*x]) n | |
putKuku = putStr $ unlines $ map show $ map (kuku 1 []) [1..9] | |
-- @see http://d.hatena.ne.jp/kazu-yamamoto/20080215/1203060588 | |
row = 9 |
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
;; @see http://d.hatena.ne.jp/marony0607/20111205/1323103005 | |
;; ここの表を参考にいくつかkey-comboを作った。 | |
(add-hook 'haskell-mode-hook | |
#'(lambda () | |
(key-combo-define-local (kbd "," ) ", ") | |
;; bind function, Eq | |
(key-combo-define-local (kbd "=" ) '(" = " " == ")) | |
(key-combo-define-local (kbd "::" ) " :: ") | |
;; Num, List, Arrow | |
(key-combo-define-local (kbd "+") '(" + " " ++ " " +++ ")) |
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 Control.Monad | |
import Data.Int | |
-- cubed :: String -> Integer | |
-- cubed x = product [x, x, x] | |
import Data.Set | |
import Text.Printf (printf) | |
cubed :: Int -> Int | |
cubed x = x * x * x |
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
(defun my-flatten (lst) | |
(cond ((atom lst) lst) | |
((listp (car lst)) | |
(append (my-flatten (car lst)) (my-flatten (cdr lst)))) | |
(t (append (list (car lst)) (my-flatten (cdr lst)))) | |
)) |
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
uruu :: Int -> Bool | |
uruu x = (mod x 4) == 0 && (mod x 100) /= 0 || (mod x 400) == 0 | |
-- uruu x = mod x 400 == 0 | |
main = do | |
s <- getLine | |
if uruu (read s :: Int) | |
then putStrLn "YES" | |
else putStrLn "NO" |
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://arc001.contest.atcoder.jp/tasks/arc001_1# | |
他の人のを見たらそれに引きづられて丸パクリになってもうた(汗) | |
参考ソース: http://arc001.contest.atcoder.jp/submissions/22675# | |
-} | |
import Data.List | |
result = do | |
s <-getLine | |
s1 <- getLine | |
let countList = map (\c -> myCount c s1) "1234" |
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
(* 1.Coqを始めよう @see http://www.iij-ii.co.jp/lab/techdoc/coqt/coqt1.html *) | |
(* Type: 型の型の一つ。あらゆる型のこと *) | |
(* Definition: 関数定義 *) | |
Definition id (A : Type)(x : A) : A := x. | |
(* 型が nat である引数 n と m を取り戻り値の型が nat である関数plus *) | |
Definition plus (n : nat)(m : nat) : nat := n + m. | |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>$title</title> | |
$styles | |
</head> | |
<body> | |
<h1>$title</h1> |
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
;;40_init-flex-autopair.el: | |
;;lisp | |
(require 'flex-autopair) | |
(flex-autopair-mode 1) | |
;; (defun my-hook-function () | |
;; (add-to-list 'flex-autopair-pairs '(?\< . ?\>))) | |
;; (add-hook 'c-mode-hook 'my-hook-function) |