code
6 June 2008 | 10 Comments
So, Colin Percival has posted a UTF-8 strlen which improves on my previous post. While his code runs slightly slower than mine on my PC, I assume that’s because his code is aimed at a 64-bit architecture. With 32-bits (reading 4 bytes at a time, instead of 8 ) it doesn’t quite get the same [...]
Tagged in C, fast, horrid, optimization, overengineered, silly, simd, sse, strlen, stupid
replies
27 February 2008 | 0 Comments
Douglas, you’re not alone. import Data.List (sortBy) import Data.Function (on) import Data.Maybe (mapMaybe) import Control.Monad.Instances gizzabuzz pairs combiner = zipWith ($) (cycle funcs) [1..] where sortedPairs = sortBy (compare `on` fst) pairs funcs = map (\n -> display $ mapMaybe (filterOut n) sortedPairs) [1..foldr1 lcm $ map fst $ sortedPairs] display [] = show [...]
Tagged in fizzbuzz, Haskell, horrid, humour, overengineered, Programming