View Brainfuck.hs
import Debug.Trace
import Control.Applicative
import Control.Monad
import Data.Word
import Data.Map (Map)
import Data.ByteString (ByteString)
View TemporalRange.java
import java.time.Period;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
import java.time.temporal.Temporal;
import java.time.temporal.TemporalAmount;
import java.time.temporal.TemporalUnit;
import java.util.Iterator;
public class TemporalRange<T extends Temporal> implements Iterable<T> {
View novice-tuple.cpp
#include <utility>
#include <type_traits>
template<typename T>
struct identity { using type = T; };
template<std::size_t I, typename... Ts>
struct nth_type;
template<typename T, typename... Ts>
View devirt2.cpp
#include <array>
#include <typeinfo>
extern volatile int poop;
struct A {
virtual void f() { poop += 10; }
};
struct B : public A {
View method_choice.cpp
#include <utility>
template<typename T, T... PMFs>
struct method_choice;
template<typename C, typename R, R C::* PMF, R C::*... PMFs>
struct method_choice<R C::*, PMF, PMFs...> {
template<typename... A>
method_choice(int choice, C &subject, A... args) {
if (choice == 0) {
View leaking.cpp
#include <algorithm>
#include <iostream>
#include <memory>
#include <typeinfo>
#include <vector>
#include <cassert>
using namespace std;
template <typename T>
View lazy_primality.cpp
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
View lambda_delegate.cpp
#include <functional>
#include <iostream>
#include <utility>
using namespace System;
using namespace System::Linq;
using namespace System::Collections::Generic;
template <typename T>
struct identity { using type = T; };
View eager_generator.py
import pandas as pd
import functools
def eager_generator(reifier):
"""
Makes it so that a generator function returns a collection by forcing its full evaluation eagerly.
:arg reifier: function that takes the generator and reifies it to a collection.
View tcp-proxy.js
'use strict';
const net = require('net');
const LOCAL_PORT = 7358;
const REMOTE_PORT = 7357;
const REMOTE_ADDR = 'localhost';
const server = net.createServer(function (clientSocket) {
const serviceSocket = new net.Socket();