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
# DESCRIPTION OF PROBLEM: Implementations of sed, readlink, zcat, etc. are different on OS X and Linux. | |
# NOTE: Put this on top of your script using sed, readlink, zcat, etc. that should work alike on Mac OS X. | |
# cross-OS compatibility (greadlink, gsed, zcat are GNU implementations for OS X) | |
[[ `uname` == 'Darwin' ]] && { | |
which greadlink gsed gzcat > /dev/null && { | |
unalias readlink sed zcat | |
alias readlink=greadlink sed=gsed zcat=gzcat | |
} || { | |
echo 'ERROR: GNU utils required for Mac. You may use homebrew to install them: brew install coreutils gnu-sed' |
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
// Tarantool quick test | |
// Copyright, Dennis Anikin 2016 | |
// | |
// Quick disclaimer: | |
// | |
// This test shows 500K-1000K transactions per second on one CPU core | |
// and 600K-1600K queries per second on one CPU core. | |
// | |
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $1 | |
// |
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
private static readonly string[] tenHoursOfFun = | |
{ | |
"https://www.youtube.com/watch?v=wbby9coDRCk", | |
"https://www.youtube.com/watch?v=nb2evY0kmpQ", | |
"https://www.youtube.com/watch?v=eh7lp9umG2I", | |
"https://www.youtube.com/watch?v=z9Uz1icjwrM", | |
"https://www.youtube.com/watch?v=Sagg08DrO5U", | |
"https://www.youtube.com/watch?v=5XmjJvJTyx0", | |
"https://www.youtube.com/watch?v=IkdmOVejUlI", | |
"https://www.youtube.com/watch?v=jScuYd3_xdQ", |
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
// Source: https://aensidhe.ru/blog/readonlyspan-readonlysequence-c++ | |
template<class TElement> | |
class Parser { | |
private: | |
const IMsgPackParser<TElement> elementParser_; | |
template<template<class> Container> | |
void Read(const Container<byte> & source, Span<TElement> & array, size_t & readSize) { | |
for(size_t i = 0u; i != array.Length(); ++i) { | |
size_t temp; |