I hereby claim:
- I am flq on github.
- I am fquednau (https://keybase.io/fquednau) on keybase.
- I have a public key ASDraf_OUnnhDWmgwKEoWTSV7QHQ1pjDPm0pCCSGME0ttwo
To claim this, I am signing this object:
module Josephus where | |
import Data.List | |
-- own, atrocious solution to josephus problem | |
lastSurvivor :: Int -> Int | |
lastSurvivor 1 = 1 | |
lastSurvivor noOfPeople = fst . last $ unfoldr theSurvivors (1,(1,[])) where | |
theSurvivors (person, (count, theKilled)) | |
| length theKilled == noOfPeople - 1 = Just (countOn, breakCondition) |
module Main where | |
import Control.Monad | |
import Data.List (maximumBy,minimumBy,find,(\\)) | |
import Data.Ord | |
import Graphics.UI.SDL as FX | |
type Point = (Int,Int) | |
type MovementPattern = [(Movement, [(Int, Int)] -> Bool)] |
// Use like BusSetup.StartWith<Conservative>().Apply<UiMessages>().Construct(); | |
internal class UiMessages : ISetup<IConfigurableBus> | |
{ | |
void ISetup<IConfigurableBus>.Accept(IConfigurableBus setup) | |
{ | |
setup.ConfigurePublishing(obj => | |
{ | |
obj.MessageMatch(mi => mi.IsType<IUIMsg>()).PublishPipeline(new UiMsgDispatcher()); | |
}); |
-- http://projecteuler.net/problem=1 | |
sum [x | x <- [0..999], any (\d -> mod x d == 0) [3,5]] |
module Ast | |
open System | |
type slotDeclaration= { | |
Index : int | |
Name : string | |
Size : int | |
} |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reactive.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.MSBuild; | |
namespace ReFuc |
module Permutation where | |
permutate :: [a] -> [[a]] | |
permutate [x1,x2] = [[x1,x2],[x2,x1]] | |
permutate items = concat $ map p $ getEachInFrontOnce items | |
where | |
p (x:xs) = map (\items -> [x]++items) $ permutate xs | |
getEachInFrontOnce items = map (putItemAtIndexToFront items) [0..length items-1] | |
putItemAtIndexToFront items idx = [items!!idx] ++ take idx items ++ drop (idx+1) items |
import {assign} from 'lodash' | |
function startModule() { | |
//etc. | |
} | |
global['Project'] = assign(global['Project'] || {}, { | |
startModule | |
}); |
using System.Collections.Generic; | |
using Xunit; | |
using static NMeasure.U; | |
using static NMeasure.Tests.IiUnits; | |
namespace NMeasure.Tests | |
{ | |
public class IIUnitsTests | |
{ | |
public IIUnitsTests() |
I hereby claim:
To claim this, I am signing this object: