This file contains hidden or 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 bash | |
set -e | |
# Validate the command-line arguments. | |
if [[ $# -ne 3 ]]; then | |
echo "Usage: $0 [chroot1] [chroot2] [only_in_1,only_in_2,in_both]" | |
exit 1 | |
elif [[ ! -d "$1" ]]; then | |
echo "$1 is not a directory." | |
exit 1 |
This file contains hidden or 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 <chrono> | |
#include <iostream> | |
#include <tuple> | |
template <typename lhs_t, typename rhs_t, typename... other_ts> | |
constexpr bool has_decreasing_periods() { | |
if constexpr (std::ratio_less_v<typename lhs_t::period, | |
typename rhs_t::period>) { | |
return false; | |
} else if constexpr (sizeof...(other_ts)) { |
This file contains hidden or 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 <tuple> | |
template <typename... input_ts> | |
auto stream_get(std::istream& stream) { | |
if constexpr (sizeof...(input_ts) == 1) { | |
std::tuple_element_t<0, std::tuple<input_ts...>> input; | |
stream >> input; | |
return input; | |
} else { |
This file contains hidden or 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 | |
# | |
# This snippet provides a simple function "combination" that can compute an | |
# arbitrary k-combination of n elements given an index m into the | |
# lexicographically ordered set of all k-combinations of n elements. | |
from math import factorial | |