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
// lambda syntax; construction & call | |
int x = 0; | |
int y = 10; | |
[x, &y] (int z) { return x + (++y) + (++z); } (5); | |
// desugared | |
struct __lambda1 { | |
int x; | |
int &y; | |
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 PIL import Image | |
from urllib.request import urlopen | |
from urllib.parse import quote_plus | |
import json | |
import io | |
import re | |
from random import choice | |
def first(xs): | |
for x in xs: |
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
import sys | |
if sys.version_info[0] == 3: | |
from io import StringIO | |
else: | |
from cStringIO import StringIO | |
def replace_entities(text, grouped_entities, **replacers): | |
entities = [] |
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
import requests | |
import base64 | |
import json | |
import sys | |
def log(msg): | |
sys.stderr.write(msg) | |
sys.stderr.write('\n') | |
client_key= '' |
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
// compile with: gcc openmp.c -o openmp -std=c11 -O3 -Wall -fopenmp | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef int num; | |
int main(int argc, char *argv[]) { | |
int n = 20000; | |
int m = 20000; |
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 <iostream> | |
// --- | |
#include <array> | |
#include <utility> | |
template <typename T> | |
using c_array = 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
#include <type_traits> | |
#include <tuple> | |
#include <functional> | |
template <typename FType> | |
struct function_traits; | |
template <typename RType, typename... ArgTypes> | |
struct function_traits<RType(ArgTypes...)> { | |
using arity = std::integral_constant<size_t, sizeof...(ArgTypes)>; |
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 <type_traits> | |
#include <utility> | |
#include <tuple> | |
#include "function_traits.cpp" | |
// --- | |
template <typename Args, typename Params> | |
struct apply_args; |
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
struct meow { | |
static int defaults; | |
static int copies; | |
static int moves; | |
static int destroys; | |
static void report() { | |
std::cout << "defaults: " << defaults << std::endl; | |
std::cout << "copies: " << copies << std::endl; | |
std::cout << "moves: " << moves << std::endl; |