$ echo 20180311" "{01..23}":00:00 JST" | xargs -n3 | TZ=America/New_York gdate -f-
Sat Mar 10 11:00:00 EST 2018
Sat Mar 10 12:00:00 EST 2018
Sat Mar 10 13:00:00 EST 2018
Sat Mar 10 14:00:00 EST 2018
Sat Mar 10 15:00:00 EST 2018
Sat Mar 10 16:00:00 EST 2018
Sat Mar 10 17:00:00 EST 2018
Sat Mar 10 18:00:00 EST 2018
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
## From: https://en.wikipedia.org/wiki/Dc_(computer_program) | |
## prime number | |
2p # A = 2; print A | |
3p # A = 3; print A | |
## スタックの先頭にある数とsqrt(処理中の数)を計算 | |
[ # func f-# (int n) int { | |
d # A = n(試す数) | |
l! # B = ! -- nと試し割りの割る数を用意 |
$ dc -e'0[1+ddn10P10>r]srlrx'
1
2
3
4
5
6
7
8
- Link(English) : http://www.jasq.org/just-another-scala-quant/inverse-fizzbuzz
- Link(Japanese): http://d.hatena.ne.jp/matarillo/20120515/p1
inverse-fizzbuzz.egi
(define $main
1#(do {
(answer "fizz") ; => {[3 3]}
(answer "buzz") ; => {[5 5]}
(answer "fizz" "fizz" "buzz") ; => {[6 10]}
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
(define $collection2array | |
1#(generate-array (nth $ %1) [1 (length %1)])) | |
; > (collection2array {a b c}) | |
; (|a b c|) |
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
愛 11100110 10000100 10011011 | |
$ seq 1 1023 | dec2bin | sed 's/^/0000000000/' | grep -oE '.{12}$' | awk -vFS= -vOFS= '{print 111,$1,$2,11,$3,1,$4,$5,$6,$7,1,$8,$9,1,$10,$11,11,$12,11}' | perl -nle 'print pack ("B*", $_);' | grep 生 | |
生 | |
$ seq 1 1023 | dec2bin | sed 's/^/0000000000/' | grep -oE '.{12}$' | awk -vFS= -vOFS= '{print 111,$1,$2,11,$3,1,$4,$5,$6,$7,1,$8,$9,1,$10,$11,11,$12,11}' | perl -nle 'print pack ("B*", $_);' | grep 死 | |
死 |
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
# Extract size from information header. 14 is the octet length of file header. | |
od -tx1 -An flower.bmp \ | |
| tr -dc 'a-z0-9' \ | |
| fold -w 2 \ | |
| sed -n '14,15p' \ | |
| tr -d '\n' \ | |
| sed 's/./\U&/g;s/^/obase=10;ibase=16;/' \ | |
| awk 1 \ | |
| bc \ | |
| awk '{print $1+14}' |
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
#!/bin/bash | |
# From: https://twitter.com/grethlen/status/906154326975905793 | |
sudo ping -i 0 -c 1400 pong4.kooshin.net \ | |
| grep -oP "icmp_seq=\K\d+" \ | |
| cat - <(seq 1 1400) \ | |
| sort -n \ | |
| uniq -c \ | |
| awk '{printf $1}' \ | |
| fold -w70 \ |
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
$ convert -background white -fill black -font ~/Library/Fonts/GenEiGothicP-Bold.otf -pointsize 48 label:和歌山 pbm:- | pbmtoascii | |
oo | |
ooooMMMo o oooo o oooo ooo oo o MMMMMM MoMMoo | |
o ooooMoMMMMMMMMMMo MMMMMMMMMMMMMMMMMMMMMMMM MMMMM" MMMMMM | |
MMMMMMMMMMMMMMMMM""" MMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMM oMMMMM MMMMMM | |
"MMMMMMMMMMMM" "MMMMMMMMMMMMMMMMMMM MMMMM MMMMMM o MMMMMM | |
" MMMMMM MMMMMMMM"M""MMMMMMM MMMMMMMMMMM" MMMMM oMMMMMMMMMMMMMMMMMMM MMMMMM |