Sharing my proof of concepts that I made for learning some techniques that can be used in my bigger projects. This is kind of GitHub GISTs but grouped in a single repository (sandbox means "bac Ă sable" in French).
Mainly C++ code but also Julia, Forth, Prolog, Scilab, GTK+ and C code, some related to C++.
Quick bash scripts for automation:
- backup-github.sh: Script for backing up my GitHub projects to a specified directory.
Automation examples using Ansible:
- Hello World: Basic Ansible playbook demonstrating directory creation, file copying, and script execution.
Interactive Programming in C: edit your C code at runtime, see your changes in your application without restarting it. This allows mimicking the C language as an interpreted language.
Proof of concept implementing an ultra-basic Forth interpreter wrapping C++ APIs. Two examples are provided:
- CppPhysicsEngine: Wrapping a thin C++ abstraction library integrating the physics engine Bullet and the 3D library OpenSceneGraph.
- CppSymbolicEngine: Wrapping a C++ symbolic library (Ginac) for symbolic mathematics.
Implementation of various design patterns: Visitor, Observer, MVP, Component, Command, etc.
Iterate over a collection of class instances with different APIs and call the correct methods. Ideal for game scene graphs.
Composition is better than inheritance. Similar to the Strategy pattern, but Component is used for completing the state of the instance instead of adding dynamic behavior.
Safe observer pattern managing the case where the Observer can be destroyed before the Observable. Includes examples using libsigc++.
Note: Personally I would use libsigc++ instead of implementing my own Observer/Listener class. This lib allows you to add signals/slots (similarly to Qt). I give an example of this lib.
Learning how to implement the Model-View-Controller (MVC) and Model-View-Presenter (MVP) design patterns in C++, first with console applications then with GTK+. Minimalist examples are provided.
Having fun mocking C functions such as open(), read() to unit test C functions calling them. We exploit the behavior of weak symbols by creating mock functions and defining C++ mock classes to use them easily with Google Test/Mock. See the README in this folder for more details.
Basic symbolic manipulation in C++ using libraries like GINaC and SymEngine for computer algebra operations.
Based on the YouTube video "Better Code: Runtime Polymorphism" by Sean Parent. https://sean-parent.stlab.cc/papers-and-presentations/#better-code-runtime-polymorphism
Examples demonstrating type-erased polymorphism using std::function and smart pointers.
Testing a basic wrapper for notifications through condition variables in multi-threaded applications.
Testing union structures for a Forth project https://github.com/Lecrapouille/SimForth. Instead of manipulating two separate stacks (integer and float), use a single one and make operators change the type similar to OCaml operators + and +., int_of_float.
Mimicking C# properties in C++ using getter/setter patterns.
Prototype data structures such as graphs and scene graphs for game development.
C++ policy templates for iterating over folders and extracting desired files using template metaprogramming.
Learning how to program in Godot, Unity, and SFML:
- Godot: Orbital camera controller implementation, ported from Unity.
- Unity: Transform experiments with local vs world position/rotation.
- SFML: Road junction algorithms for SimCity-like games, including segment intersection and border detection.
Some *.lang files for my personal projects inspired by https://artisan.karma-lab.net/faire-todo-lists-gedit
- logs: For highlighting log files generated by my personal projects (SimTaDyn, etc.)
- forth: (TODO) For highlighting my SimForth scripts (a personal Forth slightly modified)
Bash scripts to launch GTK+2 applications with GTK-server https://www.gtk-server.org/. Initial step before porting to Forth applications. Examples include drawing areas and image display using FIFO and TCP communication.
Model-View-Presenter (MVP) implementation in GTKmm (C++ wrapper for GTK+). See the Cpp/DesignPatterns/MVC-MVP folder for more details.
Examples showing how to call C functions from Julia, including structure passing and array manipulation.
Integration examples for calling C++ code from Julia.
Max-Plus algebra implementation in Julia. See the MaxPlus section for more details.
Learning how to create standalone Julia applications that can be distributed as executables.
Defining Max-Plus classes in C++ and Julia for Max-Plus algebra operations. More information about this algebra: https://en.wikipedia.org/wiki/Max-plus_algebra My port to Julia of the Max-Plus Scilab toolbox: https://github.com/Lecrapouille/MaxPlus.jl
Template Makefile helper with common build targets and utilities for C/C++ projects.
Testing various OpenCV functionalities:
- BasicFunctions: Basic OpenCV operations and image processing
- CameraSettings: Camera intrinsic and extrinsic calibration
- CarCounting: Vehicle counting using background subtraction
- Franchissement: Highway lane detection and crossing detection
- OrientedROI: Region of Interest extraction from oriented rectangles
- ParkingLots: Parking lot detection algorithms
Learning Prolog programming and how to call Prolog from C++ code. Implementing basic Prolog routines based on graph theory that could be used in my personal project SimTaDyn instead of heavy C++ classes and code. Includes examples for path finding, cycle detection, and reachability analysis.
Control theory and automation examples:
Some "as-is" very old and unmaintained C code for ScicosLab: joystick, camera, UART. http://www.scicoslab.org/
A student project for generating 3D plants made many years ago using NSP or ScicosLab. Note: ScicosLab is a fork of Scilab (the equivalent of Matlab) and NSP has been replaced. This is not a serious application. If you are interested in simulation of plant growth, read:
- (fr) http://www.linneenne-lyon.org/depot1/14367.pdf
- (en) https://hal.inria.fr/file/index/docid/71706/filename/RR-4877.pdf
Quick demo made while studying state-of-the-art algorithms for automatic parallel parking based on research papers.
Filtering algorithms:
- Kalman1D: One-dimensional Kalman filter implementation
- PolyFit: Bufferless polynomial fitting using systolic arrays
Optimal control theory examples and implementations, including theoretical foundations and numerical methods.
Testing libraries for handling physical units in C++:
Applied to car kinematic models using tricycle kinematic equations.
FastAPI web framework examples for building REST APIs:
- 01_helloworld: Basic FastAPI hello world example
- 02_simple_pokemons: Simple Pokemon database without persistence
- 03_sql_pokemons: Pokemon database with SQLAlchemy and SQLite
- 04_sql_html_pokemons: Full web interface with HTML templates for Pokemon management
Examples of thread pool executors for concurrent task execution.
Python implementation of a Forth interpreter core.
Qt6 application examples:
- Dock: Dock widget examples and layouts
- GraphViewer: Proof of concept for a graph visualization tool in Qt6
- PetriEditor: Proof of concept for a Petri Net viewer/editor in Qt6
- MVVM: Model-View-ViewModel pattern implementation
Robot Framework test automation examples for web interaction testing, including Google search automation.
Examples and setup for creating presentations using reveal.js, including PDF export configuration.