A short demo showing the explicit instantiation of templates, and how to avoid parsing the full definition(s) in every compilation unit. The limitation is that it will only be possible to use the specific specialisations explicitly instantiated in the cpp 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
//#include <sys/memfd.h> | |
#include <sys/syscall.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.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
#!/usr/bin/python | |
opacity_of_negative_direction = 0.2 | |
size_of_markers = 30 | |
range_of_b = [0.0, 1.0e99] | |
colormap = 'hsv' | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import sys |
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
#!/bin/bash | |
function run { | |
echo "===========================================" | |
echo "$@" | |
echo "===========================================" | |
"$@" vector_bool.cpp -o vector_bool | |
time ./vector_bool | |
echo "" | |
} |
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 <string> | |
#include <stdexcept> | |
#include <stdexcept> | |
#include <sstream> | |
#include <cstring> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.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
#!/bin/bash | |
if [[ $# != 2 ]]; then | |
cat <<EOD | |
usage: ./module action target | |
where: | |
- action is one of: install update remove |
This script guesses the numbers for the merged pull requests from the last tag, then fetches the corresponding information from GitHub and formats it into markdown format suitable for use in e.g. Discourse.
To use, please add create a 'fetch_changelog_settings' file in the toplevel of your repo folder, with the correct information:
repo = 'MRtrix3/mrtrix3'
user = 'jdtournier'
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
#!/bin/bash | |
# to be used for installation on older systems when all else fails... | |
# | |
# Notes: | |
# | |
# - to prevent unnecessary downloads, dependencies are only fetched if the | |
# 'source_install_files' folder does not already exist. Delete it if you want to | |
# fetch them again. | |
# |
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
#!/bin/bash | |
readelf -d "$1" 2>/dev/null | sed -n -e 's/^.*NEEDED.*\[\(\S*\)\]/\1/p' |