Skip to content

Instantly share code, notes, and snippets.

View MiyamonY's full-sized avatar
🏠
Working from home

MiyamonY

🏠
Working from home
View GitHub Profile
@MiyamonY
MiyamonY / 13-222916.org
Last active August 29, 2015 14:02
OMake

OMake Tips

ビルドするソースファイルの指定

  • 拡張子でファイルを指定する場合、以下のように指定できる。 \$(removesuffix $(filter %.ml, $(ls .)))\
@MiyamonY
MiyamonY / 16-075435.org
Created June 15, 2014 23:07
python-nose

nose(Python unittestフレームワーク) tips

nose

  • `nosetests` コマンドでカレントディレクトリ以下のテストファイル中のテストを実 行する。
@MiyamonY
MiyamonY / 21-190041.v
Created June 21, 2014 10:27
when hypothesis is instantiated, we first generalize the hypothesis
Theorem instantiated :
forall m:nat,
m <= 0 -> m = 0.
Proof.
intros. induction H.
- reflexivity.
- subst. Abort.
Theorem generalized :
forall m n,
@MiyamonY
MiyamonY / 22-180001.v
Created June 22, 2014 12:25
define plus using nat_rec
Definition Plus: nat -> nat -> nat.
intros x.
elim x using nat_rec.
- intros y. apply y.
- intros x' plus_x' y. apply (S (plus_x' y)).
Defined.
Print Plus.
(* Plus = *)
(* fun x : nat => *)
@MiyamonY
MiyamonY / gist:17814ae0697c18438d65
Created June 28, 2014 18:05
[coq]using Fin module
Require Import Fin.
Print Module Fin.
(** Finはfinite setの略で、Fin.t n でサイズnの有限の集合を表わす型。 *)
Print Fin.t.
(* Inductive t : nat -> Set := *)
(* F1 : forall n : nat, t (S n) | FS : forall n : nat, t n -> t (S n) *)
Check F1: Fin.t 3. (* 0 *)
@MiyamonY
MiyamonY / gist:91e5a4cea131274a546d
Created July 6, 2014 02:27
ipython と matplotlib
# coding: utf-8
# In[26]:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from datetime import datetime
from __future__ import print_function
import Data.List
import Data.Char
import qualified Data.Map as Map
-- head' :: [a] -> a
-- head' [] = error "Can't call head on an emply list, dummy!"
-- head' (x : _) = x
tell :: (Show a) => [a] -> String
tell [] = "The list is empty"
module Geometry
( sphereVolume,
sphereArea,
cubeVolume,
cubeArea,
cuboidArea,
cuboidVolume) where
sphereVolume :: Float -> Float
sphereVolume radius = (4.0 / 3.0) * pi * (radius ^ 3)
module Shapes
( Point (..),
Shape (..),
area,
nudge,
baseCircle,
baseRect ) where
-- data Bool = False | True
import qualified Data.Map as Map
-- record
-- data Person = Person {firstName :: String,
-- lastName :: String,
-- age :: Int,
-- height :: Float,
-- phoneNumber :: String,
-- flavor :: String} deriving(Show)
-- guy = Person "Buddy" "Finklestein" 43 184.2 "562-2928" "Chocolate"