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
type TFBuilder() = | |
member self.TryFinally (x, f) = | |
f () | |
x | |
member self.Delay f = f () | |
member self.Bind (x, f) = f x | |
member self.Return x = x | |
let tfb = TFBuilder() |
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 spock.lang.* | |
class DropAndRefundTest extends spock.lang.Specification { | |
def setup(){ | |
} | |
@Unroll | |
def "自販機に #money を投入できる"() { | |
setup: |
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
open System | |
type Result = | |
| Perfect | |
| Excellent | |
| Good | |
| Bad | |
let exam yourScore = | |
if yourScore = 100 then Perfect |
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
module Imperative | |
open System | |
open System.Text | |
open System.Security.Cryptography | |
let generateKeyFromPassword password keySize blockSize = | |
//パスワードから共有キーと初期化ベクタを作成する | |
//saltを決める | |
let salt = Encoding.UTF8.GetBytes "saltは必ず8バイト以上" |
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
module MultiParadigm | |
open System | |
open System.Text | |
open System.Security.Cryptography | |
let generateKeyFromPassword password keySize blockSize = | |
//パスワードから共有キーと初期化ベクタを作成する | |
//saltを決める | |
let salt = Encoding.UTF8.GetBytes "saltは必ず8バイト以上" |
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> | |
<title>Tuple test</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript" src="tuple.js"></script> | |
</head> | |
<body> | |
<div id="output" /> | |
</body> |
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> | |
<title>Option test</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript" src="option.js"></script> | |
</head> | |
<body> | |
<div id="output" /> | |
</body> |
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
function write(message) { | |
document.getElementById("output").innerHTML += message + "<br />"; | |
} | |
function assertEquals(expected, actual) { | |
if (expected == actual) { | |
write("OK"); | |
} else { | |
var text = "expected = [" + expected.toString() | |
+ "], but actual = [" + actual.toString() + "]." |
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
# hgrc | |
# hg-now is the simple alias inspired by git-now. | |
# (http://d.hatena.ne.jp/sinsoku/20101208/1291770514) | |
# and it is for Windows environments. | |
# if you use some Unix base operating systems, like Linux distributions, BSDs or Macs, | |
# please hack it in your environment. | |
[alias] | |
# create a temporary commit. | |
now = ! hg commit -m "[from now] %date% %time%" |
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
# -*- coding: utf-8 -*- | |
import random | |
import datetime | |
left_brows = ['´', '`', ''] | |
left_eyes = ['・', '^', ';', '>', ''] | |
mouths = ['ω', '∀', 'ρ', '_', 'Д', 'д', ''] | |
right_eyes = ['・', '^', ';', '<', ''] | |
right_brows = ['´', '`', ''] |