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
(zipseq [1 2 3] [:a :b :c]) ; => ((1 :a) (2 :b) (3 :c)) | |
(zipseq [1 2] [:a :b] [:c :d]) ; => ((1 :a :c) (2 :b :d)) |
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
package trysample; | |
public class TrySample { | |
public static void main(String[] args) throws Exception{ | |
try(AutoCloseable a = () -> {throw new java.io.IOException("closeA");}){ | |
throw new IllegalStateException("tryB"); | |
} | |
} | |
} |
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
user=> (range-size 50 5) | |
(50 51 52 53 54) | |
user=> (rand-str 20) | |
"195Tbl1nE8ME0QGEwJl7" | |
user=> (rand-str 20 "abc") | |
"cbabbbcabbbaaaabcaca" |
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
user=> (def v {:abc 1 "aiu" 2}) | |
user=> (fuzzy-get v 'ab) | |
1 | |
user=> (fuzzy-get v :ai) | |
2 |
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
export http_proxy=http:// | |
export https_proxy=https:// | |
curl -O http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm | |
rpm -ivh epel-*.rpm | |
yum install ansible | |
yum install openssh-clients |
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
user=> (forcat [x (range 3) y [:a :b]] [x] [y]) | |
(0 :a 0 :b 1 :a 1 :b 2 :a 2 :b) |
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
user=> (reduce #(if (< 9999 %1) (reduced %1) (* %1 %2)) (range 1 10000)) | |
40320 |
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
user=> (re-find #".\d(.)" "some1234abc") | |
["e12" "2"] | |
user=> (re-find->map #".\d(.)" "some1234abc" :1 :2) | |
{:1 "e12", :2 "2"} |
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
(->> (range 10) (map -) (#(nth % 3))) |
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
> 1:9 %*% t(1:9) | |
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] | |
[1,] 1 2 3 4 5 6 7 8 9 | |
[2,] 2 4 6 8 10 12 14 16 18 | |
[3,] 3 6 9 12 15 18 21 24 27 | |
[4,] 4 8 12 16 20 24 28 32 36 | |
[5,] 5 10 15 20 25 30 35 40 45 | |
[6,] 6 12 18 24 30 36 42 48 54 | |
[7,] 7 14 21 28 35 42 49 56 63 | |
[8,] 8 16 24 32 40 48 56 64 72 |
OlderNewer