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 <sstream> | |
#include <iostream> | |
#include <cstdio> | |
#include <string> | |
#include <vector> | |
// To test performance you can compile with different preprocessor defines: | |
// g++ -std=c++11 -O2 -D USE_PRINTF string_format.cpp -o using_printf | |
// g++ -std=c++11 -O2 -D USE_IOSTREAM string_format.cpp -o using_iostream | |
// g++ -std=c++11 -O2 -D USE_STRING string_format.cpp -o using_string |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
//Try this out like so: | |
//g++ -std=c++14 scoped_timer.cpp -o scoped_timer && ./scoped_timer | |
#include <chrono> | |
#include <functional> | |
#include <thread> | |
#include <iostream> | |
template <typename clock_t = std::chrono::steady_clock> | |
struct scoped_timer { |
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
#ifndef TEST_DECODE | |
#pragma once | |
#else | |
#include <iostream> | |
#endif | |
#include <string> | |
std::string urldecode(const std::string& url) { | |
// make a place for the output | |
std::string decoded; |
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 <functional> | |
#include <iostream> | |
#ifdef use_std_filesystem | |
#include <experimental/filesystem> | |
namespace filesystem = std::experimental::filesystem; | |
#else | |
#include <cstring> | |
#include <memory> |
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 <vector> | |
#include <string> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <cstdint> | |
#include <fstream> | |
#include <lz4.h> |
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 python | |
import sys | |
import os | |
import time | |
import math | |
import calendar | |
import threading | |
import argparse | |
import boto3 | |
from functools import partial |
NewerOlder