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
* { | |
font-family: 'Roboto', sans-serif; | |
font-weight: normal; | |
} | |
button.open { | |
display: inline-block; | |
width: 4rem; | |
height: 2rem; |
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 <cxxabi.h> | |
#include <iostream> | |
#include <typeinfo> | |
// http://en.cppreference.com/w/cpp/types/type_info/name | |
// https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html | |
template<typename T> | |
void sayMyName() { | |
auto name = typeid(T).name(); |
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
import os.path | |
import matplotlib.pyplot as plt | |
import numpy as np | |
FILENAME = 'data.txt' | |
SEPARATOR = '\n' | |
# Data can be generated with any tool as long as the format is good | |
# Create one to show the format of the file |
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
cmake_minimum_required(VERSION 3.10) | |
project(Boost_Python_Example) | |
# Find Boost | |
find_package(Boost COMPONENTS python3) | |
# Find Python | |
find_package(PythonInterp 3 REQUIRED) | |
find_package(PythonLibs 3 REQUIRED) | |
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
@echo off | |
ping %1 | |
if %ERRORLEVEL% NEQ 0 ( | |
echo *** ERRORLEVEL = %ERRORLEVEL% *** | |
goto failure | |
) | |
:success |
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
import datetime | |
import random | |
import matplotlib.animation as animation | |
import matplotlib.pyplot as plt | |
def read_temperature(): | |
"""Read temperature (stub here of course) |
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
char (*__kaboom)[sizeof( xxx )] = 1; | |
// xxx can be a variable or a data type | |
// See https://stackoverflow.com/questions/20979565/how-can-i-print-the-result-of-sizeof-at-compile-time-in-c | |
// Exemple of code: | |
// char (*__kaboom)[sizeof( long long )] = 1; | |
// GCC error: | |
// error: invalid conversion from 'int' to 'char (*)[8]' [-fpermissive] | |
// So sizeof(long long) == 8 |
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 <cassert> | |
#include <cstdint> | |
#include <variant> | |
struct ReadRequest { | |
ReadRequest(std::uint8_t* data, std::size_t length) : | |
data(data), | |
length(length) { | |
assert(data != nullptr); | |
} |
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> | |
#include <mutex> | |
#include <queue> | |
#include <sstream> | |
#include <thread> | |
int main(int, char*[]) { | |
std::queue<std::string> queue; | |
std::mutex mutex; |
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
def __str__(self): | |
elements = [] | |
for key, value in self.__dict__.items(): | |
elements.append("{key}='{value}'".format(key=key, value=value)) | |
return ', '.join(elements) |