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 / error
Created August 6, 2019 11:35
Sphinx test error
________________________________________________________________________________________________ test_tocdepth_singlehtml[index.html-expect14] ________________________________________________________________________________________________
app = <sphinx.testing.util.SphinxTestAppWrapperForSkipBuilding object at 0x7f51ea4776d8>, cached_etree_parse = <function cached_etree_parse.<locals>.parse at 0x7f51ec7671e0>, fname = 'index.html', expect = ('.//h4', '2.1.1. Baz A', True)
@pytest.mark.parametrize("fname,expect", flat_dict({
'index.html': [
(".//li[@class='toctree-l3']/a", '1.1.1. Foo A1', True),
(".//li[@class='toctree-l3']/a", '1.2.1. Foo B1', True),
(".//li[@class='toctree-l3']/a", '2.1.1. Bar A1', False),
(".//li[@class='toctree-l3']/a", '2.2.1. Bar B1', False),
@yves-chevallier
yves-chevallier / error.log
Created August 11, 2019 10:38
LaTeX error listings on Docker
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/dev/Debian) (preloaded format=xelatex 2019.8.11) 11 AUG 2019 10:38
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**refcard.tex
(./refcard.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
@yves-chevallier
yves-chevallier / menu.c
Created November 18, 2019 08:54
Menu en C
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <ctype.h>
void q(void) {
char d;
if(scanf("%hhd", &d)) {
printf("Info: Scanf got %hhd\n", d);
@yves-chevallier
yves-chevallier / group-generator.c
Created November 20, 2019 21:36
Generate random students groups with some suspense...
/**
* Generate random students groups with some suspense...
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
int randint(int max)
{
@yves-chevallier
yves-chevallier / spiral.c
Created December 13, 2019 22:08
Draw a spiral in text mode
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#include <unistd.h>
#define W (30)
const double pi = 3.1415;
void display(bool tab[W][W]) {
@yves-chevallier
yves-chevallier / sudoku-solve.c
Created December 13, 2019 22:09
Sudoku Solver (brute force)
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BLOCK (3)
#define WIDTH (BLOCK * BLOCK)
#if WIDTH % BLOCK > 0
# error "Invalid block size"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define WIDTH (30)
/**
* ANSI color sequences
* http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
@yves-chevallier
yves-chevallier / gallimard.c
Created March 10, 2020 20:46
Correction du laboratoire Gallimard
/**
* Gallimard text analyser.
*
* See the help below to get information about how this proogram works.
*/
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@yves-chevallier
yves-chevallier / heap.c
Created May 26, 2020 16:00
Max-Heap for strings
/**
* Max-Heap for strings implemented with a max-heap binary tree
* Insertion (enqueue) in O(log n)
* Deletion (dequeue) in O(log n)
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
@yves-chevallier
yves-chevallier / binary.md
Created June 8, 2020 08:12
UON précisions binaire

Précisions sur le format binaire UON

Introduction

La plupart des langages de sérialisation de données permettent la génération d'un flux texte comme XML, JSON ou YAML qui permet une lecture facile mais qui n'est pas optimal du point de vue du médium de transmission : un encodage minimal serait préférable.

UON offre deux solutions pour minimiser la charge utile :

  1. Partager la charge utile entre un schéma de description et une charge de données
  2. Encoder UON en format binaire