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
| module Main where | |
| import Data.List | |
| import Data.Array | |
| import Data.Char | |
| s 0 = 0 | |
| s x = x `mod` 10 + s (x `div` 10) | |
| b2r 0 = "0" |
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 Data.List | |
| ev s = map (\x -> (x, elemIndices x s)) $ nub s | |
| unifyAux [] [] substs = Just substs | |
| unifyAux (x:xs) (y:ys) substs = if snd x == snd y then unifyAux xs ys ((fst x, fst y) : substs) else Nothing | |
| unifyAux _ _ _ = Nothing | |
| unify s1 s2 = unifyAux (ev s1) (ev s2) [] |
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.Monad | |
| import Data.Char | |
| import Data.List | |
| makeGroup xs = (head xs, length xs) | |
| histogram = map makeGroup . group . sort | |
| diffHistograms ((lx, cx) : xs) ((ly, cy) : ys) | |
| | lx == ly && cx == cy = diffHistograms xs ys |
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.Arrow | |
| import Control.Monad | |
| import Data.Char | |
| import Data.List | |
| import System.Environment | |
| histogram = map (head &&& length) . group . sort | |
| diffHistograms ((lx, cx) : xs) ((ly, cy) : ys) acc | |
| | lx == ly && cx == cy = diffHistograms xs ys acc |
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
| using System; | |
| using System.Collections; | |
| using System.Net; | |
| using System.Net.Sockets; | |
| namespace AsyncTest | |
| { | |
| struct AsyncThread | |
| { | |
| public static void Start<T>(Func<AsyncCallback, T, IEnumerator> operation, T argument) |
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 <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <limits.h> | |
| void write_datfile(FILE *dat, char *datname, char *resolution); | |
| unsigned int md(unsigned char x, unsigned char y, unsigned char z); | |
| unsigned char plot_point(unsigned char *matrix, int density, | |
| unsigned char x, unsigned char y, unsigned char z, | |
| char shift); |
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
| using System.IO; | |
| using System.Text; | |
| namespace TeXify | |
| { | |
| class Program | |
| { | |
| static bool inQuotes = false; | |
| static string FixLine(string line) |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| namespace Textile | |
| { | |
| static class ExtensionMethods | |
| { |
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 <array> | |
| #include <chrono> | |
| #include <iostream> | |
| #include <numeric> | |
| #include <random> | |
| #include <vector> | |
| #include <mmintrin.h> |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| namespace Tunnels | |
| { | |
| class Program | |
| { |