http://japgolly.blogspot.jp/2015/02/zero-overhead-recursive-adt-coproducts.html https://www.reddit.com/r/scala/comments/4g43js/union_types_in_scala/
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
cat <<EOF | |
TYPE The following commands: | |
sysctl -w net.ipv4.conf.docker0.route_localnet=1 | |
iptables -t nat -N REDSOCKS | |
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN | |
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN | |
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN | |
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN | |
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN | |
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN |
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
siaq_block() { | |
curl -s -A "Sia-Agent" http://localhost:9980/explorer/blocks/$1 | |
} | |
siaq_blkinfo() { | |
date --date=@$(siaq_block $1|jq .block.rawblock.timestamp) | |
siaq_block $latest | jq ".block.transactions[0].height, ($(date -u +%s)-.block.rawblock.timestamp)/60, .block.rawblock.nonce" | |
} | |
siaq_latest() { |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
I hereby claim:
- I am codeck on github.
- I am codeck (https://keybase.io/codeck) on keybase.
- I have a public key ASDyhlx-SXtnYi3px3miYqeOkqvB3k1VVEqUeV-TAaxh7wo
To claim this, I am signing this object:
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
#lang racket | |
;There are 25 persons in three categories: A, B and C. Class a people always tell the truth, class B people always tell the lie, and class c people tell the truth and the lie separately (for example, if a class C person tells the truth this time, the next sentence he says must be the lie, and the next sentence is the truth again). The priest asked everyone, "are you a class?" 17 answered yes. The priest asked everyone, "are you a class B?" 12 answered yes. The priest asked everyone, "are you a class C?" Eight answered yes. Of these 25 people, how many class C person? | |
(require minikanren) | |
(define peano | |
(lambda (n) | |
(conde | |
((== 'z n)) |
OlderNewer