Skip to content

Instantly share code, notes, and snippets.

View TravelTibet's full-sized avatar
😉
Hello world!

XiName TravelTibet

😉
Hello world!
View GitHub Profile
@TravelTibet
TravelTibet / pngToBmp.py
Last active May 23, 2026 02:30
PngToBmp
"""
批量将指定目录下的 PNG 文件转换为 BMP 格式
依赖: Pillow (pip install pillow)
直接双击运行即可打开图形界面;也支持命令行:
python png_to_bmp.py <目录路径> [--delete-source]
"""
import argparse
import sys
import threading
@TravelTibet
TravelTibet / SPSCQueue.h
Last active June 13, 2026 01:17
SPSCQueue
// -------------------------------------------------------
// SPSC 无锁环形队列(单生产者/单消费者)模型
// Capacity 必须是 2 的幂次
// -------------------------------------------------------
template<typename T, size_t Capacity>
class SPSCQueue
{
static_assert(Capacity >= 2 && (Capacity & (Capacity - 1)) == 0,
"SPSCQueue: Capacity must be a power of 2");
public: