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
FROM python:3-alpine | |
COPY entrypoint.py /app/entrypoint.py | |
WORKDIR /app | |
ENTRYPOINT ["python3", "/app/entrypoint.py"] |
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
// Public domain, do whatever you want. | |
#include <chrono> | |
#include <cstdint> | |
class Distance { | |
public: | |
constexpr double kilometers() const { return _meters * 1e-3; } | |
constexpr double meters() const { return _meters; } | |
constexpr double decimeters() const { return _meters * 1e1; } |
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 <memory> | |
#include <cstdlib> | |
#include <cassert> | |
template <typename T> | |
class immutable_vector_data { | |
public: | |
static constexpr size_t kInitialCapacity = 1; | |
immutable_vector_data(size_t capacity = kInitialCapacity) |
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 <stdlib.h> | |
#include <assert.h> | |
#include <string.h> | |
unsigned long long next_power_of_two(unsigned long long v); | |
struct dynarray { | |
unsigned long long size; | |
unsigned long long value_size; | |
unsigned long long capacity; |
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 <utility> | |
#include <tuple> | |
#include <type_traits> | |
namespace meta { | |
// detects callable objects, not functions | |
// http://stackoverflow.com/questions/15393938/find-out-if-a-c-object-is-callable | |
template<typename T> | |
class is_callable_object { |
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 <chrono> | |
#include <thread> | |
#include <queue> | |
#include <string> | |
#include <atomic> | |
#include <mutex> | |
class AsyncStreamReader { | |
public: |
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 <chrono> | |
#include <future> | |
#include <string> | |
std::string GetLineFromCin() { | |
std::string line; | |
std::getline(std::cin, line); | |
return line; | |
} |
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
Date/Time: 2015-11-30 10:48:00 -0600 | |
OS Version: 10.10.5 (Build 14F1021) | |
Architecture: x86_64h | |
Report Version: 21 | |
Duration: 9.99s | |
Steps: 1000 (10ms sampling interval) | |
Hardware model: MacBookPro11,3 | |
Active cpus: 8 |
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
Date/Time: 2015-11-03 11:20:25 -0700 | |
OS Version: 10.10.5 (Build 14F27) | |
Architecture: x86_64h | |
Report Version: 21 | |
Duration: 9.99s | |
Steps: 1000 (10ms sampling interval) | |
Hardware model: MacBookPro11,3 | |
Active cpus: 8 |
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 <future> | |
#include <iostream> | |
#include <thread> | |
#include <queue> | |
template <typename T> | |
class concurrent_queue { | |
private: | |
std::queue<T> _queue; | |
std::mutex _mutex; |
NewerOlder