Skip to content

Instantly share code, notes, and snippets.

View turtleizzy's full-sized avatar
🐶

Izzy Turtle turtleizzy

🐶
View GitHub Profile
@turtleizzy
turtleizzy / performance_test.py
Created November 15, 2025 09:47
Performance comparison for marshalling large array blocks
import pickle
import _pickle as cPickle
import marshal
import numpy as np
import time
import io
# ---------------------------------------------------------------------------------
# from fastnumpyio
# https://github.com/divideconcept/fastnumpyio/blob/main/fastnumpyio.py
@turtleizzy
turtleizzy / itk_vs_simpleitk.md
Created November 2, 2025 10:16
ITK vs SimpleITK - Which should you use if you start a new project in Python?

ITK vs SimpleITK - Which should you use if you start a new project in Python?

Basic information

Both ITK (python package) and SimpleITK (python package) are bindings of ITK C++ library providing a number of verified utilities for medical image processing, especially 3D volumetric image processing.

ITK python package provides both C++ style bindings ( functions and classes in UpperCamelCase ) and pythonic bindings ( in snake_case ). C++ style bindings keeps the original pipeline structure and template programming style in ITK and the pythoic bindings provides somewhat procedural interface. For example, in C++ style bindings, you need to specify the datatype when instantiating filters, an example is as following. Refer to the tutorial for more information.

InputType = itk.Image[itk.F,3]
OutputType = itk.Image[itk.F,3]
@turtleizzy
turtleizzy / monitor_ec.py
Last active May 6, 2025 14:32 — forked from HorstBaerbel/monitor_ec.py
Monitor Embedded Controller (EC) on Linux via ACPI calls through acpi_call kernel module
#!/usr/bin/env python
"""Dump a range of Embedded Controller memory via ACPI. Requires "acpi_call" kernel module to be loaded. By HorstBaerbel (https://github.com/HorstBaerbel) in 2018."""
import re
import sys
import time
import argparse
output = '\033[0m'
@turtleizzy
turtleizzy / libstdc++_version.md
Last active February 20, 2023 06:49
Default GCC compiler, libstdc++ and maximum supported ABI version on Ubuntu

Based on docker images and launchpad package versions.

Ubuntu version Codename gcc libstdc++ ABI
14.04 trusty 4.8.3 6.0.19 GLIBCXX_3.4.19, CXXABI_1.3.7
16.04 xenial 5.3.1 6.0.21 GLIBCXX_3.4.21, CXXABI_1.3.9
18.04 bionic 7.3.0 6.0.25 GLIBCXX_3.4.25, CXXABI_1.3.11
20.04 focal 9.3.0 6.0.28 GLIBCXX_3.4.28, CXXABI_1.3.12
22.04 jammy 11.2.0 6.0.30 GLIBCXX_3.4.29, CXXABI_1.3.13
@turtleizzy
turtleizzy / backpack.py
Created December 1, 2020 13:12
0-1 backpack dp in python
import numpy as np
numbers = np.array([67000, 48720, 222600, 27560, 2500000, 2120, 53446, 53000, 53000, 53000, 45077, 7977, 100000, 6382, 30605, 64782, 33485, 3697, 71056, 2515])
targetSum = 301925
arr = [np.zeros([targetSum+1], dtype=np.int), np.zeros([targetSum+1], dtype=np.int)]
curArr = 1
for i in range(len(numbers)):
curArr = 1 - curArr
if (i==0):