Skip to content

Instantly share code, notes, and snippets.

View xkikeg's full-sized avatar

kikeg xkikeg

  • Zürich, Switzerland
  • 05:22 (UTC +01:00)
View GitHub Profile
@sile
sile / pfds-08-09-summary.md
Last active August 29, 2015 14:21
Purely Functional Data Structures: 第8章〜第9章

8 Lazy Rebuilding

8.1 Batched Rebuilding

  • データ構造を一度に再構築して、完全にバランスした状態にする
  • 再構築の頻度は、全体の(償却)計算量を増加させない範囲にする
  • e.g. 5.2のキュー、ハッシュテーブルのリサイズ
@xkikeg
xkikeg / zshhist.py
Last active January 8, 2025 08:40
Convert ZSH history file (.zsh_history file) between original weird encoding and proper UTF-8.
#!/usr/bin/env python3
"""
ZSH history convert script.
When you mistakenly type your password or quite bad command into ZSH,
you may want to remove the entry from the history.
The problem is, the .zsh_history is encoded in a weird format!
If you want to find a command with non-ASCII character, it'll be problematic.