author | date | company | department | institute |
---|---|---|---|---|
Pascal Albert Zosso |
2020-08-25 |
HEIG-VD |
TIN |
IAI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <regex.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
/** | |
* Convert a regex match into an integer | |
*/ | |
int to_integer(regmatch_t match, const char* str) { |
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 :
- Partager la charge utile entre un schéma de description et une charge de données
- Encoder UON en format binaire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate random students groups with some suspense... | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int randint(int max) | |
{ |