Skip to content

Instantly share code, notes, and snippets.

View elderica's full-sized avatar
🚞
I'm enjoing with trains and computers.

elderica

🚞
I'm enjoing with trains and computers.
View GitHub Profile
@elderica
elderica / plotting.lisp
Created June 4, 2023 07:56
reimplement plotting.py
;;;; This is reimplementation of `plotting.py` from "Coding the Matrix"
;;;; and contains a simple plotting interface, which uses a browser with SVG to
;;;; present a plot of points represented as either complex numbers or 2-vectors.
;;;;
;;;; First you need evaluate following expressions then load this file.
;;;; ```
;;;; (require "asdf")
;;;; (asdf:load-system "uiop")
;;;; ```
(in-package :cl-user)
#!/bin/bash
set -eux
player_hand=$(
zenity --list \
--title "あなたの手は?" \
--column="手" \
"グー" \
"チョキ" \
"パー"
# morimorihoge screenrc
escape \233\233
zombie
hardstatus on
defbce on
# Protection from attacks
multiuser off
@elderica
elderica / Makefile
Created February 14, 2023 09:48
compile each .cpp file
TARGETS := $(subst .cpp,,$(wildcard *.cpp))
CXXFLAGS ?= -Wall -Wextra -O2 -g
all: $(TARGETS)
clean:
rm -f $(TARGETS)
.PHONY: clean
@elderica
elderica / Tokyo Night Night.theme
Created January 18, 2023 11:15
TokyoNight Night for fish-shell
# name: 'Tokyo Night Night'
# preferred_background: 1a1b26
# url: 'https://github.com/chriskempson/tomorrow-theme'
fish_color_normal c0caf5
fish_color_command 7dcfff
fish_color_keyword bb9af7
fish_color_quote e0af68
fish_color_redirection c0caf5
fish_color_end ff9e64
struct XOR64 {
x: u64,
}
impl XOR64 {
fn new(seed: u64) -> Self {
Self {
x: seed ^ 88172645463325252,
}
}
#lang racket
(struct plan
(type
data-amount
price)
#:transparent)
(define plans-voice
(vector
@elderica
elderica / iijmio.py
Created January 8, 2023 13:32
IIJmio Mobile Planner
from collections import namedtuple
from itertools import product
from functools import reduce
from pprint import PrettyPrinter
Plan = namedtuple('Plan', ['type', 'data_amount', 'price'])
plans_voice = [
Plan(type='voice', data_amount=2, price=850),
Plan(type='voice', data_amount=4, price=990),
@elderica
elderica / 1_9.png
Last active October 10, 2022 08:27
1_9.png
@elderica
elderica / sderror.txt
Created August 28, 2022 06:37
Stable Diffusion MIOpen error
0it [00:00, ?it/s]MIOpen(HIP): Error [Do] 'amd_comgr_do_action(kind, handle, in.GetHandle(), out.GetHandle())' AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC: ERROR (1)
MIOpen(HIP): Error [BuildHip] comgr status = ERROR (1)
MIOpen(HIP): Warning [BuildHip] In file included from /tmp/comgr-5f7d18/input/naive_conv.cpp:1:
In file included from /tmp/hip_pch.1266/hip_pch.h:1:
In file included from /build/hip-runtime-amd/src/HIP-rocm-5.2.3/include/hip/hip_runtime.h:54:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/thread:44:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/bits/this_thread_sleep.h:36:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/bits/chrono.h:650:36: error: no matching conversion for functional-style cast from 'const duration<long, std::ratio<1, 1>>' to '__cd' (aka 'duration<long, ratio<num, den>>')
return __cd(__cd(__lhs).count() - __cd(__rhs).count());