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
// [src] https://github.com/apfeltee/cpp11-sprintf | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
std::string fmt( const char *format ) { | |
return format ? format : ""; | |
} |
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
Unicode table - List of most common Unicode characters * | |
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable. | |
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol. | |
What is Unicode? | |
Unicode is a standard created to define letters of all languages and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode. | |
How to identify the Unicode number for a character? | |
Type or paste a character: |
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
// point-to-point distance algorithms survey | |
// - rlyeh, public domain. | |
// possible output { | |
// manhattan_distance: 0.608632s. (result: 6) | |
// octagonal_distance: 0.651783s. (result: 3.52249) | |
// baptista_distance: 1.10458s. (result: 4.79492) | |
// baptista_distance_b: 1.09981s. (result: 4.64063) | |
// euclidean_distance: 1.25s. (result: 4.47214) | |
// euclidean_distance_fast: 1.03207s. (result: 4.5) |
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
// vector_view class, based on code by James exjam https://github.com/exjam/string_view | |
// rlyeh, public domain | |
#pragma once | |
#include <vector> | |
#if defined(_MSC_VER) && _MSC_VER < 1900 | |
#define constexpr | |
#define noexcept | |
#endif |
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
/*=======================================================*\ | |
* file: gb/graphics/containers/kdTree.h * | |
* author: Sharov "Zefick" Sergey zefick@mail.ru * | |
* date: 27.03.2011 * | |
* version: 1.0 * | |
\*=======================================================*/ | |
#ifndef KDTREE_H | |
#define KDTREE_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
/* | |
Delta Compression by Glenn Fiedler. | |
This source code is placed in the public domain. | |
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/ | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <string.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
// src: http://www.gingerbill.org/article/defer-in-cpp.html | |
// This code requires C++11 features such as move semantics | |
#pragma once | |
#include <functional> | |
namespace Impl | |
{ | |
template <typename Func> | |
struct Defer |
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
:: generate git info for C++ inclusion | |
:: - rlyeh, public domain | |
git rev-list --count --first-parent HEAD > git.hpp | |
set /p REVISION=<git.hpp | |
git rev-parse --abbrev-ref HEAD > git.hpp | |
set /p BRANCH=<git.hpp | |
echo #pragma once > git.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
// XLSX exporter v1.01. (tags: xlsx, ini, c++11, i18n, L10n) | |
// - rlyeh, public domain | |
// This tool exports given xlsx: | |
// | |
// ._______._____ | |
// |sheet1 \ ... \ | |
// |--------------------------------------------------- | |
// 1| LABEL | NOTES | ENGLISH | SPANISH | ... | |
// |----------+----------+-----------+-----------+----- |
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
// from PolyGlot master sheet 0.9 - CC1.0 licensed | |
// https://github.com/PolyglotGamedev/mastersheet/blob/master/PolyglotGamedev-Master.csv | |
enum { | |
comment, | |
enUS/*enGB*/,frFR, | |
esES/*esAR esMX*/, | |
deDE/*deCH deAT*/, | |
itIT/*itCH*/, | |
ptBR,ptPT,ruRU,elGR,trTR,daDK,noNB,svSE,nlNL,plPL,fiFI,jaJP,zhCN/* zhSG*/,zhTW/* zhHK zhMO*/,koKR,csCZ,huHU,roRO,thTH,bgBG,heIL |