Skip to content

Instantly share code, notes, and snippets.

@kagaya
kagaya / NBC.tex
Last active December 17, 2025 06:01
neural bundle calibration
% License: CC BY 4.0
% English title (for reference):
% Neural Bundle Calibration: Multi-Response Generalized Synchronization and Ensemble Echo-State Property
% https://gist.github.com/kagaya/71a83465c4ea17aee147dc36fd07ae02
% https://www.overleaf.com/project/692aba100c4b289dbb3279c2
\documentclass[a4paper,11pt,uplatex]{jsarticle}
\usepackage[top=30truemm,bottom=30truemm,left=25truemm,right=25truemm]{geometry}
\usepackage{amsmath,amssymb,amsfonts}
@kagaya
kagaya / BTW_sandpile.html
Last active January 29, 2026 06:42
BTW sandpile
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Sandpile Simulation</title>
<style>
body { margin: 0; overflow: hidden; background-color: #111; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
#canvas-container { width: 100vw; height: 100vh; display: block; }
#!/usr/bin/env bash
# make_public_hashlist.sh
# 使い方: ./make_public_hashlist.sh <target_folder>
# 指定フォルダ配下の全ファイルの SHA-256 を 1行1ハッシュで
# <YYYYMMDD>_<HHMM>_public.txt に出力します(実行ディレクトリに作成)。
set -euo pipefail
IFS=$'\n\t'
die() { echo "ERROR: $*" >&2; exit 1; }
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# sign_and_stamp.sh (revised)
# Usage:
# sign_and_stamp.sh --uid <FPR_or_UID_or_email> [--pubout <publickey.asc>] [--readme <README filename>] [--force] <file>
#
# Example:
# ./sign_and_stamp.sh --uid "71FC79C05FE638F8BA89CDA6A4AF19F74BA75836" ./document.docx
@kagaya
kagaya / doi2bibtex.py
Created December 4, 2024 11:10
doi to bibtex
#!/usr/bin/env python3
import sys
import requests
def get_bibtex(doi):
url = f"https://doi.org/{doi}"
headers = {"Accept": "application/x-bibtex"}
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
管理者権限で
/usr/share/ibus/component/skk.xml
を開き、
<layout>ja</layout>
<layout>us</layout>
に変更し、保存する。
念のために再起動しておく。

https://www.yomiuri.co.jp/culture/book/column/20230411-OYT8T50001/ に書かれた、太刀川氏による文章をもとにChatGPTと会話した記録

次の文章に誤りもしくは不自然な点があれば指摘してください:  まず気候変動の緩和とは、二酸化炭素などの温室効果ガスを削減して気候変動を和らげる戦略だ。これは具体的でわかりやすい。一方で気候変動への適応は、起こった気候の変化に社会を合わせる戦略だ。うむ…わかる気もするが、一体どうすれば適応できるのか。生活の全てが適応の手段なので、指標も測りづらい。適応策はこの複雑さ故に、緩和策ほどには進んでいない。

ChatGPT

文章に誤りや不自然な点は見受けられませんが、一部表現をより明確にする提案があります。

現在の文章:

@kagaya
kagaya / read_raw_pkl.R
Last active December 10, 2022 10:42
read raw.pkl file from soft_skeleton_solver (https://github.com/katsuma-inoue/soft_skeleton_solver)
library(tidyverse)
library(reticulate)
read_raw_pkl <- function(file_path="/path/to/raw.pkl"){
# https://gist.github.com/kagaya/32706c38404c99431669ba34b8bccbac
j <- import("joblib") # python package joblib is loaded via {reticulate}
arm_xy <- j$load(file_path)
tibble(t=1:length(arm_xy$path), path=arm_xy$path) %>%
group_by(t) %>%
@kagaya
kagaya / random_variable_with_Tidyeval.ipynb
Last active September 26, 2019 16:51
Tidyevalで関数としての確率変数を表現してみる
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
functions {
vector my_student_t_rng(int N, real nu, real mu, real sigma){
vector[N] Y;
for (n in 1:N){
Y[n] = student_t_rng(nu, mu, sigma);
}
return(Y);
}
vector my_ZIP_rng(int N, real q, real lambda){