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
all: union exn variant | |
%: %.cpp | |
clang++ -Wall -Wextra -Werror -std=c++17 -O3 $< -o $@ | |
clean: | |
rm -f union exn variant |
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 <stdio.h> | |
#include <stdint.h> | |
int main() | |
{ | |
int64_t i = 12345; | |
if (i < INT64_C(-9223372036854775808)) | |
printf("ERROR\n"); | |
if (i < INT64_C(-9223372036854775807) - 1) | |
printf("ERROR\n"); |
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
lines with $ are commands | |
### install mkvtoolnix: | |
$ brew install mkvtoolnix | |
### list content of the mkv-file: | |
$ mkvmerge -i mymoviefile.mkv | |
### what will give you: |
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 <iostream> | |
#include <type_traits> | |
namespace detail | |
{ | |
constexpr std::size_t pack_bool(std::size_t result) | |
{ | |
return result; | |
} | |
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 <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()) |
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
// foo.h | |
#pragma once | |
template<typename A> | |
class Foo | |
{ | |
public: | |
Foo(); |
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
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" |
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
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; |
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 <iostream> | |
#include <memory> | |
#include <vector> | |
#include <initializer_list> | |
#include <iterator> | |
struct Item | |
{ | |
virtual ~Item() {} | |
}; |
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
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 |
NewerOlder