-
名前(任意)
- 松山朋洋
-
Twitter or Facebookのアカウント or HN等
-
@m2ym
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
$ ocamlopt unix.cmxa rtq.ml -o rtq | |
$ OCAMLRUNPARAM=h=500M,s=500M,v=255 ./rtq |
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 BinHeap ( | |
Heap, | |
empty, | |
insert, | |
findMin, | |
deleteMin, | |
fromList, | |
toList | |
) where |
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
(ql:quickload '(:clack :optima :optima.ppcre)) | |
(defpackage :demo | |
(:use :cl :optima :optima.extra :optima.ppcre)) | |
(in-package :demo) | |
(defun app (env) | |
(match env | |
((plist :request-method :get | |
:request-uri (or "/" (ppcre "^/(.+)$" name))) |
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
(in-package :cl-user) | |
(defstruct (hierarchical-package (:include sb-package:standard-package))) | |
(defmethod sb-package:find-package (package-designator (package hierarchical-package)) | |
(flet ((find-package-from-string (string) | |
(when (and (> (length string) 0) | |
(char= (elt string 0) #\.)) | |
(setq string (concatenate 'string (package-name package) string))) | |
(call-next-method string package))) |
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
;; BUG1: Unnecessary readin tokens | |
(in-package :cl-user) | |
(yacc:define-parser *parser* | |
(:start-symbol start) | |
(:terminals ()) | |
(start)) | |
(yacc:parse-with-lexer (lambda () (error "BUG")) *parser*) |
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
(in-package :cl-user) | |
(defun dot-product (lst1 lst2 &optional (acc 0)) | |
"Computes the dot product of two sequences, represented as lists." | |
(if (not lst1) | |
acc | |
(let ((x (first lst1)) | |
(y (first lst2)) | |
(lst11 (rest lst1)) | |
(lst22 (rest lst2))) |
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
#!/usr/bin/env ruby | |
ARGV.shift.to_i.times { ARGF.gets } | |
print ARGF.read |
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 | |
bluetooth-device-is-connected() { | |
system_profiler SPBluetoothDataType \ | |
| grep $1 -A 10 \ | |
| awk '/Connected/ { print $2 }' \ | |
| head \ | |
| grep -q Yes | |
} |
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
(defun pp-macroexpand () | |
(interactive) | |
(save-excursion | |
(pp-macroexpand-expression (read (current-buffer))))) | |
(dolist (map (list lisp-interaction-mode-map emacs-lisp-mode-map)) | |
(define-key map (kbd "C-c RET") 'pp-macroexpand)) | |
(when (featurep 'popwin) | |
(push '("*Pp Macroexpand Output*" :noselect t) popwin:special-display-config)) |