Skip to content

Instantly share code, notes, and snippets.

phasetr phasetr

Block or report user

Report or block phasetr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:191d9c1367d4df2d88335fe4d62f8b8f
stack build --flag hmatrix:openblas --extra-include-dirs=/opt/OpenBLAS/include --extra-lib-dirs=/opt/OpenBLAS/bin --extra-lib-dirs=/usr/lib/gcc/x86_64-pc-msys/4.9.2/
@phasetr
phasetr / gist:c94a7480657474c263bb9da4eca455a4
Last active Dec 29, 2016
素数夜曲を読んでいて次のような Scheme のコードが出てきた.
View gist:c94a7480657474c263bb9da4eca455a4
(write (= 1 2 3 4 5 6)) ; => #f
(write (= 1 1 1)) ; => #t
(write (= 1 1 1 2)) ; => #f
(write (< 1 2 2 3)) ; => #f
(write (< 1 2 3 4)) ; => #t
View error.hs
assoc :: a -> [(a, b)] -> Maybe b
assoc _ [] = Nothing
assoc ekimei0 (x:xs) =
if fst x == ekimei0 then Just (snd x)
else assoc ekimei0 xs
main = do
print $ (assoc "後楽園" []) == Nothing
print $ assoc "後楽園" [("新大塚", 1.2), ("後楽園", 1.8)] == Just (1.8)
print $ assoc "池袋" [("新大塚", 1.2), ("後楽園", 1.8)] == Nothing
View math_tour_pdfcut.hs
import System.Process
import Data.Map
filebase = "math_tour"
orgfilename = filebase ++ ".org"
pdffilename = filebase ++ ".pdf"
chapters = [ ("01" , 6) -- 第0回
, ("01_enq", 12) -- 第0回アンケート
, ("02" , 27) -- 第0.5回
, ("02_enq", 34) -- 第0.5回アンケート
View math_tour_pdfcut.rb
# coding: utf-8
require 'pp'
require 'yaml'
filebase = "math_tour"
orgfilename = "#{filebase}.org"
pdffilename = "#{filebase}.pdf"
chapters = {
"01" => "6-11", # 第0回
"01_enq" => "12-26", # 第0回アンケート
"02" => "27-33", # 第0.5回
You can’t perform that action at this time.