Toy Box

Repositories and code snippets
repository
codesnippet
公開

1970年1月1日

更新日

2025年7月25日

1 Repositories

In this section, repositories are summarized by programming languages.

1.1 C++

1.1.1 Libraries

https://github.com/Hasenpfote/dualcomplex/

“dualcomplex” is a cross-platform C++ template library that provides operations for dual complex numbers. It can be used as a header-only library and supports C++11 or later.

https://github.com/Hasenpfote/dualquat/

“dualquat” is a cross-platform C++ template library that provides operations on dual quaternions using Eigen. It can be used as a header-only library and supports C++11 and later.

https://github.com/Hasenpfote/plucker/

“plucker” is a cross-platform C++ template library that provides operations on Plücker coordinates of lines. It can be used as a header-only library and supports C++11 and later.

1.1.2 Examples

https://github.com/Hasenpfote/CMakeExamples/

This is a collection of examples that use CMake for each case of a C++ project.

https://github.com/Hasenpfote/CPPExamples/

This is a collection of examples that use C++11.

  • BitonicSort

  • ComparingFloatingPointNumbers

  • ConvertString

  • ExpressionTemplate

  • HalfPrecisionFloatingPoint

  • LUDecomposition

  • Logger

  • PimplIdiom

  • ParseFntFile

  • Range

  • ServiceLocator

  • Singleton

  • SpecificInterface

  • ThreadPool

  • Other

https://github.com/Hasenpfote/cpp_examples/

This is a collection of examples that use C++14 or C++17.

  • circular_buffer

Circular buffer implemented using only the standard library.

  • stack_resource

A stack memory allocator using only the standard library.

  • pubsub_event

This is a Publish-Subscribe messaging model implemented using only the standard library.

  • dual

Header-only class template for dual numbers using only the standard library.

https://github.com/Hasenpfote/mark-and-sweep-gc/

This is an example of a simple mark-and-sweep garbage collection using C++.

https://github.com/Hasenpfote/OpenGLExamples/

This is a collection of examples of real-time rendering techniques using OpenGL.

It supports C++11 or later and OpenGL 4.x.

  • AdaptiveTerrainTessellation

  • BillboardBeam

  • Bloom

  • Dithering

  • KawaseBlur

  • LightStreak

  • RadialBlur

  • ToneMapping

  • Other

1.2 Java

1.2.1 Examples

https://github.com/Hasenpfote/RecursiveDimensionalClustering/

This is an example of Recursive Dimensional Clustering, one of the fast algorithms for finding collisions or clusters in a dataset.

1.3 Python

1.3.1 Modules

https://github.com/Hasenpfote/fpq/

This package provides modules for manipulating floating point numbers quantization using NumPy.

https://github.com/Hasenpfote/image_packer/

Pack multiple images of different sizes or formats into one image.

https://github.com/Hasenpfote/malloc_tracer/

This is a debugging tool for tracing malloc that occurs inside a function or class.

https://github.com/Hasenpfote/perfbench/

perfbench measures execution time of code snippets with Timeit and uses Plotly to visualize the results.

1.3.2 Examples

https://github.com/Hasenpfote/python-poetry-example/

A simple example of how to use pyenv + poetry + tox + pytest.

https://github.com/Hasenpfote/quaternion/

This package provides a class for manipulating quaternion objects.

2 Code snippets

This section summarizes code snippets by themes/topics.

2.1 Mathematics

Topic Links Language / Libraries
Complex number Representation and interpolation of rotations C++
Geometry Delaunay triangulation Python
Normal vectors to a 2D curve Open In Colab Python
- matplotlib
- numpy
- sympy
Normal vectors to a surface Open In Colab Python
- matplotlib
- numpy
- sympy
Analysis Taylor series Open In Colab Python
- matplotlib
- numpy
- sympy
Vector calculus Laplacian (utils) Open In Colab Python
- matplotlib
- numpy
Frenet–Serret formulas in 2D Open In Colab Python
- matplotlib
- numpy
- sympy
Frenet–Serret formulas Open In Colab Python
- matplotlib
- numpy
- sympy
Set theory Pairing function Open In Colab Python
- matplotlib
- numpy
Probability theory Inverse transform sampling Open In Colab Python
- matplotlib
- numpy
Monte Carlo Integration Open In Colab Python
- matplotlib
- numpy
- scipy

2.2 Physics

Topic Links Language / Libraries
Rigid body dynamics Translational and rotational motions Open In Colab Python
- numpy
Translational and rotational motions (using quaternion) Open In Colab Python
- numpy

2.3 Computer science

Topic Links Language / Libraries
Floating point number Floating-point comparison C++
Color CIE1931_color_space
CIE_daylight_components, BabelColor_spectral_data
Python
- matplotlib
- numpy
- pandas
- scipy
Noise Perlin noise - 1D/2D/3D/4D Open In Colab Python
- matplotlib
- numpy
Sort Bitonic sort C++
Russian Roulette Thoughts on Russian Roulette Open In Colab Python
- altair
- numpy
- pandas
k-d tree Thoughts on k-d tree Open In Colab Python
- matplotlib
- numpy
- anytree

2.4 Python

Topic Links
Python How to limit concurrency with asyncio Open In Colab
How to hook properties with Python3 dataclasses Open In Colab
matplotlib Customized colormap Open In Colab
Discrete colormap Open In Colab
pytorch Differential Open In Colab
Confusion matrix Open In Colab
トップに戻る