Skip to content

Instantly share code, notes, and snippets.

import Data.List
import Data.Char
ps :: [[[Int]]]
ps = [] : map parts [1..]
where parts n = [n] : [x : p | x <- [1..n], p <- ps !! (n - x), x <= head p]
partitionsFor :: Int -> [[Int]]
partitionsFor = tail . (ps !!)
White
White
White
White
Black
White
White
Black
Black
Black
import Data.List
import Network
import System.IO
import System.Exit
import Control.Arrow
import Control.Monad
import Control.Monad.Reader
import Control.Exception
import Text.Printf
@fvandepitte
fvandepitte / PathTest.cpp
Created November 7, 2016 15:17
Gist created by fiddle.jyt.io
#include <iostream>
#include <string.h>
int main ()
{
char const *path = "/Users/user/test/tëst/test";
char const *wp = "/Users/user/test/tëst";
if (strncmp (wp,path,strlen(wp)) == 0)
{
#include <stdio.h>
#include <string.h>
int main ()
{
char* path = "/Users/user/test/tëst/test"; //Sent by the system
char* wp = "/Users/user/test/tëst"; //Some path we claim to be ours
size_t wp_len = strlen(wp);