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 <cmath> | |
#define INITIAL_WINDOW_MS 500 | |
#define NONINITIAL_WINDOWS_MS 150 | |
#define UNCERTAINTY_SCALE 10.0f | |
#define UNCERTAINTY_SYMMETRY_CAP 0.0f | |
#define ESTIMATE_FLOOR_KBPS 0.0f | |
class BitrateEstimator { | |
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
from time import sleep | |
import requests | |
import os.path | |
import sys | |
import pprint | |
import svn.local | |
import svn.remote |
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
#!/bin/bash | |
BINARY=$1 | |
VER=$2 | |
echo "Find ${BINARY} package with version ${VER}" | |
RPM_VER=`yum -v list ${BINARY} --show-duplicates | grep ${VER} | grep -oP "${VER}-\w{40}"` | |
echo "Founded: ${RPM_VER}" | |
echo "Downloading rpm ${BINARY} with version ${VER}" |
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
#ifndef SCOPEEXEC_H_ | |
#define SCOPEEXEC_H_ | |
#include <type_traits> | |
template <typename OnCreate, typename OnExit, class Enable = void> | |
class ScopeExec { | |
using OnCreateResultType = typename std::result_of_t<OnCreate(void)>; | |
public: | |
explicit ScopeExec(OnCreate onCreate, OnExit onExit) |
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 <iomanip> | |
template <typename Clock> | |
class CurrentTime | |
{ | |
template<struct tm* represent(const time_t *)> | |
static std::string utc() { | |
using namespace std::chrono; | |
auto timer = Clock::to_time_t(Clock::now()); |
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
// | |
// Created by imelker on 23.09.2020. | |
// | |
#ifndef OBJECTCOUNTER_H_ | |
#define OBJECTCOUNTER_H_ | |
#include <cstdio> | |
#define USE_COUNTER |
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
#!/bin/bash | |
# | |
# This is workaround for faster CLion file transfer in context of remote host | |
# | |
excludes=() | |
[[ $PWD =~ cmake-build- ]] && excludes=('--exclude=*.o' '--exclude=./bin' '--exclude=./lib') | |
first="$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<string> | |
#include<iostream> | |
class ScopePrinter { | |
public: | |
template<typename STR> | |
explicit ScopePrinter(STR&& init, std::ostream& stream = std::cout) | |
: stream(stream), | |
msg(std::forward<STR>(init)) { | |
msg.append(":\t"); |
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
// determining array size | |
template <typename T, auto N> | |
char (&ArraySizeHelper(T (&array)[N]))[N]; | |
#define arraysize(array) (sizeof(ArraySizeHelper(array))) | |
// convert defined value to string | |
#define expect(expr) if(!expr) cerr << "Assertion " << #expr \ | |
" failed at " << __FILE__ << ":" << __LINE__ << endl; | |
#define stringify(x) #x |
NewerOlder