This file contains 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 Puzzle where | |
import Data.List (permutations) | |
import Control.Monad (guard) | |
solution = do | |
[a,b,c,d,e,f] <- permutations "123456" | |
guard $ multiple 6 [a,b,c,d,e,f] | |
guard $ multiple 5 [a,b,c,d,e] | |
guard $ multiple 4 [a,b,c,d] |
This file contains 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 Text.Parsec | |
import Text.Parsec.String | |
main :: IO () | |
main = do | |
input <- getLine |
This file contains 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 Classifier | |
( Classifier(..) | |
, empty | |
, update | |
, union | |
, classify | |
, singleton | |
, scaled | |
, test | |
) where |
This file contains 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 Puzzle where | |
valid :: Integer -> Bool | |
valid abcde = divisibleBy bcde && divisibleBy cde && divisibleBy de && divisibleBy e | |
where divisibleBy n = n /= 0 && ((abcde `mod` n) == 0) | |
bcde = abcde `mod` 10000 | |
cde = bcde `mod` 1000 | |
de = cde `mod` 100 | |
e = de `mod` 10 |
This file contains 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 FizzBuzz where | |
fizzbuzz :: (Show a, Integral a) => a -> String | |
fizzbuzz n = case (n `rem` 3, n `rem` 5) of | |
(0, 0) -> "FizzBuzz" | |
(0, _) -> "Fizz" | |
(_, 0) -> "Buzz" | |
_ -> show n | |
main = mapM_ (putStrLn . fizzbuzz) [1..50] |
This file contains 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 FizzBuzz where | |
import Data.Maybe | |
data FizzBuzz = Fizz | Buzz deriving Show | |
whenDivisible :: Integral a => a -> b -> a -> Maybe b | |
whenDivisible d x n = if n `rem` d == 0 then Just x else Nothing | |
fizzbuzz :: (Show a, Integral a) => a -> String | |
fizzbuzz n = if null tags then show n else concatMap show tags |
This file contains 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 FizzBuzz where | |
data FizzBuzz = Fizz | Buzz | FizzBuzz deriving Show | |
fizzbuzz :: Integral a => a -> Either FizzBuzz a | |
fizzbuzz n = case (n `rem` 3, n `rem` 5) of | |
(0, 0) -> Left FizzBuzz | |
(0, _) -> Left Fizz | |
(_, 0) -> Left Buzz | |
_ -> Right n |
This file contains 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
11/04/2014 10:49:11.070 SystemUIServer[10295]: Could not load menu extra NSBundle </Library/Application Support/iStat Menus 4/extras/iStatMenusMemory.menu> (not yet loaded) for Class (null) | |
11/04/2014 10:49:11.071 SystemUIServer[10295]: Cannot find executable for CFBundle 0x7f9bf255df80 </Library/Application Support/iStat Menus 4/extras/iStatMenusDrives.menu> (not loaded) | |
11/04/2014 10:49:11.071 SystemUIServer[10295]: Could not load menu extra NSBundle </Library/Application Support/iStat Menus 4/extras/iStatMenusDrives.menu> (not yet loaded) for Class (null) | |
11/04/2014 10:49:11.463 iStatMenusAgent[10329]: Loading istat menus agent | |
11/04/2014 10:49:11.463 iStatMenusAgent[10329]: iStat Menus Agent version 4.21 (450) | |
11/04/2014 10:49:11.514 iStatMenusAgent[10329]: iStat Menus Agent - Update checker enabled | |
11/04/2014 10:49:54.681 SystemUIServer[160]: Cannot find executable for CFBundle 0x7f8dca5181d0 </Library/Application Support/iStat Menus 4/extras/MenuCracker.menu> (not loaded) | |
11/04/2014 10:49:54.682 SystemU |
This file contains 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
# See https://github.com/jigish/slate#readme | |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config focusPreferSameApp false | |
config focusCheckWidthMax 3000 | |
config checkDefaultsOnLoad true | |
config windowHintsShowIcons true | |
config windowHintsSpread true |
This file contains 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 SpotifyPack | |
where | |
import qualified Network.URI as URI | |
import Network.HTTP (simpleHTTP, getRequest, getResponseBody) | |
import Data.Aeson (FromJSON, parseJSON, decode, (.:)) | |
import qualified Data.Aeson.Types as T | |
import qualified Data.ByteString.Lazy.Char8 as BSL | |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Monad (mzero) |