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 <climits> | |
#include <cstdint> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <bitset> | |
#include <functional> | |
#include <iostream> | |
#include <iterator> | |
#include <limits> |
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 python3 | |
import sys | |
import argparse | |
import collections | |
import curses | |
import curses.textpad | |
#python3 -m venv --system-site-packages venv |
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_traits> | |
template <typename T, typename Tag> struct NewType { | |
struct Type : T { using T::T; }; | |
}; | |
using CostMatrix = NewType<Matrix<std::int64_t>, struct CostMatrixTag>::Type; | |
using TimeMatrix = NewType<Matrix<std::int64_t>, struct TimeMatrixTag>::Type; | |
static_assert(!std::is_same<CostMatrix, TimeMatrix>::value, "NewType not working"); |
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
crash.cc:16:27: warning: unused parameter 'first' [-Wunused-parameter] | |
static Tree Create(Iter first, Iter last) { return Leaf{}; } | |
^ | |
crash.cc:16:39: warning: unused parameter 'last' [-Wunused-parameter] | |
static Tree Create(Iter first, Iter last) { return Leaf{}; } | |
^ | |
In file included from crash.cc:4: | |
In file included from /home/daniel/llvm-dev-3.8-env/boost-dev-1-60/include/boost/variant.hpp:17: | |
/home/daniel/llvm-dev-3.8-env/boost-dev-1-60/include/boost/variant/variant.hpp:1732:52: error: no type named 'type' in 'boost::enable_if<boost::is_rvalue_reference<const Tree &>, void>'; 'enable_if' cannot be used to disable this declaration | |
variant(T&& operand, typename boost::enable_if<boost::is_rvalue_reference<T&&> >::type* = 0, |
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 <string> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
#include <unordered_set> | |
#include <iostream> | |
#include <ostream> | |
#include <sstream> | |
#include <mapbox/variant.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
#include <iostream> | |
#include <iterator> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <vector> | |
#include <boost/graph/compressed_sparse_row_graph.hpp> | |
#include <boost/graph/filtered_graph.hpp> | |
#include <boost/graph/graph_traits.hpp> | |
#include <boost/graph/graph_utility.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
#include <iostream> | |
#include <vector> | |
#include <utility> | |
#include <boost/iterator/transform_iterator.hpp> | |
// Takes arbitrary [first,last) iterator range, returns pair of [first,last)-transform iterators applying fn on the fly | |
template <typename Iter> | |
auto xform(Iter first, Iter last) { | |
// dummy function requiring values in the range to be convertible with to_string |
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 <iterator> | |
template <typename Iter> | |
typename std::iterator_traits<Iter>::value_type KahanSum(Iter first, Iter last) { | |
using T = typename std::iterator_traits<Iter>::value_type; | |
T sum(0); | |
T compensation(0); | |
for (; first != last; ++first) { |
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 <unordered_map> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
int main() { | |
// Empty int,string map | |
std::unordered_map<int, std::string> m; |
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 bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
if [ $# -ne 3 ]; then | |
echo "Usage: cut.sh planet.pbf bbox.geojson outfile" | |
exit 1 |