I hereby claim:
- I am artemkin on github.
- I am stas (https://keybase.io/stas) on keybase.
- I have a public key whose fingerprint is 9D25 6F3B FE9A 0ADF E7E5 D03E 5D55 61F3 B009 1428
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Special case of memoization. Only last value is cached. | |
#include <iostream> | |
#include <memory> | |
template<typename R, typename Arg, typename Comp = std::equal_to<Arg>, typename Fun> | |
std::function<R(const Arg&)> memoize_last(Fun f) | |
{ | |
struct Cache | |
{ |
type _ expr = | |
| Int_lit : int -> int expr | |
| Bool_lit : bool -> bool expr | |
| Add : int expr * int expr -> int expr | |
| Sub : int expr * int expr -> int expr | |
| Mul : int expr * int expr -> int expr | |
| Div : int expr * int expr -> int expr | |
| Lt : int expr * int expr -> bool expr | |
| Gt : int expr * int expr -> bool expr |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <initializer_list> | |
#include <iterator> | |
struct Item | |
{ | |
virtual ~Item() {} | |
}; |
var toType = function(obj) { | |
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() | |
} | |
function stringToArray(str) { | |
var arr = []; | |
for (var i = 0; i < str.length; ++i) | |
arr.push(str.charCodeAt(i)); | |
return arr; |
import Data.List | |
import Criterion.Main | |
select :: Ord a => Int -> [a] -> [a] | |
select k = take k . sort | |
lst = ["temperish", "warehousemen", "hirtellous", "glaciology", "vermilion", "intrigante", "CDC", "torrent-flooded", "quasi-diplomatic", "writ", "toad-green", "infamiliar", "stomatorrhagia", "luminative", "bebathe", "keyless", "wonderless", "achalasia", "locules", "prettiness", "double-handed", "inirritant", "Marylinda", "Diploptera", "nonskilled", "high-low", "hypermetaphysical", "nicker", "prespreading", "kick-sled", "Sparland", "pastilled", "rebeguile", "noncurative", "nonextricable", "ketohexose", "unbraiding", "hyporhachidian", "Blephariglottis", "-log", "Wonnie", "self-evidentness", "Axonolipa", "Cappadocia", "mamsell", "agistator", "shins", "actinomycotic", "Fabriane", "abvolts", "fussbudgety", "olecranial", "sparkle-drifting", "iridocele", "Accalia", "apophlegmatism", "depersonize", "disleal", "mafia", "spuke", "gru-gru", "stupefies", "sun-marked", "casualties", "Burmannia", "Lalitta", "dauntlessly" |
// foo.h | |
#pragma once | |
template<typename A> | |
class Foo | |
{ | |
public: | |
Foo(); |
#include <iostream> | |
#include <string> | |
#include <functional> | |
#include <ctype.h> | |
using Tokenizer = std::function<std::string()>; | |
Tokenizer CreateTokenizer(const std::string& i_str) | |
{ | |
if (i_str.empty()) |
#include <iostream> | |
#include <type_traits> | |
namespace detail | |
{ | |
constexpr std::size_t pack_bool(std::size_t result) | |
{ | |
return result; | |
} | |
lines with $ are commands | |
### install mkvtoolnix: | |
$ brew install mkvtoolnix | |
### list content of the mkv-file: | |
$ mkvmerge -i mymoviefile.mkv | |
### what will give you: |