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
main :: IO () | |
main = (\x -> putStr x >> print x) "main :: IO ()\nmain = (\\x -> putStr x >> print x) " |
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 <boost/property_tree/xml_parser.hpp> | |
#include <curl/curl.h> | |
#include <iostream> | |
#include <string> | |
// #include <memory> | |
// c++ -std=c++11 -lcurl | |
class curl_wrapper // I need to RAII | |
{ |
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
// -*- flycheck-clang-language-standard : "c++14"; -*- | |
// clang++ -std=c++14 -stdlib=libc++ | |
// clang version 3.5.0 (tags/RELEASE_350/final) | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdio> | |
#include <numeric> | |
template<typename 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
// -*- flycheck-clang-language-standard : "c++14"; -*- | |
// clang++ -std=c++14 -stdlib=libc++ | |
// clang version 3.5.0 (tags/RELEASE_350/final) | |
#include <algorithm> | |
#include <array> | |
#include <cmath> | |
#include <functional> | |
#include <iomanip> | |
#include <iostream> |
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
// -*- flycheck-clang-language-standard : "c++14"; -*- | |
// clang++ -std=c++14 -stdlib=libc++ | |
// clang version 3.5.0 (tags/RELEASE_350/final) | |
#include <algorithm> | |
#include <array> | |
#include <iostream> | |
#include <iterator> | |
#include <vector> | |
namespace reinvention |
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 <algorithm> | |
#include <boost/lexical_cast.hpp> | |
#include <chrono> | |
#include <cstdint> | |
#include <deque> | |
#include <iostream> | |
#include <iterator> | |
#include <string> | |
#include <thread> |
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 java.util.*; | |
import java.util.function.*; | |
import java.util.stream.*; | |
public class MyList<E extends Comparable<E>> implements List<E> | |
{ | |
public static void main(String[] args) | |
{ | |
// MyList クラスのテスト | |
List<String> list = new MyList<String>(); |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import qualified Data.ByteString.Char8 as S | |
import qualified Data.IntMap as I | |
import Data.List | |
import qualified Data.Map as M | |
import Data.Maybe () | |
import Data.Monoid () | |
import System.Environment |
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
piExp(R, Pi) :- dimension(circle, R, Cs), dimension(box, R, Bs), Pi is Cs / Bs. | |
dimension( box, R, Ps) :- Ps is R * R. | |
dimension(circle, R, Ps) :- dimensionRec(circle, 0, R, Psr), Ps is Psr * 4. | |
dimensionRec( _, X, R, Ps) :- X > R, Ps is 0. | |
dimensionRec(circle, X, R, Ps) :- X =< R, line(circle, X, R, P), dimensionRec(circle, X + 1, R, NP), Ps is P + NP. | |
line(circle, X, R, P) :- hypot(X, Y, R), P is 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
import Control.Applicative () | |
import Control.Monad | |
import Data.Char | |
import Data.List | |
import Data.List.Split | |
import qualified Data.Map as M | |
import Data.Monoid | |
import Data.Ord () | |
import qualified Data.Set as S | |
import System.Directory |