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
(import cv2) | |
(import numpy :as np) | |
(import matplotlib [pyplot :as plt animation :as plt-anim]) | |
(setv fig (.figure plt)) | |
(setv idxs [] ims [] axs []) | |
(defn plot [f] | |
(print f) |
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
;; Example use of CL-SDL2 | |
;; Loads Sequentially named PNG image files in "(project-folder)/resources/images" and lay them out | |
(in-package #:mini-example) | |
(require :sdl2) | |
(defun collect-textures (renderer directory) | |
(loop for i from 10 downto 1 | |
collect |
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
The steel needle cuts through the hills sawing together the cool night. | |
The needle propells along the curve around the hill. | |
Sudden light the color of cream shines hard on the silver steel. | |
Rising moon with bright smokey ring hang low above montains. | |
The steel maintains momentum and sings in visible frequency. | |
The sky cassies the disk away in exchange for the light-emitting vertices. | |
2-sphere has a 3-sky. Does the 3-space have a 4-sky? |
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
(defpackage :replacer | |
(:use :cl :plump :clss)) | |
(in-package :replacer) | |
(defun slurp (path) | |
(with-open-file (stream path) | |
(let ((data (make-string (file-length stream)))) | |
(read-sequence data stream) | |
data))) |
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
;; Initialize Biwascheme interpreter on frontend(browser) then send and receive expressions with websocket client | |
;; INSTALL websocket.el, LOAD this file and RUN interactive function `load-ws` from Emacs | |
;; ws-close to close server | |
;; send expression (e.g functions) to browser with `C-c C-s` ... Tip# cursor should be on function name | |
(require 'websocket) | |
(require 'scheme) | |
(defun biwa-start () | |
(interactive) | |
;(load-file "~/.emacs.d/websocket.el") |
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
;;;;;;;;; Forth a la Let over Lambda ;;;;;;;; | |
(defvar forth-registers | |
'(pstack rstack pc dict compiling dtable)) | |
(defun sym (&rest strs) | |
(intern (string-upcase (apply #'strcat (mapcar #'string strs))))) | |
(defmacro defstruct (name &rest slots) | |
(let ((n -1)) |
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
;;[sketch] tools to write transpilers from sexpr to Blub languages. | |
;;For when you are in the direst situation. | |
;; copyleft Minori Yamashita | |
(defpackage :ult | |
(:use :cl)) | |
(in-package :ult) | |
(defpackage :ult-symspace) |
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
;;;;;;;;;;;;;;;;;;;;; | |
;;; generic utils ;;; | |
;;;;;;;;;;;;;;;;;;;;; | |
(print "loading generic utils") | |
;;convenient shorthand for lambda (^ (x) x) | |
(define-macro (^ params . expr) | |
`(lambda ,params ,@expr)) | |
;;normalize parameter list e.g. (x), xs, (x . xs) into (x), (xs), (x xs) |
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
Tech Memo on Minimaly viable work environment | |
============================================= | |
Essentials | |
---------- | |
+ w3m | |
+ fb-messenger-cli (use with M-x term then M-x mozc-mode) | |
+ emacs-mozc-bin -- japanese input |
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
;; every 60 seconds check if slime repl buffer has been updated | |
;; if not intterupt and call restart-1 | |
;; which should abort whatever is causing the hungup and continues | |
(defvar *slime-repl-last-output* "") | |
(defvar *slime-repl-watchdog-timer* nil) | |
(defun handle-sldb-restart () | |
(sldb-invoke-restart-1) ;; change here | |
(message "Invoked restart-1 upon detecting a hungup.")) |
NewerOlder