Skip to content

Instantly share code, notes, and snippets.

@CookieBox26
CookieBox26 / slide.tex
Created January 17, 2025 03:31
xelatex slide.tex
\documentclass[unicode,11pt]{beamer}
\usepackage{zxjatype}
\usetheme{metropolis}
% 数式フォント用
\usepackage[mathrm=sym]{unicode-math}
\usepackage{amsmath}
\usefonttheme{serif}
\setmainfont[BoldFont={Verdana}, ItalicFont={Verdana}]{Verdana}
@CookieBox26
CookieBox26 / dijkstra.py
Created November 4, 2024 01:37
【Python】ダイクストラ法 + 可視化スクリプト
import queue
def load_question(filename='data.txt'):
"""
以下の形式のテキストファイルを想定し問題を読み込みます
6 10 # ノード数, エッジ数
0 1 10 # 始点, 終点, 通過コスト (以下, エッジ数だけ繰り返し)
0 2 5
@CookieBox26
CookieBox26 / logic_puzzle.py
Created August 6, 2024 03:36
ロジックパズルを解くための便利クラスです。
import itertools
import copy
import math # 理論パターン数計算用
import random # 列のランダムシャッフル用
class LogicPuzzle:
"""
ロジックパズルを解くための便利クラスです。
"""
@CookieBox26
CookieBox26 / slack_json_to_html.py
Created July 15, 2024 02:32
Slack からエクスポートした JSON データを HTML 形式に変換します。
import argparse
import glob
import json
import os
import datetime
"""
Slack からエクスポートした JSON データを HTML 形式に変換します。
以下のように実行してください。
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CookieBox26
CookieBox26 / Untitled.ipynb
Created May 5, 2024 12:36
PDF の要素の取得と表示 (1セル版)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CookieBox26
CookieBox26 / Untitled.ipynb
Last active May 5, 2024 09:33
PDF の要素の取得と表示
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CookieBox26
CookieBox26 / 20240428.ipynb
Last active April 29, 2024 01:18
カスタムバッチサンプラー
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CookieBox26
CookieBox26 / run.py
Created June 30, 2023 14:49
動画を作成する (20230630)
import toml
from synthesis import synthesis
import hashlib
from pydub import AudioSegment
from PIL import Image, ImageFont, ImageDraw
from moviepy.editor import ImageClip, concatenate_videoclips
import math
import os