Skip to content

Instantly share code, notes, and snippets.

View laserbat's full-sized avatar

Olga Ustiuzhanina laserbat

View GitHub Profile
@HaraldKorneliussen
HaraldKorneliussen / bwts.py
Last active January 26, 2025 05:00
A naive python implementation of David A. Scott's bijective Burrows-Wheeler transform + inverse
#!/usr/bin/python
# Factor a string into nonincreasing Lyndon words,
# using Duval's algorithm
def lyndonFactor(s):
k = 0
ret = []
while k < len(s):
i = k
j = i + 1
@loveencounterflow
loveencounterflow / Weird Chinese Characters
Last active December 9, 2023 09:18
Little excerpt from my CJK character collections
weird:
...-emoticon:
...-emoticon-frowning-face: 囧
...-emoticon-frowning-king: 崮
...-emoticon-frowning-queen: 莔
...-emoticon-frowning-withhat: 商
...-emoticon-frowning-turtle: 囧興
...-emoticon-bomberman: 卣
...-emoticon-verydull: 槑
...-arbitrary: 𠖬𠄓𠔇𦫺𦫷𦫻𠄑𠦑𠅂𢀗𠃟𨱘𠇬𥎨𠛷𠃡𡭡𡉵𠮸𠅑
import random
def gcd(a, b):
a = abs(a)
b = abs(b)
while a:
a, b = b % a, a
return b