Skip to content

Instantly share code, notes, and snippets.

View t-sin's full-sized avatar
🆑

Shinichi Tanaka t-sin

🆑
View GitHub Profile
@t-sin
t-sin / available-encoding-ABCL.txt
Last active August 29, 2015 14:14
Available encodings on Armed Bear Common Lisp
CL-USER> *features*
(:SWANK :X86-64 :UNIX :LINUX :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :CDR6 :MOP :PACKAGE-LOCAL-NICKNAMES)
CL-USER> (system:available-encodings)
(:|Big5| :|Big5-HKSCS| :CESU-8 :EUC-JP :EUC-KR :GB18030 :GB2312 :GBK :|IBM-Thai| :IBM00858 :IBM01140 :IBM01141 :IBM01142 :IBM01143 :IBM01144 :IBM01145 :IBM01146 :IBM01147 :IBM01148 :IBM01149 :IBM037 :IBM1026 :IBM1047 :IBM273 :IBM277 :IBM278 :IBM280 :IBM284 :IBM285 :IBM290 :IBM297 :IBM420 :IBM424 :IBM437 :IBM500 :IBM775 :IBM850 :IBM852 :IBM855 :IBM857 :IBM860 :IBM861 :IBM862 :IBM863 :IBM864 :IBM865 :IBM866 :IBM868 :IBM869 :IBM870 :IBM871 :IBM918 :ISO-2022-CN :ISO-2022-JP :ISO-2022-JP-2 :ISO-2022-KR :ISO-8859-1 :ISO-8859-13 :ISO-8859-15 :ISO-8859-2 :ISO-8859-3 :ISO-8859-4 :ISO-8859-5 :ISO-8859-6 :ISO-8859-7 :ISO-8859-8 :ISO-8859-9 :JIS_X0201 :JIS_X0212-1990 :KOI8-R :KOI8-U :|Shift_JIS| :TIS-620 :US-ASCII :UTF-16 :UTF-16BE :UTF-16LE :UTF-32 :UTF-32BE :UTF-32LE :UTF-8 :|windows-1250| :|windows-1251| :|windows-1252| :|windows-1253| :|windows-1254| :|win
@t-sin
t-sin / get-runtime-pathname.md
Last active August 29, 2015 14:15
How to get a pathname of executable at run-time

How to get a pathname of executable at run-time in Common Lisp

It's NOT a load-time and compile-file-time pathname. It's equal to dirname $0 in shell scripting.

SBCL

(make-pathname :name nil :type nil
               :defaults sb-ext:*runtime-pathname*)

CCL

@t-sin
t-sin / quil-firsttime.clj
Created July 27, 2015 16:12
Playing with Quil!
(ns quil-test.core
(:require [quil.core :as q]
[quil.middleware :as m]))
(def width 640)
(def height 480)
(def circle-num 10)
(defn rand-point [w h]
[(rand-int w) (rand-int h)])
@t-sin
t-sin / inq.ros
Created August 23, 2015 15:21
Roswell script test. It's an error at L11: inquisitor (installed asdf path) not found.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(defun main (&rest argv)
(declare (ignorable argv))
(let ((scheme (first argv))
(path (second argv)))
(unless (or (null scheme) (null path))
@t-sin
t-sin / ins.ros.log
Created August 26, 2015 16:27
`ros inq.ros -v` log
opt_verbose:verbose 1
proccmd:inq.ros
frontend:script_*:argc=1 argv[0]=inq.ros
ros_script_cmd=exec ros -Q -- $0 "$@"
proccmd:-Q
opt_quicklisp:quicklisp
proccmd:--
script_:argc=2 argv[0]=--
current=(null)
system_ result:/usr/local/bin/ros
@t-sin
t-sin / asdf-source-registry
Created August 26, 2015 16:32
ASDF source-registry.conf
sin_clav@dingo:~$ cat .config/common-lisp/source-registry.conf
;; put this file to ~/.config/common-lisp as source-registry.conf
(:source-registry
(:tree (:home ".cim/quicklisp/dists"))
(:tree (:home "opt/cl-systems"))
(:tree (:home "opt/cl-devs"))
:inherit-configuration)
sin_clav@dingo:~$ ll opt/cl-systems/
合計 8
@t-sin
t-sin / powapowa.clj
Created August 27, 2015 16:35
powapowa...
(ns powapowa.core
(:require [quil.core :as q]
[quil.middleware :as m]))
(def +width+ 640)
(def +height+ 480)
(def +point-num+ 10)
(defn rand-point [w h]
t-sin@jaguar:~/.roswell/local-projects$ rm system-index.txt
t-sin@jaguar:~/.roswell/local-projects$ ros -v install hoge
opt:verbose:1
proccmd:install
which cmd:command -v "ros"
which result:/home/t-sin/.roswell/bin/ros
hoge is not implemented internal. /home/t-sin/.roswell/etc/roswell/install.ros argc:2
install:hoge:
argc_=4argv[0]=--,argv[1]=/home/t-sin/.roswell/etc/roswell/install.ros,argv[2]=install,argv[3]=hoge,proccmd:--
@t-sin
t-sin / zundoko.lisp
Created May 28, 2016 14:15
ズン・ズンズンズンドコ \キ・ヨ・シ/
(defun zundoko ()
(let ((zundoko '(ズン ドコ))
(zundoko-state 0))
(labels ((randoko ()
(nth (random 2) zundoko))
(zundoko-reset () (setf zundoko-state 0))
(zundoko-next () (incf zundoko-state))
(zundoko-check (s zd true-ret true-fn)
(if (eq (find s zundoko) zd)
(prog1 true-ret (funcall true-fn))
main :: IO ()
main = mapM_ putStrLn [take l $ drop n $ cycle s | n <- [0..l]]
where s = "響け!ユーフォニアム"
l = length s