View tristate.cpp
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 <stdint.h> | |
#include <stdio.h> | |
// The processes vision can be running | |
enum struct Process : uint16_t { | |
PROCESS_1, | |
PROCESS_2, | |
}; | |
enum struct Function : uint16_t { |
View ++operator.cpp
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 <iostream> | |
struct S { | |
int value = 0; | |
decltype(auto) operator++(auto... t) { | |
return ((*this = {value + 1}), ..., S{value - 1 + t}); | |
} | |
}; |
View test.cpp
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 <type_name.h> | |
#include <iostream> | |
class A { | |
public: | |
int a = 1; | |
int b = 2; | |
int c = 3; | |
}; |
View magic.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
/** | |
* Those functions are related to: https://www.youtube.com/watch?v=nXaxk27zwlk&t=2446s | |
* | |
* They are used to allow to benchmark functions with -O3 that would otherwise be removed because it is unused. | |
* | |
* escape(&object) prevents object to be optimized out | |
* "This ASM code has some unknowable side effects and possibly stored the pointer globally" | |
* clobber() tells the compiler some asm might be reading the whole memory | |
* "This ASM code could probably read/write to all memory" => observe all memory | |
*/ |
View merge.sh
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
# This is to be used with catkin_make or catkin_tools if we want to merge compile_commands.txt in a single file to allow some tools to work such as Sourcetail. | |
sudo apt install jq | |
jq -s 'map(.[])' PATH_TO_COMPILE_COMMANDS_ROOT/**/compile_commands.json > compile_commands.json |
View singleton.hpp
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
class Singleton { | |
public: | |
static Singleton& get() { | |
static Singleton instance; | |
return instance; | |
} | |
Singleton(Singleton&&) = delete; | |
Singleton& operator=(Singleton&&) = delete; |
View factorial.js
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
function factorial(number) { | |
let result = 0; | |
for(let i = number; i > 0; --i) { | |
result += Math.log10(i); | |
} | |
return result; | |
} | |
function scientific_factorial(number) { | |
let fact = factorial(number); |
View resume.json
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
{ | |
"basics": { | |
"name": "Alexis Paques", | |
"label": "Head of Robotics", | |
"picture": "", | |
"email": "alexis.paques@gmail.com", | |
"phone": "+32496203699", | |
"website": "http://alexistm.github.io", | |
"summary": "I love to experience new technologies, hardware as well as software. I am a conscientious person who works hard to get the right/best result, depending on the deadline. In the meantime, I consider coding as an art. It is personal and it should beautiful to ourselves yet readable for the others. I am autodidact as well as flexible, I can learn new languages with ease.", | |
"location": { |
View minimal_gcs.py
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
#!/usr/bin/env python2 | |
""" | |
Minimal heartbeat for a Ground control station in ROS for PX4. | |
It enables STATUS_TEXT streams. | |
Author: AlexisTM | |
""" | |
from threading import Thread | |
import rospy |
NewerOlder