y :: bとおく。x :: cとおく。y x :: dとおく。- (1.)(2.)(3.)より
bとc -> dは等しい。 - (4.)より
y :: c -> dである。 x (y x) :: aとおく。- (2.)(3.)(6.)より
cとd -> aは等しい。 - (2.)(7.)より
x :: d -> aである。
This file contains hidden or 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 (RandomGen, getStdGen, randoms) | |
| import Control.Concurrent (threadDelay) | |
| import System.Process (callCommand) | |
| import Data.List.Split (chunksOf) | |
| import Data.Maybe (fromMaybe) | |
| type Cell = Bool | |
| type CellTable = [[Cell]] | |
| type Score = Int | |
| type Pos = (Int, Int) |
This file contains hidden or 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 | |
| main = do | |
| gen <- getStdGen | |
| let xs = ["hage", "はげ", "ハゲ", "ハゲ" ,"禿" ,"彡⌒ミ"] | |
| mapM_ putStr [xs !! i | i <- randomRs (0, length xs - 1) gen] |
This file contains hidden or 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
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| module Main where | |
| import Web.Scotty | |
| import Data.Aeson.TH | |
| data Person = Person { name :: String, country :: String } | |
| $(deriveJSON defaultOptions ''Person) |
This file contains hidden or 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
| const valueSource = 'hage'; | |
| const keysSource = 'a/b/c'; | |
| const keys = keysSource.split('/'); | |
| const result = keys.reduceRight((value, key) => { | |
| return { [key]: value }; | |
| }, valueSource); | |
| console.log(result); |
This file contains hidden or 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
| ((x,w,d,i,g,b,p)=>{i=d.createElement('iframe');i.onload=()=>{g=Object.keys(i.contentWindow);for(b in window){p=w[b];if(w.hasOwnProperty(b)&&p&&!g.includes(b)){x[b]=p}}console.log(x)};i.src='about:blank';d.body.appendChild(i)})({},window,document); |
This file contains hidden or 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
| Require Import Arith.Mult. | |
| Definition is_even (n : nat) : Prop := | |
| exists (k : nat), n = 2 * k. | |
| Theorem even_plus_even_is_even : | |
| forall (n m : nat), is_even n /\ is_even m -> is_even (n + m). | |
| Proof. | |
| intro n. | |
| intro m. |
This file contains hidden or 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 { OAuth1Session } from 'requests_oauthlib'; | |
| import json from 'json'; | |
| let savedSession = json.load(open('./twitter.json', 'r')); | |
| let sess = OAuth1Session( | |
| savedSession.ck | |
| savedSession.cs | |
| savedSession.at | |
| savedSession.cs | |
| ); |
This file contains hidden or 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
| class Human { | |
| private age: number = 42; | |
| getAge() { | |
| return this.age; | |
| } | |
| } | |
| let f = new Human().getAge | |
| console.log(f()); |
This file contains hidden or 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
| class TailRec<T> { | |
| private next: () => TailRec<T>; | |
| private done: boolean; | |
| private result: T; | |
| constructor(next: () => TailRec<T>, done: boolean, result: T) { | |
| this.next = next; | |
| this.done = done; | |
| this.result = result; | |
| } |