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 / test.lisp
Last active December 19, 2019 03:42
This shader renders white pixels but apears black window...
(defpackage #:test
(:use #:cl)
(:import-from #:cl-glfw3
#:with-init-window
#:def-key-callback
#:get-proc-address
#:set-key-callback
#:set-window-should-close
#:window-should-close-p
#:swap-buffers
import math
import portaudio as PA
type
Signal = tuple[left: float32, right: float32]
type
Unit = ref object of RootObj
prev: Unit
@t-sin
t-sin / hash_mutex.rs
Created June 18, 2019 18:36
How to implement HashMap-insertable Mutex
use std::cmp::{PartialEq, Eq};
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::sync::{Arc, Mutex};
#[derive(Debug, Hash)]
struct Hoge {
a: u32,
b: u32,
}
(ns genart-quil.core
(:require [quil.core :as q]
[quil.middleware :as m]))
(defn setup []
(q/frame-rate 30)
(q/color-mode :hsb)
;; x軸が0から500の間で、なにか変化する値のシーケンスを生成
(for [x (range 0 500)] (q/sin (* x 0.04))))
## profile data at running pukunui, after type this code https://plaster.tymoon.eu/view/1362#1362
CPU: Intel Ivy Bridge microarchitecture, speed 3900 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples % image name symbol name
13567 13.0780 pukunui-image CCL::BACKTRACE-CALL-ARGUMENTS
7020 6.7670 pukunui-image RANDOM
6240 6.0151 pukunui-image CCL::CLOSED-OVER-VALUE-P
6037 5.8194 pukunui-image CCL::%STRING-HASH-FOLDING-CASE
4229 4.0766 pukunui-image CCL::%SHOW-STACK-FRAME-LABEL
@t-sin
t-sin / ecacrypt.ros
Created December 23, 2018 16:00
Encription with ECA (WIP...)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
;;#+quicklisp(ql:quickload '() :silent t)
)
//// Otter Lisp
// string utils
strlen
("", n) = n,
(c:xs, n) = strlen(xs, n+1)
strLen s = strlen(s, 0)
strCat
[] = "",
@t-sin
t-sin / bullet-hell.lisp
Last active May 13, 2018 16:37
bullet hell test
(in-package #:cl-user)
(defpackage #:shooter
(:use #:cl)
(:export #:init
#:main))
(in-package #:shooter)
(defparameter *window-width* 800)
(defparameter *window-height* 600)
import inspect as ins
import sys
import io
from contextlib import redirect_stdout
import re
'''
inspect.getfullargspec()で引数情報を取得できないモジュールを出力