Skip to content

Lecrapouille/BacASable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BacASable

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++.

Bash

Quick bash scripts for automation:

  • backup-github.sh: Script for backing up my GitHub projects to a specified directory.

Ansible

Automation examples using Ansible:

  • Hello World: Basic Ansible playbook demonstrating directory creation, file copying, and script execution.

C code

AutoLoadLib

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.

C++

Forth Wrapper

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.

Design Patterns

Implementation of various design patterns: Visitor, Observer, MVP, Component, Command, etc.

Visitor

Iterate over a collection of class instances with different APIs and call the correct methods. Ideal for game scene graphs.

Component

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.

Observer

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.

MVC-MVP

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.

Unit Tests

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.

Symbolic Manipulation

Basic symbolic manipulation in C++ using libraries like GINaC and SymEngine for computer algebra operations.

Runtime Polymorphism

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.

ConditionVariable

Testing a basic wrapper for notifications through condition variables in multi-threaded applications.

Union

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.

C# Properties

Mimicking C# properties in C++ using getter/setter patterns.

Containers

Prototype data structures such as graphs and scene graphs for game development.

Policies

C++ policy templates for iterating over folders and extracting desired files using template metaprogramming.

Game Engine

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.

Gedit

Syntax highlighting

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)

GTK+

GTK+2 with GTK-server

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.

Design Patterns

Model-View-Presenter (MVP) implementation in GTKmm (C++ wrapper for GTK+). See the Cpp/DesignPatterns/MVC-MVP folder for more details.

Julia

Call C/C++ code

Examples showing how to call C functions from Julia, including structure passing and array manipulation.

JuliaCpp

Integration examples for calling C++ code from Julia.

Max-Plus algebra

Max-Plus algebra implementation in Julia. See the MaxPlus section for more details.

Standalone

Learning how to create standalone Julia applications that can be distributed as executables.

Max-Plus

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

MyMakefile

Template Makefile helper with common build targets and utilities for C/C++ projects.

OpenCV in C++

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

Prolog

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.

Law Control

Control theory and automation examples:

ScicosLab / NSP (Scilab) blocks

Some "as-is" very old and unmaintained C code for ScicosLab: joystick, camera, UART. http://www.scicoslab.org/

Plant Growth

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:

Auto Parking

Quick demo made while studying state-of-the-art algorithms for automatic parallel parking based on research papers.

Filter

Filtering algorithms:

  • Kalman1D: One-dimensional Kalman filter implementation
  • PolyFit: Bufferless polynomial fitting using systolic arrays

OptimalCommand

Optimal control theory examples and implementations, including theoretical foundations and numerical methods.

SI (International System of Units)

Testing libraries for handling physical units in C++:

Applied to car kinematic models using tricycle kinematic equations.

Python

FastAPI

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

ThreadExecutor

Examples of thread pool executors for concurrent task execution.

pyForth

Python implementation of a Forth interpreter core.

Qt

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

RobotFramework

Robot Framework test automation examples for web interaction testing, including Google search automation.

Slides

reveal.js

Examples and setup for creating presentations using reveal.js, including PDF export configuration.