Skip to content

Instantly share code, notes, and snippets.

View kmyk's full-sized avatar

Kimiyuki Onaka kmyk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kmyk on github.
  • I am kimiyuki (https://keybase.io/kimiyuki) on keybase.
  • I have a public key whose fingerprint is 6457 ABC6 BEB6 8A41 F767 2E43 867F 8AB9 B0F2 0842

To claim this, I am signing this object:

@kmyk
kmyk / fstar-compile.sh
Last active April 10, 2018 15:57
script to compile F* code to binary
#!/bin/bash
set -o noclobber # (-C) Don\'t overwrite existing files with ">".
set -o errexit # (-e) If not interactive, exit immediately if any untested command fails.
set -o nounset # (-u) Write a message to standard error when attempting to expand a variable that is not set, and if the shell is not interactive, exit immediately.
# parse options
usage() {
echo "Usage: [FSTAR_HOME=...] $0 [Module.fst ...] [Module.fst.hints ...] Main.fst"
}
OPT="$(getopt --options h\? --longoptions help -- "$@")"
setInterval(function() {
if (Object.keys(player).length === 0) {
console.log('register');
socket.emit('register', Math.random().toString());
} else if (player.level == 30) {
console.log('done');
console.log(getUuid());
player = undefined;
} else if (player.nextExp <= player.exp) {
console.log('levelup');
@kmyk
kmyk / a.cl
Last active August 29, 2015 14:13 — forked from fukamachi/a.cl
指摘を受け入出力を減らした
; $ sbcl --load a.cl --eval '(sb-ext:save-lisp-and-die "a.out" :toplevel #'\''main :executable t)' && time ( echo 100000000 | ./a.out )
; ( echo 100000000 | ./a.out; ) 4.30s user 0.15s system 99% cpu 4.468 total
; $ sbcl --version
; SBCL 1.2.6
(defun main ()
(declare (optimize (speed 3) (debug 0) (safety 0) (compilation-speed 0)))
(let* ((n (1+ (the fixnum (read))))
(is-prime (make-array n :element-type 'boolean :initial-element t)))
@kmyk
kmyk / a.cl
Last active August 29, 2015 14:13
私はループと配列操作を見たかったがcommon lispの入出力は遅かったため適切な比較ではなかった 指摘: https://twitter.com/nitro_idiot/status/557918405215285248 改善版: https://gist.github.com/solorab/63e63009dd070b0093e7
; $ sbcl --load a.cl --eval '(sb-ext:save-lisp-and-die "a.out" :toplevel #'\''main :executable t)' && time ( echo 100000000 | ./a.out > /dev/null )
; ( echo 100000000 | ./a.out > /dev/null; ) 10.75s user 0.15s system 99% cpu 10.931 total
; $ sbcl --version
; SBCL 1.2.6
(declaim (optimize (speed 3) (safety 0)))
(defun main ()
(declare (type fixnum n))
(declare (type (simple-array boolean (*)) is-prime))