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
# Dealing with suspended Merchants and Employees | |
We need just one, maybe two decisions: | |
(1) When somebody activates the _employees_ feature toggle in the BO, should the | |
system create {Employee}s for suspended {Merchant}s? Yes or No? | |
**Notes** | |
(a) I want to make it clear that all {Employee}s are shown in the table in | |
the backend - no exceptions. This can not be changed. | |
(b) The assigned {Employee}s' assigned {Merchant}s are already filtered, |
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
#!/usr/bin/env runhaskell | |
-- | |
-- ## Prerequisites | |
-- | |
-- ```shell | |
-- $ brew install ghc | |
-- $ brew install cabal-install | |
-- $ cabal install shelly | |
-- ``` |
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
.highlight { | |
background-color: #073642; | |
color: #93a1a1; | |
& .c { color: #586e75 !important; font-style: italic !important; } | |
& .cm { color: #586e75 !important; font-style: italic !important; } | |
& .cp { color: #586e75 !important; font-style: italic !important; } | |
& .c1 { color: #586e75 !important; font-style: italic !important; } | |
& .cs { color: #586e75 !important; font-weight: bold !important; font-style: italic !important; } | |
& .err { color: #dc322f !important; background: none !important; } | |
& .k { color:#cb4b16 !important; } |
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 Text.Parsec.Custom (many1Till) where | |
import Control.Monad | |
import Text.Parsec.Prim | |
import Text.Parsec.Combinator | |
many1Till :: (Stream s m t, Show end) => ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a] | |
many1Till p end = do | |
notFollowedBy end | |
first <- p | |
rest <- manyTill p end |
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
require "rubygems" | |
gem "activesupport" | |
require "active_support/all" | |
def manhattenDistance objectA, objectB | |
return (objectA.first - objectB.first).abs + (objectA.second - objectB.second).abs | |
end | |
def allInterClusterObjectDistances clusterA, clusterB | |
distances = [] |
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 | |
------------------------------------------------------------------------ | |
-- k Nearest Neighbor Algorithm | |
------------------------------------------------------------------------ | |
type Distance = Double | |
class FeatureVector fv where | |
dist :: fv -> fv -> Distance |
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 qualified Data.List as List | |
import qualified Data.Set as Set | |
import Test.HUnit | |
main :: IO () | |
main = do { runTestTT allTests ; return () } |