Skip to content

Instantly share code, notes, and snippets.

View yves-chevallier's full-sized avatar

Yves Chevallier yves-chevallier

View GitHub Profile
@yves-chevallier
yves-chevallier / fire.c
Created December 8, 2025 07:38
Fire Propagation
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define GRID_SIZE 20
#define MAX_TEMP 100.0
#define MIN_IGNITE_TEMP 50.0
#define FIRE_PROB_AT_100 0.5
@yves-chevallier
yves-chevallier / output
Created December 3, 2025 19:39
LaTeX Output with latexmk -xelatex test2.tex
$ latexmk -xelatex test2.tex
Rc files read:
/etc/LatexMk
Latexmk: This is Latexmk, John Collins, 31 Jan. 2024. Version 4.83.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': Reasons for rerun
Category 'other':
Rerun of 'xelatex' forced or previously required:
Reason or flag: 'Initial setup'
@yves-chevallier
yves-chevallier / criteria.md
Created November 17, 2025 13:39
projmulti-criteria
press
title subtitle author date slots
Projet Multidisciplinaire
Critères d'évaluation
Prof. Yves Chevallier
17 novembre 2025
abstract
Résumé

Critères d'évaluation du cours ProjMulti

import math
import matplotlib.pyplot as plt
from dataclasses import dataclass
# --------------------------- context + generators ---------------------------
@dataclass
class PositionGeneratorContext:
velocity: float
acceleration: float
jerk_time: float
This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Debian) (format=lualatex 2024.7.30) 7 AUG 2024 13:48
system commands enabled.
file:line:error style messages enabled.
**index.tex
(./index.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
Lua module: luaotfload 2023-08-31 3.26 Lua based OpenType font support
Lua module: lualibs 2023-07-13 2.76 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2023-07-13 2.76 ConTeXt Lua libraries -- extended c
@yves-chevallier
yves-chevallier / teapot.cpp
Created December 24, 2023 08:42
Teapot test on WSL2
// g++ test.cpp -lGL -lGLEW -lglfw -lGLU -lsfml-window -lsfml-system -lglut
// Works under WSL2
#include <GL/glew.h>
#include <GL/glut.h>
#include <GLFW/glfw3.h>
#include <iostream>
#define WIDTH 800
#define HEIGHT 600
@yves-chevallier
yves-chevallier / svg2mxgraph.py
Last active August 21, 2025 10:17
SVG to mxGraph experiment
"""
MxGraph Primitives
<move x="0" y="0"/>
<line x="0" y="0"/>
<quad x1="0" y1="0" x2="0" y2="0"/>
<curve x1="0" y1="0" x2="0" y2="0" x3="0" y3="0"/>
Updated with changed from https://gist.github.com/dabenny
"""
from xml.dom import minidom
import re
#pragma once
#include <iostream>
#include <cmath>
template <class T>
class Vector2 {
public:
using value_type = T;
@yves-chevallier
yves-chevallier / sudoku.c
Created December 5, 2022 14:23
Generate sudoku grids
/**
* Generate a Sudoku grid.
* Author: Y. Chevallier <yves.chevallier@heig-vd.ch>
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@yves-chevallier
yves-chevallier / monty-hall.py
Created February 27, 2022 10:11
Monty Hall Problem - The Game
""" Monty Hall Problem - The Game
https://fr.wikipedia.org/wiki/Probl%C3%A8me_de_Monty_Hall
Supposez que vous êtes sur le plateau d'un jeu télévisé, face à trois portes
et que vous devez choisir d'en ouvrir une seule, en sachant que derrière l'une
d'elles se trouve une voiture et derrière les deux autres des chèvres.
Vous choisissez une porte, disons la numéro 1, et le présentateur, qui sait,
lui, ce qu'il y a derrière chaque porte, ouvre une autre porte, disons la numéro 3,
porte qui une fois ouverte découvre une chèvre.