code
stringlengths 5
1.03M
| repo_name
stringlengths 5
90
| path
stringlengths 4
158
| license
stringclasses 15
values | size
int64 5
1.03M
| n_ast_errors
int64 0
53.9k
| ast_max_depth
int64 2
4.17k
| n_whitespaces
int64 0
365k
| n_ast_nodes
int64 3
317k
| n_ast_terminals
int64 1
171k
| n_ast_nonterminals
int64 1
146k
| loc
int64 -1
37.3k
| cycloplexity
int64 -1
1.31k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE DataKinds #-}
module Main where
import Data.Default
import Text.Haiji
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.Text.Lazy.IO as LT
main :: IO ()
main = LT.putStr
$ render $(haijiFile def "example.tmpl")
$ [key|a_variable|] ("Hello,World!" :: T.Text) `merge`
[key|navigation|] [ [key|caption|] cap `merge` [key|href|] href
| (cap, href) <- [ ("A", "content/a.html")
, ("B", "content/b.html")
] :: [ (T.Text, T.Text) ]
] `merge`
[key|foo|] (1 :: Int) `merge`
[key|bar|] ("" :: String)
| notogawa/haiji | example.hs | bsd-3-clause | 828 | 0 | 14 | 275 | 219 | 143 | 76 | 21 | 1 |
-- | UI of inventory management.
module Game.LambdaHack.Client.UI.InventoryM
( Suitability(..), ResultItemDialogMode(..)
, getFull, getGroupItem, getStoreItem
, skillCloseUp, placeCloseUp, factionCloseUp
#ifdef EXPOSE_INTERNAL
-- * Internal operations
, ItemDialogState(..), accessModeBag, storeItemPrompt, getItem
, DefItemKey(..), transition
, runDefMessage, runDefAction, runDefSkills, skillsInRightPane
, runDefPlaces, placesInRightPane
, runDefFactions, factionsInRightPane
, runDefModes, runDefInventory
#endif
) where
import Prelude ()
import Game.LambdaHack.Core.Prelude
import Data.Either
import qualified Data.EnumMap.Strict as EM
import qualified Data.EnumSet as ES
import Data.Function
import qualified Data.Text as T
import qualified NLP.Miniutter.English as MU
import Game.LambdaHack.Client.MonadClient
import Game.LambdaHack.Client.State
import Game.LambdaHack.Client.UI.ActorUI
import Game.LambdaHack.Client.UI.Content.Screen
import Game.LambdaHack.Client.UI.ContentClientUI
import Game.LambdaHack.Client.UI.EffectDescription
import Game.LambdaHack.Client.UI.HandleHelperM
import Game.LambdaHack.Client.UI.HumanCmd
import qualified Game.LambdaHack.Client.UI.Key as K
import Game.LambdaHack.Client.UI.MonadClientUI
import Game.LambdaHack.Client.UI.Msg
import Game.LambdaHack.Client.UI.MsgM
import Game.LambdaHack.Client.UI.Overlay
import Game.LambdaHack.Client.UI.SessionUI
import Game.LambdaHack.Client.UI.Slideshow
import Game.LambdaHack.Client.UI.SlideshowM
import Game.LambdaHack.Common.Actor
import Game.LambdaHack.Common.ActorState
import Game.LambdaHack.Common.ClientOptions
import Game.LambdaHack.Common.Faction
import qualified Game.LambdaHack.Common.Faction as Faction
import Game.LambdaHack.Common.Item
import Game.LambdaHack.Common.Kind
import Game.LambdaHack.Common.Misc
import Game.LambdaHack.Common.MonadStateRead
import Game.LambdaHack.Common.State
import Game.LambdaHack.Common.Types
import qualified Game.LambdaHack.Content.FactionKind as FK
import qualified Game.LambdaHack.Content.ItemKind as IK
import qualified Game.LambdaHack.Content.PlaceKind as PK
import qualified Game.LambdaHack.Definition.Ability as Ability
import qualified Game.LambdaHack.Definition.Color as Color
import Game.LambdaHack.Definition.Defs
data ItemDialogState = ISuitable | IAll
deriving (Show, Eq)
data ResultItemDialogMode =
RStore CStore [ItemId]
| ROwned ItemId
| RLore SLore MenuSlot [(ItemId, ItemQuant)]
| RSkills MenuSlot
| RPlaces MenuSlot
| RFactions MenuSlot
| RModes MenuSlot
deriving Show
accessModeBag :: ActorId -> State -> ItemDialogMode -> ItemBag
accessModeBag leader s (MStore cstore) = let b = getActorBody leader s
in getBodyStoreBag b cstore s
accessModeBag leader s MOwned = let fid = bfid $ getActorBody leader s
in combinedItems fid s
accessModeBag _ _ MSkills = EM.empty
accessModeBag leader s (MLore SBody) = let b = getActorBody leader s
in getBodyStoreBag b COrgan s
accessModeBag _ s MLore{} = EM.map (const quantSingle) $ sitemD s
accessModeBag _ _ MPlaces = EM.empty
accessModeBag _ _ MFactions = EM.empty
accessModeBag _ _ MModes = EM.empty
-- | Let a human player choose any item from a given group.
-- Note that this does not guarantee the chosen item belongs to the group,
-- as the player can override the choice.
-- Used e.g., for applying and projecting.
getGroupItem :: MonadClientUI m
=> ActorId
-> m Suitability
-- ^ which items to consider suitable
-> Text -- ^ specific prompt for only suitable items
-> Text -- ^ generic prompt
-> Text -- ^ the verb to use
-> Text -- ^ the generic verb to use
-> [CStore] -- ^ stores to cycle through
-> m (Either Text (CStore, ItemId))
getGroupItem leader psuit prompt promptGeneric verb verbGeneric stores = do
side <- getsClient sside
mstash <- getsState $ \s -> gstash $ sfactionD s EM.! side
let ppItemDialogBody v body actorSk cCur = case cCur of
MStore CEqp | not $ calmEnough body actorSk ->
"distractedly attempt to" <+> v <+> ppItemDialogModeIn cCur
MStore CGround | mstash == Just (blid body, bpos body) ->
"greedily attempt to" <+> v <+> ppItemDialogModeIn cCur
_ -> v <+> ppItemDialogModeFrom cCur
soc <- getFull leader psuit
(\body _ actorSk cCur _ ->
prompt <+> ppItemDialogBody verb body actorSk cCur)
(\body _ actorSk cCur _ ->
promptGeneric
<+> ppItemDialogBody verbGeneric body actorSk cCur)
stores True False
case soc of
Left err -> return $ Left err
Right (rstore, [(iid, _)]) -> return $ Right (rstore, iid)
Right _ -> error $ "" `showFailure` soc
-- | Display all items from a store and let the human player choose any
-- or switch to any other store.
-- Used, e.g., for viewing inventory and item descriptions.
getStoreItem :: MonadClientUI m
=> ActorId -- ^ the pointman
-> ItemDialogMode -- ^ initial mode
-> m (Either Text ResultItemDialogMode)
getStoreItem leader cInitial = do
side <- getsClient sside
let -- No @COrgan@, because triggerable organs are rare and,
-- if really needed, accessible directly from the trigger menu.
itemCs = map MStore [CStash, CEqp, CGround]
-- This should match, including order, the items in standardKeysAndMouse
-- marked with CmdDashboard up to @MSkills@.
leaderCs = itemCs ++ [MOwned, MLore SBody, MSkills]
-- No @SBody@, because repeated in other lores and included elsewhere.
itemLoreCs = map MLore [minBound..SEmbed]
-- This should match, including order, the items in standardKeysAndMouse
-- marked with CmdDashboard past @MSkills@ and up to @MModes@.
loreCs = itemLoreCs ++ [MPlaces, MFactions, MModes]
let !_A1 = assert (null (leaderCs `intersect` loreCs)) ()
!_A2 = assert (sort (leaderCs ++ loreCs ++ [MStore COrgan])
== map MStore [minBound..maxBound]
++ [MOwned, MSkills]
++ map MLore [minBound..maxBound]
++ [MPlaces, MFactions, MModes]) ()
allCs | cInitial `elem` leaderCs = leaderCs
| cInitial `elem` loreCs = loreCs
| otherwise = assert (cInitial == MStore COrgan) leaderCs
-- werrd content, but let it be
(pre, rest) = break (== cInitial) allCs
post = dropWhile (== cInitial) rest
remCs = post ++ pre
prompt = storeItemPrompt side
getItem leader (return SuitsEverything) prompt prompt cInitial remCs
True False
storeItemPrompt :: FactionId
-> Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text
storeItemPrompt side body bodyUI actorCurAndMaxSk c2 s =
let COps{coitem} = scops s
fact = sfactionD s EM.! side
(tIn, t) = ppItemDialogMode c2
subject = partActor bodyUI
f (k, _) acc = k + acc
countItems store = EM.foldr' f 0 $ getBodyStoreBag body store s
in case c2 of
MStore CGround ->
let n = countItems CGround
nItems = MU.CarAWs n "item"
verbGround = if gstash fact == Just (blid body, bpos body)
then "fondle greedily"
else "notice"
in makePhrase
[ MU.Capitalize $ MU.SubjectVerbSg subject verbGround
, nItems, "at"
, MU.WownW (MU.Text $ bpronoun bodyUI) $ MU.Text "feet" ]
MStore CEqp ->
let n = countItems CEqp
(verbEqp, nItems) =
if | n == 0 -> ("find nothing", "")
| calmEnough body actorCurAndMaxSk ->
("find", MU.CarAWs n "item")
| otherwise -> ("paw distractedly at", MU.CarAWs n "item")
in makePhrase
[ MU.Capitalize $ MU.SubjectVerbSg subject verbEqp
, nItems, MU.Text tIn
, MU.WownW (MU.Text $ bpronoun bodyUI) $ MU.Text t ]
MStore cstore ->
let n = countItems cstore
nItems = MU.CarAWs n "item"
(verb, onLevel) = case cstore of
COrgan -> ("feel", [])
CStash ->
( "notice"
, case gstash fact of
Just (lid, _) ->
map MU.Text ["on level", tshow $ abs $ fromEnum lid]
Nothing -> [] )
ownObject = case cstore of
CStash -> ["our", MU.Text t]
_ -> [MU.WownW (MU.Text $ bpronoun bodyUI) $ MU.Text t]
in makePhrase $
[ MU.Capitalize $ MU.SubjectVerbSg subject verb
, nItems, MU.Text tIn ] ++ ownObject ++ onLevel
MOwned ->
-- We assume "gold grain", not "grain" with label "of gold":
let currencyName = IK.iname $ okind coitem
$ ouniqGroup coitem IK.S_CURRENCY
dungeonTotal = sgold s
(_, total) = calculateTotal side s
in T.init $ spoilsBlurb currencyName total dungeonTotal
-- no space for more, e.g., the pointman, but it can't be changed anyway
MSkills ->
makePhrase
[ MU.Capitalize $ MU.SubjectVerbSg subject "estimate"
, MU.WownW (MU.Text $ bpronoun bodyUI) $ MU.Text t ]
MLore SBody ->
makePhrase
[ MU.Capitalize $ MU.SubjectVerbSg subject "feel"
, MU.Text tIn
, MU.WownW (MU.Text $ bpronoun bodyUI) $ MU.Text t ]
MLore slore ->
makePhrase
[ MU.Capitalize $ MU.Text $
if slore == SEmbed
then "terrain (including crafting recipes)"
else t ]
MPlaces ->
makePhrase
[ MU.Capitalize $ MU.Text t ]
MFactions ->
makePhrase
[ MU.Capitalize $ MU.Text t ]
MModes ->
makePhrase
[ MU.Capitalize $ MU.Text t ]
-- | Let the human player choose a single, preferably suitable,
-- item from a list of items. Don't display stores empty for all actors.
-- Start with a non-empty store.
getFull :: MonadClientUI m
=> ActorId
-> m Suitability -- ^ which items to consider suitable
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text) -- ^ specific prompt for only suitable items
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text) -- ^ generic prompt
-> [CStore] -- ^ stores to cycle through
-> Bool -- ^ whether to ask, when the only item
-- in the starting mode is suitable
-> Bool -- ^ whether to permit multiple items as a result
-> m (Either Text (CStore, [(ItemId, ItemQuant)]))
getFull leader psuit prompt promptGeneric stores askWhenLone permitMulitple = do
mpsuit <- psuit
let psuitFun = case mpsuit of
SuitsEverything -> \_ _ _ -> True
SuitsSomething f -> f
-- Move the first store that is non-empty for suitable items for this actor
-- to the front, if any.
b <- getsState $ getActorBody leader
getCStoreBag <- getsState $ \s cstore -> getBodyStoreBag b cstore s
let hasThisActor = not . EM.null . getCStoreBag
case filter hasThisActor stores of
[] -> do
let dialogModes = map MStore stores
ts = map (MU.Text . ppItemDialogModeIn) dialogModes
return $ Left $ "no items" <+> makePhrase [MU.WWxW "nor" ts]
haveThis@(headThisActor : _) -> do
itemToF <- getsState $ flip itemToFull
let suitsThisActor store =
let bag = getCStoreBag store
in any (\(iid, kit) -> psuitFun (Just store) (itemToF iid) kit)
(EM.assocs bag)
firstStore = fromMaybe headThisActor $ find suitsThisActor haveThis
-- Don't display stores totally empty for all actors.
breakStores cInit =
let (pre, rest) = break (== cInit) stores
post = dropWhile (== cInit) rest
in (MStore cInit, map MStore $ post ++ pre)
(modeFirst, modeRest) = breakStores firstStore
res <- getItem leader psuit prompt promptGeneric modeFirst modeRest
askWhenLone permitMulitple
case res of
Left t -> return $ Left t
Right (RStore fromCStore iids) -> do
let bagAll = getCStoreBag fromCStore
f iid = (iid, bagAll EM.! iid)
return $ Right (fromCStore, map f iids)
Right _ -> error $ "" `showFailure` res
-- | Let the human player choose a single, preferably suitable,
-- item from a list of items.
getItem :: MonadClientUI m
=> ActorId
-> m Suitability -- ^ which items to consider suitable
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text) -- ^ specific prompt for only suitable items
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text) -- ^ generic prompt
-> ItemDialogMode -- ^ first mode to display
-> [ItemDialogMode] -- ^ the (rest of) modes
-> Bool -- ^ whether to ask, when the only item
-- in the starting mode is suitable
-> Bool -- ^ whether to permit multiple items as a result
-> m (Either Text ResultItemDialogMode)
getItem leader psuit prompt promptGeneric cCur cRest askWhenLone
permitMulitple = do
accessCBag <- getsState $ accessModeBag leader
let storeAssocs = EM.assocs . accessCBag
allAssocs = concatMap storeAssocs (cCur : cRest)
case (allAssocs, cCur) of
([(iid, _)], MStore rstore) | null cRest && not askWhenLone ->
return $ Right $ RStore rstore [iid]
_ -> transition leader psuit prompt promptGeneric permitMulitple
cCur cRest ISuitable
data DefItemKey m = DefItemKey
{ defLabel :: Either Text K.KM
, defCond :: Bool
, defAction :: ~(m (Either Text ResultItemDialogMode))
-- this field may be expensive or undefined when @defCond@ is false
}
data Suitability =
SuitsEverything
| SuitsSomething (Maybe CStore -> ItemFull -> ItemQuant -> Bool)
transition :: forall m. MonadClientUI m
=> ActorId
-> m Suitability
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text)
-> (Actor -> ActorUI -> Ability.Skills -> ItemDialogMode -> State
-> Text)
-> Bool
-> ItemDialogMode
-> [ItemDialogMode]
-> ItemDialogState
-> m (Either Text ResultItemDialogMode)
transition leader psuit prompt promptGeneric permitMulitple
cCur cRest itemDialogState = do
let recCall cCur2 cRest2 itemDialogState2 = do
-- Pointman could have been changed by keypresses near the end of
-- the current recursive call, so refresh it for the next call.
mleader <- getsClient sleader
-- When run inside a test, without mleader, assume leader not changed.
let leader2 = fromMaybe leader mleader
transition leader2 psuit prompt promptGeneric permitMulitple
cCur2 cRest2 itemDialogState2
actorCurAndMaxSk <- getsState $ getActorMaxSkills leader
body <- getsState $ getActorBody leader
bodyUI <- getsSession $ getActorUI leader
fact <- getsState $ (EM.! bfid body) . sfactionD
hs <- partyAfterLeader leader
revCmd <- revCmdMap
promptChosen <- getsState $ \s -> case itemDialogState of
ISuitable -> prompt body bodyUI actorCurAndMaxSk cCur s <> ":"
IAll -> promptGeneric body bodyUI actorCurAndMaxSk cCur s <> ":"
let keyDefsCommon :: [(K.KM, DefItemKey m)]
keyDefsCommon = filter (defCond . snd)
[ let km = K.mkChar '<'
in (km, changeContainerDef Backward $ Right km)
, let km = K.mkChar '>'
in (km, changeContainerDef Forward $ Right km)
, cycleKeyDef Forward
, cycleKeyDef Backward
, cycleLevelKeyDef Forward
, cycleLevelKeyDef Backward
, (K.KM K.NoModifier K.LeftButtonRelease, DefItemKey
{ defLabel = Left ""
, defCond = maySwitchLeader cCur && not (null hs)
, defAction = do
-- This is verbose even in aiming mode, displaying
-- terrain description, but it's fine, mouse may do that.
merror <- pickLeaderWithPointer leader
case merror of
Nothing -> recCall cCur cRest itemDialogState
Just{} -> return $ Left "not a menu item nor teammate position"
-- don't inspect the error, it's expected
})
, (K.escKM, DefItemKey
{ defLabel = Right K.escKM
, defCond = True
, defAction = return $ Left "never mind"
})
]
cycleLevelKeyDef direction =
let km = revCmd $ PointmanCycleLevel direction
in (km, DefItemKey
{ defLabel = Left ""
, defCond = maySwitchLeader cCur
&& any (\(_, b, _) -> blid b == blid body) hs
, defAction = do
err <- pointmanCycleLevel leader False direction
let !_A = assert (isNothing err `blame` err) ()
recCall cCur cRest itemDialogState
})
changeContainerDef direction defLabel =
let (cCurAfterCalm, cRestAfterCalm) = nextContainers direction
in DefItemKey
{ defLabel
, defCond = cCurAfterCalm /= cCur
, defAction = recCall cCurAfterCalm cRestAfterCalm itemDialogState
}
nextContainers direction = case direction of
Forward -> case cRest ++ [cCur] of
c1 : rest -> (c1, rest)
[] -> error $ "" `showFailure` cRest
Backward -> case reverse $ cCur : cRest of
c1 : rest -> (c1, reverse rest)
[] -> error $ "" `showFailure` cRest
banned = bannedPointmanSwitchBetweenLevels fact
maySwitchLeader MStore{} = True
maySwitchLeader MOwned = False
maySwitchLeader MSkills = True
maySwitchLeader (MLore SBody) = True
maySwitchLeader MLore{} = False
maySwitchLeader MPlaces = False
maySwitchLeader MFactions = False
maySwitchLeader MModes = False
cycleKeyDef direction =
let km = revCmd $ PointmanCycle direction
in (km, DefItemKey
{ defLabel = if direction == Forward then Right km else Left ""
, defCond = maySwitchLeader cCur && not (banned || null hs)
, defAction = do
err <- pointmanCycle leader False direction
let !_A = assert (isNothing err `blame` err) ()
recCall cCur cRest itemDialogState
})
case cCur of
MSkills -> runDefSkills keyDefsCommon promptChosen leader
MPlaces -> runDefPlaces keyDefsCommon promptChosen
MFactions -> runDefFactions keyDefsCommon promptChosen
MModes -> runDefModes keyDefsCommon promptChosen
_ -> do
bagHuge <- getsState $ \s -> accessModeBag leader s cCur
itemToF <- getsState $ flip itemToFull
mpsuit <- psuit -- when throwing, this sets eps and checks xhair validity
psuitFun <- case mpsuit of
SuitsEverything -> return $ \_ _ _ -> True
SuitsSomething f -> return f -- When throwing, this function takes
-- missile range into accout.
ItemRoles itemRoles <- getsSession sroles
let slore = loreFromMode cCur
itemRole = itemRoles EM.! slore
bagAll = EM.filterWithKey (\iid _ -> iid `ES.member` itemRole) bagHuge
mstore = case cCur of
MStore store -> Just store
_ -> Nothing
filterP = psuitFun mstore . itemToF
bagSuit = EM.filterWithKey filterP bagAll
bagFiltered = case itemDialogState of
ISuitable -> bagSuit
IAll -> bagAll
iids = sortIids itemToF $ EM.assocs bagFiltered
keyDefsExtra =
[ let km = K.mkChar '+'
in (km, DefItemKey
{ defLabel = Right km
, defCond = bagAll /= bagSuit
, defAction = recCall cCur cRest $ case itemDialogState of
ISuitable -> IAll
IAll -> ISuitable
})
, let km = K.mkChar '*'
in (km, useMultipleDef $ Right km)
, let km = K.mkChar '!'
in (km, useMultipleDef $ Left "") -- alias close to 'g'
]
useMultipleDef defLabel = DefItemKey
{ defLabel
, defCond = permitMulitple && not (null iids)
, defAction = case cCur of
MStore rstore -> return $! Right $ RStore rstore $ map fst iids
_ -> error "transition: multiple items not for MStore"
}
keyDefs = keyDefsCommon ++ filter (defCond . snd) keyDefsExtra
runDefInventory keyDefs promptChosen leader cCur iids
runDefMessage :: MonadClientUI m
=> [(K.KM, DefItemKey m)]
-> Text
-> m ()
runDefMessage keyDefs prompt = do
let wrapB s = "[" <> s <> "]"
keyLabelsRaw = lefts $ map (defLabel . snd) keyDefs
keyLabels = filter (not . T.null) keyLabelsRaw
choice = T.intercalate " " $ map wrapB $ nub keyLabels
-- switch to Data.Containers.ListUtils.nubOrd when we drop GHC 8.4.4
msgAdd MsgPromptGeneric $ prompt <+> choice
runDefAction :: MonadClientUI m
=> [(K.KM, DefItemKey m)]
-> (MenuSlot -> Either Text ResultItemDialogMode)
-> KeyOrSlot
-> m (Either Text ResultItemDialogMode)
runDefAction keyDefs slotDef ekm = case ekm of
Left km -> case km `lookup` keyDefs of
Just keyDef -> defAction keyDef
Nothing -> error $ "unexpected key:" `showFailure` K.showKM km
Right slot -> return $! slotDef slot
runDefSkills :: MonadClientUI m
=> [(K.KM, DefItemKey m)] -> Text -> ActorId
-> m (Either Text ResultItemDialogMode)
runDefSkills keyDefsCommon promptChosen leader = do
CCUI{coscreen=ScreenContent{rheight}} <- getsSession sccui
runDefMessage keyDefsCommon promptChosen
let itemKeys = map fst keyDefsCommon
keys = rights $ map (defLabel . snd) keyDefsCommon
okx <- skillsOverlay leader
sli <- overlayToSlideshow (rheight - 2) keys okx
ekm <- displayChoiceScreenWithDefItemKey
(skillsInRightPane leader) sli itemKeys (show MSkills)
runDefAction keyDefsCommon (Right . RSkills) ekm
skillsInRightPane :: MonadClientUI m => ActorId -> Int -> MenuSlot -> m OKX
skillsInRightPane leader width slot = do
FontSetup{propFont} <- getFontSetup
(prompt, attrString) <- skillCloseUp leader slot
let promptAS | T.null prompt = []
| otherwise = textFgToAS Color.Brown $ prompt <> "\n\n"
ov = EM.singleton propFont $ offsetOverlay
$ splitAttrString width width
$ promptAS ++ attrString
return (ov, [])
runDefPlaces :: MonadClientUI m
=> [(K.KM, DefItemKey m)] -> Text
-> m (Either Text ResultItemDialogMode)
runDefPlaces keyDefsCommon promptChosen = do
COps{coplace} <- getsState scops
CCUI{coscreen=ScreenContent{rheight}} <- getsSession sccui
soptions <- getsClient soptions
places <- getsState $ EM.assocs
. placesFromState coplace (sexposePlaces soptions)
runDefMessage keyDefsCommon promptChosen
let itemKeys = map fst keyDefsCommon
keys = rights $ map (defLabel . snd) keyDefsCommon
okx <- placesOverlay
sli <- overlayToSlideshow (rheight - 2) keys okx
ekm <- displayChoiceScreenWithDefItemKey
(placesInRightPane places) sli itemKeys (show MPlaces)
runDefAction keyDefsCommon (Right . RPlaces) ekm
placesInRightPane :: MonadClientUI m
=> [( ContentId PK.PlaceKind
, (ES.EnumSet LevelId, Int, Int, Int) )]
-> Int -> MenuSlot
-> m OKX
placesInRightPane places width slot = do
FontSetup{propFont} <- getFontSetup
soptions <- getsClient soptions
(prompt, blurbs) <- placeCloseUp places (sexposePlaces soptions) slot
let promptAS | T.null prompt = []
| otherwise = textFgToAS Color.Brown $ prompt <> "\n\n"
splitText = splitAttrString width width
ov = attrLinesToFontMap
$ map (second $ concatMap splitText)
$ (propFont, [promptAS]) : blurbs
return (ov, [])
runDefFactions :: MonadClientUI m
=> [(K.KM, DefItemKey m)] -> Text
-> m (Either Text ResultItemDialogMode)
runDefFactions keyDefsCommon promptChosen = do
CCUI{coscreen=ScreenContent{rheight}} <- getsSession sccui
sroles <- getsSession sroles
factions <- getsState $ factionsFromState sroles
runDefMessage keyDefsCommon promptChosen
let itemKeys = map fst keyDefsCommon
keys = rights $ map (defLabel . snd) keyDefsCommon
okx <- factionsOverlay
sli <- overlayToSlideshow (rheight - 2) keys okx
ekm <- displayChoiceScreenWithDefItemKey
(factionsInRightPane factions)
sli itemKeys (show MFactions)
runDefAction keyDefsCommon (Right . RFactions) ekm
factionsInRightPane :: MonadClientUI m
=> [(FactionId, Faction)]
-> Int -> MenuSlot
-> m OKX
factionsInRightPane factions width slot = do
FontSetup{propFont} <- getFontSetup
(prompt, blurbs) <- factionCloseUp factions slot
let promptAS | T.null prompt = []
| otherwise = textFgToAS Color.Brown $ prompt <> "\n\n"
splitText = splitAttrString width width
ov = attrLinesToFontMap
$ map (second $ concatMap splitText)
$ (propFont, [promptAS]) : blurbs
return (ov, [])
runDefModes :: MonadClientUI m
=> [(K.KM, DefItemKey m)] -> Text
-> m (Either Text ResultItemDialogMode)
runDefModes keyDefsCommon promptChosen = do
CCUI{coscreen=ScreenContent{rheight}} <- getsSession sccui
runDefMessage keyDefsCommon promptChosen
let itemKeys = map fst keyDefsCommon
keys = rights $ map (defLabel . snd) keyDefsCommon
okx <- modesOverlay
sli <- overlayToSlideshow (rheight - 2) keys okx
-- Modes would cover the whole screen, so we don't display in right pane.
-- But we display and highlight menu bullets.
ekm <- displayChoiceScreenWithDefItemKey
(\_ _ -> return emptyOKX) sli itemKeys (show MModes)
runDefAction keyDefsCommon (Right . RModes) ekm
runDefInventory :: MonadClientUI m
=> [(K.KM, DefItemKey m)]
-> Text
-> ActorId
-> ItemDialogMode
-> [(ItemId, ItemQuant)]
-> m (Either Text ResultItemDialogMode)
runDefInventory keyDefs promptChosen leader dmode iids = do
CCUI{coscreen=ScreenContent{rheight}} <- getsSession sccui
actorCurAndMaxSk <- getsState $ getActorMaxSkills leader
let meleeSkill = Ability.getSk Ability.SkHurtMelee actorCurAndMaxSk
slotDef :: MenuSlot -> Either Text ResultItemDialogMode
slotDef slot =
let iid = fst $ iids !! fromEnum slot
in Right $ case dmode of
MStore rstore -> RStore rstore [iid]
MOwned -> ROwned iid
MLore rlore -> RLore rlore slot iids
_ -> error $ "" `showFailure` dmode
promptFun _iid _itemFull _k = ""
-- TODO, e.g., if the party still owns any copies, if the actor
-- was ever killed by us or killed ours, etc.
-- This can be the same prompt or longer than what entering
-- the item screen shows.
runDefMessage keyDefs promptChosen
let itemKeys = map fst keyDefs
keys = rights $ map (defLabel . snd) keyDefs
okx <- itemOverlay iids dmode
sli <- overlayToSlideshow (rheight - 2) keys okx
ekm <- displayChoiceScreenWithDefItemKey
(okxItemLoreInline promptFun meleeSkill dmode iids)
sli itemKeys (show dmode)
runDefAction keyDefs slotDef ekm
skillCloseUp :: MonadClientUI m => ActorId -> MenuSlot -> m (Text, AttrString)
skillCloseUp leader slot = do
b <- getsState $ getActorBody leader
bUI <- getsSession $ getActorUI leader
actorCurAndMaxSk <- getsState $ getActorMaxSkills leader
let skill = skillsInDisplayOrder !! fromEnum slot
valueText = skillToDecorator skill b
$ Ability.getSk skill actorCurAndMaxSk
prompt = makeSentence
[ MU.WownW (partActor bUI) (MU.Text $ skillName skill)
, "is", MU.Text valueText ]
attrString = textToAS $ skillDesc skill
return (prompt, attrString)
placeCloseUp :: MonadClientUI m
=> [(ContentId PK.PlaceKind, (ES.EnumSet LevelId, Int, Int, Int))]
-> Bool
-> MenuSlot
-> m (Text, [(DisplayFont, [AttrString])])
placeCloseUp places sexposePlaces slot = do
COps{coplace} <- getsState scops
FontSetup{..} <- getFontSetup
let (pk, (es, ne, na, _)) = places !! fromEnum slot
pkind = okind coplace pk
prompt = makeSentence ["you remember", MU.Text $ PK.pname pkind]
freqsText = "Frequencies:" <+> T.intercalate " "
(map (\(grp, n) -> "(" <> displayGroupName grp
<> ", " <> tshow n <> ")")
$ PK.pfreq pkind)
onLevels | ES.null es = []
| otherwise = [makeSentence
[ "Appears on"
, MU.CarWs (ES.size es) "level" <> ":"
, MU.WWandW $ map MU.Car $ sort
$ map (abs . fromEnum) $ ES.elems es ]]
placeParts = ["it has" | ne > 0 || na > 0]
++ [MU.CarWs ne "entrance" | ne > 0]
++ ["and" | ne > 0 && na > 0]
++ [MU.CarWs na "surrounding" | na > 0]
partsSentence | null placeParts = []
| otherwise = [makeSentence placeParts, "\n"]
blurbs = [(propFont, partsSentence)]
++ [(monoFont, [freqsText, "\n"]) | sexposePlaces]
++ [(squareFont, PK.ptopLeft pkind ++ ["\n"]) | sexposePlaces]
++ [(propFont, onLevels)]
return (prompt, map (second $ map textToAS) blurbs)
factionCloseUp :: MonadClientUI m
=> [(FactionId, Faction)]
-> MenuSlot
-> m (Text, [(DisplayFont, [AttrString])])
factionCloseUp factions slot = do
side <- getsClient sside
FontSetup{propFont} <- getFontSetup
factionD <- getsState sfactionD
let (fid, fact@Faction{gkind=FK.FactionKind{..}, ..}) =
factions !! fromEnum slot
(name, person) = if fhasGender -- but we ignore "Controlled", etc.
then (makePhrase [MU.Ws $ MU.Text fname], MU.PlEtc)
else (fname, MU.Sg3rd)
(youThey, prompt) =
if fid == side
then ("You", makeSentence ["you are the", MU.Text name])
else ("They", makeSentence ["you are wary of the", MU.Text name])
-- wary even if the faction is allied
ts1 =
-- Display only the main groups, not to spam.
case map fst $ filter ((>= 100) . snd) fgroups of
[] -> [] -- only initial actors in the faction?
[fgroup] ->
[makeSentence [ "the faction consists of"
, MU.Ws $ MU.Text $ displayGroupName fgroup ]]
grps -> [makeSentence
[ "the faction attracts members such as:"
, MU.WWandW $ map (MU.Text . displayGroupName) grps ]]
++ [if fskillsOther == Ability.zeroSkills -- simplified
then youThey <+> "don't care about each other and crowd and stampede all at once, sometimes brutally colliding by accident."
else youThey <+> "pay attention to each other and take care to move one at a time."]
++ [ if fcanEscape
then "The faction is able to take part in races to an area exit."
else "The faction doesn't escape areas of conflict and attempts to block exits instead."]
++ [ "When all members are incapacitated, the faction dissolves."
| fneverEmpty ]
++ [if fhasGender
then "Its members are known to have sexual dimorphism and use gender pronouns."
else "Its members seem to prefer naked ground for sleeping."]
++ [ "Its ranks swell with time."
| fspawnsFast ]
++ [ "The faction is able to maintain activity on a level on its own, with a pointman coordinating each tactical maneuver."
| fhasPointman ]
-- Changes to all of these have visibility @PosAll@, so the player
-- knows them fully, except for @gvictims@, which is coupled to tracking
-- other factions' actors and so only incremented when we've seen
-- their actor killed (mostly likely killed by us).
ts2 = -- reporting regardless of whether any of the factions are dead
let renderDiplGroup [] = error "renderDiplGroup: null"
renderDiplGroup ((fid2, diplomacy) : rest) = MU.Phrase
[ MU.Text $ tshowDiplomacy diplomacy
, "with"
, MU.WWandW $ map renderFact2 $ fid2 : map fst rest ]
renderFact2 fid2 = MU.Text $ Faction.gname (factionD EM.! fid2)
valid (fid2, diplomacy) = isJust (lookup fid2 factions)
&& diplomacy /= Unknown
knownAssocsGroups = groupBy ((==) `on` snd) $ sortOn snd
$ filter valid $ EM.assocs gdipl
in [ makeSentence [ MU.SubjectVerb person MU.Yes (MU.Text name) "be"
, MU.WWandW $ map renderDiplGroup knownAssocsGroups ]
| not (null knownAssocsGroups) ]
ts3 =
case gquit of
Just Status{..} | not $ isHorrorFact fact ->
["The faction has already" <+> FK.nameOutcomePast stOutcome
<+> "around level" <+> tshow (abs stDepth) <> "."]
_ -> []
++ let nkilled = sum $ EM.elems gvictims
personKilled = if nkilled == 1 then MU.Sg3rd else MU.PlEtc
in [ makeSentence $
[ "so far," | isNothing gquit ]
++ [ "at least"
, MU.CardinalWs nkilled "member"
, MU.SubjectVerb personKilled
MU.Yes
"of this faction"
"have been incapacitated" ]
| nkilled > 0 ]
++ let adjective = if isNothing gquit then "current" else "last"
verb = if isNothing gquit then "is" else "was"
in ["Its" <+> adjective <+> "doctrine" <+> verb
<+> "'" <> Ability.nameDoctrine gdoctrine
<> "' (" <> Ability.describeDoctrine gdoctrine <> ")."]
-- Description of the score polynomial would go into a separate section,
-- but it's hard to make it sound non-technical enough.
blurbs = intersperse ["\n"] $ filter (not . null) [ts1, ts2, ts3]
return (prompt, map (\t -> (propFont, map textToAS t)) blurbs)
| LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Client/UI/InventoryM.hs | bsd-3-clause | 35,792 | 0 | 26 | 11,144 | 9,273 | 4,763 | 4,510 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
module CommonResources where
import Data.Aeson
import Data.Aeson.TH
import Data.Bits
import Data.Bson.Generic
import Data.Char
import Data.Time
import GHC.Generics
import Servant
authserverport :: String
authserverport = "8083"
authserverhost :: String
authserverhost = "localhost"
dirserverport :: String
dirserverport = "8080"
dirserverhost :: String
dirserverhost = "localhost"
fsserverport :: String
fsserverport = "7007"
fsserverhost :: String
fsserverhost = "localhost"
lockserverport :: String
lockserverport = "8084"
lockserverhost :: String
lockserverhost = "localhost"
transserverhost :: String
transserverhost = "localhost"
transserverport :: String
transserverport = "8085"
type DirectoryApi =
"join" :> ReqBody '[JSON] FileServer :> Post '[JSON] Response :<|>
"open" :> ReqBody '[JSON] FileName :> Post '[JSON] File :<|>
"close" :> ReqBody '[JSON] FileUpload :> Post '[JSON] Response :<|>
"allfiles" :> ReqBody '[JSON] Ticket :> Post '[JSON] [String] :<|>
"remove" :> ReqBody '[JSON] FileName :> Post '[JSON] Response
type AuthApi =
"signin" :> ReqBody '[JSON] Signin :> Post '[JSON] Session :<|>
"register" :> ReqBody '[JSON] Signin :> Post '[JSON] Response
{-} "isvalid" :> ReqBody '[JSON] User :> Post '[JSON] Response :<|>
"extend" :> ReqBody '[JSON] User :> Post '[JSON] Response-}
type FileApi =
"files" :> Get '[JSON] [FilePath] :<|>
"download" :> ReqBody '[JSON] FileName :> Post '[JSON] File :<|>
"upload" :> ReqBody '[JSON] FileUpload :> Post '[JSON] Response :<|>
"delete" :> ReqBody '[JSON] FileName :> Post '[JSON] Response
type LockingApi =
"lock" :> ReqBody '[JSON] FileName :> Post '[JSON] Response :<|>
"unlock" :> ReqBody '[JSON] FileName :> Post '[JSON] Response :<|>
"islocked" :> ReqBody '[JSON] FileName :> Post '[JSON] Response
type TransactionApi =
"begin" :> ReqBody '[JSON] Ticket :> Post '[JSON] Response :<|>
"transDownload" :> ReqBody '[JSON] FileName :> Post '[JSON] File :<|>
"transUpload" :> ReqBody '[JSON] FileUpload :> Post '[JSON] Response :<|>
"transcommit" :> ReqBody '[JSON] Ticket :> Post '[JSON] Response
data File = File {
fileName :: FilePath,
fileContent :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON)
data FileUpload = FileUpload {
futicket :: String,
encTimeout :: String,
encryptedFile :: File
} deriving (Show, Generic, FromJSON, ToJSON)
data FileName = FileName {
fnticket :: String,
fnencryptedTimeout :: String,
encryptedFN :: String
} deriving (Show, Generic, FromJSON, ToJSON)
data Response = Response{
response :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON)
data FileServer = FileServer{
id :: String,
fsaddress :: String,
fsport :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON)
data FileMapping = FileMapping{
fmfileName :: String,
fmaddress :: String,
fmport :: String
} deriving (Eq, Show, Generic,ToJSON, FromJSON, ToBSON, FromBSON)
data Lock = Lock{
lockfileName :: String,
locked :: Bool
} deriving(Eq, Show, Generic, ToBSON, FromBSON)
data Account = Account{
username :: String,
password :: String
} deriving (Show, Generic, FromJSON, ToJSON, FromBSON, ToBSON)
data Session = Session{
encryptedTicket :: String,
encryptedSessionKey :: String,
encryptedTokenTimeout :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON, ToBSON, FromBSON)
data Signin = Signin{
susername :: String,
sencryptedMsg :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON, ToBSON, FromBSON)
data Ticket = Ticket{
ticket :: String,
encryptedTimeout :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON, ToBSON, FromBSON)
data TransactionFile = TransactionFile{
transFileName :: String,
userID :: String
} deriving (Eq, Show, Generic, ToJSON, FromJSON, ToBSON, FromBSON)
deriving instance FromBSON String -- we need these as BSON does not provide
deriving instance ToBSON String
deriving instance FromBSON Bool -- we need these as BSON does not provide
deriving instance ToBSON Bool
encryptDecrypt :: String -> String -> String
encryptDecrypt key text = zipWith (\a b -> chr $ xor (ord a) (ord b)) (cycle key) text
-- XOR each element of the text with a corresponding element of the key
encryptTime :: String -> UTCTime -> String
encryptTime key time = encryptDecrypt key (show(time) :: String)
decryptTime :: String -> String -> UTCTime
decryptTime key text = (read $ encryptDecrypt key text) :: UTCTime
encryptPort :: String -> Int -> String
encryptPort key port = encryptDecrypt key (show(port) :: String)
decryptPort :: String -> String -> Int
decryptPort key text = (read $ encryptDecrypt key text) :: Int
encryptDecryptArray :: String -> [String] -> [String]
encryptDecryptArray key array = do
encryptedArray <- map (encryptDecrypt key) array
return encryptedArray
logMessage :: Bool -> String -> IO()
logMessage logBool message = do
if(logBool) then putStrLn message
else return ()
sharedSecret :: String
sharedSecret = "Maybe I'll complete this project one day" | Garygunn94/DFS | CommonResources/src/CommonResources.hs | bsd-3-clause | 5,480 | 16 | 21 | 1,084 | 1,707 | 926 | 781 | 136 | 2 |
module Main where
import Data.Maybe (isNothing, isJust)
import System.IO
import Network.Socket
import qualified System.Process as SysProc
import qualified System.Process.Internals as SysProcInt (withProcessHandle, ProcessHandle__(..))
import Control.Concurrent.MVar
import qualified System.Posix.Signals as Sig
main :: IO ()
main = do
putStrLn "Starting"
srvSock <- socket AF_INET Stream 0
setSocketOption srvSock ReuseAddr 1
bind srvSock (SockAddrInet 6699 iNADDR_ANY)
listen srvSock 1
runningProcesses <- newMVar []
Sig.installHandler Sig.sigCHLD (Sig.Catch (sigCHLDreaper runningProcesses)) Nothing
sockLoop srvSock runningProcesses
sockLoop :: Socket -> MVar [SysProc.ProcessHandle] -> IO ()
sockLoop srvSock runningProcesses = do
(remoteSock, remoteAddr) <- accept srvSock
putStrLn $ "client connected: " ++ show remoteAddr
hdl <- socketToHandle remoteSock ReadWriteMode
ph <- handleClient hdl
modifyMVar_ runningProcesses (\rp -> return (ph:rp))
modifyMVar_ runningProcesses reapAndPrint
sockLoop srvSock runningProcesses
sigCHLDreaper :: MVar [SysProc.ProcessHandle] -> IO ()
sigCHLDreaper runningProcesses = do
rp <- takeMVar runningProcesses
putStrLn "SIGCHLD"
rp <- reapAndPrint rp
putMVar runningProcesses rp
--Helper, TODO move to lib
reapAndPrint :: [SysProc.ProcessHandle] -> IO [SysProc.ProcessHandle]
reapAndPrint [] = return []
reapAndPrint phs = do
exs <- (mapM SysProc.getProcessExitCode phs)
let handlesAndExitCodes = zip phs exs
putStrLn "Child status:"
mapM_ printExitCode handlesAndExitCodes
--only keep those which have not yet exited
return [ph | (ph, exitcode) <- handlesAndExitCodes, isNothing exitcode]
where printExitCode (ph, Nothing) = getPid ph >>= \s -> putStrLn $ " "++ s ++ " running"
printExitCode (ph, (Just exitcode)) = getPid ph >>= \s -> putStrLn $ " " ++ s ++ " exited: " ++ show exitcode
getPid ph = SysProcInt.withProcessHandle ph (\phint -> case phint of
SysProcInt.OpenHandle h -> return ("[" ++ show h ++ "]")
SysProcInt.ClosedHandle _ -> return "")
handleClient :: Handle -> IO SysProc.ProcessHandle
handleClient hdl = do
putStrLn $ "handle client"
let shProcess = (SysProc.proc "/bin/sh" []){ SysProc.std_in = SysProc.UseHandle hdl,
SysProc.std_out = SysProc.UseHandle hdl,
SysProc.std_err = SysProc.UseHandle hdl,
SysProc.close_fds = True }
(Nothing, Nothing, Nothing, ph) <- SysProc.createProcess shProcess
putStrLn $ "created Process"
return ph
| diekmann/tinyrsh | rsh-impls/hs-idiomatic/tinyrsh/app/Main.hs | bsd-3-clause | 2,836 | 0 | 17 | 751 | 800 | 396 | 404 | 56 | 3 |
{-# LANGUAGE RecursiveDo #-}
-- Example: Analysis of a PERT-type Network
--
-- It is described in different sources [1, 2]. So, this is chapter 14 of [2] and section 7.11 of [1].
--
-- PERT is a technique for evaluating and reviewing a project consisting of
-- interdependent activities. A number of books have been written that describe
-- PERT modeling and analysis procedures. A PERT network activity descriptions
-- are given in a table stated below. All activity times will be assumed to be
-- triangularly distributed. For ease of description, activities have been
-- aggregated. The activities relate to power units, instrumentation, and
-- a new assembly and involve standard types of operations.
--
-- In the following description of the project, activity numbers are given
-- in parentheses. At the beginning of the project, three parallel activities
-- can be performed that involve: the disassembly of power units and
-- instrumentation (1); the installation of a new assembly (2); and
-- the preparation for a retrofit check (3). Cleaning, inspecting, and
-- repairing the power units (4) and calibrating the instrumentation (5)
-- can be done only after the power units and instrumentation have been
-- disassembled. Thus, activities 4 and 5 must follow activity 1 in the network.
-- Following the installation of the new assembly (2) and after the instrumentation
-- have been calibrated (5), a check of interfaces (6) and a check of
-- the new assembly (7) can be made. The retrofit check (9) can be made
-- after the assembly is checked (7) and the preparation for the retrofit
-- check (3) has been completed. The assembly and test of power units (8)
-- can be performed following the cleaning and maintenance of power units (4).
-- The project is considered completed when all nine activities are completed.
-- Since activities 6, 8, and 9 require the other activities to precede them,
-- their completion signifies the end of the project. This is indicated on
-- the network by having activities 6, 8, and 9 incident to node 6, the sink
-- node for the project. The objective of this example is to illustrate
-- the procedures for using Aivika to model and simulate project planning network.
--
-- Activity Description Mode Minimum Maximum Average
--
-- 1 Disassemble power units and instrumentation 3 1 5 3
-- 2 Install new assembly 6 3 9 6
-- 3 Prepare for retrofit check 13 10 19 14
-- 4 Clean, inspect, and repair power units 9 3 12 8
-- 5 Calibrate instrumentation 3 1 8 4
-- 6 Check interfaces 9 8 16 11
-- 7 Check assembly 7 4 13 8
-- 8 Assemble and test power units 6 3 9 6
-- 9 Retrofit check 3 1 8 4
--
-- Node Depends of Activities
--
-- 1 -
-- 2 1
-- 3 2, 5
-- 4 3, 7
-- 5 4
-- 6 6, 8, 9
--
-- Activity Depends on Node
--
-- 1 1
-- 2 1
-- 3 1
-- 4 2
-- 5 2
-- 6 3
-- 7 3
-- 8 5
-- 9 4
--
-- [1] A. Alan B. Pritsker, Simulation with Visual SLAM and AweSim, 2nd ed.
-- [2] Труб И.И., Объектно-ориентированное моделирование на C++: Учебный курс. - СПб.: Питер, 2006
module Model (model) where
import Control.Monad
import Control.Monad.Trans
import Control.Arrow
import Data.Array
import Data.Maybe
import Data.Monoid
import Simulation.Aivika
model :: Simulation Results
model = mdo
timers' <- forM [2..5] $ \i -> newArrivalTimer
projCompletionTimer <- newArrivalTimer
let timers = array (2, 5) $ zip [2..] timers'
p1 = randomTriangularProcessor 1 3 5
p2 = randomTriangularProcessor 3 6 9
p3 = randomTriangularProcessor 10 13 19
p4 = randomTriangularProcessor 3 9 12
p5 = randomTriangularProcessor 1 3 8
p6 = randomTriangularProcessor 8 9 16
p7 = randomTriangularProcessor 4 7 13
p8 = randomTriangularProcessor 3 6 9
p9 = randomTriangularProcessor 1 3 8
let c2 = arrivalTimerProcessor (timers ! 2)
c3 = arrivalTimerProcessor (timers ! 3)
c4 = arrivalTimerProcessor (timers ! 4)
c5 = arrivalTimerProcessor (timers ! 5)
c6 = arrivalTimerProcessor projCompletionTimer
[i1, i2, i3] <- cloneStream 3 n1
[i4, i5] <- cloneStream 2 n2
[i6, i7] <- cloneStream 2 n3
let i9 = n4
i8 = n5
let s1 = runProcessor p1 i1
s2 = runProcessor p2 i2
s3 = runProcessor p3 i3
s4 = runProcessor p4 i4
s5 = runProcessor p5 i5
s6 = runProcessor p6 i6
s7 = runProcessor p7 i7
s8 = runProcessor p8 i8
s9 = runProcessor p9 i9
let n1 = takeStream 1 $ randomStream $ return (0, 0)
n2 = runProcessor c2 s1
n3 = runProcessor c3 $ firstArrivalStream 2 (s2 <> s5)
n4 = runProcessor c4 $ firstArrivalStream 2 (s3 <> s7)
n5 = runProcessor c5 s4
n6 = runProcessor c6 $ firstArrivalStream 3 (s6 <> s8 <> s9)
runProcessInStartTime $ sinkStream n6
return $
results
[resultSource
"timers" "Timers"
timers,
--
resultSource
"projCompletion" "Project Completion Timer"
projCompletionTimer]
modelSummary :: Simulation Results
modelSummary =
fmap resultSummary model
| dsorokin/aivika-experiment-chart | examples/PERT/Model.hs | bsd-3-clause | 5,728 | 0 | 14 | 1,761 | 717 | 397 | 320 | 60 | 1 |
module Graph.MST.Plain where
import qualified Graph.Weighted as W
import qualified Graph.MST.Kruskal
import Graph.Kreisfrei
import Graph.Connected
import Graph.Util
import Autolib.Dot ( peng, Layout_Program (..) )
import Autolib.Graph.Util ( isZusammen , anzKanten , anzKnoten )
import Autolib.Graph.SpanTree ( weight )
import qualified Autolib.Reporter.Set ( eq , subeq )
import Autolib.Hash ( Hash , hash )
import Autolib.FiniteMap ( FiniteMap , listToFM )
import Inter.Types
import Data.Typeable ( Typeable )
import qualified Challenger as C
import Data.Maybe ( fromMaybe )
import qualified Data.Map as M
-------------------------------------------------------------------------------
instance OrderScore MST where
scoringOrder _ = Increasing
data MST = MST deriving ( Eq, Ord, Show, Read, Typeable )
instance C.Partial MST ( W.Graph Int Int ) (Int, Graph Int) where
report MST wg = do
inform $ vcat
[ text "Gesucht ist ein Minimalgerüst des gewichteten Graphen"
, nest 4 $ toDoc wg
]
peng $ wg
inform $ text "Sie sollen auch das Gewicht des Gerüstes angeben."
initial MST wg =
let ( g, w ) = W.extract wg
n = anzKanten g
ks = head $ teilmengen (div n 2) (kanten g)
g0 = mkGraph (knoten g) ks
in ( 100 , g0 )
partial MST wg (wt, t) = do
let ( g, w ) = W.extract wg
let kn_g = ( text "Knotenmenge V(G) des Graphen" , knoten g )
kn_t = ( text "Knotenmenge V(T) in Ihrer Lösung" , knoten t )
Autolib.Reporter.Set.eq kn_g kn_t
let ka_g = ( text "Kantenmenge E(G) des Graphen" , kanten g )
ka_t = ( text "Kantenmenge E(T) in Ihrer Lösung" , kanten t )
Autolib.Reporter.Set.subeq ka_t ka_g
inform $ vcat [ text "Stimmen das von Ihnen berechnete Gesamtgewicht"
, nest 4 $ toDoc wt
, text "und das Gesamtgewicht Ihrer Einsendung überein?"
]
let real_wt = sum $ do
k <- lkanten t
return $ fromMaybe ( error "kein Gewicht" )
$ M.lookup k w
when ( real_wt /= wt ) $ reject $ text "Nein."
inform $ text "Ja."
total MST wg (wt,t) = do
inform $ text "Ihr Graph T hat die Gestalt:"
peng $ t { layout_program = Dot
, layout_hints = [ "-Nshape=ellipse" , "-Gsize=\"5,5\"" ]
}
inform $ text "Ist T kreisfrei?"
case kreisfrei t of
Nothing -> inform $ text "ja"
Just k -> reject $ text "nein, diese Kante liegt auf einem Kreis:" </> toDoc k
inform $ text "Wird der Graph G durch T aufgespannt?"
let ( g, w) = W.extract wg
case spanning t g of
Nothing -> inform $ text "Ja."
Just (x,y) -> reject
$ text "Nein, diese Kante in G verbindet verschiedene Komponenten von T:" </> toDoc (x,y)
inform $ text "Ist das Gewicht von T minimal?"
let wmin = Graph.MST.Kruskal.weight $ W.extract wg
when ( wt > wmin ) $ reject
$ text "Nein. Es gibt ein Gerüst geringeren Gewichts!"
when ( wt < wmin ) $ reject
$ error "Das kann eigentlich nicht sein."
inform $ text "Ja."
instance C.Measure MST (W.Graph Int Int) (Int,Graph Int) where
measure _ _ (wt,t) = fromIntegral $ wt
-------------------------------------------------------------------------------
make :: Make
make = direct MST $ W.example 10
| florianpilz/autotool | src/Graph/MST/Plain.hs | gpl-2.0 | 3,464 | 53 | 11 | 1,008 | 535 | 371 | 164 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module KAT_PubKey.DSA (dsaTests) where
import qualified Crypto.PubKey.DSA as DSA
import Crypto.Hash
import Imports
data VectorDSA = VectorDSA
{ pgq :: DSA.Params
, msg :: ByteString
, x :: Integer
, y :: Integer
, k :: Integer
, r :: Integer
, s :: Integer
}
vectorsSHA1 =
[ VectorDSA
{ msg = "\x3b\x46\x73\x6d\x55\x9b\xd4\xe0\xc2\xc1\xb2\x55\x3a\x33\xad\x3c\x6c\xf2\x3c\xac\x99\x8d\x3d\x0c\x0e\x8f\xa4\xb1\x9b\xca\x06\xf2\xf3\x86\xdb\x2d\xcf\xf9\xdc\xa4\xf4\x0a\xd8\xf5\x61\xff\xc3\x08\xb4\x6c\x5f\x31\xa7\x73\x5b\x5f\xa7\xe0\xf9\xe6\xcb\x51\x2e\x63\xd7\xee\xa0\x55\x38\xd6\x6a\x75\xcd\x0d\x42\x34\xb5\xcc\xf6\xc1\x71\x5c\xca\xaf\x9c\xdc\x0a\x22\x28\x13\x5f\x71\x6e\xe9\xbd\xee\x7f\xc1\x3e\xc2\x7a\x03\xa6\xd1\x1c\x5c\x5b\x36\x85\xf5\x19\x00\xb1\x33\x71\x53\xbc\x6c\x4e\x8f\x52\x92\x0c\x33\xfa\x37\xf4\xe7"
, x = 0xc53eae6d45323164c7d07af5715703744a63fc3a
, y = 0x313fd9ebca91574e1c2eebe1517c57e0c21b0209872140c5328761bbb2450b33f1b18b409ce9ab7c4cd8fda3391e8e34868357c199e16a6b2eba06d6749def791d79e95d3a4d09b24c392ad89dbf100995ae19c01062056bb14bce005e8731efde175f95b975089bdcdaea562b32786d96f5a31aedf75364008ad4fffebb970b
, k = 0x98cbcc4969d845e2461b5f66383dd503712bbcfa
, r = 0x50ed0e810e3f1c7cb6ac62332058448bd8b284c0
, s = 0xc6aded17216b46b7e4b6f2a97c1ad7cc3da83fde
, pgq = dsaParams
}
, VectorDSA
{ msg = "\xd2\xbc\xb5\x3b\x04\x4b\x3e\x2e\x4b\x61\xba\x2f\x91\xc0\x99\x5f\xb8\x3a\x6a\x97\x52\x5e\x66\x44\x1a\x3b\x48\x9d\x95\x94\x23\x8b\xc7\x40\xbd\xee\xa0\xf7\x18\xa7\x69\xc9\x77\xe2\xde\x00\x38\x77\xb5\xd7\xdc\x25\xb1\x82\xae\x53\x3d\xb3\x3e\x78\xf2\xc3\xff\x06\x45\xf2\x13\x7a\xbc\x13\x7d\x4e\x7d\x93\xcc\xf2\x4f\x60\xb1\x8a\x82\x0b\xc0\x7c\x7b\x4b\x5f\xe0\x8b\x4f\x9e\x7d\x21\xb2\x56\xc1\x8f\x3b\x9d\x49\xac\xc4\xf9\x3e\x2c\xe6\xf3\x75\x4c\x78\x07\x75\x7d\x2e\x11\x76\x04\x26\x12\xcb\x32\xfc\x3f\x4f\x70\x70\x0e\x25"
, x = 0xe65131d73470f6ad2e5878bdc9bef536faf78831
, y = 0x29bdd759aaa62d4bf16b4861c81cf42eac2e1637b9ecba512bdbc13ac12a80ae8de2526b899ae5e4a231aef884197c944c732693a634d7659abc6975a773f8d3cd5a361fe2492386a3c09aaef12e4a7e73ad7dfc3637f7b093f2c40d6223a195c136adf2ea3fbf8704a675aa7817aa7ec7f9adfb2854d4e05c3ce7f76560313b
, k = 0x87256a64e98cf5be1034ecfa766f9d25d1ac7ceb
, r = 0xa26c00b5750a2d27fe7435b93476b35438b4d8ab
, s = 0x61c9bfcb2938755afa7dad1d1e07c6288617bf70
, pgq = dsaParams
}
, VectorDSA
{ msg = "\xd5\x43\x1e\x6b\x16\xfd\xae\x31\x48\x17\x42\xbd\x39\x47\x58\xbe\xb8\xe2\x4f\x31\x94\x7e\x19\xb7\xea\x7b\x45\x85\x21\x88\x22\x70\xc1\xf4\x31\x92\xaa\x05\x0f\x44\x85\x14\x5a\xf8\xf3\xf9\xc5\x14\x2d\x68\xb8\x50\x18\xd2\xec\x9c\xb7\xa3\x7b\xa1\x2e\xd2\x3e\x73\xb9\x5f\xd6\x80\xfb\xa3\xc6\x12\x65\xe9\xf5\xa0\xa0\x27\xd7\x0f\xad\x0c\x8a\xa0\x8a\x3c\xbf\xbe\x99\x01\x8d\x00\x45\x38\x61\x73\xe5\xfa\xe2\x25\xfa\xeb\xe0\xce\xf5\xdd\x45\x91\x0f\x40\x0a\x86\xc2\xbe\x4e\x15\x25\x2a\x16\xde\x41\x20\xa2\x67\xbe\x2b\x59\x4d"
, x = 0x20bcabc6d9347a6e79b8e498c60c44a19c73258c
, y = 0x23b4f404aa3c575e550bb320fdb1a085cd396a10e5ebc6771da62f037cab19eacd67d8222b6344038c4f7af45f5e62b55480cbe2111154ca9697ca76d87b56944138084e74c6f90a05cf43660dff8b8b3fabfcab3f0e4416775fdf40055864be102b4587392e77752ed2aeb182ee4f70be4a291dbe77b84a44ee34007957b1e0
, k = 0x7d9bcfc9225432de9860f605a38d389e291ca750
, r = 0x3f0a4ad32f0816821b8affb518e9b599f35d57c2
, s = 0xea06638f2b2fc9d1dfe99c2a492806b497e2b0ea
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x85\x66\x2b\x69\x75\x50\xe4\x91\x5c\x29\xe3\x38\xb6\x24\xb9\x12\x84\x5d\x6d\x1a\x92\x0d\x9e\x4c\x16\x04\xdd\x47\xd6\x92\xbc\x7c\x0f\xfb\x95\xae\x61\x4e\x85\x2b\xeb\xaf\x15\x73\x75\x8a\xd0\x1c\x71\x3c\xac\x0b\x47\x6e\x2f\x12\x17\x45\xa3\xcf\xee\xff\xb2\x44\x1f\xf6\xab\xfb\x9b\xbe\xb9\x8a\xa6\x34\xca\x6f\xf5\x41\x94\x7d\xcc\x99\x27\x65\x9d\x44\xf9\x5c\x5f\xf9\x17\x0f\xdc\x3c\x86\x47\x3c\xb6\x01\xba\x31\xb4\x87\xfe\x59\x36\xba\xc5\xd9\xc6\x32\xcb\xcc\x3d\xb0\x62\x46\xba\x01\xc5\x5a\x03\x8d\x79\x7f\xe3\xf6\xc3"
, x = 0x52d1fbe687aa0702a51a5bf9566bd51bd569424c
, y = 0x6bc36cb3fa61cecc157be08639a7ca9e3de073b8a0ff23574ce5ab0a867dfd60669a56e60d1c989b3af8c8a43f5695d503e3098963990e12b63566784171058eace85c728cd4c08224c7a6efea75dca20df461013c75f40acbc23799ebee7f3361336dadc4a56f305708667bfe602b8ea75a491a5cf0c06ebd6fdc7161e10497
, k = 0x960c211891c090d05454646ebac1bfe1f381e82b
, r = 0x3bc29dee96957050ba438d1b3e17b02c1725d229
, s = 0x0af879cf846c434e08fb6c63782f4d03e0d88865
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x87\xb6\xe7\x5b\x9f\x8e\x99\xc4\xdd\x62\xad\xb6\x93\xdd\x58\x90\xed\xff\x1b\xd0\x02\x8f\x4e\xf8\x49\xdf\x0f\x1d\x2c\xe6\xb1\x81\xfc\x3a\x55\xae\xa6\xd0\xa1\xf0\xae\xca\xb8\xed\x9e\x24\x8a\x00\xe9\x6b\xe7\x94\xa7\xcf\xba\x12\x46\xef\xb7\x10\xef\x4b\x37\x47\x1c\xef\x0a\x1b\xcf\x55\xce\xbc\x8d\x5a\xd0\x71\x61\x2b\xd2\x37\xef\xed\xd5\x10\x23\x62\xdb\x07\xa1\xe2\xc7\xa6\xf1\x5e\x09\xfe\x64\xba\x42\xb6\x0a\x26\x28\xd8\x69\xae\x05\xef\x61\x1f\xe3\x8d\x9c\xe1\x5e\xee\xc9\xbb\x3d\xec\xc8\xdc\x17\x80\x9f\x3b\x6e\x95"
, x = 0xc86a54ec5c4ec63d7332cf43ddb082a34ed6d5f5
, y = 0x014ac746d3605efcb8a2c7dae1f54682a262e27662b252c09478ce87d0aaa522d7c200043406016c0c42896d21750b15dbd57f9707ec37dcea5651781b67ad8d01f5099fe7584b353b641bb159cc717d8ceb18b66705e656f336f1214b34f0357e577ab83641969e311bf40bdcb3ffd5e0bb59419f229508d2f432cc2859ff75
, k = 0x6c445cee68042553fbe63be61be4ddb99d8134af
, r = 0x637e07a5770f3dc65e4506c68c770e5ef6b8ced3
, s = 0x7dfc6f83e24f09745e01d3f7ae0ed1474e811d47
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x22\x59\xee\xad\x2d\x6b\xbc\x76\xd4\x92\x13\xea\x0d\xc8\xb7\x35\x0a\x97\x69\x9f\x22\x34\x10\x44\xc3\x94\x07\x82\x36\x4a\xc9\xea\x68\x31\x79\xa4\x38\xa5\xea\x45\x99\x8d\xf9\x7c\x29\x72\xda\xe0\x38\x51\xf5\xbe\x23\xfa\x9f\x04\x18\x2e\x79\xdd\xb2\xb5\x6d\xc8\x65\x23\x93\xec\xb2\x7f\x3f\x3b\x7c\x8a\x8d\x76\x1a\x86\xb3\xb8\xf4\xd4\x1a\x07\xb4\xbe\x7d\x02\xfd\xde\xfc\x42\xb9\x28\x12\x4a\x5a\x45\xb9\xf4\x60\x90\x42\x20\x9b\x3a\x7f\x58\x5b\xd5\x14\xcc\x39\xc0\x0e\xff\xcc\x42\xc7\xfe\x70\xfa\x83\xed\xf8\xa3\x2b\xf4"
, x = 0xaee6f213b9903c8069387e64729a08999e5baf65
, y = 0x0fe74045d7b0d472411202831d4932396f242a9765e92be387fd81bbe38d845054528b348c03984179b8e505674cb79d88cc0d8d3e8d7392f9aa773b29c29e54a9e326406075d755c291fcedbcc577934c824af988250f64ed5685fce726cff65e92d708ae11cbfaa958ab8d8b15340a29a137b5b4357f7ed1c7a5190cbf98a4
, k = 0xe1704bae025942e2e63c6d76bab88da79640073a
, r = 0x83366ba3fed93dfb38d541203ecbf81c363998e2
, s = 0x1fe299c36a1332f23bf2e10a6c6a4e0d3cdd2bf4
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x21\x9e\x8d\xf5\xbf\x88\x15\x90\x43\x0e\xce\x60\x82\x50\xf7\x67\x0d\xc5\x65\x37\x24\x93\x02\x42\x9e\x28\xec\xfe\xb9\xce\xaa\xa5\x49\x10\xa6\x94\x90\xf7\x65\xf3\xdf\x82\xe8\xb0\x1c\xd7\xd7\x6e\x56\x1d\x0f\x6c\xe2\x26\xef\x3c\xf7\x52\xca\xda\x6f\xeb\xdc\x5b\xf0\x0d\x67\x94\x7f\x92\xd4\x20\x51\x6b\x9e\x37\xc9\x6c\x8f\x1f\x2d\xa0\xb0\x75\x09\x7c\x3b\xda\x75\x8a\x8d\x91\xbd\x2e\xbe\x9c\x75\xcf\x14\x7f\x25\x4c\x25\x69\x63\xb3\x3b\x67\xd0\x2b\x6a\xa0\x9e\x7d\x74\x65\xd0\x38\xe5\x01\x95\xec\xe4\x18\x9b\x41\xe7\x68"
, x = 0x699f1c07aa458c6786e770b40197235fe49cf21a
, y = 0x3a41b0678ff3c4dde20fa39772bac31a2f18bae4bedec9e12ee8e02e30e556b1a136013bef96b0d30b568233dcecc71e485ed75c922afb4d0654e709bee84993792130220e3005fdb06ebdfc0e2df163b5ec424e836465acd6d92e243c86f2b94b26b8d73bd9cf722c757e0b80b0af16f185de70e8ca850b1402d126ea60f309
, k = 0x5bbb795bfa5fa72191fed3434a08741410367491
, r = 0x579761039ae0ddb81106bf4968e320083bbcb947
, s = 0x503ea15dbac9dedeba917fa8e9f386b93aa30353
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x2d\xa7\x9d\x06\x78\x85\xeb\x3c\xcf\x5e\x29\x3a\xe3\xb1\xd8\x22\x53\x22\x20\x3a\xbb\x5a\xdf\xde\x3b\x0f\x53\xbb\xe2\x4c\x4f\xe0\x01\x54\x1e\x11\x83\xd8\x70\xa9\x97\xf1\xf9\x46\x01\x00\xb5\xd7\x11\x92\x31\x80\x15\x43\x45\x28\x7a\x02\x14\xcf\x1c\xac\x37\xb7\xa4\x7d\xfb\xb2\xa0\xe8\xce\x49\x16\xf9\x4e\xbd\x6f\xa5\x4e\x31\x5b\x7a\x8e\xb5\xb6\x3c\xd9\x54\xc5\xba\x05\xc1\xbf\x7e\x33\xa4\xe8\xa1\x51\xf3\x2d\x28\x77\xb0\x17\x29\xc1\xad\x0e\x7c\x01\xbb\x8a\xe7\x23\xc9\x95\x18\x38\x03\xe4\x56\x36\x52\x0e\xa3\x8c\xa1"
, x = 0xd6e08c20c82949ddba93ea81eb2fea8c595894dc
, y = 0x56f7272210f316c51af8bfc45a421fd4e9b1043853271b7e79f40936f0adcf262a86097aa86e19e6cb5307685d863dba761342db6c973b3849b1e060aca926f41fe07323601062515ae85f3172b8f34899c621d59fa21f73d5ae97a3deb5e840b25a18fd580862fd7b1cf416c7ae9fc5842a0197fdb0c5173ff4a4f102a8cf89
, k = 0x6d72c30d4430959800740f2770651095d0c181c2
, r = 0x5dd90d69add67a5fae138eec1aaff0229aa4afc4
, s = 0x47f39c4db2387f10762f45b80dfd027906d7ef04
, pgq = dsaParams
}
, VectorDSA
{ msg = "\xba\x30\xd8\x5b\xe3\x57\xe7\xfb\x29\xf8\xa0\x7e\x1f\x12\x7b\xaa\xa2\x4b\x2e\xe0\x27\xf6\x4c\xb5\xef\xee\xc6\xaa\xea\xbc\xc7\x34\x5c\x5d\x55\x6e\xbf\x4b\xdc\x7a\x61\xc7\x7c\x7b\x7e\xa4\x3c\x73\xba\xbc\x18\xf7\xb4\x80\x77\x22\xda\x23\x9e\x45\xdd\xf2\x49\x84\x9c\xbb\xfe\x35\x07\x11\x2e\xbf\x87\xd7\xef\x56\x0c\x2e\x7d\x39\x1e\xd8\x42\x4f\x87\x10\xce\xa4\x16\x85\x14\x3e\x30\x06\xf8\x1b\x68\xfb\xb4\xd5\xf9\x64\x4c\x7c\xd1\x0f\x70\x92\xef\x24\x39\xb8\xd1\x8c\x0d\xf6\x55\xe0\x02\x89\x37\x2a\x41\x66\x38\x5d\x64\x0c"
, x = 0x50018482864c1864e9db1f04bde8dbfd3875c76d
, y = 0x0942a5b7a72ab116ead29308cf658dfe3d55d5d61afed9e3836e64237f9d6884fdd827d2d5890c9a41ae88e7a69fc9f345ade9c480c6f08cff067c183214c227236cedb6dd1283ca2a602574e8327510221d4c27b162143b7002d8c726916826265937b87be9d5ec6d7bd28fb015f84e0ab730da7a4eaf4ef3174bf0a22a6392
, k = 0xdf3a9348f37b5d2d4c9176db266ae388f1fa7e0f
, r = 0x448434b214eee38bde080f8ec433e8d19b3ddf0d
, s = 0x0c02e881b777923fe0ea674f2621298e00199d5f
, pgq = dsaParams
}
, VectorDSA
{ msg = "\x83\x49\x9e\xfb\x06\xbb\x7f\xf0\x2f\xfb\x46\xc2\x78\xa5\xe9\x26\x30\xac\x5b\xc3\xf9\xe5\x3d\xd2\xe7\x8f\xf1\x5e\x36\x8c\x7e\x31\xaa\xd7\x7c\xf7\x71\xf3\x5f\xa0\x2d\x0b\x5f\x13\x52\x08\xa4\xaf\xdd\x86\x7b\xb2\xec\x26\xea\x2e\x7d\xd6\x4c\xde\xf2\x37\x50\x8a\x38\xb2\x7f\x39\xd8\xb2\x2d\x45\xca\xc5\xa6\x8a\x90\xb6\xea\x76\x05\x86\x45\xf6\x35\x6a\x93\x44\xd3\x6f\x00\xec\x66\x52\xea\xa4\xe9\xba\xe7\xb6\x94\xf9\xf1\xfc\x8c\x6c\x5e\x86\xfa\xdc\x7b\x27\xa2\x19\xb5\xc1\xb2\xae\x80\xa7\x25\xe5\xf6\x11\x65\xfe\x2e\xdc"
, x = 0xae56f66b0a9405b9cca54c60ec4a3bb5f8be7c3f
, y = 0xa01542c3da410dd57930ca724f0f507c4df43d553c7f69459939685941ceb95c7dcc3f175a403b359621c0d4328e98f15f330a63865baf3e7eb1604a0715e16eed64fd14b35d3a534259a6a7ddf888c4dbb5f51bbc6ed339e5bb2a239d5cfe2100ac8e2f9c16e536f25119ab435843af27dc33414a9e4602f96d7c94d6021cec
, k = 0x8857ff301ad0169d164fa269977a116e070bac17
, r = 0x8c2fab489c34672140415d41a65cef1e70192e23
, s = 0x3df86a9e2efe944a1c7ea9c30cac331d00599a0e
, pgq = dsaParams
}
, VectorDSA -- 1024-bit example from RFC 6979 with SHA-1
{ msg = "sample"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x7BDB6B0FF756E1BB5D53583EF979082F9AD5BD5B
, r = 0x2E1A0C2562B2912CAAF89186FB0F42001585DA55
, s = 0x29EFB6B0AFF2D7A68EB70CA313022253B9A88DF5
, pgq = rfc6979Params1024
}
, VectorDSA -- 1024-bit example from RFC 6979 with SHA-1
{ msg = "test"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x5C842DF4F9E344EE09F056838B42C7A17F4A6433
, r = 0x42AB2052FD43E123F0607F115052A67DCD9C5C77
, s = 0x183916B0230D45B9931491D4C6B0BD2FB4AAF088
, pgq = rfc6979Params1024
}
, VectorDSA -- 2048-bit example from RFC 6979 with SHA-1
{ msg = "sample"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x888FA6F7738A41BDC9846466ABDB8174C0338250AE50CE955CA16230F9CBD53E
, r = 0x3A1B2DBD7489D6ED7E608FD036C83AF396E290DBD602408E8677DAABD6E7445A
, s = 0xD26FCBA19FA3E3058FFC02CA1596CDBB6E0D20CB37B06054F7E36DED0CDBBCCF
, pgq = rfc6979Params2048
}
, VectorDSA -- 2048-bit example from RFC 6979 with SHA-1
{ msg = "test"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x6EEA486F9D41A037B2C640BC5645694FF8FF4B98D066A25F76BE641CCB24BA4F
, r = 0xC18270A93CFC6063F57A4DFA86024F700D980E4CF4E2CB65A504397273D98EA0
, s = 0x414F22E5F31A8B6D33295C7539C1C1BA3A6160D7D68D50AC0D3A5BEAC2884FAA
, pgq = rfc6979Params2048
}
]
where -- (p,g,q)
dsaParams = DSA.Params
{ DSA.params_p = 0xa8f9cd201e5e35d892f85f80e4db2599a5676a3b1d4f190330ed3256b26d0e80a0e49a8fffaaad2a24f472d2573241d4d6d6c7480c80b4c67bb4479c15ada7ea8424d2502fa01472e760241713dab025ae1b02e1703a1435f62ddf4ee4c1b664066eb22f2e3bf28bb70a2a76e4fd5ebe2d1229681b5b06439ac9c7e9d8bde283
, DSA.params_g = 0x2b3152ff6c62f14622b8f48e59f8af46883b38e79b8c74deeae9df131f8b856e3ad6c8455dab87cc0da8ac973417ce4f7878557d6cdf40b35b4a0ca3eb310c6a95d68ce284ad4e25ea28591611ee08b8444bd64b25f3f7c572410ddfb39cc728b9c936f85f419129869929cdb909a6a3a99bbe089216368171bd0ba81de4fe33
, DSA.params_q = 0xf85f0f83ac4df7ea0cdf8f469bfeeaea14156495
}
vectorsSHA224 =
[ VectorDSA
{ msg = "sample"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x562097C06782D60C3037BA7BE104774344687649
, r = 0x4BC3B686AEA70145856814A6F1BB53346F02101E
, s = 0x410697B92295D994D21EDD2F4ADA85566F6F94C1
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "test"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x4598B8EFC1A53BC8AECD58D1ABBB0C0C71E67297
, r = 0x6868E9964E36C1689F6037F91F28D5F2C30610F2
, s = 0x49CEC3ACDC83018C5BD2674ECAAD35B8CD22940F
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "sample"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0xBC372967702082E1AA4FCE892209F71AE4AD25A6DFD869334E6F153BD0C4D806
, r = 0xDC9F4DEADA8D8FF588E98FED0AB690FFCE858DC8C79376450EB6B76C24537E2C
, s = 0xA65A9C3BC7BABE286B195D5DA68616DA8D47FA0097F36DD19F517327DC848CEC
, pgq = rfc6979Params2048
}
, VectorDSA
{ msg = "test"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x06BD4C05ED74719106223BE33F2D95DA6B3B541DAD7BFBD7AC508213B6DA6670
, r = 0x272ABA31572F6CC55E30BF616B7A265312018DD325BE031BE0CC82AA17870EA3
, s = 0xE9CC286A52CCE201586722D36D1E917EB96A4EBDB47932F9576AC645B3A60806
, pgq = rfc6979Params2048
}
]
vectorsSHA256 =
[ VectorDSA
{ msg = "sample"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x519BA0546D0C39202A7D34D7DFA5E760B318BCFB
, r = 0x81F2F5850BE5BC123C43F71A3033E9384611C545
, s = 0x4CDD914B65EB6C66A8AAAD27299BEE6B035F5E89
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "test"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x5A67592E8128E03A417B0484410FB72C0B630E1A
, r = 0x22518C127299B0F6FDC9872B282B9E70D0790812
, s = 0x6837EC18F150D55DE95B5E29BE7AF5D01E4FE160
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "sample"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x8926A27C40484216F052F4427CFD5647338B7B3939BC6573AF4333569D597C52
, r = 0xEACE8BDBBE353C432A795D9EC556C6D021F7A03F42C36E9BC87E4AC7932CC809
, s = 0x7081E175455F9247B812B74583E9E94F9EA79BD640DC962533B0680793A38D53
, pgq = rfc6979Params2048
}
, VectorDSA
{ msg = "test"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x1D6CE6DDA1C5D37307839CD03AB0A5CBB18E60D800937D67DFB4479AAC8DEAD7
, r = 0x8190012A1969F9957D56FCCAAD223186F423398D58EF5B3CEFD5A4146A4476F0
, s = 0x7452A53F7075D417B4B013B278D1BB8BBD21863F5E7B1CEE679CF2188E1AB19E
, pgq = rfc6979Params2048
}
]
vectorsSHA384 =
[ VectorDSA
{ msg = "sample"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x95897CD7BBB944AA932DBC579C1C09EB6FCFC595
, r = 0x07F2108557EE0E3921BC1774F1CA9B410B4CE65A
, s = 0x54DF70456C86FAC10FAB47C1949AB83F2C6F7595
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "test"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x220156B761F6CA5E6C9F1B9CF9C24BE25F98CD89
, r = 0x854CF929B58D73C3CBFDC421E8D5430CD6DB5E66
, s = 0x91D0E0F53E22F898D158380676A871A157CDA622
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "sample"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0xC345D5AB3DA0A5BCB7EC8F8FB7A7E96069E03B206371EF7D83E39068EC564920
, r = 0xB2DA945E91858834FD9BF616EBAC151EDBC4B45D27D0DD4A7F6A22739F45C00B
, s = 0x19048B63D9FD6BCA1D9BAE3664E1BCB97F7276C306130969F63F38FA8319021B
, pgq = rfc6979Params2048
}
, VectorDSA
{ msg = "test"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x206E61F73DBE1B2DC8BE736B22B079E9DACD974DB00EEBBC5B64CAD39CF9F91C
, r = 0x239E66DDBE8F8C230A3D071D601B6FFBDFB5901F94D444C6AF56F732BEB954BE
, s = 0x6BD737513D5E72FE85D1C750E0F73921FE299B945AAD1C802F15C26A43D34961
, pgq = rfc6979Params2048
}
]
vectorsSHA512 =
[ VectorDSA
{ msg = "sample"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x09ECE7CA27D0F5A4DD4E556C9DF1D21D28104F8B
, r = 0x16C3491F9B8C3FBBDD5E7A7B667057F0D8EE8E1B
, s = 0x02C36A127A7B89EDBB72E4FFBC71DABC7D4FC69C
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "test"
, x = 0x411602CB19A6CCC34494D79D98EF1E7ED5AF25F7
, y = 0x5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B
, k = 0x65D2C2EEB175E370F28C75BFCDC028D22C7DBE9C
, r = 0x8EA47E475BA8AC6F2D821DA3BD212D11A3DEB9A0
, s = 0x7C670C7AD72B6C050C109E1790008097125433E8
, pgq = rfc6979Params1024
}
, VectorDSA
{ msg = "sample"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0x5A12994431785485B3F5F067221517791B85A597B7A9436995C89ED0374668FC
, r = 0x2016ED092DC5FB669B8EFB3D1F31A91EECB199879BE0CF78F02BA062CB4C942E
, s = 0xD0C76F84B5F091E141572A639A4FB8C230807EEA7D55C8A154A224400AFF2351
, pgq = rfc6979Params2048
}
, VectorDSA
{ msg = "test"
, x = 0x69C7548C21D0DFEA6B9A51C9EAD4E27C33D3B3F180316E5BCAB92C933F0E4DBC
, y = 0x667098C654426C78D7F8201EAC6C203EF030D43605032C2F1FA937E5237DBD949F34A0A2564FE126DC8B715C5141802CE0979C8246463C40E6B6BDAA2513FA611728716C2E4FD53BC95B89E69949D96512E873B9C8F8DFD499CC312882561ADECB31F658E934C0C197F2C4D96B05CBAD67381E7B768891E4DA3843D24D94CDFB5126E9B8BF21E8358EE0E0A30EF13FD6A664C0DCE3731F7FB49A4845A4FD8254687972A2D382599C9BAC4E0ED7998193078913032558134976410B89D2C171D123AC35FD977219597AA7D15C1A9A428E59194F75C721EBCBCFAE44696A499AFA74E04299F132026601638CB87AB79190D4A0986315DA8EEC6561C938996BEADF
, k = 0xAFF1651E4CD6036D57AA8B2A05CCF1A9D5A40166340ECBBDC55BE10B568AA0AA
, r = 0x89EC4BB1400ECCFF8E7D9AA515CD1DE7803F2DAFF09693EE7FD1353E90A68307
, s = 0xC9F0BDABCC0D880BB137A994CC7F3980CE91CC10FAF529FC46565B15CEA854E1
, pgq = rfc6979Params2048
}
]
rfc6979Params1024 = DSA.Params
{ DSA.params_p = 0x86F5CA03DCFEB225063FF830A0C769B9DD9D6153AD91D7CE27F787C43278B447E6533B86B18BED6E8A48B784A14C252C5BE0DBF60B86D6385BD2F12FB763ED8873ABFD3F5BA2E0A8C0A59082EAC056935E529DAF7C610467899C77ADEDFC846C881870B7B19B2B58F9BE0521A17002E3BDD6B86685EE90B3D9A1B02B782B1779
, DSA.params_g = 0x07B0F92546150B62514BB771E2A0C0CE387F03BDA6C56B505209FF25FD3C133D89BBCD97E904E09114D9A7DEFDEADFC9078EA544D2E401AEECC40BB9FBBF78FD87995A10A1C27CB7789B594BA7EFB5C4326A9FE59A070E136DB77175464ADCA417BE5DCE2F40D10A46A3A3943F26AB7FD9C0398FF8C76EE0A56826A8A88F1DBD
, DSA.params_q = 0x996F967F6C8E388D9E28D01E205FBA957A5698B1
}
rfc6979Params2048 = DSA.Params
{ DSA.params_p = 0x9DB6FB5951B66BB6FE1E140F1D2CE5502374161FD6538DF1648218642F0B5C48C8F7A41AADFA187324B87674FA1822B00F1ECF8136943D7C55757264E5A1A44FFE012E9936E00C1D3E9310B01C7D179805D3058B2A9F4BB6F9716BFE6117C6B5B3CC4D9BE341104AD4A80AD6C94E005F4B993E14F091EB51743BF33050C38DE235567E1B34C3D6A5C0CEAA1A0F368213C3D19843D0B4B09DCB9FC72D39C8DE41F1BF14D4BB4563CA28371621CAD3324B6A2D392145BEBFAC748805236F5CA2FE92B871CD8F9C36D3292B5509CA8CAA77A2ADFC7BFD77DDA6F71125A7456FEA153E433256A2261C6A06ED3693797E7995FAD5AABBCFBE3EDA2741E375404AE25B
, DSA.params_g = 0x5C7FF6B06F8F143FE8288433493E4769C4D988ACE5BE25A0E24809670716C613D7B0CEE6932F8FAA7C44D2CB24523DA53FBE4F6EC3595892D1AA58C4328A06C46A15662E7EAA703A1DECF8BBB2D05DBE2EB956C142A338661D10461C0D135472085057F3494309FFA73C611F78B32ADBB5740C361C9F35BE90997DB2014E2EF5AA61782F52ABEB8BD6432C4DD097BC5423B285DAFB60DC364E8161F4A2A35ACA3A10B1C4D203CC76A470A33AFDCBDD92959859ABD8B56E1725252D78EAC66E71BA9AE3F1DD2487199874393CD4D832186800654760E1E34C09E4D155179F9EC0DC4473F996BDCE6EED1CABED8B6F116F7AD9CF505DF0F998E34AB27514B0FFE7
, DSA.params_q = 0xF2C3119374CE76C9356990B465374A17F23F9ED35089BD969F61C6DDE9998C1F
}
vectorToPrivate :: VectorDSA -> DSA.PrivateKey
vectorToPrivate vector = DSA.PrivateKey
{ DSA.private_x = x vector
, DSA.private_params = pgq vector
}
vectorToPublic :: VectorDSA -> DSA.PublicKey
vectorToPublic vector = DSA.PublicKey
{ DSA.public_y = y vector
, DSA.public_params = pgq vector
}
doSignatureTest hashAlg i vector = testCase (show i) (expected @=? actual)
where expected = Just $ DSA.Signature (r vector) (s vector)
actual = DSA.signWith (k vector) (vectorToPrivate vector) hashAlg (msg vector)
doVerifyTest hashAlg i vector = testCase (show i) (True @=? actual)
where actual = DSA.verify hashAlg (vectorToPublic vector) (DSA.Signature (r vector) (s vector)) (msg vector)
dsaTests = testGroup "DSA"
[ testGroup "SHA1"
[ testGroup "signature" $ zipWith (doSignatureTest SHA1) [katZero..] vectorsSHA1
, testGroup "verify" $ zipWith (doVerifyTest SHA1) [katZero..] vectorsSHA1
]
, testGroup "SHA224"
[ testGroup "signature" $ zipWith (doSignatureTest SHA224) [katZero..] vectorsSHA224
, testGroup "verify" $ zipWith (doVerifyTest SHA224) [katZero..] vectorsSHA224
]
, testGroup "SHA256"
[ testGroup "signature" $ zipWith (doSignatureTest SHA256) [katZero..] vectorsSHA256
, testGroup "verify" $ zipWith (doVerifyTest SHA256) [katZero..] vectorsSHA256
]
, testGroup "SHA384"
[ testGroup "signature" $ zipWith (doSignatureTest SHA384) [katZero..] vectorsSHA384
, testGroup "verify" $ zipWith (doVerifyTest SHA384) [katZero..] vectorsSHA384
]
, testGroup "SHA512"
[ testGroup "signature" $ zipWith (doSignatureTest SHA512) [katZero..] vectorsSHA512
, testGroup "verify" $ zipWith (doVerifyTest SHA512) [katZero..] vectorsSHA512
]
]
| vincenthz/cryptonite | tests/KAT_PubKey/DSA.hs | bsd-3-clause | 31,104 | 0 | 12 | 3,692 | 2,199 | 1,356 | 843 | 299 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.C.String
-- Copyright : (c) The FFI task force 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : ffi@haskell.org
-- Stability : provisional
-- Portability : portable
--
-- Utilities for primitive marshalling of C strings.
--
-- The marshalling converts each Haskell character, representing a Unicode
-- code point, to one or more bytes in a manner that, by default, is
-- determined by the current locale. As a consequence, no guarantees
-- can be made about the relative length of a Haskell string and its
-- corresponding C string, and therefore all the marshalling routines
-- include memory allocation. The translation between Unicode and the
-- encoding of the current locale may be lossy.
--
-----------------------------------------------------------------------------
module Foreign.C.String ( -- representation of strings in C
-- * C strings
CString,
CStringLen,
-- ** Using a locale-dependent encoding
-- | These functions are different from their @CAString@ counterparts
-- in that they will use an encoding determined by the current locale,
-- rather than always assuming ASCII.
-- conversion of C strings into Haskell strings
--
peekCString,
peekCStringLen,
-- conversion of Haskell strings into C strings
--
newCString,
newCStringLen,
-- conversion of Haskell strings into C strings using temporary storage
--
withCString,
withCStringLen,
charIsRepresentable,
-- ** Using 8-bit characters
-- | These variants of the above functions are for use with C libraries
-- that are ignorant of Unicode. These functions should be used with
-- care, as a loss of information can occur.
castCharToCChar,
castCCharToChar,
castCharToCUChar,
castCUCharToChar,
castCharToCSChar,
castCSCharToChar,
peekCAString,
peekCAStringLen,
newCAString,
newCAStringLen,
withCAString,
withCAStringLen,
-- * C wide strings
-- | These variants of the above functions are for use with C libraries
-- that encode Unicode using the C @wchar_t@ type in a system-dependent
-- way. The only encodings supported are
--
-- * UTF-32 (the C compiler defines @__STDC_ISO_10646__@), or
--
-- * UTF-16 (as used on Windows systems).
CWString,
CWStringLen,
peekCWString,
peekCWStringLen,
newCWString,
newCWStringLen,
withCWString,
withCWStringLen,
) where
import Foreign.Marshal.Array
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Storable
import Data.Word
import GHC.Char
import GHC.List
import GHC.Real
import GHC.Num
import GHC.Base
import {-# SOURCE #-} GHC.IO.Encoding
import qualified GHC.Foreign as GHC
-----------------------------------------------------------------------------
-- Strings
-- representation of strings in C
-- ------------------------------
-- | A C string is a reference to an array of C characters terminated by NUL.
type CString = Ptr CChar
-- | A string with explicit length information in bytes instead of a
-- terminating NUL (allowing NUL characters in the middle of the string).
type CStringLen = (Ptr CChar, Int)
-- exported functions
-- ------------------
--
-- * the following routines apply the default conversion when converting the
-- C-land character encoding into the Haskell-land character encoding
-- | Marshal a NUL terminated C string into a Haskell string.
--
peekCString :: CString -> IO String
peekCString s = getForeignEncoding >>= flip GHC.peekCString s
-- | Marshal a C string with explicit length into a Haskell string.
--
peekCStringLen :: CStringLen -> IO String
peekCStringLen s = getForeignEncoding >>= flip GHC.peekCStringLen s
-- | Marshal a Haskell string into a NUL terminated C string.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * new storage is allocated for the C string and must be
-- explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCString :: String -> IO CString
newCString s = getForeignEncoding >>= flip GHC.newCString s
-- | Marshal a Haskell string into a C string (ie, character array) with
-- explicit length information.
--
-- * new storage is allocated for the C string and must be
-- explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCStringLen :: String -> IO CStringLen
newCStringLen s = getForeignEncoding >>= flip GHC.newCStringLen s
-- | Marshal a Haskell string into a NUL terminated C string using temporary
-- storage.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCString :: String -> (CString -> IO a) -> IO a
withCString s f = getForeignEncoding >>= \enc -> GHC.withCString enc s f
-- | Marshal a Haskell string into a C string (ie, character array)
-- in temporary storage, with explicit length information.
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCStringLen :: String -> (CStringLen -> IO a) -> IO a
withCStringLen s f = getForeignEncoding >>= \enc -> GHC.withCStringLen enc s f
-- -- | Determines whether a character can be accurately encoded in a 'CString'.
-- -- Unrepresentable characters are converted to '?' or their nearest visual equivalent.
charIsRepresentable :: Char -> IO Bool
charIsRepresentable c = getForeignEncoding >>= flip GHC.charIsRepresentable c
-- single byte characters
-- ----------------------
--
-- ** NOTE: These routines don't handle conversions! **
-- | Convert a C byte, representing a Latin-1 character, to the corresponding
-- Haskell character.
castCCharToChar :: CChar -> Char
castCCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))
-- | Convert a Haskell character to a C character.
-- This function is only safe on the first 256 characters.
castCharToCChar :: Char -> CChar
castCharToCChar ch = fromIntegral (ord ch)
-- | Convert a C @unsigned char@, representing a Latin-1 character, to
-- the corresponding Haskell character.
castCUCharToChar :: CUChar -> Char
castCUCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))
-- | Convert a Haskell character to a C @unsigned char@.
-- This function is only safe on the first 256 characters.
castCharToCUChar :: Char -> CUChar
castCharToCUChar ch = fromIntegral (ord ch)
-- | Convert a C @signed char@, representing a Latin-1 character, to the
-- corresponding Haskell character.
castCSCharToChar :: CSChar -> Char
castCSCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))
-- | Convert a Haskell character to a C @signed char@.
-- This function is only safe on the first 256 characters.
castCharToCSChar :: Char -> CSChar
castCharToCSChar ch = fromIntegral (ord ch)
-- | Marshal a NUL terminated C string into a Haskell string.
--
peekCAString :: CString -> IO String
peekCAString cp = do
l <- lengthArray0 nUL cp
if l <= 0 then return "" else loop "" (l-1)
where
loop s i = do
xval <- peekElemOff cp i
let val = castCCharToChar xval
val `seq` if i <= 0 then return (val:s) else loop (val:s) (i-1)
-- | Marshal a C string with explicit length into a Haskell string.
--
peekCAStringLen :: CStringLen -> IO String
peekCAStringLen (cp, len)
| len <= 0 = return "" -- being (too?) nice.
| otherwise = loop [] (len-1)
where
loop acc i = do
xval <- peekElemOff cp i
let val = castCCharToChar xval
-- blow away the coercion ASAP.
if (val `seq` (i == 0))
then return (val:acc)
else loop (val:acc) (i-1)
-- | Marshal a Haskell string into a NUL terminated C string.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * new storage is allocated for the C string and must be
-- explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCAString :: String -> IO CString
newCAString str = do
ptr <- mallocArray0 (length str)
let
go [] n = pokeElemOff ptr n nUL
go (c:cs) n = do pokeElemOff ptr n (castCharToCChar c); go cs (n+1)
go str 0
return ptr
-- | Marshal a Haskell string into a C string (ie, character array) with
-- explicit length information.
--
-- * new storage is allocated for the C string and must be
-- explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCAStringLen :: String -> IO CStringLen
newCAStringLen str = do
ptr <- mallocArray0 len
let
go [] n = n `seq` return () -- make it strict in n
go (c:cs) n = do pokeElemOff ptr n (castCharToCChar c); go cs (n+1)
go str 0
return (ptr, len)
where
len = length str
-- | Marshal a Haskell string into a NUL terminated C string using temporary
-- storage.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCAString :: String -> (CString -> IO a) -> IO a
withCAString str f =
allocaArray0 (length str) $ \ptr ->
let
go [] n = pokeElemOff ptr n nUL
go (c:cs) n = do pokeElemOff ptr n (castCharToCChar c); go cs (n+1)
in do
go str 0
f ptr
-- | Marshal a Haskell string into a C string (ie, character array)
-- in temporary storage, with explicit length information.
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCAStringLen :: String -> (CStringLen -> IO a) -> IO a
withCAStringLen str f =
allocaArray len $ \ptr ->
let
go [] n = n `seq` return () -- make it strict in n
go (c:cs) n = do pokeElemOff ptr n (castCharToCChar c); go cs (n+1)
in do
go str 0
f (ptr,len)
where
len = length str
-- auxiliary definitions
-- ----------------------
-- C's end of string character
--
nUL :: CChar
nUL = 0
-- allocate an array to hold the list and pair it with the number of elements
newArrayLen :: Storable a => [a] -> IO (Ptr a, Int)
newArrayLen xs = do
a <- newArray xs
return (a, length xs)
-----------------------------------------------------------------------------
-- Wide strings
-- representation of wide strings in C
-- -----------------------------------
-- | A C wide string is a reference to an array of C wide characters
-- terminated by NUL.
type CWString = Ptr CWchar
-- | A wide character string with explicit length information in 'CWchar's
-- instead of a terminating NUL (allowing NUL characters in the middle
-- of the string).
type CWStringLen = (Ptr CWchar, Int)
-- | Marshal a NUL terminated C wide string into a Haskell string.
--
peekCWString :: CWString -> IO String
peekCWString cp = do
cs <- peekArray0 wNUL cp
return (cWcharsToChars cs)
-- | Marshal a C wide string with explicit length into a Haskell string.
--
peekCWStringLen :: CWStringLen -> IO String
peekCWStringLen (cp, len) = do
cs <- peekArray len cp
return (cWcharsToChars cs)
-- | Marshal a Haskell string into a NUL terminated C wide string.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * new storage is allocated for the C wide string and must
-- be explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCWString :: String -> IO CWString
newCWString = newArray0 wNUL . charsToCWchars
-- | Marshal a Haskell string into a C wide string (ie, wide character array)
-- with explicit length information.
--
-- * new storage is allocated for the C wide string and must
-- be explicitly freed using 'Foreign.Marshal.Alloc.free' or
-- 'Foreign.Marshal.Alloc.finalizerFree'.
--
newCWStringLen :: String -> IO CWStringLen
newCWStringLen str = newArrayLen (charsToCWchars str)
-- | Marshal a Haskell string into a NUL terminated C wide string using
-- temporary storage.
--
-- * the Haskell string may /not/ contain any NUL characters
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCWString :: String -> (CWString -> IO a) -> IO a
withCWString = withArray0 wNUL . charsToCWchars
-- | Marshal a Haskell string into a C wide string (i.e. wide
-- character array) in temporary storage, with explicit length
-- information.
--
-- * the memory is freed when the subcomputation terminates (either
-- normally or via an exception), so the pointer to the temporary
-- storage must /not/ be used after this.
--
withCWStringLen :: String -> (CWStringLen -> IO a) -> IO a
withCWStringLen str f =
withArrayLen (charsToCWchars str) $ \ len ptr -> f (ptr, len)
-- auxiliary definitions
-- ----------------------
wNUL :: CWchar
wNUL = 0
cWcharsToChars :: [CWchar] -> [Char]
charsToCWchars :: [Char] -> [CWchar]
#if defined(mingw32_HOST_OS)
-- On Windows, wchar_t is 16 bits wide and CWString uses the UTF-16 encoding.
-- coding errors generate Chars in the surrogate range
cWcharsToChars = map chr . fromUTF16 . map fromIntegral
where
fromUTF16 (c1:c2:wcs)
| 0xd800 <= c1 && c1 <= 0xdbff && 0xdc00 <= c2 && c2 <= 0xdfff =
((c1 - 0xd800)*0x400 + (c2 - 0xdc00) + 0x10000) : fromUTF16 wcs
fromUTF16 (c:wcs) = c : fromUTF16 wcs
fromUTF16 [] = []
charsToCWchars = foldr utf16Char [] . map ord
where
utf16Char c wcs
| c < 0x10000 = fromIntegral c : wcs
| otherwise = let c' = c - 0x10000 in
fromIntegral (c' `div` 0x400 + 0xd800) :
fromIntegral (c' `mod` 0x400 + 0xdc00) : wcs
#else /* !mingw32_HOST_OS */
cWcharsToChars xs = map castCWcharToChar xs
charsToCWchars xs = map castCharToCWchar xs
-- These conversions only make sense if __STDC_ISO_10646__ is defined
-- (meaning that wchar_t is ISO 10646, aka Unicode)
castCWcharToChar :: CWchar -> Char
castCWcharToChar ch = chr (fromIntegral ch )
castCharToCWchar :: Char -> CWchar
castCharToCWchar ch = fromIntegral (ord ch)
#endif /* !mingw32_HOST_OS */
| rahulmutt/ghcvm | libraries/base/Foreign/C/String.hs | bsd-3-clause | 14,674 | 0 | 16 | 2,986 | 2,344 | 1,290 | 1,054 | 161 | 3 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module HERMIT.Dictionary.Unfold
( externals
, betaReducePlusR
, unfoldR
, unfoldPredR
, unfoldNameR
, unfoldNamesR
, unfoldSaturatedR
, specializeR
) where
import Control.Arrow
import Control.Monad
import HERMIT.Dictionary.Common
import HERMIT.Dictionary.Inline (inlineR)
import HERMIT.Core
import HERMIT.Context
import HERMIT.External
import HERMIT.GHC
import HERMIT.Kure
import HERMIT.Monad
import HERMIT.Name
import Prelude hiding (exp)
------------------------------------------------------------------------
externals :: [External]
externals =
[ external "beta-reduce-plus" (promoteExprR betaReducePlusR :: RewriteH LCore)
[ "Perform one or more beta-reductions."] .+ Eval .+ Shallow
, external "unfold" (promoteExprR unfoldR :: RewriteH LCore)
[ "In application f x y z, unfold f." ] .+ Deep .+ Context
, external "unfold" (promoteExprR . unfoldNameR . unOccurrenceName :: OccurrenceName -> RewriteH LCore)
[ "Inline a definition, and apply the arguments; traditional unfold." ] .+ Deep .+ Context
, external "unfold" (promoteExprR . unfoldNamesR . map unOccurrenceName:: [OccurrenceName] -> RewriteH LCore)
[ "Unfold a definition if it is named in the list." ] .+ Deep .+ Context
, external "unfold-saturated" (promoteExprR unfoldSaturatedR :: RewriteH LCore)
[ "Unfold a definition only if the function is fully applied." ] .+ Deep .+ Context
, external "specialize" (promoteExprR specializeR :: RewriteH LCore)
[ "Specialize an application to its type and coercion arguments." ] .+ Deep .+ Context
]
------------------------------------------------------------------------
-- | Perform one or more beta reductions.
betaReducePlusR :: MonadCatch m => Rewrite c m CoreExpr
betaReducePlusR = prefixFailMsg "Multi-beta-reduction failed: " $ do
(f,args) <- callT
let (f',args',atLeastOne) = reduceAll f args False
reduceAll (Lam v body) (a:as) _ = reduceAll (substCoreExpr v a body) as True
reduceAll e as b = (e,as,b)
guardMsg atLeastOne "no beta reductions possible."
return $ mkCoreApps f' args'
-- | A more powerful 'inline'. Matches two cases:
-- Var ==> inlines
-- App ==> inlines the head of the function call for the app tree
unfoldR :: forall c m. ( AddBindings c, ExtendPath c Crumb, HasEmptyContext c
, ReadBindings c, ReadPath c Crumb, MonadCatch m )
=> Rewrite c m CoreExpr
unfoldR = prefixFailMsg "unfold failed: " (go >>> tryR betaReducePlusR)
where go :: Rewrite c m CoreExpr
go = appAllR go idR <+ inlineR -- this order gives better error messages
unfoldPredR :: ( AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb
, MonadCatch m )
=> (Id -> [CoreExpr] -> Bool) -> Rewrite c m CoreExpr
unfoldPredR p = callPredT p >> unfoldR
unfoldNameR :: ( ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c
, MonadCatch m )
=> HermitName -> Rewrite c m CoreExpr
unfoldNameR nm = prefixFailMsg ("unfold '" ++ show nm ++ " failed: ") (callNameT nm >> unfoldR)
unfoldNamesR :: ( ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c
, MonadCatch m )
=> [HermitName] -> Rewrite c m CoreExpr
unfoldNamesR [] = fail "unfold-names failed: no names given."
unfoldNamesR nms = setFailMsg "unfold-names failed." $ orR (map unfoldNameR nms)
unfoldSaturatedR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr
unfoldSaturatedR = callSaturatedT >> unfoldR
specializeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr
specializeR = unfoldPredR (const $ all isTyCoArg)
| conal/hermit | src/HERMIT/Dictionary/Unfold.hs | bsd-2-clause | 4,084 | 0 | 13 | 885 | 1,024 | 540 | 484 | 70 | 2 |
module IOFullyQualifiedUsed where
import qualified System.IO (putStrLn)
main :: IO ()
main = System.IO.putStrLn "test"
| serokell/importify | test/test-data/base@basic/24-IOFullyQualifiedUsed.hs | mit | 121 | 0 | 6 | 17 | 36 | 21 | 15 | 4 | 1 |
{-|
Module : Idris.Completion
Description : Support for command-line completion at the REPL and in the prover.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
module Idris.Completion (replCompletion, proverCompletion) where
import Idris.AbsSyntax (runIO)
import Idris.AbsSyntaxTree
import Idris.Colours
import Idris.Core.Evaluate (ctxtAlist, definitions)
import Idris.Core.TT
import Idris.Help
import Idris.Imports (installedPackages)
import Idris.Parser.Expr (TacticArg(..))
import qualified Idris.Parser.Expr (constants, tactics)
import Idris.Parser.Helpers (opChars)
import Idris.REPL.Parser (allHelp, setOptions)
import Control.Monad.State.Strict
import Data.Char (toLower)
import Data.List
import qualified Data.Map.Strict as Map
import Data.Maybe
import qualified Data.Text as T
import System.Console.ANSI (Color)
import System.Console.Haskeline
commands = [ n | (names, _, _) <- allHelp ++ extraHelp, n <- names ]
tacticArgs :: [(String, Maybe TacticArg)]
tacticArgs = [ (name, args) | (names, args, _) <- Idris.Parser.Expr.tactics
, name <- names ]
tactics = map fst tacticArgs
-- | Get the user-visible names from the current interpreter state.
names :: Idris [String]
names = do i <- get
let ctxt = tt_ctxt i
return $
mapMaybe nameString (allNames $ definitions ctxt) ++
"Type" : map fst Idris.Parser.Expr.constants
where
-- We need both fully qualified names and identifiers that map to them
allNames :: Ctxt a -> [Name]
allNames ctxt =
let mappings = Map.toList ctxt
in concatMap (\(name, mapping) -> name : Map.keys mapping) mappings
-- Convert a name into a string usable for completion. Filters out names
-- that users probably don't want to see.
nameString :: Name -> Maybe String
nameString (UN n) = Just (str n)
nameString (NS n ns) =
let path = intercalate "." . map T.unpack . reverse $ ns
in fmap ((path ++ ".") ++) $ nameString n
nameString _ = Nothing
metavars :: Idris [String]
metavars = do i <- get
return . map (show . nsroot) $ map fst (filter (\(_, (_,_,_,t,_)) -> not t) (idris_metavars i)) \\ primDefs
modules :: Idris [String]
modules = do i <- get
return $ map show $ imported i
namespaces :: Idris [String]
namespaces = do
ctxt <- fmap tt_ctxt get
let names = map fst $ ctxtAlist ctxt
return $ nub $ catMaybes $ map extractNS names
where
extractNS :: Name -> Maybe String
extractNS (NS n ns) = Just $ intercalate "." . map T.unpack . reverse $ ns
extractNS _ = Nothing
-- UpTo means if user enters full name then no other completions are shown
-- Full always show other (longer) completions if there are any
data CompletionMode = UpTo | Full deriving Eq
completeWithMode :: CompletionMode -> [String] -> String -> [Completion]
completeWithMode mode ns n =
if uniqueExists || (fullWord && mode == UpTo)
then [simpleCompletion n]
else map simpleCompletion prefixMatches
where prefixMatches = filter (isPrefixOf n) ns
uniqueExists = [n] == prefixMatches
fullWord = n `elem` ns
completeWith = completeWithMode Full
completeName :: CompletionMode -> [String] -> CompletionFunc Idris
completeName mode extra = completeWord Nothing (" \t(){}:" ++ completionWhitespace) completeName
where
completeName n = do
ns <- names
return $ completeWithMode mode (extra ++ ns) n
-- The '.' needs not to be taken into consideration because it serves as namespace separator
completionWhitespace = opChars \\ "."
completeMetaVar :: CompletionFunc Idris
completeMetaVar = completeWord Nothing (" \t(){}:" ++ opChars) completeM
where completeM m = do mvs <- metavars
return $ completeWithMode UpTo mvs m
completeNamespace :: CompletionFunc Idris
completeNamespace = completeWord Nothing " \t" completeN
where completeN n = do ns <- namespaces
return $ completeWithMode UpTo ns n
completeOption :: CompletionFunc Idris
completeOption = completeWord Nothing " \t" completeOpt
where completeOpt = return . completeWith (map fst setOptions)
completeConsoleWidth :: CompletionFunc Idris
completeConsoleWidth = completeWord Nothing " \t" completeW
where completeW = return . completeWith ["auto", "infinite", "80", "120"]
isWhitespace :: Char -> Bool
isWhitespace = (flip elem) " \t\n"
lookupInHelp :: String -> Maybe CmdArg
lookupInHelp cmd = lookupInHelp' cmd allHelp
where lookupInHelp' cmd ((cmds, arg, _):xs) | elem cmd cmds = Just arg
| otherwise = lookupInHelp' cmd xs
lookupInHelp' cmd [] = Nothing
completeColour :: CompletionFunc Idris
completeColour (prev, next) = case words (reverse prev) of
[c] | isCmd c -> do cmpls <- completeColourOpt next
return (reverse $ c ++ " ", cmpls)
[c, o] | o `elem` opts -> let correct = (c ++ " " ++ o) in
return (reverse correct, [simpleCompletion ""])
| o `elem` colourTypes -> completeColourFormat (prev, next)
| otherwise -> let cmpls = completeWith (opts ++ colourTypes) o in
let sofar = (c ++ " ") in
return (reverse sofar, cmpls)
cmd@(c:o:_) | isCmd c && o `elem` colourTypes ->
completeColourFormat (prev, next)
_ -> noCompletion (prev, next)
where completeColourOpt :: String -> Idris [Completion]
completeColourOpt = return . completeWith (opts ++ colourTypes)
opts = ["on", "off"]
colourTypes = map (map toLower . reverse . drop 6 . reverse . show) $
enumFromTo (minBound::ColourType) maxBound
isCmd ":colour" = True
isCmd ":color" = True
isCmd _ = False
colours = map (map toLower . show) $ enumFromTo (minBound::Color) maxBound
formats = ["vivid", "dull", "underline", "nounderline", "bold", "nobold", "italic", "noitalic"]
completeColourFormat = let getCmpl = completeWith (colours ++ formats) in
completeWord Nothing " \t" (return . getCmpl)
-- The FIXMEs are Issue #1768 on the issue tracker.
-- https://github.com/idris-lang/Idris-dev/issues/1768
-- | Get the completion function for a particular command
completeCmd :: String -> CompletionFunc Idris
completeCmd cmd (prev, next) = fromMaybe completeCmdName $ fmap completeArg $ lookupInHelp cmd
where completeArg FileArg = completeFilename (prev, next)
completeArg ShellCommandArg = completeFilename (prev, next)
completeArg NameArg = completeName UpTo [] (prev, next)
completeArg OptionArg = completeOption (prev, next)
completeArg ModuleArg = noCompletion (prev, next)
completeArg NamespaceArg = completeNamespace (prev, next)
completeArg ExprArg = completeName Full [] (prev, next)
completeArg MetaVarArg = completeMetaVar (prev, next)
completeArg ColourArg = completeColour (prev, next)
completeArg NoArg = noCompletion (prev, next)
completeArg ConsoleWidthArg = completeConsoleWidth (prev, next)
completeArg DeclArg = completeName Full [] (prev, next)
completeArg PkgArgs = completePkg (prev, next)
completeArg (ManyArgs a) = completeArg a
completeArg (OptionalArg a) = completeArg a
completeArg (SeqArgs a b) = completeArg a
completeArg _ = noCompletion (prev, next)
completeCmdName = return ("", completeWith commands cmd)
-- | Complete REPL commands and defined identifiers
replCompletion :: CompletionFunc Idris
replCompletion (prev, next) = case firstWord of
':':cmdName -> completeCmd (':':cmdName) (prev, next)
_ -> completeName UpTo [] (prev, next)
where firstWord = fst $ break isWhitespace $ dropWhile isWhitespace $ reverse prev
completePkg :: CompletionFunc Idris
completePkg = completeWord Nothing " \t()" completeP
where completeP p = do pkgs <- runIO installedPackages
return $ completeWith pkgs p
-- The TODOs are Issue #1769 on the issue tracker.
-- https://github.com/idris-lang/Idris-dev/issues/1769
completeTactic :: [String] -> String -> CompletionFunc Idris
completeTactic as tac (prev, next) = fromMaybe completeTacName . fmap completeArg $
lookup tac tacticArgs
where completeTacName = return ("", completeWith tactics tac)
completeArg Nothing = noCompletion (prev, next)
completeArg (Just NameTArg) = noCompletion (prev, next) -- this is for binding new names!
completeArg (Just ExprTArg) = completeName Full as (prev, next)
completeArg (Just StringLitTArg) = noCompletion (prev, next)
completeArg (Just AltsTArg) = noCompletion (prev, next) -- TODO
-- | Complete tactics and their arguments
proverCompletion :: [String] -- ^ The names of current local assumptions
-> CompletionFunc Idris
proverCompletion assumptions (prev, next) = completeTactic assumptions firstWord (prev, next)
where firstWord = fst $ break isWhitespace $ dropWhile isWhitespace $ reverse prev
| markuspf/Idris-dev | src/Idris/Completion.hs | bsd-3-clause | 9,713 | 0 | 16 | 2,688 | 2,675 | 1,402 | 1,273 | 159 | 17 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
module TcCustomSolverSuper where
import GHC.TypeLits
import Data.Typeable
{-
When solving super-class instances, GHC solves the evidence without
using the solver (see `tcSuperClasses` in `TcInstDecls`).
However, some classes need to be excepted from this behavior,
as they have custom solving rules, and this test checks that
we got this right.
PS: this test used to have Typeable in the context too, but
that's a redundant constraint, so I removed it
PPS: the whole structure of tcSuperClasses has changed,
so I'm no longer sure what is being tested here
-}
class (KnownNat x) => C x
class (KnownSymbol x) => D x
instance C 2
instance D "2"
| sdiehl/ghc | testsuite/tests/typecheck/should_compile/TcCustomSolverSuper.hs | bsd-3-clause | 726 | 0 | 6 | 136 | 63 | 34 | 29 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="sr-SP">
<title>AJAX Spider | ZAP Extensions</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm"/>
</maps>
<view>
<name>TOC</name>
<label>Contents</label>
<type>org.zaproxy.zap.extension.help.ZapTocView</type>
<data>toc.xml</data>
</view>
<view>
<name>Index</name>
<label>Index</label>
<type>javax.help.IndexView</type>
<data>index.xml</data>
</view>
<view>
<name>Search</name>
<label>Search</label>
<type>javax.help.SearchView</type>
<data engine="com.sun.java.help.search.DefaultSearchEngine">
JavaHelpSearch
</data>
</view>
<view>
<name>Favorites</name>
<label>Favorites</label>
<type>javax.help.FavoritesView</type>
</view>
</helpset> | kingthorin/zap-extensions | addOns/spiderAjax/src/main/javahelp/org/zaproxy/zap/extension/spiderAjax/resources/help_sr_SP/helpset_sr_SP.hs | apache-2.0 | 973 | 78 | 66 | 159 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE CPP #-}
module Distribution.Simple.GHCJS (
configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe,
replLib, replExe,
startInterpreter,
installLib, installExe,
libAbiHash,
hcPkgInfo,
registerPackage,
componentGhcOptions,
getLibDir,
isDynamic,
getGlobalPackageDB,
runCmd
) where
import Distribution.Simple.GHC.ImplInfo ( getImplInfo, ghcjsVersionImplInfo )
import qualified Distribution.Simple.GHC.Internal as Internal
import Distribution.PackageDescription as PD
( PackageDescription(..), BuildInfo(..), Executable(..)
, Library(..), libModules, exeModules
, hcOptions, hcProfOptions, hcSharedOptions
, allExtensions )
import Distribution.InstalledPackageInfo
( InstalledPackageInfo )
import qualified Distribution.InstalledPackageInfo as InstalledPackageInfo
( InstalledPackageInfo_(..) )
import Distribution.Simple.PackageIndex ( InstalledPackageIndex )
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(..), ComponentLocalBuildInfo(..)
, LibraryName(..) )
import qualified Distribution.Simple.Hpc as Hpc
import Distribution.Simple.InstallDirs hiding ( absoluteInstallDirs )
import Distribution.Simple.BuildPaths
import Distribution.Simple.Utils
import Distribution.Simple.Program
( Program(..), ConfiguredProgram(..), ProgramConfiguration
, ProgramSearchPath
, rawSystemProgramConf
, rawSystemProgramStdout, rawSystemProgramStdoutConf
, getProgramInvocationOutput
, requireProgramVersion, requireProgram
, userMaybeSpecifyPath, programPath
, lookupProgram, addKnownPrograms
, ghcjsProgram, ghcjsPkgProgram, c2hsProgram, hsc2hsProgram
, ldProgram, haddockProgram, stripProgram )
import qualified Distribution.Simple.Program.HcPkg as HcPkg
import qualified Distribution.Simple.Program.Ar as Ar
import qualified Distribution.Simple.Program.Ld as Ld
import qualified Distribution.Simple.Program.Strip as Strip
import Distribution.Simple.Program.GHC
import Distribution.Simple.Setup
( toFlag, fromFlag, configCoverage, configDistPref )
import qualified Distribution.Simple.Setup as Cabal
( Flag(..) )
import Distribution.Simple.Compiler
( CompilerFlavor(..), CompilerId(..), Compiler(..)
, PackageDB(..), PackageDBStack, AbiTag(..) )
import Distribution.Version
( Version(..), anyVersion, orLaterVersion )
import Distribution.System
( Platform(..) )
import Distribution.Verbosity
import Distribution.Utils.NubList
( overNubListR, toNubListR )
import Distribution.Text ( display )
import Language.Haskell.Extension ( Extension(..)
, KnownExtension(..))
import Control.Monad ( unless, when )
import Data.Char ( isSpace )
import qualified Data.Map as M ( fromList )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) )
#endif
import System.Directory ( doesFileExist )
import System.FilePath ( (</>), (<.>), takeExtension,
takeDirectory, replaceExtension,
splitExtension )
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration
-> IO (Compiler, Maybe Platform, ProgramConfiguration)
configure verbosity hcPath hcPkgPath conf0 = do
(ghcjsProg, ghcjsVersion, conf1) <-
requireProgramVersion verbosity ghcjsProgram
(orLaterVersion (Version [0,1] []))
(userMaybeSpecifyPath "ghcjs" hcPath conf0)
Just ghcjsGhcVersion <- findGhcjsGhcVersion verbosity (programPath ghcjsProg)
let implInfo = ghcjsVersionImplInfo ghcjsVersion ghcjsGhcVersion
-- This is slightly tricky, we have to configure ghcjs first, then we use the
-- location of ghcjs to help find ghcjs-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcjsPkgProg, ghcjsPkgVersion, conf2) <-
requireProgramVersion verbosity ghcjsPkgProgram {
programFindLocation = guessGhcjsPkgFromGhcjsPath ghcjsProg
}
anyVersion (userMaybeSpecifyPath "ghcjs-pkg" hcPkgPath conf1)
Just ghcjsPkgGhcjsVersion <- findGhcjsPkgGhcjsVersion
verbosity (programPath ghcjsPkgProg)
when (ghcjsVersion /= ghcjsPkgGhcjsVersion) $ die $
"Version mismatch between ghcjs and ghcjs-pkg: "
++ programPath ghcjsProg ++ " is version " ++ display ghcjsVersion ++ " "
++ programPath ghcjsPkgProg ++ " is version " ++ display ghcjsPkgGhcjsVersion
when (ghcjsGhcVersion /= ghcjsPkgVersion) $ die $
"Version mismatch between ghcjs and ghcjs-pkg: "
++ programPath ghcjsProg
++ " was built with GHC version " ++ display ghcjsGhcVersion ++ " "
++ programPath ghcjsPkgProg
++ " was built with GHC version " ++ display ghcjsPkgVersion
-- be sure to use our versions of hsc2hs, c2hs, haddock and ghc
let hsc2hsProgram' =
hsc2hsProgram { programFindLocation =
guessHsc2hsFromGhcjsPath ghcjsProg }
c2hsProgram' =
c2hsProgram { programFindLocation =
guessC2hsFromGhcjsPath ghcjsProg }
haddockProgram' =
haddockProgram { programFindLocation =
guessHaddockFromGhcjsPath ghcjsProg }
conf3 = addKnownPrograms [ hsc2hsProgram', c2hsProgram', haddockProgram' ] conf2
languages <- Internal.getLanguages verbosity implInfo ghcjsProg
extensions <- Internal.getExtensions verbosity implInfo ghcjsProg
ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcjsProg
let ghcInfoMap = M.fromList ghcInfo
let comp = Compiler {
compilerId = CompilerId GHCJS ghcjsVersion,
compilerAbiTag = AbiTag $
"ghc" ++ intercalate "_" (map show . versionBranch $ ghcjsGhcVersion),
compilerCompat = [CompilerId GHC ghcjsGhcVersion],
compilerLanguages = languages,
compilerExtensions = extensions,
compilerProperties = ghcInfoMap
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
let conf4 = if ghcjsNativeToo comp
then Internal.configureToolchain implInfo
ghcjsProg ghcInfoMap conf3
else conf3
return (comp, compPlatform, conf4)
ghcjsNativeToo :: Compiler -> Bool
ghcjsNativeToo = Internal.ghcLookupProperty "Native Too"
guessGhcjsPkgFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessGhcjsPkgFromGhcjsPath = guessToolFromGhcjsPath ghcjsPkgProgram
guessHsc2hsFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessHsc2hsFromGhcjsPath = guessToolFromGhcjsPath hsc2hsProgram
guessC2hsFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessC2hsFromGhcjsPath = guessToolFromGhcjsPath c2hsProgram
guessHaddockFromGhcjsPath :: ConfiguredProgram -> Verbosity
-> ProgramSearchPath -> IO (Maybe FilePath)
guessHaddockFromGhcjsPath = guessToolFromGhcjsPath haddockProgram
guessToolFromGhcjsPath :: Program -> ConfiguredProgram
-> Verbosity -> ProgramSearchPath
-> IO (Maybe FilePath)
guessToolFromGhcjsPath tool ghcjsProg verbosity searchpath
= do let toolname = programName tool
path = programPath ghcjsProg
dir = takeDirectory path
versionSuffix = takeVersionSuffix (dropExeExtension path)
guessNormal = dir </> toolname <.> exeExtension
guessGhcjsVersioned = dir </> (toolname ++ "-ghcjs" ++ versionSuffix)
<.> exeExtension
guessGhcjs = dir </> (toolname ++ "-ghcjs")
<.> exeExtension
guessVersioned = dir </> (toolname ++ versionSuffix) <.> exeExtension
guesses | null versionSuffix = [guessGhcjs, guessNormal]
| otherwise = [guessGhcjsVersioned,
guessGhcjs,
guessVersioned,
guessNormal]
info verbosity $ "looking for tool " ++ toolname
++ " near compiler in " ++ dir
exists <- mapM doesFileExist guesses
case [ file | (file, True) <- zip guesses exists ] of
-- If we can't find it near ghc, fall back to the usual
-- method.
[] -> programFindLocation tool verbosity searchpath
(fp:_) -> do info verbosity $ "found " ++ toolname ++ " in " ++ fp
return (Just fp)
where takeVersionSuffix :: FilePath -> String
takeVersionSuffix = reverse . takeWhile (`elem ` "0123456789.-") .
reverse
dropExeExtension :: FilePath -> FilePath
dropExeExtension filepath =
case splitExtension filepath of
(filepath', extension) | extension == exeExtension -> filepath'
| otherwise -> filepath
-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramConfiguration
-> IO InstalledPackageIndex
getPackageDBContents verbosity packagedb conf = do
pkgss <- getInstalledPackages' verbosity [packagedb] conf
toPackageIndex verbosity pkgss conf
-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration
-> IO InstalledPackageIndex
getInstalledPackages verbosity packagedbs conf = do
checkPackageDbEnvVar
checkPackageDbStack packagedbs
pkgss <- getInstalledPackages' verbosity packagedbs conf
index <- toPackageIndex verbosity pkgss conf
return $! index
toPackageIndex :: Verbosity
-> [(PackageDB, [InstalledPackageInfo])]
-> ProgramConfiguration
-> IO InstalledPackageIndex
toPackageIndex verbosity pkgss conf = do
-- On Windows, various fields have $topdir/foo rather than full
-- paths. We need to substitute the right value in so that when
-- we, for example, call gcc, we have proper paths to give it.
topDir <- getLibDir' verbosity ghcjsProg
let indices = [ PackageIndex.fromList (map (Internal.substTopDir topDir) pkgs)
| (_, pkgs) <- pkgss ]
return $! (mconcat indices)
where
Just ghcjsProg = lookupProgram ghcjsProgram conf
checkPackageDbEnvVar :: IO ()
checkPackageDbEnvVar =
Internal.checkPackageDbEnvVar "GHCJS" "GHCJS_PACKAGE_PATH"
checkPackageDbStack :: PackageDBStack -> IO ()
checkPackageDbStack (GlobalPackageDB:rest)
| GlobalPackageDB `notElem` rest = return ()
checkPackageDbStack rest
| GlobalPackageDB `notElem` rest =
die $ "With current ghc versions the global package db is always used "
++ "and must be listed first. This ghc limitation may be lifted in "
++ "future, see http://hackage.haskell.org/trac/ghc/ticket/5977"
checkPackageDbStack _ =
die $ "If the global package db is specified, it must be "
++ "specified first and cannot be specified multiple times"
getInstalledPackages' :: Verbosity -> [PackageDB] -> ProgramConfiguration
-> IO [(PackageDB, [InstalledPackageInfo])]
getInstalledPackages' verbosity packagedbs conf =
sequence
[ do pkgs <- HcPkg.dump (hcPkgInfo conf) verbosity packagedb
return (packagedb, pkgs)
| packagedb <- packagedbs ]
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
getLibDir verbosity lbi =
(reverse . dropWhile isSpace . reverse) `fmap`
rawSystemProgramStdoutConf verbosity ghcjsProgram
(withPrograms lbi) ["--print-libdir"]
getLibDir' :: Verbosity -> ConfiguredProgram -> IO FilePath
getLibDir' verbosity ghcjsProg =
(reverse . dropWhile isSpace . reverse) `fmap`
rawSystemProgramStdout verbosity ghcjsProg ["--print-libdir"]
-- | Return the 'FilePath' to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath
getGlobalPackageDB verbosity ghcjsProg =
(reverse . dropWhile isSpace . reverse) `fmap`
rawSystemProgramStdout verbosity ghcjsProg ["--print-global-package-db"]
toJSLibName :: String -> String
toJSLibName lib
| takeExtension lib `elem` [".dll",".dylib",".so"]
= replaceExtension lib "js_so"
| takeExtension lib == ".a" = replaceExtension lib "js_a"
| otherwise = lib <.> "js_a"
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int) -> PackageDescription
-> LocalBuildInfo -> Library -> ComponentLocalBuildInfo
-> IO ()
buildLib = buildOrReplLib False
replLib = buildOrReplLib True
buildOrReplLib :: Bool -> Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildOrReplLib forRepl verbosity numJobs _pkg_descr lbi lib clbi = do
libName <- case componentLibraries clbi of
[libName] -> return libName
[] -> die "No library name found when building library"
_ -> die "Multiple library names found when building library"
let libTargetDir = buildDir lbi
whenVanillaLib forceVanilla =
when (not forRepl && (forceVanilla || withVanillaLib lbi))
whenProfLib = when (not forRepl && withProfLib lbi)
whenSharedLib forceShared =
when (not forRepl && (forceShared || withSharedLib lbi))
whenGHCiLib = when (not forRepl && withGHCiLib lbi && withVanillaLib lbi)
ifReplLib = when forRepl
comp = compiler lbi
implInfo = getImplInfo comp
hole_insts = map (\(k,(p,n)) -> (k,(InstalledPackageInfo.packageKey p,n)))
(instantiatedWith lbi)
nativeToo = ghcjsNativeToo comp
(ghcjsProg, _) <- requireProgram verbosity ghcjsProgram (withPrograms lbi)
let runGhcjsProg = runGHC verbosity ghcjsProg comp
libBi = libBuildInfo lib
isGhcjsDynamic = isDynamic comp
dynamicTooSupported = supportsDynamicToo comp
doingTH = EnableExtension TemplateHaskell `elem` allExtensions libBi
forceVanillaLib = doingTH && not isGhcjsDynamic
forceSharedLib = doingTH && isGhcjsDynamic
-- TH always needs default libs, even when building for profiling
-- Determine if program coverage should be enabled and if so, what
-- '-hpcdir' should be.
let isCoverageEnabled = fromFlag $ configCoverage $ configFlags lbi
-- Component name. Not 'libName' because that has the "HS" prefix
-- that GHC gives Haskell libraries.
cname = display $ PD.package $ localPkgDescr lbi
distPref = fromFlag $ configDistPref $ configFlags lbi
hpcdir way
| isCoverageEnabled = toFlag $ Hpc.mixDir distPref way cname
| otherwise = mempty
createDirectoryIfMissingVerbose verbosity True libTargetDir
-- TODO: do we need to put hs-boot files into place for mutually recursive
-- modules?
let cObjs = map (`replaceExtension` objExtension) (cSources libBi)
jsSrcs = jsSources libBi
baseOpts = componentGhcOptions verbosity lbi libBi clbi libTargetDir
linkJsLibOpts = mempty {
ghcOptExtra = toNubListR $
[ "-link-js-lib" , (\(LibraryName l) -> l) libName
, "-js-lib-outputdir", libTargetDir ] ++
concatMap (\x -> ["-js-lib-src",x]) jsSrcs
}
vanillaOptsNoJsLib = baseOpts `mappend` mempty {
ghcOptMode = toFlag GhcModeMake,
ghcOptNumJobs = numJobs,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptSigOf = hole_insts,
ghcOptInputModules = toNubListR $ libModules lib,
ghcOptHPCDir = hpcdir Hpc.Vanilla
}
vanillaOpts = vanillaOptsNoJsLib `mappend` linkJsLibOpts
profOpts = adjustExts "p_hi" "p_o" vanillaOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptExtra = toNubListR $
ghcjsProfOptions libBi,
ghcOptHPCDir = hpcdir Hpc.Prof
}
sharedOpts = adjustExts "dyn_hi" "dyn_o" vanillaOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptFPic = toFlag True,
ghcOptExtra = toNubListR $
ghcjsSharedOptions libBi,
ghcOptHPCDir = hpcdir Hpc.Dyn
}
linkerOpts = mempty {
ghcOptLinkOptions = toNubListR $ PD.ldOptions libBi,
ghcOptLinkLibs = toNubListR $ extraLibs libBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi,
ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi,
ghcOptInputFiles =
toNubListR $ [libTargetDir </> x | x <- cObjs] ++ jsSrcs
}
replOpts = vanillaOptsNoJsLib {
ghcOptExtra = overNubListR
Internal.filterGhciFlags
(ghcOptExtra vanillaOpts),
ghcOptNumJobs = mempty
}
`mappend` linkerOpts
`mappend` mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptOptimisation = toFlag GhcNoOptimisation
}
vanillaSharedOpts = vanillaOpts `mappend`
mempty {
ghcOptDynLinkMode = toFlag GhcStaticAndDynamic,
ghcOptDynHiSuffix = toFlag "dyn_hi",
ghcOptDynObjSuffix = toFlag "dyn_o",
ghcOptHPCDir = hpcdir Hpc.Dyn
}
unless (forRepl || (null (libModules lib) && null jsSrcs && null cObjs)) $
do let vanilla = whenVanillaLib forceVanillaLib (runGhcjsProg vanillaOpts)
shared = whenSharedLib forceSharedLib (runGhcjsProg sharedOpts)
useDynToo = dynamicTooSupported &&
(forceVanillaLib || withVanillaLib lbi) &&
(forceSharedLib || withSharedLib lbi) &&
null (ghcjsSharedOptions libBi)
if useDynToo
then do
runGhcjsProg vanillaSharedOpts
case (hpcdir Hpc.Dyn, hpcdir Hpc.Vanilla) of
(Cabal.Flag dynDir, Cabal.Flag vanillaDir) -> do
-- When the vanilla and shared library builds are done
-- in one pass, only one set of HPC module interfaces
-- are generated. This set should suffice for both
-- static and dynamically linked executables. We copy
-- the modules interfaces so they are available under
-- both ways.
copyDirectoryRecursive verbosity dynDir vanillaDir
_ -> return ()
else if isGhcjsDynamic
then do shared; vanilla
else do vanilla; shared
whenProfLib (runGhcjsProg profOpts)
-- build any C sources
unless (null (cSources libBi) || not nativeToo) $ do
info verbosity "Building C Sources..."
sequence_
[ do let vanillaCcOpts =
(Internal.componentCcGhcOptions verbosity implInfo
lbi libBi clbi libTargetDir filename)
profCcOpts = vanillaCcOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptObjSuffix = toFlag "p_o"
}
sharedCcOpts = vanillaCcOpts `mappend` mempty {
ghcOptFPic = toFlag True,
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptObjSuffix = toFlag "dyn_o"
}
odir = fromFlag (ghcOptObjDir vanillaCcOpts)
createDirectoryIfMissingVerbose verbosity True odir
runGhcjsProg vanillaCcOpts
whenSharedLib forceSharedLib (runGhcjsProg sharedCcOpts)
whenProfLib (runGhcjsProg profCcOpts)
| filename <- cSources libBi]
-- TODO: problem here is we need the .c files built first, so we can load them
-- with ghci, but .c files can depend on .h files generated by ghc by ffi
-- exports.
unless (null (libModules lib)) $
ifReplLib (runGhcjsProg replOpts)
-- link:
when (nativeToo && not forRepl) $ do
info verbosity "Linking..."
let cProfObjs = map (`replaceExtension` ("p_" ++ objExtension))
(cSources libBi)
cSharedObjs = map (`replaceExtension` ("dyn_" ++ objExtension))
(cSources libBi)
cid = compilerId (compiler lbi)
vanillaLibFilePath = libTargetDir </> mkLibName libName
profileLibFilePath = libTargetDir </> mkProfLibName libName
sharedLibFilePath = libTargetDir </> mkSharedLibName cid libName
ghciLibFilePath = libTargetDir </> Internal.mkGHCiLibName libName
hObjs <- Internal.getHaskellObjects implInfo lib lbi
libTargetDir objExtension True
hProfObjs <-
if (withProfLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
libTargetDir ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if (withSharedLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
libTargetDir ("dyn_" ++ objExtension) False
else return []
unless (null hObjs && null cObjs) $ do
let staticObjectFiles =
hObjs
++ map (libTargetDir </>) cObjs
profObjectFiles =
hProfObjs
++ map (libTargetDir </>) cProfObjs
ghciObjFiles =
hObjs
++ map (libTargetDir </>) cObjs
dynamicObjectFiles =
hSharedObjs
++ map (libTargetDir </>) cSharedObjs
-- After the relocation lib is created we invoke ghc -shared
-- with the dependencies spelled out as -package arguments
-- and ghc invokes the linker with the proper library paths
ghcSharedLinkArgs =
mempty {
ghcOptShared = toFlag True,
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptInputFiles = toNubListR dynamicObjectFiles,
ghcOptOutputFile = toFlag sharedLibFilePath,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptNoAutoLinkPackages = toFlag True,
ghcOptPackageDBs = withPackageDB lbi,
ghcOptPackages = toNubListR $
Internal.mkGhcOptPackages clbi,
ghcOptLinkLibs = toNubListR $ extraLibs libBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi
}
whenVanillaLib False $ do
Ar.createArLibArchive verbosity lbi vanillaLibFilePath staticObjectFiles
whenProfLib $ do
Ar.createArLibArchive verbosity lbi profileLibFilePath profObjectFiles
whenGHCiLib $ do
(ldProg, _) <- requireProgram verbosity ldProgram (withPrograms lbi)
Ld.combineObjectFiles verbosity ldProg
ghciLibFilePath ghciObjFiles
whenSharedLib False $
runGhcjsProg ghcSharedLinkArgs
-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramConfiguration -> Compiler
-> PackageDBStack -> IO ()
startInterpreter verbosity conf comp packageDBs = do
let replOpts = mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptPackageDBs = packageDBs
}
checkPackageDbStack packageDBs
(ghcjsProg, _) <- requireProgram verbosity ghcjsProgram conf
runGHC verbosity ghcjsProg comp replOpts
buildExe, replExe :: Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Executable -> ComponentLocalBuildInfo -> IO ()
buildExe = buildOrReplExe False
replExe = buildOrReplExe True
buildOrReplExe :: Bool -> Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Executable -> ComponentLocalBuildInfo -> IO ()
buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi
exe@Executable { exeName = exeName', modulePath = modPath } clbi = do
(ghcjsProg, _) <- requireProgram verbosity ghcjsProgram (withPrograms lbi)
let comp = compiler lbi
implInfo = getImplInfo comp
runGhcjsProg = runGHC verbosity ghcjsProg comp
exeBi = buildInfo exe
-- exeNameReal, the name that GHC really uses (with .exe on Windows)
let exeNameReal = exeName' <.>
(if takeExtension exeName' /= ('.':exeExtension)
then exeExtension
else "")
let targetDir = (buildDir lbi) </> exeName'
let exeDir = targetDir </> (exeName' ++ "-tmp")
createDirectoryIfMissingVerbose verbosity True targetDir
createDirectoryIfMissingVerbose verbosity True exeDir
-- TODO: do we need to put hs-boot files into place for mutually recursive
-- modules? FIX: what about exeName.hi-boot?
-- Determine if program coverage should be enabled and if so, what
-- '-hpcdir' should be.
let isCoverageEnabled = fromFlag $ configCoverage $ configFlags lbi
distPref = fromFlag $ configDistPref $ configFlags lbi
hpcdir way
| isCoverageEnabled = toFlag $ Hpc.mixDir distPref way exeName'
| otherwise = mempty
-- build executables
srcMainFile <- findFile (exeDir : hsSourceDirs exeBi) modPath
let isGhcjsDynamic = isDynamic comp
dynamicTooSupported = supportsDynamicToo comp
buildRunner = case clbi of
ExeComponentLocalBuildInfo {} -> False
_ -> True
isHaskellMain = elem (takeExtension srcMainFile) [".hs", ".lhs"]
jsSrcs = jsSources exeBi
cSrcs = cSources exeBi ++ [srcMainFile | not isHaskellMain]
cObjs = map (`replaceExtension` objExtension) cSrcs
nativeToo = ghcjsNativeToo comp
baseOpts = (componentGhcOptions verbosity lbi exeBi clbi exeDir)
`mappend` mempty {
ghcOptMode = toFlag GhcModeMake,
ghcOptInputFiles = toNubListR $
[ srcMainFile | isHaskellMain],
ghcOptInputModules = toNubListR $
[ m | not isHaskellMain, m <- exeModules exe],
ghcOptExtra =
if buildRunner then toNubListR ["-build-runner"]
else mempty
}
staticOpts = baseOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcStaticOnly,
ghcOptHPCDir = hpcdir Hpc.Vanilla
}
profOpts = adjustExts "p_hi" "p_o" baseOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptExtra = toNubListR $ ghcjsProfOptions exeBi,
ghcOptHPCDir = hpcdir Hpc.Prof
}
dynOpts = adjustExts "dyn_hi" "dyn_o" baseOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptExtra = toNubListR $
ghcjsSharedOptions exeBi,
ghcOptHPCDir = hpcdir Hpc.Dyn
}
dynTooOpts = adjustExts "dyn_hi" "dyn_o" staticOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcStaticAndDynamic,
ghcOptHPCDir = hpcdir Hpc.Dyn
}
linkerOpts = mempty {
ghcOptLinkOptions = toNubListR $ PD.ldOptions exeBi,
ghcOptLinkLibs = toNubListR $ extraLibs exeBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs exeBi,
ghcOptLinkFrameworks = toNubListR $ PD.frameworks exeBi,
ghcOptInputFiles = toNubListR $
[exeDir </> x | x <- cObjs] ++ jsSrcs
}
replOpts = baseOpts {
ghcOptExtra = overNubListR
Internal.filterGhciFlags
(ghcOptExtra baseOpts)
}
-- For a normal compile we do separate invocations of ghc for
-- compiling as for linking. But for repl we have to do just
-- the one invocation, so that one has to include all the
-- linker stuff too, like -l flags and any .o files from C
-- files etc.
`mappend` linkerOpts
`mappend` mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptOptimisation = toFlag GhcNoOptimisation
}
commonOpts | withProfExe lbi = profOpts
| withDynExe lbi = dynOpts
| otherwise = staticOpts
compileOpts | useDynToo = dynTooOpts
| otherwise = commonOpts
withStaticExe = (not $ withProfExe lbi) && (not $ withDynExe lbi)
-- For building exe's that use TH with -prof or -dynamic we actually have
-- to build twice, once without -prof/-dynamic and then again with
-- -prof/-dynamic. This is because the code that TH needs to run at
-- compile time needs to be the vanilla ABI so it can be loaded up and run
-- by the compiler.
-- With dynamic-by-default GHC the TH object files loaded at compile-time
-- need to be .dyn_o instead of .o.
doingTH = EnableExtension TemplateHaskell `elem` allExtensions exeBi
-- Should we use -dynamic-too instead of compiling twice?
useDynToo = dynamicTooSupported && isGhcjsDynamic
&& doingTH && withStaticExe && null (ghcjsSharedOptions exeBi)
compileTHOpts | isGhcjsDynamic = dynOpts
| otherwise = staticOpts
compileForTH
| forRepl = False
| useDynToo = False
| isGhcjsDynamic = doingTH && (withProfExe lbi || withStaticExe)
| otherwise = doingTH && (withProfExe lbi || withDynExe lbi)
linkOpts = commonOpts `mappend`
linkerOpts `mappend` mempty {
ghcOptLinkNoHsMain = toFlag (not isHaskellMain)
}
-- Build static/dynamic object files for TH, if needed.
when compileForTH $
runGhcjsProg compileTHOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
unless forRepl $
runGhcjsProg compileOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
-- build any C sources
unless (null cSrcs || not nativeToo) $ do
info verbosity "Building C Sources..."
sequence_
[ do let opts = (Internal.componentCcGhcOptions verbosity implInfo lbi exeBi
clbi exeDir filename) `mappend` mempty {
ghcOptDynLinkMode = toFlag (if withDynExe lbi
then GhcDynamicOnly
else GhcStaticOnly),
ghcOptProfilingMode = toFlag (withProfExe lbi)
}
odir = fromFlag (ghcOptObjDir opts)
createDirectoryIfMissingVerbose verbosity True odir
runGhcjsProg opts
| filename <- cSrcs ]
-- TODO: problem here is we need the .c files built first, so we can load them
-- with ghci, but .c files can depend on .h files generated by ghc by ffi
-- exports.
when forRepl $ runGhcjsProg replOpts
-- link:
unless forRepl $ do
info verbosity "Linking..."
runGhcjsProg linkOpts { ghcOptOutputFile = toFlag (targetDir </> exeNameReal) }
-- |Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity
-> LocalBuildInfo
-> FilePath -- ^install location
-> FilePath -- ^install location for dynamic libraries
-> FilePath -- ^Build location
-> PackageDescription
-> Library
-> ComponentLocalBuildInfo
-> IO ()
installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do
whenVanilla $ copyModuleFiles "js_hi"
whenProf $ copyModuleFiles "js_p_hi"
whenShared $ copyModuleFiles "js_dyn_hi"
whenVanilla $ mapM_ (installOrdinary builtDir targetDir . toJSLibName) vanillaLibNames
whenProf $ mapM_ (installOrdinary builtDir targetDir . toJSLibName) profileLibNames
whenShared $ mapM_ (installShared builtDir dynlibTargetDir . toJSLibName) sharedLibNames
when (ghcjsNativeToo $ compiler lbi) $ do
-- copy .hi files over:
whenVanilla $ copyModuleFiles "hi"
whenProf $ copyModuleFiles "p_hi"
whenShared $ copyModuleFiles "dyn_hi"
-- copy the built library files over:
whenVanilla $ mapM_ (installOrdinary builtDir targetDir) vanillaLibNames
whenProf $ mapM_ (installOrdinary builtDir targetDir) profileLibNames
whenGHCi $ mapM_ (installOrdinary builtDir targetDir) ghciLibNames
whenShared $ mapM_ (installShared builtDir dynlibTargetDir) sharedLibNames
where
install isShared srcDir dstDir name = do
let src = srcDir </> name
dst = dstDir </> name
createDirectoryIfMissingVerbose verbosity True dstDir
if isShared
then do when (stripLibs lbi) $ Strip.stripLib verbosity
(hostPlatform lbi) (withPrograms lbi) src
installExecutableFile verbosity src dst
else installOrdinaryFile verbosity src dst
installOrdinary = install False
installShared = install True
copyModuleFiles ext =
findModuleFiles [builtDir] [ext] (libModules lib)
>>= installOrdinaryFiles verbosity targetDir
cid = compilerId (compiler lbi)
libNames = componentLibraries clbi
vanillaLibNames = map mkLibName libNames
profileLibNames = map mkProfLibName libNames
ghciLibNames = map Internal.mkGHCiLibName libNames
sharedLibNames = map (mkSharedLibName cid) libNames
hasLib = not $ null (libModules lib)
&& null (cSources (libBuildInfo lib))
whenVanilla = when (hasLib && withVanillaLib lbi)
whenProf = when (hasLib && withProfLib lbi)
whenGHCi = when (hasLib && withGHCiLib lbi)
whenShared = when (hasLib && withSharedLib lbi)
installExe :: Verbosity
-> LocalBuildInfo
-> InstallDirs FilePath -- ^Where to copy the files to
-> FilePath -- ^Build location
-> (FilePath, FilePath) -- ^Executable (prefix,suffix)
-> PackageDescription
-> Executable
-> IO ()
installExe verbosity lbi installDirs buildPref
(progprefix, progsuffix) _pkg exe = do
let binDir = bindir installDirs
createDirectoryIfMissingVerbose verbosity True binDir
let exeFileName = exeName exe
fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
installBinary dest = do
rawSystemProgramConf verbosity ghcjsProgram (withPrograms lbi) $
[ "--install-executable"
, buildPref </> exeName exe </> exeFileName
, "-o", dest
] ++
case (stripExes lbi, lookupProgram stripProgram $ withPrograms lbi) of
(True, Just strip) -> ["-strip-program", programPath strip]
_ -> []
installBinary (binDir </> fixedExeBaseName)
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO String
libAbiHash verbosity _pkg_descr lbi lib clbi = do
let
libBi = libBuildInfo lib
comp = compiler lbi
vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (buildDir lbi))
`mappend` mempty {
ghcOptMode = toFlag GhcModeAbiHash,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptInputModules = toNubListR $ exposedModules lib
}
profArgs = adjustExts "js_p_hi" "js_p_o" vanillaArgs `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptExtra = toNubListR (ghcjsProfOptions libBi)
}
ghcArgs = if withVanillaLib lbi then vanillaArgs
else if withProfLib lbi then profArgs
else error "libAbiHash: Can't find an enabled library way"
--
(ghcjsProg, _) <- requireProgram verbosity ghcjsProgram (withPrograms lbi)
getProgramInvocationOutput verbosity (ghcInvocation ghcjsProg comp ghcArgs)
adjustExts :: String -> String -> GhcOptions -> GhcOptions
adjustExts hiSuf objSuf opts =
opts `mappend` mempty {
ghcOptHiSuffix = toFlag hiSuf,
ghcOptObjSuffix = toFlag objSuf
}
registerPackage :: Verbosity
-> InstalledPackageInfo
-> PackageDescription
-> LocalBuildInfo
-> Bool
-> PackageDBStack
-> IO ()
registerPackage verbosity installedPkgInfo _pkg lbi _inplace packageDbs =
HcPkg.reregister (hcPkgInfo $ withPrograms lbi) verbosity packageDbs
(Right installedPkgInfo)
componentGhcOptions :: Verbosity -> LocalBuildInfo
-> BuildInfo -> ComponentLocalBuildInfo -> FilePath
-> GhcOptions
componentGhcOptions verbosity lbi bi clbi odir =
let opts = Internal.componentGhcOptions verbosity lbi bi clbi odir
in opts { ghcOptExtra = ghcOptExtra opts `mappend` toNubListR
(hcOptions GHCJS bi)
}
ghcjsProfOptions :: BuildInfo -> [String]
ghcjsProfOptions bi =
hcProfOptions GHC bi `mappend` hcProfOptions GHCJS bi
ghcjsSharedOptions :: BuildInfo -> [String]
ghcjsSharedOptions bi =
hcSharedOptions GHC bi `mappend` hcSharedOptions GHCJS bi
isDynamic :: Compiler -> Bool
isDynamic = Internal.ghcLookupProperty "GHC Dynamic"
supportsDynamicToo :: Compiler -> Bool
supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too"
findGhcjsGhcVersion :: Verbosity -> FilePath -> IO (Maybe Version)
findGhcjsGhcVersion verbosity pgm =
findProgramVersion "--numeric-ghc-version" id verbosity pgm
findGhcjsPkgGhcjsVersion :: Verbosity -> FilePath -> IO (Maybe Version)
findGhcjsPkgGhcjsVersion verbosity pgm =
findProgramVersion "--numeric-ghcjs-version" id verbosity pgm
-- -----------------------------------------------------------------------------
-- Registering
hcPkgInfo :: ProgramConfiguration -> HcPkg.HcPkgInfo
hcPkgInfo conf = HcPkg.HcPkgInfo { HcPkg.hcPkgProgram = ghcjsPkgProg
, HcPkg.noPkgDbStack = False
, HcPkg.noVerboseFlag = False
, HcPkg.flagPackageConf = False
, HcPkg.useSingleFileDb = v < [7,9]
}
where
v = versionBranch ver
Just ghcjsPkgProg = lookupProgram ghcjsPkgProgram conf
Just ver = programVersion ghcjsPkgProg
-- | Get the JavaScript file name and command and arguments to run a
-- program compiled by GHCJS
-- the exe should be the base program name without exe extension
runCmd :: ProgramConfiguration -> FilePath
-> (FilePath, FilePath, [String])
runCmd conf exe =
( script
, programPath ghcjsProg
, programDefaultArgs ghcjsProg ++ programOverrideArgs ghcjsProg ++ ["--run"]
)
where
script = exe <.> "jsexe" </> "all" <.> "js"
Just ghcjsProg = lookupProgram ghcjsProgram conf
| Helkafen/cabal | Cabal/Distribution/Simple/GHCJS.hs | bsd-3-clause | 41,352 | 0 | 23 | 13,289 | 8,181 | 4,270 | 3,911 | 708 | 8 |
{-# LANGUAGE OverloadedStrings #-}
module Clay.Attributes where
import Clay.Selector
-- From: http://www.whatwg.org/specs/web-apps/current-work/multipage/section-index.html#index
accept, acceptCharset, accesskey, action, alt, async, autocomplete, autofocus,
autoplay, challenge, charset, checked, class_, cols, colspan, content,
contenteditable, contextmenu, controls, coords, crossorigin, datetime,
default_, defer, dir, dirname, disabled, download, draggable, dropzone,
enctype, for, formaction, formenctype, formmethod, formnovalidate,
formtarget, headers, height, hidden, high, href, hreflang, httpEquiv, icon,
id, inert, inputmode, ismap, itemid, itemprop, itemref, itemscope, itemtype,
keytype, kind, lang, list, loop, low, manifest, max, maxlength, media,
mediagroup, method, min, multiple, muted, name, novalidate, open, optimum,
pattern, ping, placeholder, poster, preload, radiogroup, readonly, rel,
required, reversed, rows, rowspan, sandbox, scope, scoped, seamless,
selected, shape, size, sizes, spellcheck, src, srcdoc, srclang, srcset,
start, step, tabindex, target, translate, type_, typemustmatch, usemap,
value, width, wrap :: Refinement
accept = "accept"
acceptCharset = "accept-charset"
accesskey = "accesskey"
action = "action"
alt = "alt"
async = "async"
autocomplete = "autocomplete"
autofocus = "autofocus"
autoplay = "autoplay"
challenge = "challenge"
charset = "charset"
checked = "checked"
class_ = "class"
cols = "cols"
colspan = "colspan"
content = "content"
contenteditable = "contenteditable"
contextmenu = "contextmenu"
controls = "controls"
coords = "coords"
crossorigin = "crossorigin"
datetime = "datetime"
default_ = "default"
defer = "defer"
dir = "dir"
dirname = "dirname"
disabled = "disabled"
download = "download"
draggable = "draggable"
dropzone = "dropzone"
enctype = "enctype"
for = "for"
formaction = "formaction"
formenctype = "formenctype"
formmethod = "formmethod"
formnovalidate = "formnovalidate"
formtarget = "formtarget"
headers = "headers"
height = "height"
hidden = "hidden"
high = "high"
href = "href"
hreflang = "hreflang"
httpEquiv = "http-equiv"
icon = "icon"
id = "id"
inert = "inert"
inputmode = "inputmode"
ismap = "ismap"
itemid = "itemid"
itemprop = "itemprop"
itemref = "itemref"
itemscope = "itemscope"
itemtype = "itemtype"
keytype = "keytype"
kind = "kind"
lang = "lang"
list = "list"
loop = "loop"
low = "low"
manifest = "manifest"
max = "max"
maxlength = "maxlength"
media = "media"
mediagroup = "mediagroup"
method = "method"
min = "min"
multiple = "multiple"
muted = "muted"
name = "name"
novalidate = "novalidate"
open = "open"
optimum = "optimum"
pattern = "pattern"
ping = "ping"
placeholder = "placeholder"
poster = "poster"
preload = "preload"
radiogroup = "radiogroup"
readonly = "readonly"
rel = "rel"
required = "required"
reversed = "reversed"
rows = "rows"
rowspan = "rowspan"
sandbox = "sandbox"
scope = "scope"
scoped = "scoped"
seamless = "seamless"
selected = "selected"
shape = "shape"
size = "size"
sizes = "sizes"
spellcheck = "spellcheck"
src = "src"
srcdoc = "srcdoc"
srclang = "srclang"
srcset = "srcset"
start = "start"
step = "step"
tabindex = "tabindex"
target = "target"
translate = "translate"
type_ = "type"
typemustmatch = "typemustmatch"
usemap = "usemap"
value = "value"
width = "width"
wrap = "wrap"
| Heather/clay | src/Clay/Attributes.hs | bsd-3-clause | 3,332 | 0 | 5 | 481 | 782 | 556 | 226 | 126 | 1 |
{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-}
{-# LANGUAGE UndecidableInstances, ScopedTypeVariables, FlexibleContexts #-}
module T11990b where
import GHC.TypeLits
import Data.Proxy
type family PartialTF t :: Symbol where
PartialTF Int = "Int"
PartialTF Bool = "Bool"
PartialTF a = TypeError (Text "Unexpected type @ PartialTF: "
:<>: ShowType a)
type family NestedPartialTF (tsym :: Symbol) :: Symbol where
NestedPartialTF "Int" = "int"
NestedPartialTF "Bool" = "bool"
NestedPartialTF a =
TypeError (Text "Unexpected type @ NestedPartialTF: " :<>: ShowType a)
testPartialTF :: forall a.(KnownSymbol (PartialTF a)) => a -> String
testPartialTF t = symbolVal (Proxy :: Proxy (PartialTF a))
testNesPartialTF ::
forall a.(KnownSymbol (NestedPartialTF (PartialTF a))) => a -> String
testNesPartialTF t = symbolVal (Proxy :: Proxy (NestedPartialTF (PartialTF a)))
t2 = testNesPartialTF 'a'
| ezyang/ghc | testsuite/tests/typecheck/should_fail/T11990b.hs | bsd-3-clause | 981 | 0 | 11 | 207 | 252 | 135 | 117 | 21 | 1 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, RoleAnnotations #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Ptr
-- Copyright : (c) The FFI Task Force, 2000-2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : ffi@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- The 'Ptr' and 'FunPtr' types and operations.
--
-----------------------------------------------------------------------------
module GHC.Ptr (
Ptr(..), FunPtr(..),
nullPtr, castPtr, plusPtr, alignPtr, minusPtr,
nullFunPtr, castFunPtr,
-- * Unsafe functions
castFunPtrToPtr, castPtrToFunPtr
) where
import GHC.Base
import GHC.Show
import GHC.Num
import GHC.List ( length, replicate )
import Numeric ( showHex )
#include "MachDeps.h"
------------------------------------------------------------------------
-- Data pointers.
-- The role of Ptr's parameter is phantom, as there is no relation between
-- the Haskell representation and whathever the user puts at the end of the
-- pointer. And phantom is useful to implement castPtr (see #9163)
-- redundant role annotation checks that this doesn't change
type role Ptr phantom
data Ptr a = Ptr Addr# deriving (Eq, Ord)
-- ^ A value of type @'Ptr' a@ represents a pointer to an object, or an
-- array of objects, which may be marshalled to or from Haskell values
-- of type @a@.
--
-- The type @a@ will often be an instance of class
-- 'Foreign.Storable.Storable' which provides the marshalling operations.
-- However this is not essential, and you can provide your own operations
-- to access the pointer. For example you might write small foreign
-- functions to get or set the fields of a C @struct@.
-- |The constant 'nullPtr' contains a distinguished value of 'Ptr'
-- that is not associated with a valid memory location.
nullPtr :: Ptr a
nullPtr = Ptr nullAddr#
-- |The 'castPtr' function casts a pointer from one type to another.
castPtr :: Ptr a -> Ptr b
castPtr = coerce
-- |Advances the given address by the given offset in bytes.
plusPtr :: Ptr a -> Int -> Ptr b
plusPtr (Ptr addr) (I# d) = Ptr (plusAddr# addr d)
-- |Given an arbitrary address and an alignment constraint,
-- 'alignPtr' yields the next higher address that fulfills the
-- alignment constraint. An alignment constraint @x@ is fulfilled by
-- any address divisible by @x@. This operation is idempotent.
alignPtr :: Ptr a -> Int -> Ptr a
alignPtr addr@(Ptr a) (I# i)
= case remAddr# a i of {
0# -> addr;
n -> Ptr (plusAddr# a (i -# n)) }
-- |Computes the offset required to get from the second to the first
-- argument. We have
--
-- > p2 == p1 `plusPtr` (p2 `minusPtr` p1)
minusPtr :: Ptr a -> Ptr b -> Int
minusPtr (Ptr a1) (Ptr a2) = I# (minusAddr# a1 a2)
------------------------------------------------------------------------
-- Function pointers for the default calling convention.
-- 'FunPtr' has a phantom role for similar reasons to 'Ptr'. Note
-- that 'FunPtr's role cannot become nominal without changes elsewhere
-- in GHC. See Note [FFI type roles] in TcForeign.
type role FunPtr phantom
data FunPtr a = FunPtr Addr# deriving (Eq, Ord)
-- ^ A value of type @'FunPtr' a@ is a pointer to a function callable
-- from foreign code. The type @a@ will normally be a /foreign type/,
-- a function type with zero or more arguments where
--
-- * the argument types are /marshallable foreign types/,
-- i.e. 'Char', 'Int', 'Double', 'Float',
-- 'Bool', 'Data.Int.Int8', 'Data.Int.Int16', 'Data.Int.Int32',
-- 'Data.Int.Int64', 'Data.Word.Word8', 'Data.Word.Word16',
-- 'Data.Word.Word32', 'Data.Word.Word64', @'Ptr' a@, @'FunPtr' a@,
-- @'Foreign.StablePtr.StablePtr' a@ or a renaming of any of these
-- using @newtype@.
--
-- * the return type is either a marshallable foreign type or has the form
-- @'IO' t@ where @t@ is a marshallable foreign type or @()@.
--
-- A value of type @'FunPtr' a@ may be a pointer to a foreign function,
-- either returned by another foreign function or imported with a
-- a static address import like
--
-- > foreign import ccall "stdlib.h &free"
-- > p_free :: FunPtr (Ptr a -> IO ())
--
-- or a pointer to a Haskell function created using a /wrapper/ stub
-- declared to produce a 'FunPtr' of the correct type. For example:
--
-- > type Compare = Int -> Int -> Bool
-- > foreign import ccall "wrapper"
-- > mkCompare :: Compare -> IO (FunPtr Compare)
--
-- Calls to wrapper stubs like @mkCompare@ allocate storage, which
-- should be released with 'Foreign.Ptr.freeHaskellFunPtr' when no
-- longer required.
--
-- To convert 'FunPtr' values to corresponding Haskell functions, one
-- can define a /dynamic/ stub for the specific foreign type, e.g.
--
-- > type IntFunction = CInt -> IO ()
-- > foreign import ccall "dynamic"
-- > mkFun :: FunPtr IntFunction -> IntFunction
-- |The constant 'nullFunPtr' contains a
-- distinguished value of 'FunPtr' that is not
-- associated with a valid memory location.
nullFunPtr :: FunPtr a
nullFunPtr = FunPtr nullAddr#
-- |Casts a 'FunPtr' to a 'FunPtr' of a different type.
castFunPtr :: FunPtr a -> FunPtr b
castFunPtr = coerce
-- |Casts a 'FunPtr' to a 'Ptr'.
--
-- /Note:/ this is valid only on architectures where data and function
-- pointers range over the same set of addresses, and should only be used
-- for bindings to external libraries whose interface already relies on
-- this assumption.
castFunPtrToPtr :: FunPtr a -> Ptr b
castFunPtrToPtr (FunPtr addr) = Ptr addr
-- |Casts a 'Ptr' to a 'FunPtr'.
--
-- /Note:/ this is valid only on architectures where data and function
-- pointers range over the same set of addresses, and should only be used
-- for bindings to external libraries whose interface already relies on
-- this assumption.
castPtrToFunPtr :: Ptr a -> FunPtr b
castPtrToFunPtr (Ptr addr) = FunPtr addr
------------------------------------------------------------------------
-- Show instances for Ptr and FunPtr
instance Show (Ptr a) where
showsPrec _ (Ptr a) rs = pad_out (showHex (wordToInteger(int2Word#(addr2Int# a))) "")
where
-- want 0s prefixed to pad it out to a fixed length.
pad_out ls =
'0':'x':(replicate (2*SIZEOF_HSPTR - length ls) '0') ++ ls ++ rs
instance Show (FunPtr a) where
showsPrec p = showsPrec p . castFunPtrToPtr
| tolysz/prepare-ghcjs | spec-lts8/base/GHC/Ptr.hs | bsd-3-clause | 6,465 | 0 | 15 | 1,196 | 711 | 423 | 288 | 44 | 2 |
{-# OPTIONS_GHC -O -funbox-strict-fields #-}
-- The combination of unboxing and a recursive newtype crashed GHC 6.6.1
-- Trac #1255
-- Use -O to force the unboxing to happen
module Foo where
newtype Bar = Bar Bar -- Recursive
data Gah = Gah { baaz :: !Bar }
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc226.hs | bsd-3-clause | 265 | 0 | 9 | 55 | 33 | 22 | 11 | 6 | 0 |
module HAD.Y2014.M03.D21.Exercise where
-- $setup
-- >>> import Test.QuickCheck
-- >>> import Data.Maybe (fromJust)
-- | minmax
-- get apair of the min and max element of a list (in one pass)
-- returns Nothing on empty list
--
-- Point-free: checked
--
-- The function signature follows the idea of the methods in the System.Random
-- module: given a standard generator, you returns the modified list and the
-- generator in an altered state.
--
-- >>> minmax [0..10]
-- Just (0,10)
--
-- >>> minmax []
-- Nothing
--
-- prop> \(NonEmpty(xs)) -> minimum xs == (fst . fromJust . minmax) xs
-- prop> \(NonEmpty(xs)) -> maximum xs == (snd . fromJust . minmax) xs
--
minmax :: Ord a => [a] -> Maybe (a,a)
minmax = undefined
| geophf/1HaskellADay | exercises/HAD/Y2014/M03/D21/Exercise.hs | mit | 722 | 0 | 8 | 132 | 64 | 47 | 17 | 3 | 1 |
{-# LANGUAGE Arrows, FlexibleContexts #-}
module QNDA.ImageReader where
import Text.XML.HXT.Core hiding (xshow)
import System.Directory (copyFile, doesFileExist, getCurrentDirectory)
import qualified System.FilePath.Posix as FP
import qualified System.Process as Prc (readProcess)
import Network.HTTP.Base (urlEncode)
import qualified Control.Exception as E
import System.IO.Error
-- import qualified Debug.Trace as DT (trace)
voidimg = "public/void.jpg"
imagePathToResourceName :: FilePath -- directory of image files
-> FilePath -- input file name
-> IO [FilePath] -- list of image paths within the file
imagePathToResourceName imagesdir f = do
links <-
runX (readDocument [ withIndent no
, withRemoveWS yes
, withValidate no
] f
>>>
(listA $
multi $
hasName "img" >>>
(ifA ( hasAttrValue "class" (=="inlinemath")
<+> hasAttrValue "class" (=="displaymath"))
(none)
(getAttrValue "src"))))
paths <- mapM (
\((basename, extension), counter) -> do
let imgpathInEpub = imagesdir ++ (FP.takeBaseName f) ++ basename ++ (show counter) ++ extension
imgsrc = imagesdir++basename++extension
dfe <- doesFileExist imgsrc
if dfe then (copyFile imgsrc imgpathInEpub) else (copyFile voidimg imgpathInEpub)
return imgpathInEpub
) $ zip (map (\link -> (FP.takeBaseName link, FP.takeExtension link)) $ concat links) [1..]
return paths
ignore :: E.SomeException -> IO ()
ignore _ = return ()
mkImgId :: FilePath -> (FilePath, Int) -> String
mkImgId f (s,c) = FP.takeBaseName f ++ (urlEncode $ FP.takeBaseName s) ++ show c ++ FP.takeExtension s
mkImgSrcPath :: String -> FilePath
mkImgSrcPath imgid = FP.combine "images" $ imgid
imgElem :: (ArrowXml a) => FilePath -> a XmlTree XmlTree
imgElem f =
fromSLA 0 (
processBottomUp (
(((\(alt,path) ->
(eelem "img"
+= sattr "src" path
+= sattr "alt" alt
+= sattr "class" "figure"
+= (sattr "style" $< styleAttr)))
$<
(getAttrValue "src" &&& nextState (+1) >>> arr (mkImgId f) >>> (this &&& arr mkImgSrcPath)))
)
`when`
(hasName "img" >>> neg (hasAttrValue "class" (=="inlinemath") <+> hasAttrValue "class" (=="displaymath")))))
styleAttr :: (ArrowXml a) => a XmlTree String
styleAttr =
((\(h,w) -> (case (h,w) of
("","") -> addAttr "style" "width:90%;"
("",w) -> addAttr "style" $ "width:"++w++";"
(h,"") -> addAttr "style" $ "height:"++h++";"
(h,w) -> addAttr "style" $ "width:"++w++";height:"++h++";"))
$<$ ((getAttrValue "height") &&& (getAttrValue "width")))
>>> getAttrValue "style"
| k16shikano/wikipepub | QNDA/ImageReader.hs | mit | 2,938 | 0 | 23 | 854 | 924 | 493 | 431 | 65 | 4 |
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Game.Tournament
-- Copyright : (c) Eirik Albrigtsen 2012
-- License : MIT
-- Maintainer : Eirik <clux> Albrigtsen
-- Stability : unstable
--
-- Tournament construction and maintenance including competition based structures and helpers.
--
-- This library is intended to be imported qualified as it exports functions that clash with
-- Prelude.
--
-- > import Game.Tournament as T
--
-- The Tournament structure contain a Map of 'GameId' -> 'Game' for its internal
-- representation and the 'GameId' keys are the location in the Tournament.
--
-- Duel tournaments are based on the theory from <http://clux.org/entries/view/2407>.
-- By using the seeding definitions listed there, there is almost only one way to
-- generate a tournament, and the ambivalence appears only in Double elimination.
--
-- We have additionally chosen that brackets should converge by having the losers bracket move upwards.
-- This is not necessary, but improves the visual layout when presented in a standard way.
--
-- FFA tournaments use a collection of sensible assumptions on how to
-- optimally split n people into s groups while minimizing the sum of seeds difference
-- between groups for fairness. At the end of each round, groups are recalculated from the scores
-- of the winners, and new groups are created for the next round.
-- TODO: This structure is meant to encapsulate this structure to ensure internal consistency,
-- but hopefully in such a way it can be safely serialized to DBs.
-----------------------------------------------------------------------------
module Game.Tournament (
-- * Building Block A: Duel helpers
seeds
, duelExpected
-- * Building Block B: Group helpers
, groups
, robin
-- * Tournament Types
, GameId(..)
, Elimination(..)
, Bracket(..)
, Rules(..)
, Results -- type synonym
, results
, Result -- no constructor, but accessors:
, player
, placement
, wins
, total
, Size
, Tournament -- no constructor
, Score
, GroupSize
, Advancers
--, Game(..)
--, Player
--, Games
-- * Tournament Interface
, tournament
, score
, count
, scorable
, keys
-- -* Match Inspection
--, scores
--, winner
--, loser
, testcase
) where
import Prelude hiding (round)
import Numeric (showIntAtBase, readInt)
import Data.Char (intToDigit, digitToInt)
import Data.List (sort, sortBy, group, groupBy, genericTake, zipWith4)
import Data.Ord (comparing)
import Data.Function (on)
import Data.Bits (shiftL)
import Data.Maybe (fromJust, isJust, fromMaybe)
import qualified Data.Map.Lazy as Map
import Data.Map (Map)
import qualified Data.Set as Set
import Control.Arrow ((&&&), second)
import Control.Monad (when)
import Control.Monad.State (State, get, put, modify, execState, gets)
--import System.IO.Unsafe (unsafePerformIO) -- while developing
-- -----------------------------------------------------------------------------
-- TODO should somehow ensure 0 < i <= 2^(p-1) in the next fn
-- | Power of a tournament.
-- It's defined as 2^num_players rounded up to nearest power of 2.
--type Power = Int
--type GameNumber = Int
-- TODO: use int synonyms more liberally?
-- | Computes both the upper and lower player seeds for a duel elimiation match.
-- The first argument is the power of the tournament:
--
-- p :: 2^num_players rounding up to nearest power of 2
--
-- The second parameter is the game number i (in round one).
--
-- The pair (p,i) must obey
--
-- >p > 0 && 0 < i <= 2^(p-1).
seeds :: Int -> Int -> (Int, Int)
seeds p i
| p > 0, i > 0, i <= 2^(p-1) = (1 - lastSeed + 2^p, lastSeed)
| otherwise = error "seeds called outside well defined power game region"
where
lastSeed = let (k, r) = ((floor . logBase 2 . fromIntegral) i, i - 2^k) in
case r of
0 -> 2^(p-k)
_ -> 2^(p-k-1) + nr `shiftL` (p - length bstr) where
bstr = reverse $ showIntAtBase 2 intToDigit (i - 2*r) ""
nr = fst $ head $ readInt 2 (`elem` "01") digitToInt bstr
-- | Check if the 3 criteria for perfect seeding holds for the current
-- power and seed pair arguments.
-- This can be used to make a measure of how good the seeding was in retrospect
duelExpected :: Integral a => a -> (a, a) -> Bool
duelExpected p (a, b) = odd a && even b && a + b == 1 + 2^p
-- -----------------------------------------------------------------------------
-- Group helpers
--type Group = [Int]
-- | Splits a numer of players into groups of as close to equal seeding sum
-- as possible. When groupsize is even and s | n, the seed sum is constant.
-- Fixes the number of groups as ceil $ n / s, but will reduce s when all groups not full.
groups :: Int -> Int -> [[Int]]
groups 0 _ = []
groups s n = map (sort . filter (<=n) . makeGroup) [1..ngrps] where
ngrps = ceiling $ fromIntegral n / fromIntegral s
-- find largest 0<gs<=s s.t. even distribution => at least one full group, i.e. gs*ngrps - n < ngrps
gs = until ((< ngrps + n) . (*ngrps)) (subtract 1) s
modl = ngrps*gs -- modl may be bigger than n, e.e. groups 4 10 has a 12 model
npairs = ngrps * (gs `div` 2)
pairs = zip [1..npairs] [modl, modl-1..]
leftovers = [npairs+1, npairs+2 .. modl-npairs] -- [1..modl] \\ e in pairs
makeGroup i = leftover ++ concatMap (\(x,y) -> [x,y]) gpairs where
gpairs = filter ((`elem` [i, i+ngrps .. i+npairs]) . fst) pairs
leftover = take 1 . drop (i-1) $ leftovers
-- | Round robin schedules a list of n players and returns
-- a list of rounds (where a round is a list of pairs). Uses
-- http://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm
robin :: Integral a => a -> [[(a,a)]]
robin n = map (filter notDummy . toPairs) rounds where
n' = if odd n then n+1 else n
m = n' `div` 2 -- matches per round
permute (x:xs@(_:_)) = x : last xs : init xs
permute xs = xs -- not necessary, wont be called on length 1/2 lists
rounds = genericTake (n'-1) $ iterate permute [1..n']
notDummy (x,y) = all (<=n) [x,y]
toPairs x = genericTake m $ zip x (reverse x)
-- -----------------------------------------------------------------------------
-- Duel elimination
-- | The location of a game is written as to simulate the classical shorthand WBR2,
-- but includes additionally the game number for complete positional uniqueness.
--
-- A 'Single' elimination final will have the unique identifier
--
-- > let wbf = GameId WB p 1
--
-- where 'p == count t WB'.
data GameId = GameId {
bracket :: Bracket
, round :: Int
, game :: Int
} deriving (Show, Eq, Ord)
-- | Duel Tournament option.
--
-- 'Single' elimation is a standard power of 2 tournament tree,
-- wheras 'Double' elimination grants each loser a second chance in the lower bracket.
data Elimination = Single | Double deriving (Show, Eq, Ord)
-- | The bracket location of a game.
--
-- For 'Duel' 'Single' or 'FFA', most matches exist in the winners bracket ('WB')
-- , with the exception of the bronze final and possible crossover matches.
--
-- 'Duel' 'Double' or 'FFA' with crossovers will have extra matches in the loser bracket ('LB').
data Bracket = WB | LB deriving (Show, Eq, Ord)
-- | Players and Results zip to the correct association list.
-- 'scores' will obtain this ordered association list safely.
data Game = Game {
players :: [Player]
, result :: Maybe [Score]
} deriving (Show, Eq)
type Games = Map GameId Game
-- | 'score' clarification types.
type Position = Int
type Score = Int
type Player = Int
type Seed = Int
-- | Record of each player's accomplishments in the current tournament.
data Result = Result {
-- | Player associated with the record.
player :: Int
-- | Placement of the player associated with this record.
, placement :: Int
-- | Number of games the player associated with this record won.
, wins :: Int
-- | Sum of scores for the games the associated player played.
, total :: Int
} deriving (Show)
-- | Results in descending order of placement.
--
-- Only constructed by 'score' once the last game was played.
type Results = [Result]
type GroupSize = Int
type Advancers = Int
data Rules = FFA GroupSize Advancers | Duel Elimination
type Size = Int
data Tournament = Tourney {
size :: Size
, crossover :: Bool
, rules :: Rules
, games :: Games
, results :: Maybe Results
}
-- Internal helpers
gameZip :: Game -> [(Player, Score)]
gameZip m = zip (players m) (fromJust (result m))
gameSort :: [(Player, Score)] -> [(Player, Score)]
gameSort = reverse . sortBy (comparing snd)
-- | Sorted player identifier list by scores.
--
-- If this is called on an unscored match a (finite) list zeroes is returned.
-- This is consistent with the internal representation of placeholders in Matches.
scores :: Game -> [Player]
scores g@(Game pls msc)
| Just _ <- msc = map fst . gameSort . gameZip $ g
| otherwise = replicate (length pls) 0
-- | The first and last elements from scores.
winner, loser :: Game -> Player
winner = head . scores
loser = last . scores
-- Duel specific helper
pow :: Int -> Int
pow = ceiling . logBase 2 . fromIntegral
-- | Count the number of rounds in a given bracket in a Tournament.
-- TODO: rename to length once it has been less awkwardly moved into an internal part
count :: Tournament -> Bracket -> Int
count Tourney { rules = Duel Single, size = np } br = if br == WB then pow np else 0 -- 1 with bronze
count Tourney { rules = Duel Double, size = np } br = (if br == WB then 1 else 2) * pow np
count Tourney { rules = FFA _ _, games = ms } WB = round . fst . Map.findMax $ ms
count Tourney { rules = FFA _ _} LB = 0
-- Scoring and construction helper
woScores :: [Player] -> Maybe [Score]
woScores ps
| 0 `notElem` ps && -1 `elem` ps = Just $ map (\x -> if x == -1 then 0 else 1) ps
| otherwise = Nothing
-- | Get the list of all GameIds in a Tournament.
-- This list is also ordered by GameId's Ord, and in fact,
-- if the corresponding games were scored in this order, the tournament would finish,
-- and scorable would only return False for a few special walkover games.
-- TODO: if introducing crossovers, this would not be true for LB crossovers
-- => need to place them in WB in an 'interim round'
keys :: Tournament -> [GameId]
keys = Map.keys . games
-- | Create match shells for an FFA elimination tournament.
-- Result comes pre-filled in with either top advancers or advancers `intersect` seedList.
-- This means what the player numbers represent is only fixed per round.
-- TODO: Either String Tournament as return for intelligent error handling
tournament :: Rules -> Size -> Tournament
tournament rs@(FFA gs adv) np
-- Enforce >2 players, >2 players per match, and >1 group needed.
-- Not technically limiting, but: gs 2 <=> duel and 1 group <=> best of one.
| np <= 2 = error "Need >2 players for an FFA elimination"
| gs <= 2 = error "Need >2 players per match for an FFA elimination"
| np <= gs = error "Need >1 group for an FFA elimination"
| adv >= gs = error "Need to eliminate at least one player a match in FFA elimination"
| adv <= 0 = error "Need >0 players to advance per match in a FFA elimination"
| otherwise =
--TODO: allow crossover matches when there are gaps intelligently..
let minsize = minimum . map length
hideSeeds = map $ map $ const 0
nextGroup g = hideSeeds . groups gs $ leftover where
-- force zero non-eliminating matches unless only 1 left
advm = max 1 $ adv - (gs - minsize g)
leftover = length g * advm
playoffs = takeWhile ((>1) . length) . iterate nextGroup . groups gs $ np
final = nextGroup $ last playoffs
grps = playoffs ++ [final]
-- finally convert raw group lists to matches
makeRound grp r = zipWith makeMatch grp [1..] where
makeMatch g i = (GameId WB r i, Game g Nothing)
ms = Map.fromList . concat $ zipWith makeRound grps [1..]
in Tourney { size = np, rules = rs, games = ms, results = Nothing, crossover = False }
-- | Create match shells for an elimination tournament
-- hangles walkovers and leaves the tournament in a stable initial state
tournament rs@(Duel e) np
-- Enforce minimum 4 players for a tournament. It is possible to extend to 2 and 3, but:
-- 3p uses a 4p model with one WO => == RRobin in Double, == Unfair in Single
-- 2p Single == 1 best of 1 match, 2p Double == 1 best of 3 match
-- and grand final rules fail when LB final is R1 (p=1) as GF is then 2*p-1 == 1 ↯
| np < 4 = error "Need >=4 competitors for an elimination tournament"
| otherwise = Tourney { size = np, rules = rs, games = ms, results = Nothing, crossover = True} where
p = pow np
-- complete WBR1 by filling in -1 as WO markers for missing (np'-np) players
markWO (x, y) = map (\a -> if a <= np then a else -1) [x,y]
makeWbR1 i = (l, Game pl (woScores pl)) where
l = GameId WB 1 i
pl = markWO $ seeds p i
-- make WBR2 and LBR1 shells by using the paired WBR1 results to propagate winners/WO markers
propagateWbR1 br ((_, m1), (l2, m2)) = (l, Game pl (woScores pl)) where
(l, pl)
| br == WB = (GameId WB 2 g, map winner [m1, m2])
| br == LB = (GameId LB 1 g, map loser [m1, m2])
g = game l2 `div` 2
-- make LBR2 shells by using LBR1 results to propagate WO markers if 2x
makeLbR2 (l1, m1) = (l, Game pl Nothing) where
l = GameId LB 2 $ game l1
plw = winner m1
pl = if odd (game l1) then [0, plw] else [plw, 0]
-- construct (possibly) non-empty rounds
wbr1 = map makeWbR1 [1..2^(p-1)]
wbr1pairs = take (2^(p-2))
$ filter (even . game . fst . snd) $ zip wbr1 (tail wbr1)
wbr2 = map (propagateWbR1 WB) wbr1pairs
lbr1 = map (propagateWbR1 LB) wbr1pairs
lbr2 = map makeLbR2 lbr1
-- construct (definitely) empty rounds
wbRest = concatMap makeRound [3..p] where
makeRound r = map (GameId WB r) [1..2^(p-r)]
--bfm = MID LB (R 1) (G 1) -- bronze final here, exception
lbRest = map gfms [2*p-1, 2*p] ++ concatMap makeRound [3..2*p-2] where
makeRound r = map (GameId LB r) [1..(2^) $ p - 1 - (r+1) `div` 2]
gfms r = GameId LB r 1
toMap = Map.fromSet (const (Game [0,0] Nothing)) . Set.fromList
-- finally, union the mappified brackets
wb = Map.union (toMap wbRest) $ Map.fromList $ wbr1 ++ wbr2
lb = Map.union (toMap lbRest) $ Map.fromList $ lbr1 ++ lbr2
ms = if e == Single then wb else wb `Map.union` lb
-- | Helper to create the tie-correct Player -> Position association list.
-- Requires a Round -> Position function to do the heavy lifting where possible,
-- the final Game and Maybe bronzefinal to not take out
-- the list of games prefiltered away non-final bracket and final games.
-- result zips with Player == [1..]
placementSort :: Game -> Maybe Game -> (Int -> Position) -> Games -> [Position]
placementSort fg bf toPlacement = map snd . sortBy (comparing fst)
. prependTop 1 (Just fg)
. prependTop (((+1) . length . players) fg) bf
. excludeTop
. map (second toPlacement . (fst . head &&& foldr (max . snd) 1))
. groupBy ((==) `on` fst)
. sortBy (comparing fst)
. Map.foldrWithKey rfold []
where
pls = if isJust bf then concatMap players [fg, fromJust bf] else players fg
rfold (GameId _ r _) m acc = (++ acc) . map (id &&& const r) $ players m
prependTop :: Int -> Maybe Game -> [(Position, Player)] -> [(Position, Player)]
prependTop strt g
| isJust g = (++) . flip zip [strt..] . map fst . gameSort . gameZip . fromJust $ g
| otherwise = id
excludeTop :: [(Position, Player)] -> [(Position, Player)]
excludeTop = filter ((`notElem` pls) . fst)
-- zips with Player == [1..]
sumScores :: Games -> [Score]
sumScores = map (foldr ((+) . snd) 0)
. groupBy ((==) `on` fst)
. sortBy (comparing fst)
. Map.foldr ((++) . gameZip) []
-- zips with Player == [1..]
getWins :: Int -> Games -> [Int]
getWins np = map (subtract 1 . length) -- started out with one of each so we can count zeroes
. group . sort
. Map.foldr ((:) . winner) [1..np]
zipResults :: [Int] -> [Int] -> [Int] -> [Result]
zipResults a b = sortBy (comparing placement) . zipWith4 Result [1..] a b
makeResults :: Tournament -> Games -> Maybe Results
makeResults (Tourney {rules = Duel e, size = np}) ms
| e == Single
, Just wbf@(Game _ (Just _)) <- Map.lookup (GameId WB p 1) ms -- final played
-- bf lookup here if included!
= Just . scorify $ wbf
| e == Double
, Just gf1@(Game _ (Just gf1sc)) <- Map.lookup (GameId LB (2*p-1) 1) ms -- gf1 played
, Just gf2@(Game _ gf2sc) <- Map.lookup (GameId LB (2*p) 1) ms -- gf2 maybe played
, isJust gf2sc || maximum gf1sc == head gf1sc -- gf2 played || gf1 conclusive
= Just . scorify $ if isJust gf2sc then gf2 else gf1
| otherwise = Nothing
where
p = pow np
maxRnd = if e == Single then p else 2*p-1
-- maps (last bracket's) maxround to the tie-placement
toPlacement :: Elimination -> Int -> Position
toPlacement Double maxlbr = if metric <= 4 then metric else 2^(k+1) + 1 + oddExtra where
metric = 2*p + 1 - maxlbr
r = metric - 4
k = (r+1) `div` 2
oddExtra = if odd r then 0 else 2^k
toPlacement Single maxr = if metric <= 1 then metric else 2^r + 1 where
metric = p+1 - maxr
r = metric - 1
scorify :: Game -> Results
scorify f = zipResults placements (getWins np ms) (sumScores msnwo) where
-- all pipelines start with this. 0 should not exist, -1 => winner got further
-- scores not Just => should not have gotten this far by guard in score fn
msnwo = Map.filter (all (>0) . players) ms
placements = placementSort f Nothing (toPlacement e)
. Map.filterWithKey lastBracketNotFinal $ msnwo
lastBracketNotFinal k _ = round k < maxRnd && lastBracket (bracket k)
lastBracket br = (e == Single && br == WB) || (e == Double && br == LB)
makeResults (Tourney {rules = FFA _ _, size = np}) ms
| (GameId _ maxRnd _, f@(Game _ (Just _))) <- Map.findMax ms
= Just $ scorify maxRnd f
| otherwise = Nothing
where
-- rsizes :: [(RoundNr, NumPlayers)] lookup helper for toPlacement
rsizes = map (fst . head &&& foldr ((+) . snd) 0)
. groupBy ((==) `on` fst)
. sortBy (comparing fst)
. Map.foldrWithKey rsizerf [] $ ms
where
rsizerf gid g acc = (round gid, (length . players) g) : acc
-- maps a player's maxround to the tie-placement (called for r < maxRnd)
-- simplistic :: 1 + number of people who got through to next round
toPlacement :: Int -> Position
toPlacement maxrp = (1+) . fromJust . lookup (maxrp + 1) $ rsizes
scorify :: Int -> Game -> Results
scorify maxRnd f = zipResults placements (getWins np ms) (sumScores ms) where
-- NB: WO markers or placeholders should NOT exist when scorify called!
-- placements using common helper, having prefiltered final game(round)
placements = placementSort f Nothing toPlacement
. Map.filterWithKey (\k _ -> round k < maxRnd) $ ms
playersReady :: GameId -> Tournament -> Maybe [Player]
playersReady gid t
| Just (Game pls _) <- Map.lookup gid $ games t
, all (>0) pls
= Just pls
| otherwise = Nothing
-- | Check if a GameId exists and is ready to be scored through 'score'.
scorable :: GameId -> Tournament -> Bool
scorable gid = isJust . playersReady gid
-- | Checks if a GameId is 'scorable' and it will not propagate to an already scored Game.
-- Guarding Tournament updates with this ensures it is never in an inconsistent state.
-- TODO: really needs access to mRight, mDown (if duel) to ensure they exist
-- TODO: if FFA only allow scoring if NO matches in the next round have been scored
safeScorable :: GameId -> Tournament -> Bool
safeScorable = undefined
-- | Score a match in a tournament and propagate winners/losers.
-- If match is not 'scorable', the Tournament will pass through unchanged.
--
-- For a Duel tournament, winners (and losers if Double) are propagated immediately,
-- wheras FFA tournaments calculate winners at the end of the round (when all games played).
--
-- There is no limitation on re-scoring old games, so care must be taken to not update too far
-- back ones and leaving the tournament in an inconsistent state. When scoring games more than one
-- round behind the corresponding active round, the locations to which these propagate must
-- be updated manually.
--
-- To prevent yourself from never scoring older matches, only score games for which
-- 'safeScorable' returns True. Though this has not been implemented yet.
--
-- > gid = (GameId WB 2 1)
-- > tUpdated = if safeScorable gid then score gid [1,0] t else t
--
-- TODO: strictify this function
-- TODO: better to do a scoreSafe? // call this scoreUnsafe
score :: GameId -> [Score] -> Tournament -> Tournament
score gid sc trn@(Tourney { rules = r, size = np, games = ms })
| Duel e <- r
, Just pls <- playersReady gid trn
, length sc == 2
= let msUpd = execState (scoreDuel (pow np) e gid sc pls) ms
rsUpd = makeResults trn msUpd
in trn { games = msUpd, results = rsUpd }
| FFA s adv <- r
, Just pls <- playersReady gid trn
, length sc == length pls
= let msUpd = execState (scoreFFA s adv gid sc pls) ms
rsUpd = makeResults trn msUpd
in trn { games = msUpd, results = rsUpd }
-- somewhat less ideally, if length sc /= length pls this now also fails silently even if socable passes
| otherwise = trn
scoreFFA :: GroupSize -> Advancers -> GameId -> [Score] -> [Player] -> State Games ()
scoreFFA gs adv gid@(GameId _ r _) scrs pls = do
-- 1. score given game
let m = Game pls $ Just scrs
modify $ Map.adjust (const m) gid
-- 2. if end of round, fill in next round
currRnd <- gets $ Map.elems . Map.filterWithKey (const . (==r) . round)
when (all (isJust . result) currRnd) $ do
-- find the number of players we need in next round
numNext <- gets $ Map.foldr ((+) . length . players) 0
. Map.filterWithKey (const . (==r+1) . round)
-- recreate next round by using last round results as new seeding
-- update next round by overwriting duplicate keys in next round
modify $ flip (Map.unionWith (flip const)) $ makeRnd currRnd numNext
return ()
where
-- make round (r+1) from the games in round r and the top n to take
makeRnd :: [Game] -> Size -> Games
makeRnd gms = Map.fromList . nextGames . grpMap (seedAssoc False gms) . groups gs
-- This sorts all players by overall scores (to help pick best crossover candidates)
-- Or, if !takeAll, sort normally by only including the advancers from each game.
seedAssoc :: Bool -> [Game] -> [(Seed, Player)]
seedAssoc takeAll rnd
| takeAll = seedify . concatMap gameZip $ rnd
| otherwise = seedify . concatMap (take (rndAdv rnd) . gameSort . gameZip) $ rnd
where
-- Find out how many to keep from each round before sorting overall
rndAdv :: [Game] -> Advancers
rndAdv = max 1 . (adv - gs +) . minimum . map (length . players)
seedify :: [(Player, Score)] -> [(Seed, Player)]
seedify = zip [1..] . map fst . gameSort
grpMap :: [(Seed, Player)] -> [[Seed]] -> [[Player]]
grpMap assoc = map . map $ fromJust . flip lookup assoc
nextGames :: [[Player]] -> [(GameId, Game)]
nextGames = zipWith (\i g -> (GameId WB (r+1) i, Game g Nothing)) [1..]
scoreDuel :: Int -> Elimination -> GameId -> [Score] -> [Player] -> State Games (Maybe Game)
scoreDuel p e gid scrs pls = do
-- 1. score given game
let m = Game pls $ Just scrs
modify $ Map.adjust (const m) gid
-- 2. move winner right
let nprog = mRight True p gid
nres <- playerInsert nprog $ winner m
-- 3. move loser to down if we were in winners
let dprog = mDown p gid
dres <- playerInsert dprog $ loser m
-- 4. check if loser needs WO from LBR1
let dprog2 = woCheck p dprog dres
uncurry playerInsert $ fromMaybe (Nothing, 0) dprog2
-- 5. check if winner needs WO from LBR2
let nprog2 = woCheck p nprog nres
uncurry playerInsert $ fromMaybe (Nothing, 0) nprog2
return Nothing
where
-- insert player x into list index idx of mid's players, and woScore it
-- progress result determines location and must be passed in as fst arg
playerInsert :: Maybe (GameId, Position) -> Player -> State Games (Maybe Game)
playerInsert Nothing _ = return Nothing
playerInsert (Just (gid, idx)) x = do
tmap <- get
let (updated, tupd) = Map.updateLookupWithKey updFn gid tmap
put tupd
return updated
where updFn _ (Game plsi _) = Just $ Game plsm (woScores plsm) where
plsm = if idx == 0 then [x, last plsi] else [head plsi, x]
-- given tourney power, progress results, and insert results, of previous
-- if it was woScored in playerInsert, produce new (progress, winner) pair
woCheck :: Player
-> Maybe (GameId, Position)
-> Maybe Game
-> Maybe (Maybe (GameId, Position), Player)
woCheck p (Just (gid, _)) (Just mg)
| w <- winner mg, w > 0 = Just (mRight False p gid, w)
| otherwise = Nothing
woCheck _ _ _ = Nothing
-- right progress fn: winner moves right to (GameId, Position)
mRight :: Bool -> Int -> GameId -> Maybe (GameId, Position)
mRight gf2Check p (GameId br r g)
| r < 1 || g < 1 = error "bad GameId"
-- Nothing if last Game. NB: WB ends 1 round faster depending on e
| r >= 2*p || (br == WB && (r > p || (e == Single && r == p))) = Nothing
| br == LB = Just (GameId LB (r+1) ghalf, pos) -- standard LB progression
| r == 2*p-1 && br == LB && gf2Check && maximum scrs == head scrs = Nothing
| r == p = Just (GameId LB (2*p-1) ghalf, 0) -- WB winner -> GF1 path
| otherwise = Just (GameId WB (r+1) ghalf, pos) -- standard WB progression
where
ghalf = if br == LB && odd r then g else (g+1) `div` 2
pos
| br == WB = if odd g then 0 else 1 -- WB maintains standard alignment
| r == 2*p-2 = 1 -- LB final winner => bottom of GF
| r == 2*p-1 = 0 -- GF(1) winnner moves to the top [semantic]
| r > 1 && odd r = 1 -- winner usually takes the bottom position
| r == 1 = if odd g then 1 else 0 -- first rounds sometimes goto bottom
| otherwise = if odd g then 0 else 1 -- normal progression only in even rounds + R1
-- by placing winner on bottom consistently in odd rounds the bracket moves upward each new refill
-- the GF(1) and LB final are special cases that give opposite results to the advanced rule above
-- down progress fn : loser moves down to (GameId, Position)
mDown :: Int -> GameId -> Maybe (GameId, Position)
mDown p (GameId br r g)
| e == Single = Nothing
-- or case for bf: | e == Single && r == p-1 = Just (MID LB (R 1) (G 1), if odd g then 0 else 1)
| r == 2*p-1 = Just (GameId LB (2*p) 1, 1) -- GF(1) loser moves to the bottom
| br == LB || r > p = Nothing
| r == 1 = Just (GameId LB 1 ghalf, pos) -- WBR1 -> r=1 g/2 (LBR1 only gets input from WB)
| otherwise = Just (GameId LB ((r-1)*2) g, pos) -- WBRr -> 2x as late per round in WB
where
ghalf = (g+1) `div` 2
-- drop on top >R2, and <=2 for odd g to match bracket movement
pos = if r > 2 || odd g then 0 else 1
-- testing stuff
upd :: [Score] -> GameId -> State Tournament ()
upd sc id = do
t <- get
put $ score id sc t
return ()
manipDuel :: [GameId] -> State Tournament ()
manipDuel = mapM_ (upd [1,0])
manipFFA :: State Tournament ()
manipFFA = do
upd [1,2,3,4] $ GameId WB 1 1
upd [5,3,2,1] $ GameId WB 1 2
upd [2,4,2,1] $ GameId WB 1 3
upd [6,3,2,1] $ GameId WB 1 4
upd [1,2,3,4] $ GameId WB 2 1
testor :: Tournament -> IO ()
testor Tourney { games = ms, results = rs } = do
mapM_ print $ Map.assocs ms
maybe (print "no results") (mapM_ print) rs
testcase :: IO ()
testcase = do
--let t = tournament (Duel Double) 8
--testor $ execState (manipDuel (keys t)) t
let t = tournament (FFA 4 1) 16
testor $ execState manipFFA t
-- | Checks if a Tournament is valid
{-
PERHAPS BETTER:
WB: always has np (rounded to nearest power) - 1 matches -- i.e. np = 2^p some p > 1
LB: always has 2*[num_wb_matches - 2^(p-1) + 1] -- i.e. minus the first round's matches but plus two finals
tournamentValid :: Tournament -> Bool
tournamentValid t =
let (wb, lb) = partition ((== WB) . brac . locId) r
roundRightWb k = rightSize && uniquePlayers where
rightSize = 2^(p-k) == length $ filter ((== k) . rnd . locId) wb
uniquePlayers =
rountRightLb k = rightSize && uniquePlayers where
rightSize = 2^(p - 1 - (k+1) `div` 2) == length $ filter ((== k) . rnd . locId) lb
in all $ map roundRightWb [1..2^p]
-}
| clux/tournament.hs | Game/Tournament.hs | mit | 29,171 | 0 | 18 | 7,041 | 7,752 | 4,178 | 3,574 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE QuasiQuotes #-}
module AoC201607
( runDay,
) where
import Data.List (tails)
import Str
import Text.Parsec
import Text.Parsec.String
runDay :: IO ()
runDay = do
let tlsCount = execute addressesParser fullInput
let sslCount = execute2 addressesParser fullInput
putStrLn $ "7) The count of transmissions with TLS is " ++ (show tlsCount) ++ "."
putStrLn $ "7) The count of transmissions with SSL is " ++ (show sslCount) ++ "."
data Ip7Address = Ip7Address { primaries :: [String], hypernets :: [String] } deriving Show
-- Part 2
execute2 p xs =
case parse p "test" xs of
Prelude.Left msg -> show msg
Prelude.Right addresses -> show $ length $ filter supportsSSL $ addressesCombiner addresses
supportsSSL :: Ip7Address -> Bool
supportsSSL address = let
myAbas = abas address
hasBab = anyTrue $ map (\aba -> isBab aba address) myAbas
in hasBab
isBab :: [Char] -> Ip7Address -> Bool
isBab aba address = anyTrue $ map (babChecker aba) $ possibleBABs address
anyTrue :: Foldable t => t Bool -> Bool
anyTrue xs = any (True ==) xs
babChecker :: Eq a => [a] -> [a] -> Bool
babChecker aba x = x == babMaker aba
babMaker :: [a] -> [a]
babMaker aba = [(head $ drop 1 aba), head aba, (head $ drop 1 aba)]
abas :: Ip7Address -> [String]
abas address = filter abaChecker $ possibleABAs address
hasABA :: Ip7Address -> Bool
hasABA address = 0 < (length $ abas address)
abaChecker :: Eq a => [a] -> Bool
abaChecker x = x == (reverse x) && (head x) /= (head $ drop 1 x)
possibleBABs :: Ip7Address -> [String]
possibleBABs address = possibles $ hypernets address
possibleABAs :: Ip7Address -> [String]
possibleABAs address = possibles $ primaries address
possibles :: [String] -> [String]
possibles xs = concat $ map (windows 3) xs
-- Part 1
execute p xs =
case parse p "test" xs of
Prelude.Left msg -> show msg
Prelude.Right addresses -> show $ length $ filter addressSupportsTLS $ addressesCombiner addresses
addressSupportsTLS :: Ip7Address -> Bool
addressSupportsTLS x = let
pAbba = anyTrue $ map isAbba $ primaries x
hAbba = all (False ==) $ map isAbba $ hypernets x
in all (True ==) $ pAbba : [hAbba]
isAbba :: String -> Bool
isAbba xs = anyTrue $ map abbaChecker $ possibleAbbas xs
abbaChecker :: Eq a => ([a], [a]) -> Bool
abbaChecker x = ((fst x) == (reverse $ snd x)) && ((fst x) /= (snd x))
possibleAbbas :: [a] -> [([a], [a])]
possibleAbbas xs = let
l = windows 2 xs
in zip l (drop 2 $ l)
windows :: Int -> [a] -> [[a]]
windows n xs = filter (\x -> length x >= n) $ map (take n) (tails xs)
-- Gross intermediate data handling code
-- There has to be a nicer way than this. I think I probably need to learn about parser generators or something.
data Ip7AddressFragment = Ip7AddressFragment { primary :: String, hypernet :: String } deriving Show
addressesCombiner :: [[Ip7AddressFragment]] -> [Ip7Address]
addressesCombiner xs = map (\x -> fragmentsCombiner x) xs
fragmentsCombiner :: [Ip7AddressFragment] -> Ip7Address
fragmentsCombiner xs = foldl (\acc x -> Ip7Address ((primaries acc) ++ [(primary x)]) (hypernets acc ++ [(hypernet x)])) (Ip7Address [] []) xs
-- Parsers
addressesParser :: Parser [[Ip7AddressFragment]]
addressesParser = do
a <- many1 ip7Parser
return a
ip7Parser :: Parser [Ip7AddressFragment]
ip7Parser = do
p <- primaryParser
h <- option [] hypernetParser
rest <- option [] ip7Parser
optional endOfLine
return (Ip7AddressFragment p h : rest)
primaryParser :: Parser String
primaryParser = many1 letter
hypernetParser :: Parser String
hypernetParser = do
char '['
h <- many1 letter
char ']'
return h
-- Input Data
part2TestInput :: String
part2TestInput = [str|aba[bab]xyz
xyx[xyx]xyx
aaa[kek]eke
zazbz[bzb]cdb|]
smallInput :: String
smallInput = [str|abba[mnop]qrst
abcd[bddb]xyyx
aaaa[qwer]tyui
ioxxoj[asdfgh]zxcvbn|]
fullInput :: String
fullInput = [str|dnwtsgywerfamfv[gwrhdujbiowtcirq]bjbhmuxdcasenlctwgh
rnqfzoisbqxbdlkgfh[lwlybvcsiupwnsyiljz]kmbgyaptjcsvwcltrdx[ntrpwgkrfeljpye]jxjdlgtntpljxaojufe
jgltdnjfjsbrffzwbv[nclpjchuobdjfrpavcq]sbzanvbimpahadkk[yyoasqmddrzunoyyk]knfdltzlirrbypa
vvrchszuidkhtwx[ebqaetowcthddea]cxgxbffcoudllbtxsa
olgvwasskryjoqpfyvr[hawojecuuzobgyinfi]iywikscwfnlhsgqon
jlzynnkpwqyjvqcmcbz[fdjxnwkoqiquvbvo]bgkxfhztgjyyrcquoiv[xetgnqvwtdiuyiyv]zyfprefpmvxzauur
vjqhodfzrrqjshbhx[lezezbbswydnjnz]ejcflwytgzvyigz[hjdilpgdyzfkloa]mxtkrysovvotkuyekba
xjmkkppyuxybkmzya[jbmofazcbdwzameos]skmpycixjqsagnzwmy
zeebynirxqrjbdqzjav[cawghcfvfeefkmx]xqcdkvawumyayfnq[qhhwzlwjvjpvyavtm]sbnvwssglfpyacfbua[wpbknuubmsjjbekkfy]icimffaoqghdpvsbx
enupgggxsmwvfdljoaj[qlfmrciiyljngimjh]qkjawvmtnvkidcclfay[bllphejvluylyfzyvli]heboydfsgafkqoi
ottpscfbgoiyfri[iwzhojzrpzuinumuwd]orfroqlcemumqbqqrea
zhrhvyfxxcsdpris[xdqecoqujrnqbgla]bpwibmrkcfbzigf[rlqtqykdltcpusvc]ybtsglkxrhucxwv
msaebhhuxyaevahov[skkhuecthcqtrvtunw]bzlvljpsapsezchptjs[lbcxoczqbyysmha]zdqlfydjdctfnuetghr[owwhfhnjmpekukafw]qqitepzwooogqifl
jhdfwesnofrkpse[mkruficpgplktbmoo]mnrjpuvsauanolvzhym
ucibfxxivatgxlupp[rxlbgrqostcioowo]faiimhdhgpockadenua[teomupxzwrernokhyud]ohsfljkyjvkfzwus
gzxcgjqdbyvfndfpw[ypfsapvecfqihnpuszq]mvwxgfkniekgqzqid
fipkggpfwvgrqiwosi[itadifxotejgzkt]szwurlcbvffhgse
ketltdpowbxcusrcua[oonjssgqvcgwvlz]otjxgpizqfpcriuco[mgtgmwcjecomtdkxdev]dnrecyeyhqcpausqzsw
lcototgbpkkoxhsg[erticxnxcjwypnunco]notoouvtmgqcfdupe[hubcmesmprktstzyae]unuquevgbpxqnrib[egalxegqwowylkdjkdg]spqmkzfjnzwcwgutl
nesmourutitzqtolwd[rurfefjvljejcufm]jagkqdwpkefkjdz[cctohikipqxxbdjxsg]badmffkslhmgsxqscf
vvbwenaczgfagvrv[dqjzprtikukbikojlgm]bkfrnbigwaitptbdcha[llnwgonsrsppphnnp]sqozspzzfbeigmw
jzkzjzzghblqqme[fsqzyykcotbavruyp]vjzohzsunrevhmpi
jlngucjirfgdgorbgb[nvvkvebcjahujrwjmy]cfnlrssuthgusytkqt
kegsdcxndhtlskseb[zbtcngduxclffzlw]wrdqbtrqbcpbeaiqvx[svsyqhkrryycnkceq]ztrawvffepndijceeih
imtafeyfivrcegpagsl[tjzsewuwboushjl]mtnyptormlwiijlds
sblhlpnuutqgtuvlc[jlkivbtbkivklrnr]zkzcykzkyjxarepzvrr
ojuqmcidxmsyjkhuh[gsegkxlimzuyceo]dlhjiensaurluhul
sxkxluastorxmnd[gwkeczwgmamhjquth]yvpdadteadabxgsplmr
cndxxzfcmwwtcibgktm[ntsvmiwosuvniztv]onnfaenxutizlbxdk
eqiwaqxxstamxgzc[vnomzylvfpmcscjar]rwdqevxpeqvrmvliu
tvzbzkhvpzedqtp[whzeqaisikjjbezzcow]hqbizwaaffwbtfglq
ajwpjiqawievazmipkw[mgfhwrppaxagfdgfsa]iaqcnovhgearcutadns[anaukyaljeflxdnucbn]bhqcwrkeolrhwdih
neakzsrjrhvixwp[ydbbvlckobfkgbandud]xdynfcpsooblftf[wzyquuvtwnjjrjbuhj]yxlpiloirianyrkzfqe
jugqswdvlbaorwk[dfqvlubdcigzpcz]aqhybhnoukoyxuiw
kkkfysfugyvqnfvj[ahhqkrufcvhfvapblc]jfincvlxbjivelqrs[mpoymhslpyekjmy]eicbqlzecwuugez[tsqmqvjiokqofbp]senbbdxrdigwcjwik
ogiiiqaxakiaucwa[ltdchlxwnzefocrw]koxethzfvlsewbqdt[qdfqgtzftqpaxuzcruo]fvkgjcglmmxqnifv
epmnxkubnsnyeeyubv[ydzhcoytayiqmxlv]edmbahbircojbkmrg[dlxyprugefqzkum]svdaxiwnnwlkrkukfg[eacekyzjchfpzghltn]ofwgevhoivrevueaj
vvwvubpdeogvuklsjy[psnqcfnqhxaibnij]fwzpkbdgmpocoqp
pjdxcbutwijvtoftvw[zkqtzecoenkibees]llfxdbldntlydpvvn[uaweaigkebxceixszbh]xxlipjtlogbnxse
zmnirrxetiwyese[cedxmaoadgjjvsesk]nuisspyclmncqlasmuy[zxwlwmbzbjmvubgcf]hfqniztoirmsdwz[zlffqhttbpehxoabzhx]upmydjqzzwefvgdpqu
lwvsssgvvylrvqh[duxjrrqkzchbpvnmm]pckmefvejytvzavgzgc[dcekfwnrzooigwio]pmutxfiwfowlfnnggl[lzytuzirtzgwhkz]yzgxtksuqrgvvgfefon
tpmyecqhqjjpertn[qomuwmxstmgzexds]ftvqqwsvsrnmvpg[vtpebuufpyieqbhuu]dorortnekxkwnploro[pzajzflqvbkhautupl]eowpcyzmyvnntvzmvx
foguzgeasrkncbny[tlyweucylxkswwxb]jtzjubgewwhlddar[dkddqrpwaqvlhdp]skkegnatbjubqglwu[pkwscrmgvjzarzb]ibaagrqwnxblvtkg
ejgpdxesfyoyaggmymi[axfkdoyoqkpkhusfwe]pnczsmszqevkqiwlfc[dqhzcqjzpgnoknmv]ldrjdhopfyctlqtn
gqhyasteoryuofc[bhblyxlbiqtzzyzvzqg]dtvxrlkyuwxttyw[qvvzvuzhkemwglh]bopvfttkwtaeckq[vvhkkgrddaoxnzctwar]gsscsjuictekguq
sviwnvbtrgyydtadhz[ipjrrywkoxwuzmlrzd]kcxruwyisqvokporkub[tvarlltnhjmcuvvcck]raafszljrhconjqsqi[snbxmvzrkojpjybkgpi]ekoeuottccqbxrvpkb
vtouviqjarqwnoexuy[lzxhegzxptktueqo]azfsikzbwiajcrhnas[hvqxgtffjyyfgsjowxy]ddbmpksrtghvvypev[eoepwehfavxzwgt]igsulpdhrevkghzh
fucimprxzsubuuzmk[umzezmmnkfzvjlela]qxzdlcryifsinmkgeha
kauzjbailyzpvtji[hgeslalzqgpdkpuvomw]utsywinellykvmuawwr
oacbdgfaszolybf[hsytrkjoylrkkduzfz]bmoelqhppaxshmfjl[cusgbbuydfqtbbmsju]mcftwalxlvfvvpeu
ybylybngqxxrmplf[mybpfztzwnisfpfgqmb]fsllclehoezgthek[ldxhvhwniqfpqbl]ebybalwrmrqldukb[okenxoqxjgrenrcjd]kluumgtqybryflqi
mufsafgfxiegfgf[ydibrbrmiaulexjek]ouwchrlvilmygbuppjl[imyaxsiodgjteppdyy]ugondbuqnhjrzzzn
idihouejjocbahe[mclnirhxghanatge]ubwhxskdzgkmyrp[vksyktucsyumvxoc]bregaefrdlrgmtwt
qnsqwkqttdevlnzg[noyxiueharjajsalnhu]heaxmujxhpgjddqur[xnqwujjeasceovnroiv]hnrnwuogebatnfsa
evruuxfhpivnmknolsj[itpsnnhbtrrbllsbo]gefodpceljlvwuahz
ebddlswrvbjohtnkyip[qkssdudizhcoaazvyow]xvnqicorrkjrnxixp
bbmmzbebuexzmtbr[tpzfxmwgamhaikfpaeu]kraaocehdtalyjrf[zzqqtjplepyidohpvx]kzehgejueimxlqglfj[zgysopfdgxtokkdxwk]gwcfaflybmhdgoxjq
xztpwfipuczrtoyt[uwnlokmtopkhdtemm]sdfmvgvctgwbdjpmvhh[ozjpkdigpjqzqgy]yrkwokmkrevauzroaqm[vctyupmildfnnjomue]cvagxsievhrukgyqzg
jpmvqhuabqsvroxgmyk[toieqxrazxhhsbrm]wdwhoqdddwdacuo
mlaqnefjmwbxeetyxz[sziklwesunikpiqjark]iltkcgfzmhvusdnlr[bmfprkswemctykvio]hhsmvppnztgipxij[kvlbovfklljaumwmy]mdpaiazrlputabj
czdgmoqwzhvfnulxo[mlbkytxjhscsxrgchri]veugcvavrzihzencp
rbjtyudgcswzezr[inlznakcutfnnequc]uhisbxotgqqtzionoq[hzlgqtkpeubvudi]qqsryagiowmcijbejhr
wkvwdohwocizssun[kimsjrwwfpilzpkf]ruqhrplgugwhmnn[iouhwbjnqzlqyewxof]exjuguxwmphfypvsivl
bcnuloxdfhnyesgtdky[hvmgfzcjhhiiqino]sfipughwbebgstwrua[behnamammdxrnnok]ttpbmbflilacfvwiwd[sosjbmmjygpbfetziv]qcosdgrbfdsgqqrlhym
fbmthzppxydfxiipo[zsyfzbueqoaoxeueado]santekllapuywlmwjkl[yfsonktbvuyilcxf]xjerezinsamruvn[cceqpogyrsztadfap]fiivtuyynltqoypypou
lfjigofbbnyrdlhxv[gfblbnmkfnpxbio]zeqevpmpjowrxtw[mofuoyllwekzcjtxjhp]lnzewigzwruzlbjh
xjgdfbtgqmgazgvtif[farekeencwufapef]dxjltmtfxuiydactuko
njaolcljynwvrwy[qplxbpadtyndosjcch]fscxierutuanappsqiy[jftravlojauqkmgludp]pkfwxpdfcrjrmbucf
iyotvokljqynxnpjsfs[lfwwocnwcwstidfpb]mutsdjbqfruxxprzrnk
kpvxcagazjsxgagg[sabugyxucglnvcjb]uvrdglycowrjddy
zclgitkurpfdspcbk[yedvkzgbawpthoyn]dhvnmtxbrpttrdrio[drdahsrphffqsigrlmk]ykghbvcdosmtcgxdeb
rkmajkdvlbqwtnuanue[brdlutivdnfekggixum]pbsgstnxgghrygqwpf[rlqzaflmkbvvefdoc]jhbtzkodsfglsaow[onlllmfziapizsd]usvejrxmziulunvjux
jqlketojwcgvuce[ftcxdqqebijrnfzjriq]ucwgiavuxrxokmvxgad[zmyusreluasvwgzngmx]semjnvafnqvwtvkimy[owvczdccmvfohtbijfu]dmhbiikbzcualbbs
roewzhbnwyvondnn[ejikyjgtzpmepihnnl]yurjuztavzqkxqlrle[mbjcyqrzfuhhsnipzx]fcrtuzhrqorxrdmrcn
ycznijylnnqwmqzdd[ycnztjgxgyapvafhwaa]pzdtesugxpchhdb[sdruhgxaqpitoxlncc]exnhjwmnvqmquvclhu
iufdjzqflteyvhrem[eqiluhtbfuegasby]ikqccaxrpnjjrevdsev[wfluwngzffaxhaflbf]wnlyrgvaxzsmqvc[smkdicgtwwwxmdizdi]joaqneodtgvioxzg
pddsupswtnzture[pehcqhpltqocptr]ymzrvibfbeasccxh[jwwhastouxzmyhh]xsllfxcuzbtciegzcd
rnnvfdyavlqnvwze[aistrderxrrojbsspnu]hfkzgodowrlajmmeq
qnebfycqdylighjpgo[ablnwbutiwhdcrmwbg]hnqeseogqdsdhith[nmrgaeenxhizhoqper]tjxbhutvqtjzpyzh
batsftctktgebkvzv[rovosiyqqpafttgdmoc]ynnztvhekfnexdcuq[lnevylboilqebnkf]udftgymwddomqmy
ybrcyivzafzoubcj[crhigqvjszwqflocc]aesdfdfgzcnyxsmzg
oskvnzcbuyaytyixp[ypctohskpfoxhpydwpf]kgkbxhyfncznsar[vulxrgolpxlqzkknzva]ightbuekpmjodxzfky[nyjpxhpycxjrqdno]jhvrgxgfjwarwzkmfj
relqdjmixussrbijgqj[mfsyrfbtjbojcesuyw]wsckbuhopguszeh[unyhvpqjxxgfbgyf]dddjalolfjwliasyezn
xahbldxnvsviywko[ucmjsyoejvcggbtx]prfpnzzlexpolsgsmsf[bgocwabottcqekxs]ijvpreqlfejnqhfbi
qtcopopjmmcjlyfrtot[dmnfjowrhqtqhevs]pfczfmefcnnfbxiovzj[exoentzecnbfjsy]comgdcvnlyaemmya
plhhfkjlotvzupi[ilbcfjbrxuildya]uuvdzteoijumhavq[tcuesohvzusidbgpw]hdsgdngmjtlybnas
yoifccopobbguvkytps[xhkzrdcfsyhpmuujbt]ocidhllwycinggwu[kouoyzxtwiwknduclv]wkokzcbbqvjxtubqg[plgujclgyfmafflyurt]rpjrpxriaxyinneajvy
jbmiqrqkpbjasqhvwcv[zlyzpnhzdtqiorod]dkigqgjtzmpleja[ijenfaygzeceopbmxks]iwzcpoekmitcckbxbzr
zixveaipmutzulr[awdlukrjbyxtssfksb]hreqwpgrawaqwtqpt[bykxrwwuypetebhs]xhtujigporvkxqot
cldscqwnyjkrzvyegsf[zwsvoudppoalxeja]dbqrfscekpmhmpoellj[xxxpuyedbyuihdzdf]bmtfdebklpxvuacq
ohdqlkppqasvyrkkjm[hevshusrmyhuyyo]qbmrotalialbvje
nvwdnytzqwrugam[pflhibktydncffbnlva]lguqdlkusqqwovr[bgufsrqjnngbwxnhuco]uanvcpxragayfoj
zkvrrzmgitfjnit[gezdzgcdvxdkxytcq]avznjhxyjldbqpfoua
mmyxbuoieontkaxvnk[lijzkcghkhiryhceqc]zuouxoicowwkhklyp[baqxxkavhepnpepnj]jcdekzxrpfucavdq[nxrhabcrumlshoitzba]httcbsbgoyhjpkv
hpzoxihsevceefdjv[nxgkyykcfpjwtlz]lkszzbxqdrwyktr
djqunzvzcyxmjqhy[qapfiyujulhgqipfm]htqbtlhlsqxnjyply
lilhndsdretyqjojrn[oxrhvlpgqiotmvruvh]hgdlazecfzdrmegmnw[alxxixmnnjkyhrqjgh]mpbjuwwcyhdfxynyk
fcrwgutcgcqizev[nwszwhfvqtdhrymgqf]iiahiososrpdafnt[gbkrardsossgcvu]fmudukrxbiqyrpi
xpcgsvaeydonptb[ewpsimxlttaeoth]gersjqmmdamhikqtv[sxyvukeegkkbbarjknr]sohijvshdnoawujw
vnjkhbmpsmvxkdt[yrpltayaihgspvnjxb]ivhwkahhjjlwzxfpz
ofoancxlupttxku[hkedaqsibrvtvqu]zkssllvuecmgtqvs[eklsqwgwuhucbxykl]ioompempaewmnco
nwviejwlkyokiqhuvo[csddbtlbfdwtakxlmss]fxdoqlbdjhoslraj[shasfhtvpcsajdsmxfp]errsdzqcqzbrfnkeux
gvmytvlyluvnmemhgjr[bvqbhytqwpyemefwo]sygljhpvyjnuxzjqy
zootaoveazcrmtbda[qlxlwntntbkjtkqve]vffdsbekufzemgwomh[vzllvqlmloffyyldfh]alltnttrzqrchacoiqm
ksbuxsjkmtzsfsy[shracmzkycsuqrei]qrmgsndwzkqhtojsn[innhjjhyfsffgsboglx]zhwuwgyrwmucjfii
dagldnrnugbavjwiiq[vrsiyprmsvuapxvn]piirprosbofdwzuuhn[epdsrdcpgzkkzdjle]jylrtjltlmvazfpmh[rqqteknolbyzykdysvr]ieejzvgtumekqapi
mtamroysxwglblwmjn[gmebbprtzaogucvyzv]tjzuzqyyfuihjubuzu
pcfbudkakpzlyou[zznswrvmytntytfkt]kvudoarqnyybzeddvn
moelqaykzlstyntby[qmpxihbeysykajdo]omqcjgdbuqvvydd
ddyczdjdwnoacci[wpgjlohduqnlrifih]dfwcghvsdezgdixnpxe[ohhccenoirazgekq]lqtssqpzgusrlvyrd
ewirhlfcfhkqbvmvi[ixrorekrimzzkckpel]ihyukzubvqdpnmqpgu[mbtybrusfomfdhlg]ucrcmbvpnjbghnxdo[lyajfieycgiubui]llelwgnuopqhjax
jpltuunwbrijwnudg[ejxyrxniclwnqxxnh]krckhlysnmqahsz
hkdpdpshmftvxob[fsdhonsqalgpydpub]dirxpfxsxhpxliqg[tvbhlcqkymtbnytjp]xuvawokttfililgwgue
mdnmunbnueofzddapl[wxfahokzfixiapig]wekvqzgvufgztlgldh[zwglgerouhvhtbrdib]xeogmvaqszvkdvxv
mbqnuqonmkxmczjo[ueqnkvfdskaqwesufs]zmoqtlzfcwqaxdnddkk
qoaqjkdsftjstyjyqd[fyvizziweplccjt]ryvpqznfcdvjxuu[syspurpgsonxbbdrcc]vvedpafqmoeugwuize
ctdgzypcrjqxirm[ouyjhaohcueqwdez]kroowbthpspnnzgzuau[pqijczlztofszvdzhx]iccbpchemtflqnhdrnw[esvbnyvlckqirev]psrquqfxaotuzsojbt
rgukaurlmsyzovie[noclopxqrusykxpix]zbbopbxzogbeppp[anouobvemneuuztti]rpnbuugshsxxbbkhauq[zpqywyyxjfabzyppw]ecdrhvipvzregbgl
vmbtrbtoajfkswgy[kailajjwltvmwasynoq]goxmpryedtsrgkx[hljqifnoadoljqtub]xucplzmspnbxvliaap[tfqpmrhbakiidoxwa]iceqprkydjgouemqsmf
cvpnedbnibipftign[cigxthfejgyjzvspaam]esifvgljjjbexwm[uspsplcqhomoszleq]qnogejwqjdiznyfellc[sszzsifsfavntyghfs]btswodsrhcrrbodmtz
lvxwpuujqxypkhqfymh[wtizujakvxzrqwpols]jffeswrfpnhhakyhwlz[lzyloeveicgwixnvdx]uvwhpnjlszclssbf
noblqdnmgtyjbxjq[chxjibegmcbmljibes]edtgpajthcmqgpz[qafbzkjfqbjzilzh]aorhwssnugyflolh
hunicsoijinxshpfskq[lniiseazhvpjiyg]wirqusdwvaiyatimhx[jntjijtppuekuvvzz]mxebkmgiqyfaglow
wvzgoeqwcuudhjlc[nsjqegpxfiwvbtyuo]hehqjsarzkbbidy
ncjcjhyagdubxcibe[qpddbjyualjarnnpkf]cizleaqaaewqysxwys
jqslpqaqntewoglud[xtzdawarqxbigpuf]qnxdyobxvfsrwoaz[snegbwbzchqcbavh]kipasixtzznhgkjskv
hptaschabsnqdgmuzoj[satvzxkqetnonungbjb]gqhigqimupvihhwy[nejqgulbxtzfjbjlya]jywahuqdzrufxenshjj
sjgpoxxqtfsltzk[jqwzhblplilweukbso]tgorxisfymrcgyr[tfbebfnnljlpcfeps]ahpjfbonoajtohthzri[tdgaokthtdhxpsg]ajcykosmkhftnrjqphg
tnwtnvvrpilvadiy[taucexvsohfmaxd]cfhrctuhgqwjgtll
xzzmvrhyhwvprzczwz[lnshilvbyfjqgff]qfkoodzijhqkpuob[iyyvvfibosnuwlov]fhbcvpuqvpxmlolhry[osdmjplktygtobvt]msazwlubhinqvyfh
wanhwievduqinfwlcou[uyalesnoaqmajcc]zbdddgzmqprwiia
dfovljmseevxcfarf[enpclythxgepfzqcw]wechankwzxxkkutq[mvzawbhttzrauulkxvd]emcdawwiunjraebra
sylgfxqcfrqgeeuh[dljwdydnbuddmtdgp]fhenkxvmwvdyaukaxa[xcdbxlqqfgqtjyhoi]tbnpjbnpoxxaxef[rlnmcnmntjlitsmn]vkculrpgrmqsrayre
xexefhsfpwtpxuygp[omxfywhnlcapmpalz]foblbhtxieggkgpcru[lscwcbkqvexwzzbri]ipjoiumgoyugfzq
hbeghglpgqnwpxqio[pcujpvhzhghnyjkmppe]jwcnwmqwctqgoxpj
apqmhkpxrtrfwulqbq[trthojavkcrlcgc]oikizlfqpukeudv[afgmhbusoqjubra]ajbuhxzuhecopcxm[lowqlmwiyvmdojjla]jrrhjmopywkqrhlgicl
dxrqnbrkijtvmkwq[dvtqzljjbreayipqgp]erhjjvypeyramuaab[cjedbzbceteuydrps]kolgelhdemrbeviu
gwjakwyuaxixflozol[omjuyjzbtditgoznip]nqybdawthoydext
lcdwaahhbhajoai[cszvgduipwduhgmo]vpsgnhmtypusbgmhwnb[qitqpalswmqvjiu]iyjenmmobfasnzqefci
tkxizzrgmsxvmrdawsx[edbhkciwrqmoflyang]nbuwbbspldrfhic[guhvpvocfyjpwwclv]olxhqqgrylvzzqxxd[cnhwdegsxurungopo]rdenofdlpgilpiuvmr
wkadrydzokfmuiah[mihkmnzzjladulkvb]weqzktdsbwalcdijda[rejzrqqdtbvrwgbgojt]ggruyvfdesfdwenyx[jjyyleykqeskpfmzl]ssqauxmvzygppvncz
djzzsqykcfbhgfoq[frykddayaohlxmkem]kawloxhrgcpronph[xxkgjvdfespwmnja]jddmrdznkctmsmaxih[uxotxlcobxfemckshh]irmewesnknuknipl
hzojrovrbmfobhsau[itboujfkrmpgjpsvsr]qgczawmbunmisxs[dtrvnzrayqlvdpyzbuy]wrcsquxgcxpvbwwzlqo[kqbfajfleopglhfui]bsoomwrdifoekal
cntxerwyrvbludhaa[fclfiyjfekdtavmgy]lnvvlflygrewrgswx[juijxzrpwfrmshbttg]yjeuhzyjbmbdslbdhf
gclzrtvgfbqqqcl[fdkwmnpoansxtklyusn]ywwzqahbabjbcbzd[kuiejkftwfuzmjbiify]tabpjhaiwzcdnzvof
hmshguykeqstxgzs[fsnsxtrvkdyrlek]rkzkooteryozbwmda[jyjzddadewtuaqulp]gtprcoocgdsfbtduekc[llfoixzevsmexhuitz]ppiutxxuvaxhzgiib
ouvpvcchazfdcljaux[kxqnkynylosbuekz]arsuffkkpzlwuibqd[lmmxhndkoldfbtyfpw]nvcrjoborzogjhgwn
ojesaevpprrzqaksixa[ykxbgapdjiulhmxgihm]nrxxnhdwodfgqoeproy
vzbltcugyxvtlxqnkxu[fcflcasuyaljgewcynf]azqaltkfsglwgkeh
urcslegrolaaalf[grobiijzrtgpntne]uhpzjqkslgahpkehix[prmevyrajmgfhsjpag]kwfhbrhzkojqazxjocg
zwfeopovkggasxxb[fadbebqmbxwktwfdeui]ftomtaogfvgkkdrkc[rdkdznntsigigjiv]warlzbzbnfbjjsh[etjzyzfdjztsfsyi]dulnqfxjoewssxgkfb
nvrsqzcyguparczn[ewfmgkjaibzjoiex]kpooaykofbtkpawayfh[ssuzuankcdhqvold]qaeuwxgakqvcugn
rnlhwrnjgxwleghohuz[nktpaaaciwyfagkpqw]yeyzojziajnryse[bmpxxtaljjigfiv]ojzukghfhfhykqrcdyy
doqbqcwjoldvwtws[qaxghysnphejfacrnkn]iqyhfkjogmrkjpk[hfjqxqeuzwywwmnzj]uzhpypjadzqcpeibcgc
kmcmhdptzlhgqui[cpluzrcwihnwxrsdoj]czbxutspkzdwesrc[fccnqmeaqfmxtqqng]fitsnmdmyzwsifevbat[fxhgcmqhxrudtnleoww]yhxgwphkxlzhxzjnvcp
tmjpplcwhmsaxav[epfnxqdzfpxmaztdqn]vwdoatnafiotogpsxk[lydghxujguhqcjqtbbk]mtvqsesoxvybfrxyoi
fslvgbiibdkhchajyb[zpbhqrokrbfuqrowop]gqqzoqvfsdfcjcdurrs[xhqfcfytbbekivnvod]jxjwuxivnyhppvfhaol[evfnrmrjnnhychtpv]emiyjcjsnojxexs
gqaygymjihevbsps[iepworrljuepufyvne]fzfjulzebpsphczby[kxaohggiqnjpdbf]bsjfluhncewudkumaxj
mvjlhovwivdanexv[iaphahshtwtnhoeoqsk]syolycabjeiwtwtec
ikhcujftlekmcnmcy[ubsoslmlaitakaqb]ruyiqnoobymxiim[ppxtpuphuisxnqumd]qxjhzfwvixjjmfgaqej[bdjpilcwzhqphfumpny]itvjttbjsbfmxppif
xhemwtnqvfankrccdtk[bbjzsytqxhxcgtedp]ksfozdggjvyvpoyw[tberajbwhcirnenwv]juojuogrifenjsbldn
bczvqdwkurvezjxgrg[yjvuwvfypobetomm]vtfujjaergrizoots[snwcbtqylvuhnxyvb]turadiqlfjvclpvbweg[mekdlejerxpllbf]bgkveafnrceyxufsqj
duqeascyrgxyhlspebo[kzimyrleaopbbwmbi]xsxqyleqvoscazopte[debdbibiuaosfdyioum]vjaptdzpitqctukwhf[jffyamdmvkrggbe]qrnqpwcdoditjixsc
cuxdugzthpcubgw[qjvtzbgagyebkobkhf]tsbcghahxswropcgj[yenmfdvoxlqekjsk]kjdmhdgepvdoovzvg[mafjriyxqtotmhxgvty]mdyayljihzqxhiga
ehkhfoqcdkpyxeum[xvjaglxwocodctbzj]osufidsaijsczhtfg[rvmapxxierwnjkc]pgshnzbphxdoaitou
wagqtjalswmbehwmuwm[oarjxyzwyhxzhpgilh]qapupwvuflcoryf[hmqhnrjiahzdfbaz]kuprvbaykjhqagnl[wfxatijeapdinkt]hadtvdjbkdduycdut
emfkovpbnkaxykrmwjg[otoxyqlkgczzivgdt]nsvpzdvcbsvrbpo[vdfxwihznfpxlbsju]xbcniikjhgzelav[opidnljejcjawbikt]gedgtkiksnpijteviu
fxbpujpvuboflfip[dogcwovzlakonhdyww]tkzftiqvyzumadasjtu
rqtkvmbmqtdrqsahsdy[dhaassflbjfdslopp]zetcyybbahysvheand[uncbkqyoidhvxjf]mxqjozeotsollwolhs
pxfqsysywqfsmername[yfcktnozutkhniqyp]tjzzakrnlxrtscena[bitenzjdqfopqevroqo]zujogbgemdxiaven[dtxlpfkysfcivyrxqt]fsgjjgzltbnlvdojqvk
guclyozvgpvbuhktwbh[qmueutcpmdebodbilp]vglsdvkxogzhzewjpl[guoovyobczavohc]jdguogegerfiwrxthui[hdcvpajqgpsoxuoawmz]ztwnqkdjnnwazrdzpc
llcocydhktglycn[aqvpbqqcyyjlfspio]bfwtqbvqbywnhvn[bdkrsfpiokzttiazuaw]kchhszhegdhxega[mgfuozyxaqcxmillwlx]mzcerkylhvawvyujx
jceiyppxbreywlqlc[fizmzubzyefdntbmd]bmholmqrninpjuux[wkbshvxwlfhlrpkbk]bnqhoqtiqqpsibgykwd[ajvhuevpxmsrjrdwt]ejcwhcsechltmxlycwv
lhzgbwzjykgdqwj[ksxhpuzyromwycwqtmi]fqkgkgvjfshsltg[ypmdudbfamagwadtia]nxqvzfdgxlwbbkrssc[zqmfrjzhsztnqbdgo]dvzoywqsqizywigsqsm
vvnbnhvgcpquhzbarub[ufazesxvliazvkcanib]agtuglmgoxupumcispr
mtpdvvydctgradgywc[mtpimzrgtmnlcge]vxbxcxjkpticzboc[ffiyihkovkviqjifrnt]yhxctiahahicybqti[latcrvinlucwkxhmc]ajivvpmxwiypcjtevwh
dpnjvkzcoyyzmgvvs[gtjdsruwdhyukkx]qndpbpmhkdngjmab
raugsxxkqxpsglitbj[ncskiewbnqnhxvojfx]qnqtemgvotsgnlgxyb[exshfmlaagkpxueykd]vgcwastyxsoddgu
vtmkqugezjlfpad[ljdytmxdmcfjvqus]zwkxtirtowwwoqybn[wwbggxlelxpmctsyio]ojizduyxsklhvogj[wkjkwbzdmusrmnwuq]dnvercuduocxwzzqvc
kcuaibmbtowdpkk[behnytmljmvkfzjzx]vwmeazoaavjnyopedp
jzmgdckgiwbhbits[qapkyzlxkcinhakr]zymyymfbxgiypcn
kbcfgsoqgqvurokxs[ygvbgzijbgfeylxvl]xsjucuevvfddgod
unfolwpdrbsrzgoo[xcskhiayzcpeegqfoe]sqhinsvvbcdboctc
yclpzeggejjnvkssg[jaxstjrzmutqmaqq]buvqcwkayhypitxnmp[hpxwubjyepaqhyhud]qhqlpdiqdhhgffsgtqw[ijhwhbvlbixaeywd]fwpyiwyrgoquoeuicxp
jwgenomewntwyxiawpa[eqcukoqwwwaruuaeoaz]przxcbqvsrozygtcyl[krwnmcxmgcgfbvkj]pcifuzymidokmsecl[wetuprgdinttljgam]wiiixvydbevhtscp
vzuukbqyqsivwpeeygi[bsfyvyrjgidexcfzq]wyfowikcidviqqnzcw
nsvfdglsbfbwlxfpfs[hdfyjgnwdgeropdfian]gznlvhnfjawhokhugz[klxeguqtsnydunmtj]gaauhesdugovoftjb[agqwktizuxyqgbvt]zhbzbgfwnkahvueja
xcnkdghtgpxbfefay[iekwzcvfquaynjpflf]rfmwtjyxputzpsgr[rxbiyhzboydmvufaz]vbibxkxeazvkbzpnrqv
efxnnxokdpeqbimle[sygsnwvurqpxovmfv]bfkvfubmjyasmvc
pvyunauqgvtigep[ypayrmkixxbagcbawlh]gsvqfsxbquttcaayobo[cwanbliqbdzlcur]ckdwzoeeeldqnmpnzta
uaxiegivsmmvixygiih[bwxhotmjiqmiffwt]ifggldhrjitovzh[wtrrvwjwudasapqdal]zegculmtzsyaxytuhih
hvikzocatynjoxxzjrr[yowwrajfokqlojraj]gvquwhdppqvtcvd[sqcangyggkdiljktl]fpjugbjlanzohbvfylb[fxdhqobssfucfmeaz]mzrtcejhidkqkpqc
lcgelocktqpqhjgon[vmfhipgnrbypfellki]bqgdqxjnlynzdjogpbk[ppgoudyairolaaomp]utxjqpmjzchqdhz
mtfryyrtmzzlooy[qltyhniowpskiqmolx]nuxblfnfrcqtjqfbzi[bdslgcpqyowecpp]vlxwrojvicfzzzfb
widpcxggzgbkofmmtkl[bhvmncpisdisugtk]azxcnslcqsbtyufnt[lqwxnibqiwuwzwkf]iqnupikuhmhvvhf
amceoqorrqtczywlb[znieihkpkxkvvqxk]rmoexicvufbvzrcxisb[nrrbalocuvporahypgm]sapytlndnufcmsmnl
ldbwysbqqkcizwlkqk[kxbcvzlolkrtyzou]zsqlgwgtcvtkmrc
bejhbhwlnmysyqgzk[gombhcspwwomoqoprog]zgwpzkhgbgaveqpe[kldisefosjggfqzo]eiyzwmdoqqsrpekrs[yoblfghskpxbimnq]ewghiykdpitzdsydl
uxdgjfelalnofqouoee[obhlfmbrcdwvtgs]hgtqhblpsfyxxdmruq[amhlljtgsqandpxg]uftttypexliymsri
xwcoczwpeprblqvdsze[fcqzupldpqdpibi]peaetflnafpkrqz[aibobqkhvfzpwaajxj]mzlrkrfslubibbu
fpofuivhqvybvczq[zbhaursvrqknspvj]zlovzphchihqwko[bxcpnqiijtjpypqk]hmdzgwlnervibxuz[hxskzadaiwuhkjrvia]fqtcewytffzarnbdid
kqzfapnhrgdwnrxtwcw[keiqggcxbtzwrcvrvl]itnkudvtbvfwlcvguev
folpqmauykgkbtb[sajzutpltmpwuvzu]qgkgeonxzucthfluwfz
qiniyhvlxrpcbscgf[mmjtkliysclrogfxsx]snxccrqkeuqchwfi[wbbptxydvrbgemquc]uyqttlcltqvqmhu[sawrjbeubszmuwsjuj]rowkyiykcizmcgha
xafcvdeuuhyxixxn[abpngbyvpnkmojksc]anahdcroysddmoxf[tasztimgjqwkkic]fiycikeddfoyafacbfl
fzmscbkkolwovgnjeb[qzholetigkxxmnmkoc]ffztdtemtdnustwuu[zjrqslegqkywtcaqod]qdtqbyfhwehdezedf[qqvslpytqtjuzrkc]knqvowafliildhqxgex
hicsgtpdpugetplbufu[lzlwcptzokxrsxtrl]smxnwfvtzttcsesdu[wmucgluptdavbca]xggqqcfaxxcagagkx
hwnfzlhdbchsmjwaytr[xfggqnxtnpdjzuyqm]efiweqzxmsxetmyjnhc[mgjnkbfmmvyrwyocr]jhviqqnrgzjsdmidsjs
nvouetegmutetgw[keqvyocxdetebkcgl]qfhnyfdnjqnklpad[swuvsfhrnzsnatb]zjwqmrmphlgwdnms[hdlfprihcbcemfn]lrraefojxvtpxljil
fowkqklueytawgdxklx[pmrpenfrmskqjttdqiw]ttqjijvoxxfxrrdve
nsyzzlnqjssmirvejh[gpqbubkrsqphkdjwg]gvzcxqgbvhopkgy[nzlfaemkjnuwvhul]vxdiuaimpogvtkx
pofmqefryoxboubl[neoxktodwrswfsxwruj]frlrumshrtcllqqf[erlodpkifgfpjlbl]bbfocfbyqjagesavoc[ajasttvajmlfwec]enqqcyveejcayzw
rqtdsfpdgwrlmfj[nmeovqshevzueyvd]ibiplfpvkyxvacl
wtvwzmpwviqbzol[oqlqunyszsyebxbm]ywqypuyvaiegekaok
ijcorxkdzocwisjb[qvcjrwytrzftjicua]buuniicmziszwzikph
pplaiaulcciebujjsx[hlyeskfzscwmeqss]tuuolvvbnyymfmo[trsqblvfyagxmgtwfk]kcigogbmkzsjlsrj
dbsqyxlovoghbra[lwqmeeclsvfsrezsed]odqamvyyhsmctpqegav[xxoamahurojgqse]tngvfzhoprhrxsccgnu[zwwglwyqrieusmlfmrv]tzfresqfmfspigfeo
tmnutczqpsydibk[skiokxeqdgilzjq]rfkxwumjpjulbkiz[folgircuujlcjhjqxa]snhsgynrkjecrsu[vukuvrankaiilqegzup]clzyhjlcbrfdbjrzlu
opgifufncugjrflllk[epkqgmpkzdijtdedk]xmvotyghoniyalmmg
ovtwjnqubjphsgapb[cnrcpnxrfclncasoeka]duqduyvmbzwdopyxp
imtmstorxxvbvmz[muklxeyazsgitgb]sjuudyrlbxgtlph
zbnvlmvzeitlrvclu[rwlyxjkxlvgeyfzdl]uzlfzyvmybjonpqay
cdxryezdoiyoopuzgl[rnmncixgvbxromitr]jgqlptcrlpzdrqh[sstvgpzcldcmoslnycc]cyrecvckpuyjqifsuil
acjvnpfqosyvnvzbjyv[tmnczokfkjaxcvwjo]cszegpeuzanwadl
knqqmdktrcvcikcfvcg[lnsoisfwtfpizbpo]xfxuxthdxsekjpi[qsroiaojvihodgq]jaamntgiaqvdasnz
mqefdyhtbqynychpbh[rrjozrtcexpbrpvfs]dotleanpfblcxfltod
coayqpuuvtnwmxzhgnu[fyjdjtselprfevq]elfqjzpryzqsyqykkb[utrizxtivhakgjoeryu]ozeuxjmcorkcejprcr
ybbgylmtmhxlhqizp[uvknavcimbacgtcaq]bcmdwwkdvfnmnunyp
xfdywwnnhzqqvuywq[drtdcfuoxvlflptlca]oimttatgiboynmu[sdgkeffjrteokyiby]tdiaadhkqdginrtqpq
fbpfhfecwfprygkwu[hvqikgwyrdwtieahmt]dvtcvnchfsienpasxw[ybkvqrxztwzpsnz]aecndxpzpamjkanchaa[gbjwjnipsmepfxpee]wqjnfjiezpzacmgf
adwjbyiantljqwsixso[wpjjoobofoumdxgrxv]rkvrcmmrlditmjtsh[vthldqtnlpjrqbobzs]efwiuqkqzfdxyhvgim
hbbvxnhhxsvghuh[fcrgvyndxojknfr]twczivatsbiynqjxeby[ckqrjoolqrxxjgejzua]omspfwphybvgiqpsc[hmnpdaumzrmqrti]sdysxoudxhpllkknvq
gfussckpoykcibjnoi[fqnfbkgojenspavpz]xqwvoktikoqyzpofg[xhdumbvmqllllthhsrv]vattqhipurbfvlk[hbebbjewrlmxdblgq]dmdhdbknmkouvie
tupwpbmrvffvqbfiw[rqpefvswlzjnphduk]mvafdoftaeiojrirv
bawbqabxqwpswzezv[cjmoppcjgifyfignuf]uawfxptpbgjnqbv
sekswalpvwmmczwdxbf[wmcngumevhrbffuzwp]tqwvmkfngyrhgknowv
dovrepylcvtomveqe[vzzskfllpjbvrvrkryl]byjsouhntlopqffti[lqxrgcqywryeexyao]qsukbxhzoifswmycw[rktzizqtdvetwyrchc]vtsdazzrpipfcrnxbk
ydnkchnxezkalny[wlfhmxcboamfrry]rmzprrgselhmfbeamf[dssnudvuvyhvzyacu]jyzdefurrnaqrfzq[rnndewpbutqgejcy]qxuganmeckxcpdtd
xhwdvxmfxmktgaz[qfzqjtuqokjeznwalq]ddgmotioparmkkudqef[pkgzogoaxvcwsao]cyebyhigpzgyclscf[qehxqzuztsluyweopsq]tikkkgtpkewkzzkdu
cygqebguktathghp[qlkscioiowgqftpd]ytftmijxsnhgacfmmf
ccuocdvpjktkdceebi[pshiishnrprqohwpt]bubrhtrzuabpzzvbwrv[msdeugbygsvewfxco]nzavazcgkniyxva
coscymyrfqgisrge[oggmfoqevlabvhm]xfyhzwpfzhhyhimqkhz[cybjjylavqoqjyyoy]igzwdivoxazgajmiy[kkxkhfunkpsgyvwp]isgotyzlmyzfqrij
vaezncmuzyyjpeomif[lyvwvohtlkcdyuxze]wzdkddeqkxmqbqet
yxcqysoxpbwjlqjdp[jinwxwcdeflygawd]hgdgruqilmuzuzhsg[ivpimcyrtifudwjgso]ostoopidgdzcrzzyzts[vvaiuzzuzywesuzk]ccmdnuyihasnldexf
jhpygjolrfstkxwt[krdivayaqwfuktykopv]dmposdxasvjkzjesg
lcprcppxkrnwuytdt[wysluivwtmytfgqpks]orlmxnkipofpsdteaa[vroskwwxeeylirbkna]zkeahngpukldeszwuk[harebfdcelqdbfemgo]usisvvczvasjomnjrip
eybojdjnfockfbsdjd[xjxxevnxuwjdamien]frogttytivtegcy
rezxczwcihbkywyq[sdzzflizzygfiovwyw]jhtiwvelkbaqhvnylca[xpnwnmqbaawlyqz]kftcwdejxaznztqsbhy
zitlyztihmeogushh[wpsygveulmddxdzvwvt]auvwghiyvkvfxyzf[ccnkvkboczqbgcmekt]hkqnuaoeffocspxkck
ucliphnwkaxtwgnma[wxkbcziemdvopzeq]nwxnkykbefamsdo[lveynsoldnjkcdn]kluaaaoiqsepyqfz[bgjuhrlfjgiyngwkwgj]ofjimzheftgbbyrugn
hshzrytllakuifsbuap[znsqxjzxbeewshkb]tdiohjkqimfsaijvmvf[wxvmhzzkjopfxhshsol]qgjutmxlputvudf[thwwxcavnensivbscm]dounftyvyaoguqzy
hktpfbzotlbrgddcff[adqmcoiraqbphjpag]fxxdcjqhwkftprk[lfeudfsbvnqjvywynfl]whirlnojvbkpyndhyv[xpypetlsykaucaibapl]gcpogvgqrgensxdeyh
afbiuqpasfjkniuw[bqclbergutdzfdqhdpm]gcgpimwjmvopfjhk[geztaacbsloyevwikqp]jjmlssrsuxmhbtnq
ojotaeydgumtjrfdtam[gpkjanckhqjvfjewt]zonzrwxnucpwtrmqyhv
llkryzvclmpozerpao[gfrhlpemunmdackfmp]fbntrvdilgbposhu[koksbsqnmtfdsyifpp]eswrneaxvurkzfs[ixjekbpjqsrhnpgw]pppbdmxsdflptotr
vbmibdiednxxbammtn[gqvlmbobpzpiuoda]agjiighkbopkxvwakva
fnlgxejzkpocaonnloc[ojrecrvcmirtehjfcvi]mrafnbifqfcqxpmqdrb[obuqfqpyrkeinweynd]qceebfqvcmnowjanh[ejpkcpwkjfbvyjmyzoo]hhjyeulunsuagwq
nubgjzyeuxvtwcc[vlpjhggsyeiulml]evysofvjmwxxazzr[tapuneqjkzgtblgy]gvbvijhcgtrdsybt[sdufwiyfojmptfruns]zqzvbotgmrcynfyq
ibcblmwnlhhftwfd[ajuhvgkyaqeikjgju]rvuwgrbnjxvbcgdpy
hizeoqbkkesksvtjotj[wkvmcgctdzwhzlubt]aegcgfmdneprdbw
lqyvebgqsrsfbcdccps[hygatrvziszspyihy]ratonoqinqfwcmm[pfieelpgzrfzhdffhx]zwaytmidpntpolajcg
admawesoilkvcfx[rqurmchqtkuifxm]tliyyitqauzegwst[zwpbngnlemkipcku]hpxfncvznjgfglvugk[ruinbrosnwmxdzav]adbvgjbxedbmxbkpxa
gpqgezsbrdmqmeihdr[etboranxahpniwzr]woeyirnlebizohoa[rufjzeicrsxgitspt]gltoxcqgcsnvlys[dcvxqvoivyuxxayd]zkxlasittnitmoisr
acoxthwyfwbhszfoz[wphyzlksmfenksfs]hpzmfaofkobjpcdxzs[sncrftlydahuqmuvoqq]ojvuhabayhrsynq
nxtmkatkddomlbnxs[qdqxrwoaamrztvkzq]ycyqxxaijhrpzamcbh[japizeqvlqsmdqygr]xhxvgqmbzgomhsm[kizldaqvytagvviondv]tidqihojfrzvyxy
lllcbzykxbdewnyff[iomemkjmyaqllvcx]vjvnigrbpnhdrbi[ukmffsdgnyqxafwstg]ralpevvmfxtqbzyii
vphviazdmmvtcyc[dcomcirqycymvqkm]meeikjmqliqraeqd
jcgueeliyoclqera[verzkovhghnquyndr]lptflbxptsugmbhvf
rcdghcuautflhme[zngtjffrvagsmdrxurj]mwsuxjbytlzyhinxyr[cibaxfqjdkmdwxr]yikrelnmbneqrsg
jyvaeqjealrbvbvekn[yharteswtwefyedz]wosalojtbxzaujpiba
cdfzjfycznejinx[uhnuxxhxgipoujnarw]bkwbisknvmurfnhp[jwbnvuvlvegrddzf]bkeykrhmjuphuvoza
aalmyxywwvbwwttad[daxeeneiiiupzvqz]cqcjxzindssjrqb[komptxyxwgtnuedefro]xfbjflfujclbqflke[fpatdmophhvpcmwfj]cqbuduaifbuhwiy
kogkhuakigjclxbjoi[yuidmmdeopwzvatxc]qdsbzscrwpmnloga[xsnwctwrdpgqvggoian]yayspjjhhpdsyzkkzx[qbttlvpkbplhagtb]ndnljzkxhgdvclz
rojijwgcylsaspmmrdy[jzptmasniljjjusl]fslcazgojebnrrrz[ybcsqnloovizrxiwal]ghjlkcnvkjjlqodusp
egzqbmomtlqvjfo[cdarustihbcqwpfpcv]fzxqpzavyniyjbfvc[wkmiofpbdcsnbtj]kmtvlxnlvdjflivtuge[jvlzovzdpwxwbcak]hwbtpuolbupvwfcbh
drzhzwluzurvcjogd[haakukjmwslumvgq]cmwkhsuahrqxfae[kugdxfrtkjmyyfheze]dyxxyffqsfctugyca
mlalvviidgseekfkqtk[rmltlzesxldtmsnyn]xdqfkftanryqfqrqkhc
vkajuyjjhekfhmwwek[uuanfibpmdbwxesfmsk]dxpsqnnmrnspifpcyts[ezmjkdjacskqhhbaupr]wkzxoqszqigbajudnq
wmpzatzujoibyjdle[awbuzjartnsdxfqtlh]votzdrynubyfrdip
tstuekiwimhtizzlky[trscvkeiiriseqj]glbwxwiwdqhndmnku
kjgjcnoipwnlqnk[hpukxdqokakrgjgjpk]nvinvznddzuhupepemb
vuawkeimjefqtywj[mgdvjppiouqnnyhzz]eeemepklcxhhfot[ktiuxquqhzrojqo]zcwlowvczfjucqeo
zatolywcfoplujidaz[avcmpullpablbdhusiu]bkwehsbzcysrauzz[tbgkmrwkzqfysfdh]anakunhzskapvmq[cqzomvulpzbizfuqug]untygoozordiywrnkm
ozynyagffvaeava[lvsgzdvrtdifdoxgvwy]pdkwomqrhfolkmj[fhemhaolmihgxlehn]huscypjzuujagfaqk[deqkgecbrdfhskujqg]grknbktwdyznqgrwm
mywakayudrxzofpri[qlywfoydoqmsmaoygp]xpwmtcqqfqsmsys
sdwltsgbumfnbqq[irstsqsogmppmlmkont]lrwnbdnpkxgfhjeo[eqstbbwumfepxoqaszs]fdrrfpfiotaugunbdrr
bappxujhicaqxhwiaoo[bjvhcmhrnldlwyrf]jdxfokaxlkbifuwyv
jlziyvwcuubpsziikv[mvkolefxtgoarsk]tpixifdoybzfwnwle[lpbkitwthyxdbvwflp]eyuzdxvhuukuiaqfp[xcwvlmoqpjnehwudh]sqxbifjmrgwknsno
rblicwlpfezecfhati[aqqhagfhathupym]vspyjiyytesirim[rqjyqiviftryoyychs]voksponpgjfuwsp[tmsccufpnvjdtgs]llptwgpugyjizqfch
admwljcwmrudrrph[rcxxxswmdlllfdwrk]etyjbtmryjxeajzccmq[nivhwmfzjwaspuon]tslmnzikhnbtqwkf[xnwykihihgkletgdy]mrtryzmlleorzwpi
ibgqtdglmjgcdfsycxt[ruddaxuheyvamwyi]neoneshgxmsbpydg[ytpshrjgditzqmjdlz]nlvhgtzsbzoskiva[asuilfpsgtgyftgtsho]xgoevzdtjemapbnady
appgubyezsrmwec[wbqyvobthbuperojt]gqxsjlchxpwvdfvdf[xlndklktmbpjkzuo]molwavhkvungdkvwywm
jusgjqhnjemncvbvy[voitjezdotclvwaggg]ffunuypbjmopbbvoh[lhufstqbkhqxqiworpi]gnhhneydiasvmbvbga
hvboappbxdqyjvxqyd[yukgymhpumetulsznf]hgiqjmlrezzsfndrx
jkovbtabgnbztjmzsoa[flxcmdoflhlgvaio]qjxscacvdykhkxclej[taocvcbcyfrjgcxlkm]aovpiymrcdmebktxwfa[coviwkpdmukcsixdob]trjjdhlgwwkwtegkqmp
ibnaxwwqjgtgxnlax[zozdkkwbccwdbvbpf]dwuzbcgeqfepczlvwo[pmlmuysuwyudzjam]pvhpqtcigtknoqxlib[kvwfykhxumzltcxidt]hybnroedkguawhgl
xqwhbiiflggraco[uwhisdtpaprjfji]dexzbtghefojvtt[nlhtexyhufqeneytdtu]fpskbqhfhavnbkjxwn[gtxmsoydrotriljoov]labmxjlalzgybpdjm
ibxakiwqconeyudxj[mwzjwhmnlaobsdy]gvxbmnzqbrzuorla[dvbreuhggwgdtbjet]hjrvpdrakncsfejis[tstdqmetsguihzdws]ukllrzriimevvsekrkv
ztiyqybtvliidsq[mvhqxpqunpsqouvgrbx]qmhkzbqhemycwxeq[cdadaodqyhjhelanr]rtrnroumhiwdadrbe
nswbgqjuxdygjrihvn[mkznbbryojdlhwee]kccwymwlzrsilyn
sebujequsxstufe[romzdeirdhctzkmemwt]vqcobpsqzelktljh[twewiabushguyyp]mktiojirfewuoacey[tgnliawsrpkhyko]kaytwdodmxqandynomu
qvfoyofzmhctntofr[xcokguepiaisrpwewng]lwwzyewekuamxxlepz[vybjmfsierveheb]bzvvxsdlcohnpmgir
txjecoixmxyskgactb[tvgiyxcbgzkdmgb]yvjfganhyoguuygau[vztmvqrrheqkzasss]mngxndysymgybqw
ptprazbzxzrjpnrcbko[qtdvwjwftefqzaw]ajavbdsfdjghhismds[vvouytxwsxpkttqr]kobwalobjsrwmxz
ucvupuxupiasbzxsuo[hnocitmtlqgttgdr]qghjdvyrttaklumszdi[oyeqkgycqizvaok]xpnaaapzbfqdzvcqhr
vvjibkoyadzluivaen[cesqlbhxmigdxphcr]ztmuzxnzeprichmdsc[daemwvspbbljrfc]jmqbyfpmjcddlepf
ztncnhqvomvfnkhca[ohbigcgrevrnpvuwgpv]lnjucgcpghvtzlrgkh
nsdamwafqwcjnslx[upwtncktpxkvkyhd]smtcegxuoakvjrl[dhvmeqrfgnbwqtd]zwlvwesmxdcnywjdb[whrrgcaujehwqcf]ayjiiktvzvxxquszmh
vnqareestxydfvuvj[psgzifyszldodtw]zkrympmklegtsstov[gblinnqlnfqargqx]hfcchypjbzvbleabbo[xvlxasumenqxcdgzqo]zyhgaickhrgscmo
jqaahcqcjjtinevp[kkntdvvdghnkloliin]zmrsdzabbeotokuz
vnrmthshyygudsrbu[yjvauysxhjhnmqenmkd]jbjlrunbjbzvilmyqf[gnoejrqddyzsdixecs]qipibwxkrnbmdgtevfx
uoqovspbksjvndhjz[gntlvpnmkbjcbsesyk]thzecqozlhmhrpm[ebvhbuhvuyfudyeyeey]zdlhgafvupyipekqoqt
hwilsmnzpcjvpyor[pmphksrtsuqgkdqfyx]psibvhgullieqqwyd[uqesmzorfwbvwgkiu]hlxqjuuflhxlgrub
dzxxmdpesgrpwhw[ohdfatbpppptmdyia]pqxvivkjxrisnmzbrl[iilqjrtayjrvxccs]gwfohsvsvsldpwaelep
vaenounqqmpnzww[duovdncntfceyoqojlv]qttmppevxurnlzde[jhwuqoqwdxjwilrgxil]ehuvfpawjlrzmssbzkm
wwxcidipvnqzxsvhaxw[oivkplzzdeoyqlemho]qthsqnpnbraqqkeyvk[pdkqargzfikxoxwsimn]biqpfsweppknwjvuwx
yefdguujlfuicqqiq[hqlabsggdampkda]tccxpvlmetflxhnd[oqnlgkzvzbhvnzzwz]rfugmbtihisgdklb
cmapvofvmxpioycw[wsmfasgncvdkvjnodyr]dkxkldjxlpdineg[omntdlldszepbdcynah]swcjxnbotrewahi
awbucpjznymkfhjaa[avrrlftouhjbnle]atvuoxpckhvplxm
wfrfilbmvnfdjycnlsf[thxhuqnznohekfern]ndjiygqshnkfehr[jpdgoiqcdevzyrywcp]iuqxgoskimjzasbvsct
crckwgzymgpzhckbgct[euhwrvuqcknwnfwokiu]muiqtteekeqzajvnuc
tljyrckyrcnheftu[xshakjmkjvzulic]mrloxmdpqnxcjhnwh[yyqdzldmfgsnmph]lwlpnskgxbkivqku[bwyxcdoyizqjmfvmc]reyetuasijwucrgylh
zkisfuqufwbhfklf[nicopfmlcpsvwfq]nmwkhlxmquqelszgbe
cqnuuhyddzalcxc[fjmqzkljrqjbexcxxf]pbjsvyixepnkthndhb[xztvuzlknucygyvegxp]nwxzswdvaspdufotcxs[bivsecxgawosnflmfd]bvdtxxionieorvecr
txqpvnrfxykothvao[uikgxsmnyxwlobod]tddprkiwjtdcwbobzrn
qjgftnxktteviik[hsnjrychdzepxamtfop]golzdtnptijzmpo[gfgevfrczlektwaohmu]vauncttcwnozkrwc[ljvbawzsqbknkuktnn]inwckpvsipmunmpo
kqxvmryochlslekzhl[ivuyfsoefnqqtwspxtu]bytaafalzlqvjumuleu[apezlzoaspstxvknv]mnkfbppakmectmiafs
vungsqgzakhfjlbuwig[cgydynonrrgfswomgev]lkyqpvlplfsmznc[kttzkoqpeplpfaoheek]ssijcynyhenhnwvd[hleabsbwqkqqnvdd]xbbxdphvgzmnauj
rxweekbgidxrpbcxk[zvguddibzffxqcmvq]edhnueezmvxinaxyo[mqhjuhujxklirvkm]eaozfcadmhsyfpoj
rcdwnquofraczluzh[gvtnjtocgohcsiswush]gnajmbxnrzppwobfjta[dckvvzvigupevbt]veqtchjayfclaltohjl[mkwsfnvdltripnzdkwr]jhdwksbflywaaul
iltlipfzwdrsmefm[brcprzzhfwsrzbk]dlegyxlpizwtlts[fcqadgpocjjnahyqm]htwrqtzfxoeamiqgeq[utrgqiasppoxrbhhv]hwkrxhaxxtltgbuvj
ljimkpaohzhoifdaiko[dkjxnandaghzxflymm]szzkmlubraphtnokpcj[irrxpfhtabogipufkev]bjucnqsbphjhekfvco[vejyxqrtfxuxeuelvmv]muygwodxspxrrijc
inovovgduyohxdw[tbzvjivtssmlxyc]pimyxafhdeyomgeu
ivahljnswgwewyhhn[jvfdvgftpukjcny]rtisgwgamadavuw[lmwlmlrkckbundmzjvo]eqjgikocnpbjpdh[mdpfdbxenzwycoou]uelglssvxdcxlwucz
zolsnrosfihzzhu[ravlcysbjoagcvaacmk]czfdqdbrlvweyyvbq
vktqafvmirobwwhtr[iqvczcryidfihypuz]adgkyomqrwfucufmm[ecbtnwriqiiaurzkn]vtyotrwlidvraksywke
oagqrhpfnkdvvsqemp[qsjyvadkirmihtfezev]vuuantqauwqrbyzxpev[mpaqvjcfntbdcpdi]ghgstpggptgbvwnmyiz[hghmuvsvhqxvxmmnx]owoulisjbqpndzgt
yyyrtktdrrprfdtbyli[tqbcxefwdtzllez]uaixdyuensmvobo
rginebxdxtfoudqwqx[bvnzfxfxsztzqyyq]dfvdsghoihksjcoccbe
avmokgrhvdnoptv[ngynfydflwspxifoi]lcdqccyarzcasxrbue[navvkjotgujkewhrx]ogzqcdvefknpghfjssj
sshuolwwobwchug[cwcurmfcxqblopvho]ghvtsqgltvvlsahwqpt[skxuphjregpzpqm]epmegfynfypbewftism[mwtakvgutsuppqz]tvapecuvnpedscjkfs
vsqfdssjnhoineb[tmcwmioejrnbdyrq]hlclokouzhvmmywskkk
zuxeupjvtrzzlwezm[gsptwvqfzpvkevapsvq]pvjuezgybonsblmmxdv
dsyuvmvaisuqxff[vmguqxuvvtbjrrva]ivytyfdovrfmzudyzcw[kwgjymkeadjgvdvxarz]rpizkvgpobjriqutyt
rpetcixepthhnydtsx[dvivlhhlgbxftlw]ensdqrwytpwniviwh[uierkmawdkijrbrbb]ywvqqtldiulgtft
iruarpzjrxupbdovqlk[cipcsklubepettbee]jfnvwjcgypepsbnauh[ncvfofkqfotujbat]moqzftmyjreztaugkij
uqqijwordoicegmn[ihceutxbgzatiwhtd]hxqgbplciimactv
kthovdomnavxzkrtg[utmtbhgqydotlxos]rtwopdppoocytum[ptdpdrndjiboffigipy]fwxyvpdnlhjofwjtwx
vitzjdhxjjossygyje[vzysmvvgddhvkufqb]fhwstpatifhmyespsay[mrpnqgygncsiwial]cwbbaisjnqrpuzca[taqkhmlvfdelcrzbryp]kwsdxlkmoplziobgct
iwybfvkucobqwagtdf[nafgfydrpzzdujp]nzdzwcpazorvzncb[niuturhwvakdywurves]txickuysfxeaamhlv[kpiwhdphpimfnmjinua]crunehowomfdmznrc
qololsmsdenfcxmtqxo[orjyxjutzakvhok]wgcgzavspuxtiyhdds
fvzbruyrecjzobgjfnv[tfnighcrmbgeklgaq]eanwrgtehcxvxow[hrmkbicsuekiicxw]pmyfavysbfzttzncxbm
frjvccazhabvndxri[wrmbltymeeoqpqtx]hbyuxmlxfrjrzifpj
nkasezsbfuldeolo[wshypstyfliqxplkh]nsoplkbnmiagngvusr[mwpwshlkyfrxlgcofiy]ycplnfgorpssaitngop[rtplyrqezwrwqhc]houlrclmoatskoufgti
cmsmitcywtmhtimj[pevbzyuhvaqftnugc]rjaxtggjpjvayzmhx[pvfplwswzpusjzhom]jmaurmlkkbusduxd
tshzomvzzouayvevgb[esegiphlwqwlkgt]letvbhxdhuzidevee[zngibooquknjqqxnxz]dtnugmifjztkwjpqd
uuzovqhxwovqeki[ddwwgejprtbquodnj]nafunjrpotozufcf[lqyfeicklrejcwwrvxu]kfxgdnpvqdmvvitzt
syawdtcaspkeubwty[vyxykmhcofzktwfex]fmevgmpetmzurpou[bgqqdkgrojeesxj]lhnvraueoksvtjz
hkyhsguxgsejarhub[kuluosrzpmogndwe]wzqvcpdculcwgqldxm[uybwzbsgzjqfspayk]nysymudwyxdocossgu[usnahkjspekuwvgtje]gtjxtcjsdvtzwmf
jiuygraiggbzoxz[wopmhgtzdwlkyzvfhs]kquojxccygvgujcopbq
rmdqmtbvzoocsjddyj[mmwewpzkjayrxkortj]cznmpvsiqtjdpbgbbf[dfgdncqhajjrohr]kjsivnolfcccyijyd[smuudgbnrfqkxzec]zukmasqygzxrjqoz
zvhafubtbxcnggnnec[khfuhiaikrpowmg]udtuciwamjspaojuks[wlzjqwtmrfrfxmxcfd]plaqjdorfrbkkppep[exrlzahsxksdqsllkn]fooqtqpmnglrwokq
rilxjscompommcmc[qpdxzxqycqutfyj]xvoufpojhanaloymvez
crvrlgjjpprknkurjq[tuvlylfiibnpkzmi]ghncayxzzrrhwfe[atnpozkssbyznplv]elzhtwbiernezqns
yvdbhamisqligavziqh[jcfjonwpgcszajk]xdszcpfvefvmlduoo[vqszbxqazfwgrfazh]geltrpsnlfyzzxjsg[usmmfawdtvkvkcm]wqimqpbsojuimmf
fsgjpguxmrmwxeymhjr[gsunymylqpnrbmiqyi]bwqcxjzweyndcslvxx[rhtvuzqaxazgzhhwp]lqiceppxpscreytystv
zdzsidcfertfbeifye[vdttvawxhnsjirsifn]abpddikgqtsqalilwl[mgqwvkdulrgdgni]bqjuliwrgnvycgnvcr
jrrmfvdpwdborgjxw[uqsuxsointqfsbunl]qosvmfqnyadjfhrc
huekbtocejhhjud[hzglqavqagcxaaksxp]afqncrfalluiiqzfo[mdgrvbtzxdzaztpeg]lsthchkkrvofbaa
lsehhfmwrfuqzewvxkv[rjrryjrjwhgtdifux]nnhqgwmoxdcixsna[wgburhmplkpkrgmpco]hrakazqqsstcrxupvv[mhacbkzqgskhorwf]fbobhetgehykvsbmb
cjmaltrbirusgyoirp[eipxzkuhukkdcdh]iqyymukrkwitywb[dcvtitgqvetxqip]sldydwlrcdcrljhzu
oqpgfzdkcrsrazei[geqerlvxxatddmn]igakhcntksmsttyqsv
tjhfyftjaclsdwzby[oiinbkqwzmhzxeic]ehyliwwisegufbhh[sqmpgxuqhsxnzdi]whwxlqgetakchwht
ukgmtuvowisscvp[nhzgobykdniheamz]ekflzosxwmggiuuudz
sqbsxlbyunhhepfx[okuhhqbyojpkahiz]hhywggdmcojawfpvkhx
xlqohzjcztxennv[cnbtlwijpkczgrk]pwxkxivbtxzovdn[bekntreckjtfkrsihm]ouowyjrzyjbgsygj[cbirdomndbelavpb]ujdrausbmqhnretkhtw
jaowfyulkleymkdpl[yxwftdgbtfzugqnnzwr]ztmzcodybfzmfrv[sttkedpckbjaxmqvhds]fidvanwfqvpywervo[jtludguqxuwucvzcjmv]mfnoqzvgatqhvteacyp
txyjtniwndqckudby[jbemysikizywlxbv]bezhcvssxmbmzgpo
gcxfeqprbvpwtdnrxcx[kvhziidtwrxlhejxm]kxzumooacujxvuwsiui
vvzhcfuecgfvrxrnquo[oqgutuxthxlcxhpke]liqjotlxzbmsassyxrf[colshvmiwbfjansdg]vggdkkyqrjvthtvp[dmozaqtceghrabasafj]lnsoewepnlbqvibyk
keehyqsqydfzlqrqqu[obaslijmtiakxkc]wmrxgysajmjymaqpas[tqwlwdqldidsapjtzct]mjeqlhemnwupulj[xdnkrxbbtlkzeapnat]btxcxfncwhdqlhmh
qwdiosimjitfulva[dhnypfmjunifrhopd]plrzlaakgfirzcccif[strfuwthjgfazeoq]lvhimnjpbpagrozczhn
adqktintsuslnns[mtlbicyrgqgnxuhqcd]mdadfpkvbkvkaimvghc[cvqgxjplvvqbato]lbskgsbvqnvndequq
brftuxdhebezivqio[yukrabpvgetpxpylxj]ldgifnehggvkdtq[pobhasghdmctwcgl]ccevtzwnziffjhqu
ibeocesspzaammu[twfeunwtyqohdtz]kiknftbdbkwrzhrdj[ywsjzyncsuyykqgu]yqbjeqoftsblixeozlz[mmcmncavhecsxbxi]aumsmhzrbxpjqrxllit
hieqiicvqswviniteuv[ubxwceioqqhagxybrl]kikxmdnftjiqazj[oyvdrxwqbljzkjbh]mejsqgnksglqmsfrlf
zjeouhblfsglaxzz[efenlnptrfbopulk]tbdiezqxnkiwmifiyy[pylvblxazwozkdv]guaxwfuktjlovasatlc[blnlcbxxlcgddfquwgx]jkemembgzzxssliiywp
juscmzarbykdkbcf[naosptvhazhfydzz]yflhbtlxgowuvmf[bdmledxprwnfcaflpf]fvjeubkojokjcfnzoo[bmmclnpuykellsdywvh]vibjnjgmtpoyvdw
kqmrdsifaonqprpach[chzxtugxvhbjujlzgq]ffbjsynmytyajcbsyn[jsondannallzwhz]gjrnybnhyxjismip[nocashryyqnbsszebpp]pbugutcxooiznkwwim
vfziparbxeibtccl[efwcwvbtlutmoltmrr]fjwkgsaambdhwvefs[nsrvprujruqdlxrls]ivmnrtvdbkumpiio
bjweouryhlzxnkfj[uuqptwyhasahjmkirh]rrxwiqmpcbwkhzr
bgdivzqqpztnswtd[xwfurbswsweduce]osimciokvwbydgqojkk[yyjvptlwdknyxnzpr]cqiztxdhugywyclvz
ftcvabkblehqjyqtl[txwnhqhrsrnengcl]skhszkrtpljsgiylab
ackokzybncuxpku[xzpocuamnohjypcdq]dwroulahreyhkraojf
hqlijbwudkycvijqs[buaclznmftiadyidde]jxhkyqsoqbpxcjgsus[atcehpnpgwuchfzekk]rvyzujpclugrfyksmk
hnrkcioqaeeqjrpg[cowbmmovdcsubwiltd]myuwiosvtmymgfyav[yvyjgtogmgxxnawpda]saqmtvyakacfwsvtxvd
tyanupyqajrxmuk[bkxkehodeqxpclfebq]kiupgpdlxfvzydgs[rvbbrqbdsolzrgse]srmrovuaxvxvzmrmev
pjbnyjsxcwyhjzpvqkl[qtgofokbciwsszwa]bwvnbcneuvipqaaiyjv
ecxbamdgtlfpmqhi[khvmvwiorzygnitsbb]znripfwspcqgsdzosv[nfhgdavrprmveeexppv]uhzugtmfmipmaznbby
jdoggfnexvkxovwiatd[xzxovisxynejpyxhfz]ciehyiyumbbwwxrc[nozxzgzvotunvgnhhjk]umzgdkvcwauvkzr
qhdaymaijahfkqzw[mbjhxuvbksqtvxwveau]rkvgvfqsehbynbom[keygsbhockgurps]nzmhlxxwjlpjhzbhw[ujitcxihwbjrmrep]cbfpxvdzbljvbfpzsw
wiuprpjfojcowmy[vmrpruwhtzbwyciid]ntbkrodejcrwavjfqfa
ctqdkuxwiricymu[wexourbkgedaqbybfj]revrxjgaoalievfbj[qtvcolrhwgqtjesuvkw]ozphhuwwzzguldf
bqpwrkyhlysqvwxga[ghyqnatqnccegjnkgw]pdgglsmagwkwemidd[fcddsukcrksifkv]cyutddgeoqcyopmm
mxmpasrqdexjpqfapbh[rqeoslcvcwqteki]zpervmncbpfbhwaxmd[rnljbhhtgiyluaaetx]aycxgjfqyxhgeraelo[fukyvtlgjzupjjrxvt]peumsiryqvhwcsutrj
nbdnniplhgrqkrcd[thcyuekybfqraxspek]rlwhyqiavfrfglg[luswlglyiuklvbuqe]mdgjepgjbhuyqkcs
lwueejoqpguiciw[kpbyblloubmxdhk]omjurxlkfpsdwdmbl[qnifmaxwapfvglrt]vssmqdzlxyyrdgkwh[ljslsxolkkivoakh]upwkosogsrzzuej
rfqbvdzxrnrbuhvw[wzurtnrnslhoqkdoaja]vuxsxofemkrjzqkk
pqslistydhvgulggwbi[nipdejpoxqfmbeft]frepgyumygqywwycjl
excgzlqtguboybi[guywktnzbmkwqrbp]qghuyihqlgjrdbuljs[zrkzhirafcadgqnifuz]medyulldvxdtpmqifpg[lsmokycxcicnxcyfpe]cobezkjtvpuqyqu
aajcheqlcfjvktswy[lsgbzwuxqcbgicd]skvwyyeawvlzzfp
afnnxrxdhbqqixcli[msrrsiakxynnwiard]tzanbapzvxtabeuz[rbyqhswrxrofedlykg]phyilynmscckkxgbhks[enrqxrwqiotksdor]phnmohcaqxspqhv
pjyiwunebggfgpgsk[ovrxnqwfhtrjoxwi]lmkquysxzdebvarwfxu
cdztgjverhjafgemi[aogtmpdwqhazrij]dmypauxszajopbp[sdsrejzmjvpjijq]okitpugefdhpbfnzs[jyospqqhusxbhfuuzp]btfwfpiblknocxncj
djgkwjxzxrgsncwd[iuaqmffmnfklkieaq]agtkftischmbszqpo[conozrxbpdsuonpvx]mflbagusvgzybhasrlf[ntidmtstsedfdbfwost]igffrxgipzxzzyjy
ahfhhpqofpjyshcus[lrxchnknzrjtzkgt]hvtqhnuzihgxovj[wbnqnjjnzltdyvxswv]bmppxzhzgwdsckuo
ghwlmylxxuybkpmo[bkxcurwihedpwjm]ypkvoiavnzgzlkahlp[lnxohqbghwsnbeqgk]vsegowbzcrqwcsgy
whzaoswycajecyuw[nwzgcizbidljdtoull]zfyczyjiqsqxgzsjm[nfkpyfcjwjijtnb]dabgzqajwpzsczrfzrl
sitsnxvhgjjnlitqs[vvlbonwoskugqxo]bqitwdmlvnlcziltj
avgdblmcidneynp[gkjdefhfakqungkij]eztuncfdkicjhaytdzw[dcfldbgzscsumjox]okqkplzsscszdsxejso[yihmpxvcbnsofchozr]easrxwgppwzqern
cvefvhycaorfsfbmi[fkvzdrremrlrvdl]cfcjirtcmdphvfircx
wegfumofnzigbnhy[oqkrudppjpvcuvr]fzyxsxrktwkgrvyiwz[jkporwybtotanposc]exmwkvygccdurwge
iqfavtweexjxhdkz[drnsnxjziacormb]yftyjvtetmuvwew[vlrdviggcdfnribze]xzykwuzopkedwfqjxo[vnadxonxshmwhvk]mqbtnfjmhjmfdftwm
odyopnscztauzvjvbfe[zpgqzgzcqclarhkkc]lfuvvhwhtlypbfv
ogaqzpgfwlmdrjgo[abvqsomptscdejeyfg]rukgbtpqwyyvnvrdz[bcvgngjhgitweuc]bljvftlzomvgvmlkzsd[yhpnqsmblsnfgfnyv]nvnkvwwllyygxcdnef
jlbnwewczmvtoshkwk[rmtpjyqhqxturbfc]ulsjqpziwqfjccmdpgy[neunvaltjjkcxvf]opuswwcrtqbkqyq[wzpxgeaohprbhvamaf]ybxisfhszawrtgsj
mmrbaaqjvgpshmn[exjdqzgpzdalrwmtha]qrxggoccbehivaiegs[udbyzlbkpvwfkaot]vfbmvytjziptkyv
pjtbkayljttjwyztu[clbiouysqsjbyjguhe]srltvgtetxcbkud[qnuhjnuziihtvqtbeyw]iccppmvrkzyehgiv[lldvqxdqvpcrizue]vpwqjhbktcmiyed
vxqpmalvgeaxtkpv[elquojhkjsxpmks]dqvuljielvjopjcuvsx[yoklegkajhhpatv]cnfivppgdnkjzmrr[vnjebiwfefjgqzle]aqkvijxvgljbxmm
lhkkzniihzzsqxdr[gvhbztmgmlicdoasdxn]fthfehxdcnyjhdwvsx
sthxexgjpexecjzr[semwlxfagpybhblcq]ztkmocjbxsqnwfs
tsswuaezqpzyevei[nolctgupccscwsj]serolamcjmqaawea[qgjyyldemhsqivwmvtn]rlmxvchrccptrgmmbko[qtiqgvilvevjvlkxc]jjcnzdjdxycczflslq
geiglvdxwpsdtyt[isbkywwxvuzljpnv]djxvppprsgjagqtfgl[wmhnkumvdpikdjhmt]snjqvydpmjqutduh
ksqeegpqcodzekvp[htprcliyvqdgjbqv]sqykqimpyqiwktnq[bfjsisougvnyjoyha]ixghemgcvicbedylz
mwomvddjcxrdzmqplow[fznhevtpwhldwpo]ygskvziyhzxmtbcikbl[tjhieqjuukoqmixm]mgzzrsccohxzfgak
xvdiafigrvgrckwol[gttxgvtlreruvonzl]fgwyzafvtwaqdwuo
siyvzqpzfobnlgtxn[zcgxyzgysabhpvsviup]xfdpicxyxyjgxyxd
tuyintcsfdyhfxofk[abiuiwquiscebxbk]zqazrpoxqqswycjwvk[hayvaaykkacbakpom]bwwhqzhuiitdaed
ckkmzdomnglfwcbeh[avqftwjqckajjqe]fkpgyrqzygfcheoctfy
teuvnsaipkrkmuu[rtiypvevtipwuelkzxf]xqywsffobbokraw[oonkmkqovksdycu]noxwpblcqqbikpbck
bwgmejgaihdorgcqq[djldztucejcjizv]nuuzvdhlgqscyrjmab[nwcglzehbfzzvgr]aybubdihvypmvqmpfhi
gxrmeqpjnbegqjeuui[iqpcaqmpavyeeqkye]etydxarxyxculok
wakuruxdmenhmcsgt[lndpybwsvzyibmd]tfabajlzuxwwhofz[msknqgraxzpzwytjx]lfoqigitqufmhfmgwgi
gpusiwyruzmkoluea[ofbgogetujmjnqv]dzmarlipdqkgwdzwzd[uhsfvlrawossxvxyk]yeseypubhoapfgdjom
rcmnwwzrimrifziyoyg[avrikteehxhxcqhsq]yklfcrtqwaxmoepr[lahpskzjdwrjonqg]wddynujhryzkunrokho[ixwzkdpcqefelgcoabt]arjhdevhgaqcohbut
zkcxzfkwxxdtbumymqv[qgaztskshqiukhwuelq]wxzpzaxuhdtfbimub
nlgurkzredyklilaicv[mtxzdczugdhoowtp]hnhcyeygqrbqdnsc
pbbcmecbydtmjigfn[giiambqbdgbgntq]zaaqvlpkysxuvbgbo
aqyxolkflikpaxr[iqrnhzdtynkqymz]rwmgahzmvwtfebyguxh
kcxhmwgrvommccee[oqvsuahbhwioqeunkz]mhcyripmlfivqsimnpk[zptnyqihvavtlxkq]guacutltkqoixskg
ldpiuuwsszyidqxqj[tsmectapcwuyhhy]slauiehtpaocaeqyd[wbhrligadmsgznlyvd]nyvfiipvkthxjuoubc[zplkhqbtciuqnhjhiwy]olcmrcsayukgcbf
tzcpkpyrdolcerqnwu[zqvhulfxfhgaehbwf]zaekvjegdligfrsh
ghellbvwbjaummjjoss[pevgyftbjzmlsryfzv]kjdgnwfofftlxbiabir
pidtrxbnvaobubqwah[nftxjicikdapqexh]mwssisitrwjgxhk[nghedqdzfdgxaqacas]hvehmhbxzfwylzdrjf[bisktoqalmaapoomzt]lwkkhvacvuqvmsv
bdqjqlmohbjvqlson[mupepkeeoofwydse]ekylhrfsudqdcvkv[joofkljfkmpknazry]anyojhejtzfofcg[zcvpdeswtvtngyqleri]seqoyrfsqawkrudmg
lmjegqfshvauxngz[ysmejumumaurgvgrsy]xrmslpnljfmaidojz[mtvwolafkcxlwjjthy]yjqsssxayanfdrel
qmmiampdlsscnqml[ymselibefbqnqakirdw]uzxhisxyqljsdvhfe[jhjnivjgqdfyeqcea]nxbqpgyhtqzcwoptq[frlnwadwwyfnndeqv]qcbefaxmhgspalprcdo
tavfmtbizkrpnerc[kmenfsatjafincrwrlk]pbbxvydrsqnfyap
hwrkfzaovfbmrqhff[qglmybgnoytlkma]ibbbvmtqegqqxdk[gquqtiaqekcwiudebb]ozhpyabnxipgwfs[xqcajsdxhwpkofa]ssaordrnwjyvmcmjtp
pkyhiseqcvejtkbqcgf[xvgqerenvyizecof]sflyqnazxuwbyexzwyq[zppuknfnnngpwihe]hacwithomkpaveqjrs[whsspxqxxqihxrmqxvn]ifsktqmduowpuhck
xqctscaefqpvqcrm[rqbjdsxwoynqeoubwz]zycfrxbkijaedhkr[rzzbvjmogwxgcqa]hpzjokedwwmsbcrggmd
hcbohuwdyeacvgmbmea[mmpvzmjiryorskh]tydknyaqhgcxafmqj[ejadhaojfjlsfxs]duohhgjdfjffvwzcgel
ltlddqcbkkayshw[qdedbdppzuqdhfaxt]doedeeehsibaylpsnk
bywykrbttmmpyacsoo[ghicjobuumyckupnmw]wzxuueyajmgprxe
gejngdvsephfgyawm[eahzdehzhyymhcwx]qejrbkjhhplzgbehwdw
hobcaacuxkoxnutlayu[yvsylobmhtczpxdhvh]qpwhgyojuomiubmahcd[pmspsmyxaqrdvcpwnwj]ghdvfbhifxhphkseh[ntyabnyuoadseevhvpf]opibtuiwjogylqzt
bbuecmhireivvxmtw[kkvuwrudhmpqpmqr]cqrzfeasrpqapvtjqnz
uxsiwqfamsnemtcqyym[wemijyiqgxbcsvdz]tdhlutowbxpxrkrlpx
tnnlwlvfrrluuxjnvx[fgijrjghghgrkfmfb]lslknlacvseuzwy[acexgqeksduhjpf]enxevtqjetnyftgrad
wiegevfedudnajr[uryivbxbutbhfuh]zrpurmrupgeggdyc[tfykavyeulosotky]ahsieiakxnitxhaa
cdymukpgwzamxpe[ihvwjlomeozhnxq]zqlglkiyekzhkesoyui[dqdkxlczjrxgbdfqf]pdipsbuxwhibjytdb[ngoqkjeboqlsuic]efcostvlclbxvzhloan
uuavzipkjlcgutoxrbc[orpbrqapdzdsagy]hbgwsmgmyowonxftjl[wrimpmzmwyjjtnkaf]qmlpvrkqhqbdswyyvpf[lpjhsulqumdzgjxuajn]yocpoqqrpuquduay
wivyimuplkhmmkxioub[vqfixqklclmrbume]trenzswrpqljwctfat[ulkqyvjjpchvkpd]mvlwfrclcfqziho[pbmrqudqsivfemt]osmrlwtwstidtwmbmzc
owpgvzzedsxwjjdeuz[kyqifdbwfxcphnb]kyeaxxmsplabrbd[gayquqvysxjwpckzlvj]tiuxhodkebirvmdb[zhnicexwwcgbbnfd]hcxwgyjpphxocggfl
vrjvymyzflpaqfy[fokfgiaiyyzruyt]yvfrfomlsjqkvtps[mprfrwzeokyjmdetnl]znjipokvzxljjgqaw
opczfzhpovblsevqcx[twcavjnyjerbqfqvooy]tmyyybovoyqcygzzyk
gpifunuvcpqjornc[wcenyqazsxzksun]dijyypqoxxmjiyi[kdzvguquhohgsghqqko]tzknqsgldnnbotqnocj
xtnewbseisluqott[ukktnadfrptzmvmnmwe]nfevmvifmaaubdrytcb
uvwgvqvzikkvvaltpbs[darnokckfpuiwvaq]qjgglscrdhximnfg[cplqfytiupsnlwjnz]tjjkzojxijhhghoo
mwvyjvnzfbptvndlui[dvpxdnwzdssddngva]nkvlbcdcwjumrqmjuw[xgrpriwhdpyxvakfpsu]jzugamflkelhfrzswca[hvdnwrkyrvcdkep]kqyiaalprdowzeudqvt
zahhurbvayisuhkxluc[dpkhtfqcplnlwkr]moobahksmsqtmxasrw[oyxemzzmvwvxrldebja]tqnquzqoslugwcqcwtr[vibjzqdbmsmtxckkkn]ylujuamatwbexgo
ffpiprpoymeaccwoun[avnvjzwvzowgthwymt]sakvpfnqtnzdyhodzud[egijncssvgvsofu]dplbxmzfihrpopurlvn[knjefyormeaeoni]ubcbldkemxgefbnjcbj
fpyokxpcrydmqzkgr[gprmekopimtigwz]fobjyaxokhstzjsgkw[njzhtjqrhoynlzpiw]svrqxlhgpckwoat
srrcdyevzyzhxnx[bbojuevgatiabjudws]zoxxvzrngllhtrtfm[rxoiyzmzwoenbodp]keodzdiobtdfgrxzgye[akofrgfwqtqblvntv]rfyrjcwbfblulkw
kxuswiaijpaejqzoxes[cgyhiwbpjrhaacwe]uqqocaxbsotoaei[runskhbiegmjwfyjv]qgnmhdcjcbgbsztap
kvzutkvgsyiyrab[zhbqkvgbyqzgwvfpbf]nhtaiwzmvrssvxsrdz
tncgsbkllaugseepp[axryamrptnzekcb]xcvqkfuggjcfqhb[mtmzyjnvrgyuwtev]xziofjwvnbsothqzdm
hmjthvqdelrmghgnvxg[cvfmsllxyxchaglntl]ikpeldmfhjdtnvaw
sdhirfhdcxlwhxevbv[rfktrkotbfwiolxd]bhbkmmbdisqlclttbi[ueaqlmpvdaoxhezzg]baphbkfivkwpmtj
crzkarxgbgpitxjeunw[xlonohiojoepwnuhd]kalfjqpazwmwruq[erssxjpfzosbcta]exvgtqljewfuwioyq[syaeqtgrgswbgbetkzw]ofnozzjtykajqcuc
xdojuclultxptlxgci[nkmxgmiyhrrfgoshmeg]zqxcexaabvdjcaiarw
rewjiwxykozqjzneh[tczrbiawzwtndtqnew]yxrgwvnswgyxjvnot[khomcpuiavkhwjsl]ksqiuqyarwwibcssseg[dsrplcalbjojxlecjdo]falbpuscbjsdxvyn
dusvvyynezzobcrt[yrikyxqxqreoqcyyq]vkjxvnlnmleqybmgt
qzmjfdvoruomeilaejd[ksrwqvmnyiessfejo]lvhmckdfwzoxwmydxm[icmiecrnoqepcuzctl]unxwrfwxgnijdxqjc[tuwcbylgfhpaveyak]qslgbtviucbmeluf
djblesvduxlxfxp[grmuswjaheivlqvtst]yrqstsaryoqejwkd
kpyoqmyglnrmxculu[tuyuqjronsgluls]whuymvpcdxvxrimvmow
lruqeoicrisykqejy[ruqwiitwyrsithkyo]hbgqgiywqwsclcsn
pkpmmddfcezjrrs[rbzbxotrbqlnmlpidpu]aakddaqjvbbafbnk[sendmtepxbcpttn]udnifsqhogqvszi
foqjzmqhghzmymeq[isvvkjfpmvmhquoidkk]tskrbirqdtjpxolwzw
pneojhviynihvnv[meuldylhohlfwsxp]nmdwxhxuexorktj
gpnxdnxmueucaawmctx[ggcizpwllvbffytwv]riqcitchmdekosocp
kcoafhejmqsopizo[lyoqftddzxuuerafco]zrvrzbmnzcawaydwg[bhnmhrnwpzmghrprzzw]qcrnkmyfcdoymceacg
chcabwcrpxqnelguile[ckxfqhnrwlulnfgxjb]toauhcbsxmeirtlyy[cfgmasaieapbabcgdd]ijenfrqiaeiehllwpvk[ciymykejvkzxsbxy]iiyypzaxohmykgbzej
yeqhlpncjcipsmtzpi[zoidbyeatjrlgmi]rcrhombxichyykncbwh[wtduqjwbefekhnwo]kqemsisbcrcjaqzdzw
nbxvvetblqcarlcku[njrccfhdvxtarpj]rhndgwlyfzaeubc[imtcezhovdlfyixzwm]dwughoowqyazwaziea[slarywwdukqwygnhre]efzdruetqfoqqxusb
vhvbnbyluqqaqzolkrs[fbfwkawbihbzwlrhd]npfzyqkoxlgkklgxz[zboinxtlzrqbwcqo]jqhvalbjqaogtyn[razwnxfkshezamemtr]nywqcxpvmuudyqo
jubvozjfmykufhrkk[qhbaxcvcpyzbrwjlrij]itseilbvjwvzlgqjfe[lgxynowzlpqgoyrk]inolsbnzxvdmvbrvwqu[hjzfopqwsuqvqhb]wffwgmhjubihiqkpuls
rqnjadbwfosviivshb[rutsuesebrktxitgy]abukeyordcrrqvrgf
bfveiveawwoqyluxwu[trxwkfvioqzltgafma]swkyqokgtrprzzit[kuziuekaorgdgqjgi]zudaehzrjfzogiwb[fyxwwswqrbwgomriqo]sqfjrdskmdvalkhchc
pnrvpotetwyvodue[xwkxyzxflrvxdfogk]kamxypekoelgwktq
etjkovmlbwryvhv[wvubzziqtxbjvua]hmrqokvqrctugqdazz[ykobpstcxdqweotsi]eiczvmdcfjpvhdyfnci[eeklndzunbzipcqubp]tjsktxuorvbnisy
fnexznsqqbhygrm[jgnmivchcvxgssjcm]klqcaszkwyzzecve
pdmzjundpcsxbgplk[lbdsyrmgxnatuwk]nwrhpgieqrtzpktaiqw[dcxtjtkzvlxpibanjma]djszxtofdcuyfpdr[kzblikjgqfiaykr]yhiqqurlkwlrrjo
bwtgmmjbtisnzbnyedf[iniovvuewpetwsg]dgvjyrzfrqcozekvp[xsulvxvvtwcxuvbxau]vvjyodjlbbjxigdxvxv
jcanelvhybigzhplc[lhgjkwbpdlcybzgacya]uwisdadjoniyerw[kzcrorifvylivkhs]ssicvecwpkxbdwq
tuxlnjuyudvhazlxdf[oknheznyzffrtcb]joozaraxuivijskxblf
rvfdfyaemhgyeynw[hmmkdfdhadrqkxzzmsj]ugfozgghllznjhdxw[ucrgusuuqthlgxx]ipiercifxtkghbkf
jgzrilirvzcocaphnz[gyrvhettmmhxaxbmyg]ecpwkoozcgtpoac[iretjtqyscaqfqziu]wqjckfkbfoqmmjkuhqe
pswuxyynrpckrquj[wfbedboaabsgnnzzzwl]wgfrecpfkvlvjzl
zkcihebtrfmiryqkd[ybedpynfafkkrbfdm]ovrsmnhexyqblafad
pbkoczqfumwdpfu[gtcvqjuwknlrfxre]crpyxhawudbilybaomf
pnagrmxhmjftwltxh[aqlhxdwuzrvnwjwl]xhmgrrajywnizazyrdc[hxdxewvthhrwhsva]ckluhnyewiiqazzmvd
amjksgqzgmoavvxtov[ekqixufaaepczzusfga]fvlmiilpsqsgfgg[gzcyehzgpujyquhrkm]caaocajhmhqzbacvpog
hitezskizncharbzyz[nbwuldsjxkjezjq]monndtwsxuikupvi[iardznrxkorquvyvwlk]etzyolkxhyqsdirbaj
ocsxlxpsgimcvori[gawgkxlilqzeakhzds]bodnyayaioozoeg[bmaukrfdlswrnvuwy]nafolaiqfeendahms
kseklqtakbkzzhfd[ghivxwcqlgfgxeot]levjimgmcfpgqrjjic[ixwevpbqkyzthafyj]azdxqlromttwteeqep[kxyiyoxyhvgqlmvscwz]zxdujwvngqyoabmrio
elgbshsnykhiyndouao[nhumkawagmrztsamd]fwqupmyuogneywsyhub[zzcemywfdswhvjpl]ockclifwawqsyzt
hyetqdpieicmycip[ciwciijtqspvydxsdu]zjrfhyctplqvypy[hdewteddlqfaoifgy]murcplulddvzheegmgd[rooqfiqsnkjeelfjcag]pdzzjacxzdzmmgmqwu
nufvveulfkudkrvskbg[cdrvqfofoxmqwtv]jzgfbywojzvwumo[vvshcsjnhobkayk]gkwnyerwhezneuze
qhmjnzcokmkmvclhfh[ywruoexbmjwuxvrk]lswliylmniqdgybtyx[yjrzasyfroiuaeps]xevbxtsyjknqmeuv
crwelvogceorioqm[xmduhdacxyzodslgtv]wilmwenmmnwgqteftrx[zonwpkkjimmmhbrtls]vfbovjoabzwjpxd[jjxievceapgflzeldwb]onucskcmpkgsryl
ujitrvtlzcrtazmghgm[mculcmczwibnuhtunnt]izqgurxwxhwboygvmf
lespfnkqubxfoqa[exmzkeazfrfrkhzufz]xpunddczqrkxtgorc[ymsbogpyjeimnuola]kufhnwzukrdayts
mitdlhggspwferwda[fcwhldszpyfznayp]rbfzewqihtcwtjznsp
wzhbemsmffcmcswdvp[jcbuktuymokdqfjj]zyhqthqbczupmcmkhi
qulvtldmhliyflccbyg[mqggwujrznjefvjw]sduatqntzkkvgfqel[fyxdewnrtlkkils]utxmideawxrzpewmee
ggpinoooeucoxmezfi[ovisfbmebypyafknejc]ccqkrmaimxmvxhtain
cqezdujipgzaara[afkpzozyzuitollf]srmeiyjzqjruima
ivbrwakbgkrxpilylu[eewfaajedkwjbdrk]stsichtqqsksydtubf[umxwxeikoyehrou]kwddyduytdhdgdbyn
vowwatzholrusydvmdb[jarugsbvowdtznwx]oofschlksdrodakrk
oruwtttstrcvcgxz[cvidyuxfxluddzxuz]jckmrrmvolclrbam[dqptqpdwkpewhmcax]rtfmeakahrcbazlzsju
vjrkcrzvefpxgardmqb[wxmurzwunsvjaxfhik]meiaafxurfgikqg[dkoextitsnfeorgoihc]diohmorpmlhisrs[ibtzwvoovjmdpfi]oelairhwcbbltmjcjdr
miafjehtxwnfqzxg[nlovpfjpeclnmlbm]rleupmgzewtvuewypt
osoaytxzfrkcljfjv[bbpjqntkuuwpgupxsy]bgryerdaukelujvayjt[gycrjaelxuemeosc]jgdfpdoltoqnmow[yfwoyzixdzamgqweb]lvmnjywqfjfvyxhb
oiksidcbtzhhtnegqa[vdxnacjfxbcsjzqdq]ixvwmdqdaleuzjniki
ngbyqfvobuxdnjeqia[ksktvzdyzkvyvjrgkos]xwuslzgntfwrnyqrod[cxmkhhwyremunrbc]hijkgxizhlyzqfaay[ljwayjqxyrduyoebm]ancrkgmzboqtwkjah
kxcifwahsdmqasrmwi[aqzdihesmgntomgmj]jkhmcqvxqxtshprsy[wgewbxfsobokszgsivz]zlpavaqlwvauvedwf
ibhzychwgtvobvws[qaestubbbtvyylbr]ovsxlggntxnneirtot[kgqrkbiqracxbnbi]lzpfersavecdddsytb
abjcqoeeqfhvqmo[eferwxtafaxzidjzbr]qztbvxsaiyqhcsdkj
uqqngbvhyfxovmdods[zwyybohwrhprvxaaaio]cgyaactenmhiokzh
hiqqvjquvdkfcjwmo[jzrxnmbrqfhjhvppdxm]mwvibfiltxmwroeruo[fasknewgpsmftnx]aubymogtwkseupwmr[xnyevhhalilxuxqqvya]mastwtyfihocpbjngaw
aqvkyxqnjtthgkjxr[ahvjgtzfqetvqhz]vcaijasfqaygnxmdba[loyjulxsgyldkotlefn]lnzykvlsbkyuvnqb[iqjxfxdmjgyxboyzr]zbfwxpxbthtwtnjdaw
iweumcmplhykolkazmb[zgzeryniuwebpka]hsuxltmwyxogseiogl[ogacxzbrbvopihzm]ipogfmqtohqqfvowzl
hlvbzegrmbrgoepemyh[luscnqomtcxbpxjmxvx]tipsuhgnhdavsubyqha[ozroemaxbdbcpnydjqs]xqdwngpkteoyyvkq
fgpmkosjnfnltkfy[sxqzypihbntsfnryubc]oygetjhbfvozerfzw[nwvofzjfuwdzxncwvo]nvbtoxgwkmhnyox
kbqkyxwacrffvkoxmb[tqfooaoggaauopcanz]ptiakppuyxzwzpua[tefuhyaqzyeteexrsj]hkuwublifohismiqg
pdbrixpmacobfnpg[mxmgtvdlsuyhjnjxz]ghuebmnxzqfljxyutl
ichijthjvilenbfg[zeibnuadotzachqyvej]qogvchvkfeskckvmxw[plyhbwjrhhnvdumajut]xazlyayoobgkmevrpho
cbkznopiuqsssvle[gecuynehzvcmfuzcaxz]qfihmsdjfsxymvesb[jtriyipbkkpfnazcj]wbcwllfdxxdzrimwues
ntxzlslwvxztbmola[duloarwqzkzxsfag]nzrsxasndnrktih
fvvowikdydblgts[xozwhuhhngdjqnbry]hkcwbqloymkqjyzpj[xfwuoehhuljposct]ashitwoprqcooweytiw
ynbifagloxgkzlydhk[qoxltvqdpmqhawcvef]wfnbtiyjafaqfujr[crcuopstahopywinvgc]ppxsgbvevlrkdgsv
tdgutgskbatswuizuv[zpmhakbnxnkehhf]ffuohvkaxpiptot[zlykjduigarhxygukw]bucqoskhlesclyzbpd[igdjnevmqlibrugc]seyjwcizckvbncjwon
holbjgzpvhqirwrxts[lpvaadhoqjjwvijk]etjusqwbrccaqea[livhtrfodwoxnkvk]dmprijbirsnzuptikc[icjaaepybpgnorie]imtoivdxpujjmlegqn
ljywtdshrtzqzrln[lqzqgywtrpgszaigfv]vjyyvrbkjdiiminfas
xfluerhpuqsqnrq[rtxglsxbetzajmo]bktotbhryqxdqfaf[cptmsctjrifdojglh]qzpxnniqwxlbvnexlg[vooexmzwbpulnxxv]eumwdzoixhfxkoavu
xmomvhstjavjyisvhs[suremlzhaiwhikzzojb]urbiiuvmveiapcybgz[botikbmkcfsghtgtcn]jbsrxdkpxnynfibgxyw[agdmtydfehaujynym]xfpytnqyoafnuott
xjzhgefdlodsdahv[ihwwnfbwhcjdbrdixy]kmsckqifucrgpocyvc[pudtuuaebkvsrflz]qjfwaaylzyhzerjbhyn[fsnmlxncwzsdsqp]edevlblbzmwkgkfluke
qxlppzrvoymnsiyb[ybyeqxwtoberzwvcdlk]zsofrmazkapwiuxwjjn
jbdmjeyxyksaonmswm[vhxyxtashfdrzjzytoq]jpkbmclxjtprrhmaz
vxishfigjpmdwufh[oykzgieieiypyrqaxdx]etgleieyrezvbcg[scrtyttykipejzmuhy]oxnektqrkndltaixnj
jnetcyoxmhjfyfjxm[dezndcwpoghexum]xloobrzxrvanbbh[gvcaufplrrstvrf]jgdhedqsxchoorlai
enbtwxacyokhcwyhxp[ahjgrmfhavhnhqoqsfs]ahdcbzojcfgzkjfe[gtjphvcbwzsiohlha]lwaphixwqbmbqhyoccv
arwtwiiowytbbjsumh[iwdhsnllysydgbcuxw]kummpwhpyydfdaf
laidhzhbdwoezqhi[eccvqcxwasyyzqvhrw]oobigxsojqsyijmjmu[kinacswultmqsxdhw]xlildtoykeuzgzl
fbwcshbijakfapcqzj[qktwqwrlnuktxjvuvn]nbzsrphskcxzuzho[lrbnsyzvrorznoq]ewytfrszdyhcrhpcx[bmzudjktpnqxqwmblf]xtwqqocsaxoluhsh
xgnhvwkwhfbprypnak[yuwpjkfdxygltniuepa]mmbkjavsboilcvpp
hprznssbfrukcvu[mojrsfuktavnbhzty]ipdxnxmtbvsazyx
tfdicuergiqhvie[wwpqnqkyfyhuqlb]wovoujvgcwuptcqhkd[whhyzgbflhplrff]kezriqiamcvkeifegv[kcbdxrvoharumkgzufn]xypaikbmpsjqcbxrrp
tkqpijxftrvwkam[yyajdcxgzrkhkroq]qfrbvprhxlpgunqqs
fvwgqznbhbrmcaubz[lgsawqyuhadojbqwrwt]gzbvdgpwjuwqsgokqy[zpzdukphcvdqgpdoex]atanoaretkhxbyzw
fispfedprcrygxs[xqiggqkjgjhaskp]thgqnbgscmrcfqjckbw[tvueixxvxlsnaupqed]lshjncmwxgzzczjssh
fplljoayuqmjtjs[vnlhbmvowousilhym]emygvrnfsofwobaducv[flrnwxzgkghpboubuh]sdndpovsuohytnq
utkqxfkbxtoudnbh[bjatbltbacnlwzlbjk]eunawwbizxdytndqc[arhtjgntcqetkeikojq]jfooeguervzgzgudb[nhifbismjhcwqyt]xwsxwzwwvtqoadmgvoe
bxbifxmedhwkesbmjff[ncfbdgsqfejalnqyar]oifushwlnfxghktjhtq[gnapwycvocshetc]zzslupkhadbieerb
rrotstdgmwqowfmf[zlddfgpxgucuestu]dvlbhinllnkxdybha[aovlzdyhamvvcgm]dzehxcilzoxrmcyhiwb[xkeszyasnqsumpx]bnrsppzfvjhiyafpk
qgpylzwwdjxmepsc[bumaitztsvayatapvl]gotathwcrjrsknrfuk
odbkgubddtpxdsgmhvh[mbgpgqafpcrymkkdpsd]ieabelyvewiypbkjm[psowbfplvsxifqwq]szgntjujujycbfy
urqwuzkruqfgejkdoh[qxxkamiyhedlffzg]hnfntvahsaivnzmawf[mxcrmrqtgmnplma]gxcsbxvqcoxpddj
qzkfvuxmfneyrpysh[clufxjecvedwwegflp]rcxzfazrzbgogna[ogoplmljfwvizwniudc]yewvacqgzcjgdnmasw
mgweqpewhvtdjnjdbu[pecantesazignmq]upotybqiovoujemqg[ipzggdcevkbkvpyz]wqtflwovevactij[ednlhfkzrtfwpuignhd]epfijiuwnczwxdmgvzd
lavqyaejctfofhdend[enxgzalvzelvvxdt]dkrlwjpuipwnqvuv[ishvyxwuhxdxujbgkev]euytwzxkpwccexc
haibamsiwfwmdvzu[aekmrvauzoxdbtury]tfgjabbgdrwbzde
gqoyggrpzhfgrkjjw[kwhwkctzmjdpdoeey]ngurqljoormcjarv[bmvadfmdgpwpzfiiv]fkfqchwhedeymsa[etqtnxepdmolklpa]tywoaqpoowybxcoqq
vnvmbxxccmctcba[ncggihzavxxxrhb]mblrxjgtypycewg[syiizsazwqrhsllezvs]tpzocblnycaokaphz
ffpbdxvenqkihvvsi[bbukwnounmzzxody]bzfefymopdtkpdm[sjbemcyhrspadzkuwi]xlhinxfjjeajzuqjkuo[zfpeikvvdfptpxe]dhsjhnwlzlcxbkz
gulvdtkcmjewjchf[auqodvrekgvzxzyiwee]rarumiavqvnbyqu[xywssgnmbeefrqgr]lyyjmkpmqxmjbughzta[avdsmuyfdwvzrzn]qvhfqmazlactaxtxi
vvqlvlsnrxwhoxfnac[sablzmrjccqvauyjfao]avdnqlseflqxtgb[masnpoqnvjtkreifrvy]lvtoftpiotxcstvu[vohbaippdypuwpkuip]kxffhmrvrbmvhecnui
kclmgqkaprofpmdm[bhbitgjmddxhbhu]hmasnpqsttrgtmuq
tvqcqkarkyqtpvea[fjqrifichijyykq]qqtmxszpmovzfvk[xrcoyhzyxwmqwujxp]nzlgwxpkuersepyhy
zalveeaqakqjhfl[uypjekwlbcplfcasa]sasiztlswzyhvpd[weglkkwlrrvdvfd]mvsdbveypnjsymtjka[kroszrkveyammdqqool]kgmxohwwgmvcdludvdl
xbroawhwunnamvnaogo[uzdvwckcbkaahqltp]bxudkhzxrykrkffaiiq[ljfeimkibushcpclbia]wztapafqrfdpwcwpyz[xwzhahnbnaxjorpkaj]glhfrkaiizzidtmfi
cycyarwdelrstoi[rivlkfszzvyljoa]hkjtyvycydwronsgyd
mbdqighfupmzacpi[keeoafjlwzqeoaryo]vjcwhcjkjkandqir[auactffhpuwzgzm]ybkwzkxyevwrphq
cpiuxmmwrsjzbyqkfms[buipqvxsetxzsgqi]tzwpfhknlpwmtxzggc[nidtlxvnowvutuqv]qsohatjnnizngzsqxxr[klnzvuognkllhhr]clpjgdupfpanyxwjg
hhtduiwmfhibnpmhjm[emakclmaqjnvjsjyt]ntebrhiztekglpmhsrg[rgehmkrotjobrtah]gzlybshvhkoznupnhr
hyzvardyeiddsgk[vszukhazfkwqsodz]psztzqehiwcpifdlna[igstccorevbmgfae]vdapqjiijwygxap
towtxxuitgwhddsua[bydcnwqycygmimbrut]cvnvgtuiuduzjod[gpazublcnojkfnnvn]rozlfkywwjelmry[wvtxeleixyqstxjqed]vsuvzaskgyooigoczd
uywuytlehdznyxr[goerwtisqdsinimd]abuktfxdobkfqabm
rolwzkzesawhyxddo[yuuvalxthkptulugzh]tagfpsdniekrekzkt
nstbvilzeselffses[cpgyssgpjimcevp]ehfkumlscjuocclfhel
idvdfrmadfyhafvyixs[igsqckpzuelddtl]eclbbakcdyttbtse[irchopmhiqbeloiqq]lwbecblskhopzyw[yjmdufblseluvukftkv]nnawapbepipwcsfz
thqwduckwmjtxwwmj[ppnucfmtpcsawxvkago]vojtdpukjwwlnirsvle[cscyjfrxjlgxhyu]fldolxqfbxhigdom[tgacpmzitahxucqpzke]copdqvctocklhvrq
maseolhlyrjuoqdazl[klgwgcdfwhpwmnlklcx]jycbhtwurlwwsjyuubt[cuabclvzukvmoiniql]pzockwxqjbtadsspl[izzcraalbnmcopcr]cqdxcrkdnwclxcitizq
ucyccfdgxaciwhx[txuygxhekywmyuaaina]szfdjuddiopneadpot[zpjsnpjtmicknxkybi]lfirzuldnatglheyhnw[rhgqfyfxlaunabfqxl]hplszylhorbrkuy
vmgeqazfjldqcfif[fuepxyjuuzxkect]ywoxrfdxbyjomjo
qacfshruytmlwyj[jpqmllbdypmnzqoe]sdhmtuefjbrmvmeby[xkyplnmmmcrcmixkls]motyvnyucleirbnmrys[zdopkcnnuvxmhrg]feeagfdkgorsubr
knlaaiwxponscqwtqla[jxilqsyolsnanzxvqi]itqqqbrfpcexbnecnkw[bpcxykvtdbxejlcda]mxodmdxzohrturffnwf
txvqlvddwpcysvkctlu[wvuoeprflcpycbghfv]ksbpnggnitrxkua[hqyiyucnvjqsceml]uwwwbxrjvodohwznlx
oebxtpwwjtewgkwjbv[omataxkuqenxmxolwe]aiepvclknbgapqh[wywlrbzliilwwvebxbl]ljsiuvllqbjrvqzh
jznegbplekeeohnf[hegaqbzbjwdhgkouzja]msaozvrtyshcajexwen[cnleoafnzyvbvdfndha]guawhzetoxlxmjwt
nytoqgolirudokcgok[qjtvenvrstrjjlsbvzq]mwhkktxfsokxxqb[pgswnhmmgzcrgjbqcx]amhrxgwmcnykgpuzfb[dnihosgggajabkoq]jtyxfrifreihydzwjdx
bxihyluintytvypxhl[kbnizownozfekbhmsp]sjgxqgjbhoftgmbck[knoibzmlipdnfca]ofyxruebaspanxxhakl
xhrlcwziflvahls[babpaszszfgfywj]gkquumhyqvozkgubcs[gkjczyujqykeifhsylz]fhmvopfsltpzijdw
ntyxwcfpdgnsyau[eqjxtsfneseakvrf]sbzesbxxrrmpmlazhi
lwakhsvcamfxiceusua[ymczlpqkoiophom]fiybjcxhftziivsrsok[sejyfiorjpptboakf]ipsamdcnfnlhger
ncgeewwfszytkag[kizbzwnxepsvdxsbzbm]fofhxxpymrbqvcco[swphuoqvhbpghtku]hvxqclwgtxxqywhhs[ibvpkuiylqazccin]oftqdvkbzdkmycntx
yhnhzwjjsiqngmhe[jtkcipgiclbqublpfs]glxyczwidjilkqoa[ytsphdvgnawjsctty]xdofsnhnpsylvmso[pmjrjgiwhqfegydcs]ylfcipikfzvmpjn
pwlhyvxnneepoqexj[jsnwzbjxibgqnpjgdf]qndnlnzxewcrjio[hccvunupvbcyptqdihc]rfhmapmentuhoiv[kohfhnoakeglvnasojm]oggzhzybuuupwdrjrtj
eyglfycgaoqwsqqnue[woaxqinxtvrhsbjjvnk]cfnkhvorifhxedbmbmq
nrqqggalpihpjyu[dqbqopedkxhoqqnp]qguazmdjtenlvzgoemw[ccjlmsdaajwghuikrnp]xrjcyfkrrfxddnjn
wkiymdlskwyjrft[ovucvqbenolfvvu]tzymrvmekxnlptynj[dupyullbzepmmrmgwe]fnjtcvrvzstijxq[elzfqhyjdyprzfxa]uszwjwzbbzgpcavynk
jrdliqwwffvgzpu[mxoivfuwuqvtxqmbbs]tvtlqzqgwzgshkpw[hspnaspqnjvwybzfzxd]clkhutlibvxzxfrgg[yujteartlwdhzfgsn]lyfrxjqcpkcvcsnsw
gtfhmxlpptgvgwob[xlzqaoawpmmjwszqmhm]xalfbbroilfuzzqm
gqxmhinpeppmdhbdt[cpoaeltrlzmfgsipvg]iqlrhncmkmjijjh[xsbdusetrksrxjiofj]zndjqyxwvmsnrbcyrmh[qnbxczovjlrrvilks]rfpihmkwzmgxcynu
abcncmuhelkxeph[crlbybjylvbgtsk]yvnbosicedmzurqcm
fbhtialrsrrtpwcxxh[pisambikwkesdtbsj]zcdseybwrdrkxeiylg
sehxfywgpznuuypj[upswvzwnkinocjk]nabhugsxhitlhis[ilrwksgypfqgfexvuhv]torregbntatolgchv[kkimpdkcxhsxyuczj]xpfacbmnrhcxnbgwis
hldgiynbgrfjcunattg[nwfovbxygpkwmxnulm]xleqlwcajqwnncww[waoaudnttcfdktcd]yikfvdmekcexcrhsi[sntclwlhouhyjrob]wqpclaistsngwfmf
izblnsxlmqjhxvx[qpmqqzakbjpbapwtlel]vmriwjoqlrttqpoxay[ylqzxxdpycurefadv]ftcuduceaycwejp
jqjtnshmtsvokhwnpr[bxprgnaltcsqdkceygx]udqckcknpvegeryj[zvjfvligrqxnpypoerp]zhzwojzkckjwgdyu
ohxpnvtduqvsihjt[eczkrdqlgyddymrdjfj]zzqhfijxsgoisbwpd[lysfkgekxvqspagq]kemxkdqxetnkyctjp[bknjdsvchfxflsrkuum]wmxncxrwwxxxgza
xnulgysrzxheppsiril[hdxgzhscbjhkcntrmsy]vhedyohrrqclnoe[nnuxdbtlbjvaddo]xivkwdwvmkplsvfaal[omihwmflpvrshkcoci]hekqpjtrjlsaomfd
hfyusspcypxdbgzb[cxbfccrumbqqqxb]ygsuxbxdfkisqwstqp[lqctoagvchrmggtmo]dgmcjusbvlmlvkdmnpu
vmpobkctlhdwqjyb[dxeinhrldspqhgeu]ndglldouuoawkiwtask[szkthuhxdkmfqoqwwgq]zwjhzselzvirjadzvr[rholepzsidriqmlepo]yhbxhcmbkvripyusams
mzscivdohxhfkdqet[imwvpkunuzbhbaj]tohxwppjtsjykxrj[nhonsbadufgsqiysn]cogovslrrwexgzujn
pzsteeyowqmhzaqao[qsbohgqamrksizzs]vscfiltkxbxwbdlold[psofpwfkxhsxllnz]odwbidqaqpuchaew[kruwykloeqpcrjzon]famaoipldevywnouele
tuqiapyobwqwpwbqqu[ycphsbdcwbmklro]medgafihivwegukhfof
lficcecamifbjwk[sdguwtafkigjiapxagj]hmeqrhxptojctevbdbu[zvxeefaytjajdpwi]uliqtzilzcnwmbfusnm
pvyzncrszmuienoptx[bigapupzitygcxstqx]rqikselsbelyfjdm[lyqmdmfyofksmecg]wjceogefnlgelpguu
hmddytvxqrazumnnr[hpeurkbdfejhlfvg]pedwizmuhmtpdwh[efikgkrhnagpmqypzx]ltlncfegswhwcxa[bakxhwhtvxcwcxtmofk]zwjvbxyvljlfaie
oxgoszggsifsgrck[gruwptjveewmfewguku]otchieijhojsyxi
kunxbbrdhibhtlknrq[tmtsuhwakksyets]xdugxmqcstdallfqgq[tticbbqirncbjtx]knkygxawcwdhefesu[rerbfffgddyehtvl]yasblwlhikbvjidgku
qoqnwslopcpytqy[zngrksptgviifcwbw]nuislpzizqikmgn
khmctigslwdgzghkbk[veaqghpizqwjxlwcf]aymehevjgpjgwruhyc[hzgzilbhyoazljsk]jocgjmooxqxayzsa
xodvowdhvnquwtma[kvlbfwwzeuucthg]djlyemkbpudpjlnrkv[cbaqlhuwfwwfvbdewx]vsjvsxsizgwsakpx[pzyowqndqdbkdakdney]eeylqpqpuqvdyyr
cmdykdqavxgeismtlua[iwviddbtauhirfcabh]fhpsinbnwrcpxdho[tdbgrmgscvzukjl]rxupjtwbwmtgnltbjp[vgzucvscpzgjnvg]zftzsshpmizeksiz
kfzmwzmzdpxabvi[ftkotbrorpkpfxzbg]hgbrsewdgnnqhxvueya[lkjknzgrbuzjqxwqseg]oyzaqahfuqtpbzi[yflzhfxwkugpetsqli]nowgjqaquqhrlxz
ktphtjqwsitgbaii[tjwcbyfrpupwkvzrol]smlczhhekwxtlvxdfn[mqfupholnlvfhuv]mvdhzncezgunydrk
lrvdftzasxbpfgb[pglmengmgfbnzxz]hbasbstksqkkqpwkcbp
siheyyvdmjiubhlapns[xfcaevnaoexubdar]pgbougfzkmlzjqygdta
tblrafqbjhwzbwbe[iefobcqdrypwnwidvm]olrzzrqgkwiefngf[asvmlckavcwtuosgkrm]esqsgwmiyxncjjqsqp
alvaycnbqdlvvnwcnq[jwxzjzgpnzmcampkye]hepmdlzjvxhboxh
mtfkavmnrxyfzvkes[gmwvavomsyolkahey]dnqosibjkplwzjojus
gbckujjuhwnvovpfqw[qwievsrrtusgzbscuf]bnrjcovodutibjtq[fxteivdfkpixonphrog]mnumbxikkkyeositn
remzamtzlhwpndrknl[xgrbcgdvlvrcdrpi]tnzimcpmxzaxsgpu[klvglrrepqxiiewn]lozcwxnclirneaky[nevhtplqsmuhykzqxf]fgmsbwdgfwjftndzi
aybmjypdrytigyyip[zafsvprjirkniuwr]wfdyfncywtdtzezdbtm[umbxrtflhquwdofgut]lyjixlycobwpwvhfp[xoxtkyhvwqgawmike]bfqtgcxvcfwtdpl
tugswvsgbsfbiyzcm[akmlddjckugylrea]fyzltfupxnvagbshlb
lcgvlozzzzpzxeoee[zsvjydznyoadkvyxlsq]wqmgagbkerqyxjnnx[isukybwewezizpll]odqwazjphoaqhzltms[gtqeysqpwuuohdbhcnx]yqtvojobgaluizidrbn
agnxxgirnprujhsk[hagcvuqcwyhmkdqmn]zehvuytegijhnfqnk[ytlokgpipjcviulp]hsomdskdngoysnbmg[wztsneomppnewhrl]gpkauttapxhcjrsicvy
cvnowinufvrjpiqtq[kuavqbtrcelpcuasmk]poksbapbwverccds[qdddbhewvxgfoldib]mthrvrsfygbhlwlkcs[zhivcpxibufugkpigzs]qffdjnrsoigwxqhaf
kovjiaxxjvzmzvmn[cmrbwjccgphtstvaiq]onqfbpryjertymd[sgmcnqbseodopnnd]gbgealygrgjnamdq[yrjuwjfvmsmgbur]ldiztdwrwmeqrohy
tluglhveqluxpiy[wrsgxdrzuigwzfsby]bmhqmnbecjnyutpwlbk[iifejjworkzrsaj]illltueflutteej[adfixnftjenvyrigmkv]zgsqagrctomzublltjm
fhcnrceynkcnnjxj[jrevstsodmhopao]zqapczirtxrunfhl
rzmxbxurpdmzgef[agevdburkuvnsrof]rhclixqpruwxuanwxct
vxejrazzpddvobzlq[dpspaddyabqzrjgvv]elcpgozzkqjsasufcv
iaodnwpcpresylkhyy[dltvlrxbvnqslzzyvox]qownkehbhjprbzf
kqbwgctrhxwrkkedau[occltggonhshykttsrr]snshslgqtlgejanlg
jpesfmiguicqdcnkm[oawppiwdsmoidvkcre]wfifgnhqeisplngcjkr[wevtsiuznmpapke]dqgxavmudniuaml
ddewtwhdfjatjlgrt[ceurnauksrgwzondnb]znsvkdkwsimbmdxfkh
hwjwuhdokecprunbju[jhftguwujsuetdriyu]vcgpesthcnwuwpwes
cgizaalsahfzkcxab[nehrqohgkmbxiufyco]xbnclpuepsanwrwjoo[kvdifptokbtlihgx]hgynbeebmdwbkwrfbh[rlypefyljzefnft]wwevofyexvbojyc
ckxkzlpwrfhwzuep[etqgjhcmexxvaccx]qqkhjttaudjpbjboeo[gihevbqqqumfythcfm]hraqbarwvqnmvtiy[cbnfqzxyjcpmwvu]lrugefybnoiopvzi
bbmhfnwnuhvdgmoibjq[eugipbrefcqiniulz]frkuvbhbdiaoaqdcaq[ksqqrrhjltlxvet]cdjhqazjzfrphjzjr[aspkvkpmwhkzxfeic]vkhbjolvoddtaasvs
rxkbkkhnaiudojzsr[ecdvrnjjyzyqjxf]uxctotuqtvambwea
saknwxxhcybeglwr[molhqlfbvopapnuco]hbbaomsdwcfwvoi[rlvhmvffqcyftricsyb]pkeuoigxjpwfbffif
pylywhhzktocomu[sehthaaqwkyerucg]cwfmpqudeylrtavze
vmawzgbfmmsivwfqclb[fpvwdbyrfjgmidxw]btatkdonphkxtprxfsj
kspofpgsttceoft[fcqagpbfoujjulhp]fkbxvsbuwioyngydy[hnoxyyuhdviahwsf]gustmoflyrtelseo
xyiofnffruqapvtgnr[wmigiedeszezgunm]vydqpobqqrisgtt[kolobhezpsiolofxrlq]abrzbbmtlqvuhxl
enzmvjyrzypbbtmbvx[izvhoqpjgqgmmvricf]dbghstbtqgqawqjr[irvprevogenchjy]gbiwvcxncbjjvwmshsx
uavpufepuqdbjedp[itqmeflkorinwdpjwp]hlrnsxymcnxwulsmfk[bayxjuxhtpcwafadefe]srrkibtivlskepjxamu
dlwhxttrwjlxlit[atmcusmqvonodkfwqvb]ilfdsqjtjbimpaqht[zsbqjwsrgxlxbjqmulb]feblytbapctmfuao
zfzicvjnuuugutgymp[owgyvyjfhrqpuukkgok]dfkfwodxgvrdqelliaa[xaumszuhzjjsxwe]ihaxfxpxjxcbhjg
gmsgnyadjfimoemyzt[fjtprppdzhkorpqoo]eyxayeizyntiumrgk
wvdatykekdfednl[kwpjrdcfjjklpdofpq]lidlhawqalcyigapvv[ukqjuzvvxehbwzhsci]rdrfhnobcwtvivgcc
wvqxpnxpjmzfnfy[xgtkzusumupupuqvn]vmxceafgkxhnosupdkj
ypfaupbycoerlpnhvk[pjrtdmwsmsckcfongoo]bjxlfxbekwvfruvy[uccfekaoczxlyigfs]gnvkjcwikenkmvgrpdj[yrtbyzxjkmpewjpbstp]nfwcwhereraqwxu
cqxbsrqdgqudcci[olptuqqvfgunmstjc]xnppdflvdcjfviaemlm
asywjbgrfvbfnkhnc[euubbvzujqjnsxtmel]gwxqasfbyjazgqodfh
gvnexriimytwvefmo[dtuxofcgyfnaiibqx]iaaodpjwjnkbrqsmdzp[nuvnumldfhglafg]dpcqqfdrekqdfyfe
hnwaqtrqgztvegfhj[mzqkcvhmqhzwmhlkc]kytpmyhzrvtytwvfkqk
latjxjyjkwwnvyrbl[bjnilknxprpwziowcjn]zpdvccsjiuhfwrkn
nowozzvrysgsfhxd[lhgxyitirlsyljl]nodxmmwtydaqkoxvu[vgbjtbbjqgfbssytsk]gpzprrvyvseifydxz
sjihqhaecgshhhdrbto[goawszmxrrdtoxq]qvywgrnewpsordounhw[oaxydcsvrzzunbizz]nzisqsdrmmsaqwt[nmyxmrkeainaqyfe]eacdicawhfuobezyao
oyztkiwsxqcufgqk[iyxqvktohfnoymgisag]acfhjawamdhawitvjg[npflzsugezpsmunukqa]vhhxnunvyxjtehyvv
jzfmuzdlemckyiccan[rykdnvtoavzjtjxtx]vcmkcuioriltvpzzxqb[jdgqayewkwcqpkg]ulsujrvqzsmnpqgvg[lshytukyfqhnjehk]cpwbeyiudngpkrl
uruvigtkkoqkfdbqkre[wyvcwnxixwkacuu]ajvziogdmzueetqzxxx[fyevgfzreomzjbsumi]ahbhcyjbadiacwjplq[quesxyjqfbckmnt]oqehbkjyoxsyczfta
xzqfptkjpiknvkyzzt[hklpsitbnhlozgp]pkbgrwmqrbhohay[mhphptvyseydwfq]ehswmqarsalmcatb
ohahitbjjxlnkyb[umyhhgtcasbfbxqx]dxyhbvpjjatkwvpkyry
bcixbnnzlqxkisv[tapovjggqzlwlmc]vwnosivvmdcfsor[uaapwzmzarenaplcjp]jdcpazyedcdkdinrrz
kdofbgwblzpnocgpq[scfdzdrueknbdud]axnfckaaghmrpfmk
fisxkiplryvtnrvm[sypuemhvxvohsapkccc]exrrwesixcvnhzpopk[hpsilxrztuukzksyax]lixfijobrlgmonzui
zjnlscyhmjmoofha[ezglbbmqulybnvf]qvbharzbfbbustsm[tdeqjfbfxeiknfr]chpwwntytidtnnjf
qildxsfzfukzbmre[jykfpbbfelicvkqov]pyemzfzobutliokrrox[uplajddwknupdnfje]vombwrjguiukbiwozj[kcutkvgruxqqcuykn]zsbonxyerpjkfpnxchj
pdmfyadwrblhcvecezb[fhqgurbenzitepyh]xhhtisxbusntgekaps[yefgbqwocpsexwq]emmlcuwjwvluecbfo[ohehzdjljocucatf]zmgbwenmeuiftywp
xhrulprzdnbbzenux[ptzrrcmdscsuryk]ognjzqtletsyrcy[snpqabmryhyvcyztmd]lhkwhjylportbbo
xphruwdeuqibzdss[ubuaiomstyuqgcgzyn]upkpgfqmamubaqhkao[ohjojarsqpjldirf]ianntdwcgclwmyzwjh[qqeajbudidxsqfw]nenqeljkdyjucrqnsgd
xuydzitbfqwpaafru[jasqmetengbkljylhse]wkqxkjwkoipjfhkafnt[uolbyhzhmtupebneng]pcjjrczeczmoenefu
ievtjpcjrlfqwisl[pzhzabrlrdeadbtpyec]sowfrknejwbuvgs
qcuiylijqwfcqwjisqr[icjobpbxzjzuaxc]pcrdpfgwajrudfhxb[oiqtbvhfvitjvuts]ctwyepzbqlrtwuclz[smugjsqssswocjyc]lhlncivlmhmoexsrd
yqmqbdhiciqlgdmf[rywqydtlwdocdih]ofxwyqckxktvcrlxsx[rxupkwzkvwrmhuiz]znbksfkkqxephhb
bgzhbpweidflkmmjc[gxozhwikjiygyrm]vykpmxdywyfummana[mcqteiumnmmoyiwtcqw]ntczagaqoprodvhxbl
gvtyicyxseltoqfgk[eozvokbnjytodemeo]ogofokdupjyhzdgrk[fucnzhyuqkcakflcky]zfgxqfofzfdxyzetc[kdgpxyithocprbr]rpqlihcmgthswhvz
svrwqsrlntabucyssj[trbqnxxvtfiatqd]isjqyfxsoarfetrtgmm[lnwqkkgqucipvocrk]cdcsuvgwvzurnxleuus[wqjewzmcvqhhgwawyo]arzledaetbnpjmwjrl
jttgsvurypqumflcm[ccznbkqklwsxmva]ooughikefyugfvz[rzsyqmtahohpmnq]kyotvedmsjfshan[bwadbneyfitukleqbyg]oyeonratlyvtfbcrs
rpbklfvsjmisbnowf[vupfpfstcrfdxipqi]wuftflxmtftrcrb
igqcfvsqbbvpmgflu[kremgawldkinlqnr]ogcijqlgvrvbloj
ncjbiybzlsophbdemtc[zszwhtluxpobqclp]unvkyqmemvucdtwt[bzmibpkgwokausrgo]btnixophsknmjrqozwt
gxapkeestvvhodxnp[xlvglgrlzjdrpjrps]sephfhztipqaftxnqp
zalwvceeodddhqqyrk[znydhdhxhprlmip]bjijtiotyvfgyiou[odtkdhdrwuzpgwkf]kldnjprzjewdeyzmdua[wsdyljqvdmfdenajaks]zcvlwqkrytjsryab
schsgvlniqevsrjfkxw[drtzpizdeopipceke]bduaeqelcxyvykt[vhoefhavfmuhjkgooub]tzgcfhwkfuvwcif
wocmjawhtyhxksjiktg[hftunpxmlvyxauvnfj]spefcqpimqgjhnou[gmzejgwtyavnatavwju]vccngpxjmmxlruac
igqxjgofompnnrsaxoh[lmmrwzhovfloeps]loixvtpiyzagyvgq[yaiiiuvpjpuldqk]jwpjsgmvglkzuiepr
jgvoejrytatxvfqwt[hinkejefiqlrpqy]cgmvjuyjejpinjunld[qcdmwbqbqusirlxh]udhmheqsvmqmczbbofh
qffigxgklwwslnts[gwhobujjovmwfmrg]menqzjmmxrgchttltek[fwegvyhranuutxgxec]fwzgoobvkjekogpfscr
qlphzfkuyrhvkmsfxmb[unvtasxalhelbiw]gwqjfeftpkxtfiru[dhkyfsvpktyrttk]mypdaocnergxlnbodpi
pxdqzshlqhkrhzwcqkb[tudazezhnktsxxexyq]ybzclsifzrgndcaxq[ewlslzvwnqqwvljgo]nwnyptvummeraaoow
ysivygqkobbtznpxy[ydbgipznapsnkzfq]upackoodqdqmpvbgc[qnzvzwnbwrvgvwn]imcsgjzzaeltfxyhbx
hcqlfxoahajthjesrdy[nammwfgfdqnjewunwz]pdzecgfgatymrrntt
vwpdygtfuvbryipr[ehziaqbphyzzdolbfsv]rqxvfvafrauzncapu[dvqlgdgkzgpbjuihbl]sdtldsvjvvtlvjdgd
rajovnvmoxozjldjd[czqnvirgxkydoaaxr]dejvwkgmpwqvnvnzzsb[zwxifotwvljvpkxae]taoulidxuvefjqxjdu
jywqykajspyzvcw[jkqxjzfmvcrsqszgim]fncjgfxwbvfdwujhooa[otrkhmvyonynxsyap]skgdhtgcwmzixpdgmjh
wbkndoivecgnkrid[tpdmkrufmawhpijryk]untkposunbiezua[njngjktbavkmsozyy]dqotrtnnoxxejcz[nyinrkqzxnsaahwa]zpdibcyegeumjjgowz
gexzzkajyulforpnmb[mwihfmwsdpjjsnaxmme]xavowvaqybvqcqescdq[hjymwnhorqcdkoxv]myycpwmcpxinhru[koqbxfaoankdcpi]hgdktcvvxvoolccqcy
alpcsvxjoouuhjrgzo[blnjpvnbtcufzsxqn]ipijmuwbljfwuxotk[sgpwkohrsfeypqc]vqlggpiytetmkifwc
ixbszxrkuuzvvstrn[kdgfwhiapjrtiervwi]iugjmuvqljcbnmumal[ajgjfwerxsqqyrxuvob]qcdagpdvlnicajqcooo[qtuiukkwxyevxmgijtm]bgfetysdwvceqjc
pdbbmswfeutwunlcm[ywbxptxhgqpjkpeenbx]wzzaxgyiztbdftpm[lbeexhgaqvezxfef]fqktklfxugwifcfaio[ucpewlhkqnbsigioumy]cawftwrwmbnfmzmhd
xmtduxirbkbxjrqkvg[ythlqfokwjfwowrq]dguxbidgwelcrbxahi[mdumdnvbcsicvki]yhdgylmjisngrkcnbne
yzilepuvsfipivcroyu[czocwppwvwxjadgqpc]uoypwqxrpcpdzmsyyqx[mzjaguojtnjobsvpdx]vnsywqfvrnpipenwka[dtiayvtdtuyeqlddh]wpxkwbagfqncorkomi
qyebzyuerdwfocyr[cayytpduwkezuatyb]nuazweyhjemncuqpp[gwadeldyzfsvyqyk]gqjdzsuylxshtoayat
eliktfnkrxvywmvr[tlnexbwvbbdeupd]gynrdmuppfbawfcb[dqsidilgsixsudputz]odwsmpcptosjdhrp[mumunqhddegofkrpabd]bnetmxiqkwhtcsgpuui
wuozzupdubqhnbm[siwvzeelxcodzissd]niswczzlnrokkhrnd
bjxpecnvcntfbqdyqy[hjawjkugajcwmouz]ipusnakbyyxmqhyislo[xcafwiwiabdlxpaqqo]vaemogopzemmnilw
dlczcabztkrsdznjlcd[atcfirjxoipnvnoobjr]ujnimmhscetvevwpj[vnbwetjzberefmavwuy]penzvgcewibypznzpv[rqsqdxopumiqfftcb]qrotltpgkmzcndx
juqqbnfozoikxscqata[cgretlqkyynhwhmk]yiehuxyidjlzpjs[jdnlbxkxvsufsduoulo]ymrfqienfjrrgraxfh[jlopugujyekjzrfet]hqlqjkulbfsnnxyksp
epcyjxlwzmxwlulhx[pxjecldoxjwjkrndmir]baneyblyinubutjdi[cufdnjpvlwbfqbulb]dbzgyztjopciduxuo[paqntbrciorikaw]jbpsfzmzxvxlrgj
euufrqxfhnfdzlawui[zwgpectzebtpxfwbym]btexmfeuilnoqsbgmz[hvnxaanolwzkygx]hurfyrjkanhjlaz[vdmsczzhobknlhoslpg]bgitrvjaildspbz
gaweiazdfuixwqo[qedebtjxaewtracsgk]qnmuhjsbvqvcnov[aabcxwfcazxjqajv]xlhkehyvjohrqkbzyow
uqxzgyclomagldxv[amcvkpboneuscronwcs]qbeqgbmrdcdtvsc
xgkenttkfbysllows[bamxgmibkgysryjebgr]dhfiqnlocykclbofdzj
ppyfzqrjpxgouxmsduv[euokodyohaiajyvsrz]xfxsvtjasezevkjwjk
vcsgnfhhjkjssirc[kfdwqpdjaejqbfaxu]riqzqfwmwnsiqgamwm
tvxtikdqugadgbux[niaxwpplrlwrnipcnnc]tcunnqamexertrdm[xkxjepysgqqdphb]vnxvtxntrsqrfjaz[akxkeqvlxgaorhqnd]sfhwarxbzfbtftuflr
lwklfaiawghiwljxxow[oqmepnydmfkjbgkrjaj]clhguzdrfrmcoslsghh
eqtzgxqoviujmxpg[pkkbcdmlkvbcppqrm]zjzmsjmxdkaknido[sellbmhvshvqdsslyq]xuokcgfaxstavgkni
gstjodvjotzmvnm[mfvosfrnlksillaqs]riecejrjvhdrjvdl[sznhzufedvbdhbeq]msgvdfzoxeykqyx
ivwoejkryedvxpi[autbisivgebnntgixu]papdjtvhwtxgipbhes
apzalddmyxxmfysm[cdzptytpjydinlfdxa]gnjxiwepetlucfl[izgqnvcdaqkzgtpvwvk]cdxqaizjmvdnxigkmvm[cdybhclfttdchsbnyzs]xlqahfrmgnowlgba
slubhmrmovzbgdw[dehwvsngduvcfkontgs]zeiqylnomqgevvikm[oubxjfwewqtdjwacb]mqjinmndnakfemp[mccapdxlrmrevbuaas]hcjdpjgnoguztrdjgbt
vqeogkqjnfuayfpioi[rnkeynfubkpmjalnz]ybrwpzhiscwtyue[vnhkeaqwzawibjnvnos]ctmmursouxvylixiqko[voqlscgdnaelsbxcshf]azssljeollyzjjwkxin
sanarwdtnkaemdsoj[ojswyaadxpnpzcm]acjrepbjwnnpncdf
uvankqvbgxtgignh[zaimktolqipleig]mobimtizmlgqetrxkft[kooknezmesqkqisip]jdpwwsisdorcrryvyjn
lkiqyvxlouvphqf[wiibwrighxagoiod]mavajklcesvhiytvcx[ntesmbqoxkadtth]kovhcrsmmtllhai
ilzqxrlibfavovp[hrdmyejnxrlntti]yqmycbqlyitgkumdm
oslndtyjgissmwhqbo[lguvaxjavhlklnqvd]cbmjzevkakhfauq[huujtqleuzhwcbpxjf]hiitxzclsgphiembgwx[ixccjsoybxmjmufm]knmagcfohytzcoq
eutljtdlueiugunxsy[bmbgyvpiruvvuezir]vksxzmgftqglhrowpk[wphxqgxjmzhuqrwhce]giazmdryyjldglcivd[nsicphjzfpfzlhfymh]pfpeazmsdcttsutbs
tmdniznfpsrdaivxpcp[nlebmzzfjfklqixhk]sbusrwexlbpswiyslbh[tuvimwrkchmarbvl]ykhoceojfjugoim
vjkixsnkgnhzcsj[eqauuxevvcbzmlrvxk]owiikpkahbpkpuhkmns
yiomyydjxljwyxoeh[rxyahvmloktamapez]ygtodyeyjtqusou[esemeduybcbngynmzl]rxszjfhelknuyjq
hayzvqcfdjowlfeavo[mmcaawmtqthurqvmlfq]kbdpwcduhsjfbskcin[sueeedwjrdazxpae]drtfzfbefgvneiiqtsn
lfsgnugdavjvstpk[usjflghmtbzdzavzgos]vajnuirkzezjgkst[ixiusdyawuqkbnacri]yfhtwiifnoltnygk
fqvyvpipisvelyjfa[xewusykjjogfsupar]icdydlsidbisscyn[bpibwwfzoqajtnxlad]potpbswobrhcyvy
wozhxjyiybczbhbqvd[kfsajcbxdespfdewbjw]afcsihkfitjosfwxb[fngvcuammwspeglx]xizamsngscxtprjwkq
kmakicivcpvmjokl[rnsobihgweztudwrql]wytavzsniyqrdrxu
nawqmyenftpbvxo[nsztprtyzoacbxy]jiwvrmgzztoisveafzh[kgpykqugwgvfkztnnz]qqmehjutfdzzowkof
mxddcacabljlmyxmpn[zdlffviwrbhbjhl]niubaphkzsiybwkmh[ysxwkjpjhpyjmosgeo]kkhqupjsegymyxfh[sxxdsrtuwgsznnvhuy]licmdzzrtcxkgce
hkvugidmuerakcmmsn[mkmrvpqxfoghbyxr]brkgsmexzyvqztplvgo
inbjfdjjfofwckfckfo[nhjqvxeoedsfzfpwt]snlalnxxyjihecmxl[qtoxbcyxxtvuliams]bijqmocptaquusurml
wmwfxoaocwtzuhvenl[yzpbmaoazbchjxozl]oulzkybjweqqzml[ydkamvkncxomqsibme]fcuomzdfejvijxeniaf
clyxvevuyzylpdud[jmwhfhkzrzzkawp]nwcvtlwlwnbebgdz[cbnfsolnppgafml]mxhbrzrialopbbk
ekyvudgmgzgiomwt[ebcbzzamsuhycbcvc]gzmmgrqbbuvbzfebh[lyuflvjhaxkfxkv]bvnmyumtjzismbtig[nqoxegjljmzarvyowo]rldakoyzzgansfefpwr
wjhfgmicaoysnhmcer[kocbthyqjwsefyepgqh]vvzlwheralmhnixsb[adysumyfpsahmkntv]bnzgyilfgsepwvrdbdo[yqcnxfvzlpjxnvv]syedcecdzbffhmpztd
qdmvnazvvyyxqjkm[lcmgrtbttzwijqf]gjacmuqivbcttnp[uduzbmcdayazzpr]vabqjkbgwnjophdxwvr[yyljnrcxwwcehamtg]psdjpizyavaebua
fzjlpppzspuaflfwtv[dqmrdnatqlqnvowh]bevfgmojlmxmvfqb[smrcvucejxdrppkldvg]nbagvxquhrilbzi[dtbbwkaqepopjtgsgnz]zebxmxzzszbxtqeyjmd
kipuoxmzbydfycmkxcx[bfmjtzvthijzhezx]aiwnfmjhetyrdahmi
hiekvarctkixnmypau[dafmuxavuaosooos]czvsosvafizsjiouwi
epzppyfkcwcqiirpm[drxvceywherxdpnxl]pzylclelnhztrgnqb[qrmfgrtyqmlnsggg]seaeqafycqwjfccuyhv[fnwvqeftfesdvyu]djdlucfogiqnrblz
ihjtuvxjkvzqdpepjd[xzmyhwkdjooosritpw]rsvwysjoukgevdeve
wdgepzzfwonrsxprc[oefuycfwngwkrgklo]fbckfdmwzzwfiinlfhw[mjebaresrtulcvkeb]aqxnxzpnqukspcol[hpfnupcjrkswiwlgzz]xbnwmtcsqwbpkxys
nbaxkwtbtodcuecg[xqoetzqgjhxmuvfvnoa]edvwhehydqhhfjm[xyepeppmsepsaixyisi]txxbbqwefwuffdztlnc
aqeknneydrvnameefot[dduhtgzqtjyggmr]ausnandgijmikvgd[jjvsfofhypkfrrc]rgzmkiqggfaesoznlxl[przqmabciaxkcunhy]cnntseafxmnjldcp
rxilrztnhgzclsgy[yaxsuppphljrtcxev]mqyqgjopdetsxzmutjk[adyfostrkvhuajndjaw]ikumnitoxctaqcpop
ntotlcdwgtsgotovhyj[wgduvgtqijgobem]hhdytbkiplykiejg[sntkfbyrzgguijtwmm]mpxnepfkhssujwhegbq[sxpsxodobizsvppqptl]uqlqlsopbfmgliw
wbyugpjhymzlgbl[zdoddxxbnxqimlo]tyaobecgkbvrmgajpga[asriovkglwqiukcxtjk]nvjqkrzxwicfzdr[vzqasgjrafilljt]eobbqeenineqwps
xbtwnvkwrlnwseaids[znlftryxezmidoc]suigxfrnxfzeudpi[ahlshriqmozkpiogtc]zpjiwsbdawhjynju
drjfebkgnrcuqyzpezw[hnweqviwyjtfrwpu]popubobnviqwkqfv[plaxjplhmhjqjmqjsh]idacejabrvhfteelbiu[hhxwpwgvjcncpjcovv]tqyykiwalnnkoniju
fwdnjlvptzmxpwvsli[eidmcurldxszfvvhjf]bshskptweuzuqtjym[dpwmmspdxpiqidrfz]bulnlyngfaybqfinqn
khvidctisgemoswq[vzknkycuuvznnjkzay]rvzkmucboqomxkmtuvv
ymfxlhojyjfqvctzue[sihfpembvmdtdda]wezkljquqtkcyiar
cgzdjkbnmhptcggqib[autoeqiibhxdief]zapmbimuvhywdtsbtm
gilwnvmvdyftcdmvaql[esmtawtmepovyih]quztpmdplotzlszav
sfsncarxehtgmutj[aqauaojoqabkguvan]olgokvyhpfjzyqgvbcy[fsfdkbxhstvxlkzb]ozwgbzlhrocqpjoseq
shzexlixgxazcobmdvz[bvrebdcpytgplvii]gxdgzyoqpmkqznz[wuywofxihsgxgpcksgh]lwqsslamcrmkobn
pkjlltvbsjnfarycgf[gwkayyieahfowbrgr]ccgyjvjbdeoilsznvbi[njniljtubngiuwlil]kosrulvapzdufvq
clhvakestwquwywsohs[ubwecsjptinhzngw]dvjcvukpkdrgpbeua[svetegijnnbtetpgfu]nfejtethkqavpol
vksryzexymetdykenw[etxzvunetbovrwttr]pnmwnldqzmxzjldnmh[vnskreneiwajgmd]rwbeletsldocxguy[agccpaxhrlfokpt]wembexaqbprlrzg
wrxyiatlpvvcuroguv[hfcsmxesvpwfgtpqip]jbspeicucxtbnti
gbxyskaitzeogoej[drokshekgcpxpgktoi]ivxtocmlrugoguf
sfzpstesdmegcuhn[drrpxmsfpcjvqerjb]jqcvoeifgceremgz[chsbisfayixexqer]qyhonslazxrkagpp
bfufgciknfkthfbr[tlfmuebscorrclekjfx]offqunmqlcetebpov[bsbmhnbmmqmdbpnt]knkjsvpmffjqvtqpk[bryxvufxbsocwnd]hkxplkqhsymumxarn
ftafmqgtmaazvmstfq[qxsvdxplpesqzqg]yrbkrhtzaqtygxjheuo
xqgmldfvsmitjzhbr[yrwujpzkzksxdbthk]jblnpmdcljgadym
ijtilnlhxlkhoaftet[rgzfrfsilxhwgpzx]gmdwwndlvtvvtdimd[wyghkhzahfwpaknrxiy]ekpkylqvvxypaszcozp[hjdwslazthbzhdimne]xuptxflgcjgdajfgqa
ceklxvygwnkfrqvwd[qxjqndmhxzvhicvcf]lvrzumjuaawtgviue[xdvdtoulmeaaiiuqa]xveikrwzicxctyy
pdvdkirojjubchc[iylcutkspnuquwdc]uzbtxemzazuwottv[sojezpwrsstkdwkses]laokggzzeaobwfus
ibuowtqicxqiifze[emohxvujvolopghkrgw]secpljnouzblzup[xvpvnqvnsgsnmhwdpbn]ykpvwjlhtpdjlflxvye
botbhhrfjqjqwdgmeu[itwjgbhzrqnnagvy]pzexftzhniligeyd[egtdkuktihxgmdd]cumzxbfgryzedtsc
dgvuwphikpupaovhovx[nbwxxhepxfzlxcoma]vypmvuopklupuzlk[plkvxscxriyzeln]sopaaxvckgcbiahm[gpafvifmxvjouczus]uyqhgsdxkcylwle
gufjlajgktlwahsa[kwtpvwbvjzpmpbstiyj]nqkkgajutaofdauzmfq[zihotkwlyixmfsp]fezlipznjthttsiwpj
lqriaqvyvawemnogd[gyqqrvivtuxxbzf]xqrrsgnxbpmjsgqqr[zfwpyfwojhemhmyoajq]pyninwzcjzypmygy[qzftysfhztknzjo]zyybzurfxiolsik
iojvqxazkhdwzed[jnnntfrduoxnyqpeszj]dpeducyducrsuwa[rnfiudvklwbdbho]lklubgxkqldqalvh[ogbeiwjdaeuwjyz]cvhoaaenmeuovocvog
kxtwtkvaixeisgzjky[cnzhhsipmfawaqzc]gjpptvjnwmbqqbuum[qryazcieexjwwsvfi]cysiabvuldrkvsxqgu[koflanzstuwaebjih]krzursoabnpundffqs
bzqcnugxfeixhnvk[sjyuxwjdceauputr]tcjsgbmvjklijlowud[mdmuqbpupxhndvfcd]ypgdbaxwopztyqelfis[bvpphfvdscmfbhynf]vjaytjezersopuqa
sceyeinwgkcccgn[sgxwelfgqimdwzlbj]uvyuazuplvkhpndc[etahwkowloxlylnp]hletqjpvxzicdrs[kyrfwcyoudjlueqrvr]kdqsjyoajsfenmrol
atkckckrgntchlets[tyebmdckmayofez]hryglgphkgeoswe[jeamxrrzxgyzvmuh]vcvejocdlauybbz[lnnricpcvqztoumc]uggeimsqrjnppskl
rutaemkjlwrslmsp[jwwgmphxqlggydlsh]xdudpbdjfqtcgrw
lwddwkagigyjsht[zpizzqoqkcbqmdqfqp]vbvigihfyemwjqusdh[kqgxbnysneqgxdwzkpp]issqguyhzmttxofz
zzxsolnnbmerygtvvk[bhfexiwvaohrbqbadi]zdsieuxicwijamvo
lbfovxmrghyzhfdybb[whedwghlrxnjtvqelzp]oezlanrknbaxtmo[jtrlurnbhmuymfwx]puvsiaizbjtqnot[rssajpiwyftzhoacoqh]ihmzohwlncqrfrjpbpn
mflsnlcufwvqbhye[lslradskdqrueaxvoez]iyrdzgwbghbrctrmdt[bqgxpsiwleisnru]sjwifvnufaaedueaag
rcdjaebyojixvatc[bjybjvqonbvdtyjwet]rnatoqmpxauyiezad[ltcfporqmmavmsjgmrb]sdiogziluykhmgcjf[bkkhyuslxlarrqbqe]zzsdsepgilymdpnhw
jikhvuzivjikuxkmlus[vsgrhafeosvtphzg]bjhxequjxbqorsnhx[pvkgxrttjofimfuq]cmrxlinhwqxhrkrdzpk[xugunnrtpxbnemj]hapjbouhnfydllttkdt
xsvwiruapkldajmkyx[iohclbiotvabvkhkngm]qfvbpipvniprtqjj[ehcphknxkybflhn]ackdoidsuczifwx[bdbekqnxcwwskgxp]ofvzsecshsgbqll
rnpjfqpbnpfqtlpkc[itzrqowsquwryisqywl]mrkjwermsejxwqubxwi[plxkhpuflnhspjficnt]djldgtkuzafchfwar[auijeassmbtfdsd]etfcwmifwixeffrtpco
nkqwqvkikgnmwcnos[nmvtwkyhwtwyrrupx]emdniphxpavkede
tkcdryrjllweves[pqdjnylpftbbktemtkl]qlykuckixcfhwuczikv
cfjwosfrfjwgwognyjc[jiwoynoxdngalmreoq]otqvhbkwlkpqatkx[wwgwguxuzwlorap]rjuopkpuaftnkdeg
icgtjqangadcebdax[wyosawgqnexwsdqq]ulyhqvrzrqhibudyu
mrrdimungjnszyr[quzeqzycxcsamewykb]vqrhnvflewxwzvxwxg
aciggfsvhpeaemh[xhizavbtwzpsxdkgzdl]dbqpkvkmrbwjcle
ctxwfkazxjvguatxus[hkcjonilmmvovjawir]ruwyywhbhkrheofbpr[qeknvkabxrdgfxgrp]hymknrdlgolmqrpklal[qbkzigpdxfcgnfhdrqr]hrutorkgyzxlqlujnv
ocyqsefzuzizjllui[ttpjltsmxnkavfbviwn]ccfanejrzrghpnb[ehkgwatoncpnwfpjc]qkwynkumqgvxuslirgg[vrnprgoivxrsqlpbmke]jdygjgsfkbhrbfc
necmpldghpppjggvw[vtantcichlsjgrzdxlo]bihypdunzshlhxktuk[iusfpqesheojjdmk]ycztqgqrqsuifzgnqvw[oyjhytgpicigpcf]ewrixdzorbmmxgywf
tsddziihnzqushtoeg[ldqhzxrgtfkcrhecrm]nnesvhwbrujwmon
rdapxiunwuijmxrqf[qvekjcwvibpucemj]uidzbyozcfnpempx
fdvouzrhnlgyemqqqa[rosijdvpwbgnxzzr]moxykttwbfixxvflpje[daadlshdcnrwftzxpjj]pgpphzgfkeapstad[rptqkhjmanvnfuj]drurgqqilijigaa
dcdcoboftwhtitlto[qdqpbbobdncixqwhmn]cdjrukqmcdbzwji
fsmzzqlggnjqunemec[oxrxnckqpvilfinnolv]mgpmmemxrkuonag[wsoiyculboqjnux]urwswywdpuesxaq
gpughkygfkxahewxsip[licxlfgczxcqejs]idnuezcmwhwgryjare
shoehgaydkpbxwshf[ksbdsdldhfsxjipf]ubrrcyykdsgnywhojya[hfjwtuughentmddwd]wjpsomayxantmltuoep
srpgizgochbueqgg[qeqltfdohredaspdbmy]cexowllqgvorkapnkc[kfivkiksqxospfw]naiqwxlkjowysnh
patacqalyfmxulxxtkw[hyxkhrfewkpafeel]thgckmswuwcjgcuepp[lsfmmxuvmiyyzzxu]yiktaounkhxoqzm
maeefdbswszxotz[sdfwswrwotoblvzk]bqmhwlxmzvjnorn[phhhipunsmqfmormtk]aasvyeqeffypmcop
fhpaqlgiumuampggbha[tktjydzyzgbpqosq]dpqodhygfzmbfku
iotcaohleclcmtwp[zirjcaznbsuwrbbspl]vdyhcyoroztlltnsubz[nmnaakmudmmobxzk]xjxybbzqfoibovwhr[tpzyhrmupmrfoeufsv]nfvtlfdnynqiwrmnmt
bsadpcmsvgfxbpskka[bqcswpjvfijomiajzjv]zjzfrshleucdcwpf[ipqvielmzuykgbs]rsvzmpmpfahujfofx
fvryaokhaacjqgah[epbqswhzewpvaip]cuveezfvkvejvvaizr[hlhatamayfeqllu]ixwqbzzaekbgxkmhzaz
reyvoyklzltgudphp[oxjgegadnwxleogg]ljmtypolhtjwpvs
cbihaubuoteffoyu[svxjexmihzibcqb]jzdqjhmjgugqyur
krpfvdsywmrzxbusjl[juomxpbfboxgvkm]brhpobarqecdmqkiwy
wsbwcjnpzputekmilg[qhdrjrdtwqqaqsymipv]fyrpxnpnbowlhwkcwd[wcxmrmmzlznnrel]oamqtpijleztiuknf
mmjzxbxoyrxkyvdtss[cikixrlteokbezfi]urjcocznnivoqkf[wzqgjmuuvuniccrj]eiarnnhreduakcv
honratmzckbtooiwan[epebkioukueaexbb]xyakukoiqfmtdhvxf
auczawuragikjbyg[xqvricdlkrsbnmjqymq]uwinnxrbwluaanvjyvz
rrpjxhttogyefupw[cidavmfspeeooolb]ucfrrurpkeqltglk[ulptzlfrcvniduqkc]bytebcgtpqkknxpbh
ateymyqwgrjfwemgg[xppbfkjrlnizskzttbw]genvojuvqaudosfm[psnzsxmpjtdbznh]kljgvgkdvezzljte[ovfuojewcuvcqrfdzsk]kmbgrfpjzllvrbmpimu
mrvctdetjidibveb[msvevesuydbqwrytbh]yiliwznzilsslmachk[mqyuthyalilcmdpxz]ctawteeyyrsbncp
xhqazvqcraogaog[efbpamcmboregjesn]vinozerwxjyrytyd[vmzmjnevhaiidnhiuw]nvzsnlixrdzmzvtgfy[veacynylxxfkeep]syokzdwmkkhirrz
swavkosetgudxoshj[fvzlrzpjhrbnbqsccn]hlvbbqalpdfefmaxdse[ekisavmzzlowfwcmqp]hutgwyxxcqjdiso[vraskyhzrfjitpxakqa]rcljjityeqogidyb
hidnzkzjrekzkkqqpj[qvvuzioihfbxhglu]nzlgputvbrvwrchwhzc[rimjeexwqbdnsdn]tfzbpsuttxirwszy
wiubbpcsjjmtbnd[thcllhnafhmdojqr]viplkejozrbrwacv
jaywbjoscfdifdfalf[lvouibjhzbkxdqd]mcxggciwqqirwcyps[ztiybfroldnlieeg]vwnzbrghyfatjsxsvfl[jenhflndcjmgdojv]uyxvsnfigbtgaemccz
uutahwebslojhtl[affybmhohxqavah]xocumtcofvavgdgl[xlypyhazihrgfwllp]ptfnqjlzbaccyoaawi
akdzebybusompcsooz[xgymxdecspvdvkgit]dtnhtzkelcazovecig
jqajvhvbrkrynxg[yekfvwkborakrkfl]bovxzhceonjclmgecgy
ilythgztqwpxktjrpf[igwywudlvdqpqbu]hxmvjverypjvjtk
dbkmmuymxedkowpcws[kxtthcqfurgkuxxx]vkypnrqtmhlsqogt[rtixamexlrydluvxe]nbehtyxipwgvefctyaf[cxtipjkxixrgawvomc]ssvdpknocgugwjxpzpf
fidyxymrgwqpntyg[loqqjfrzmidkxskyfsa]mqilmzklkzhzedf[mitpmedchdhhzxdqpl]roerrhbijrjwmsm[quhrsmqqujwufnm]layxublhkfpoykadvcr
njsjelrfstonstmhq[crcgsmvxndyvyfsjku]yvyrpgjnuimkxcutgvh[gwmbqumupsdfrusp]sbedcqptxzhsohroth[wudivolpxauvxvxbpqk]bnfygsxxzqwxumonnm
ivtobvcmwywqtjkfa[tcfyhhgftbsswpnvbtv]bkuulyhtihhqcckjo[lgnkduoojrzyjhby]uwkeujommiprdopgche
mzrhrvpuyolqlku[rlofuuumtasfuknrasa]tfhglvunxtkafazyehj[hrnjrlpyjntwosogwti]ixtpihfavwqkjnlipmm
jzhfwqxoqsgnrnex[ccrtrnroigtbvrnjeji]bbhfsodufjqhjvplii[mcubmtdgwttmmnazhpt]hovifldmlnbzrwqicaz
hcchhpmerpjppsj[wftljcxoqwtoclz]xihvvfjfhefdkeip[abdthspjojqvwxx]fhffpflinospcczm
vupulseekbaiaoempu[zupmjydxyobqbfmy]xkyopqxvogwcpuwnud[orgnovcpbpqecljkaq]sdvcakqwdmgydeeup
wruccyxbyiexpnka[iirsbfvggokpwli]gztvpqcsckeaiqofwf[zdloxqdlcazkhkppz]jydaafpuoznegyif
lwxqnbbzjlckuji[bzxykmlhlgjosvs]fdocjjmtlhlghzvj[snveavqbuhnzqktmyur]xcoabwwqxexqzakbrh[iqkdvngcdtlhlhudqk]edydfxflcnpzrcjsppt
eokcsyiozfqhcbzffj[uiczyrevovzcgvu]mniuhovkpklhedhx[gbyzowvpnxpemkcrccc]avfhgxxldgtjxuy
rxjbmcovdnxoxrjter[ijiplhrlromkesgs]xwtfawphuvrjimntwvs
uuwjtmgqskgrxrlzt[nqzvntwfmxeptqylma]gbahtqxvunohprsd[strhrrwmxsuoiuvi]nhamfjzlocoufnwbgu[osdxgghdsdkbqcpj]ywmalngfjbjymkz
vsmcjtzwfubhlop[ttbkmxwjonmuscwi]ikjuxrmqhqldtfzqa
oqhkopaodmimgikwcg[biimzvsoczaxfdy]bkcbjbcusyhdpfo[vfnzlymbwetzhbcxz]zyntiiipnkmsjjemxq
hzaeznnipwioicdfa[lperfrgxekbntipyf]mnerflshwywujfsp[nrkcmayjxnxbhuvo]mdxovxksmxlwvkbrdf
cuqqyiwojnwvbybcps[bujmpcuovhebtztm]bektaixvzjpofzb[egiiqzxqdlfwoukjyiw]nqkjlpwevuxeognpnq
ryxoyvavwharlbwzeq[rphqbmnaiykgafsftjs]ijrqxkvnqersvvryz[mevoiitcztvfztorohn]hkchrvkqswjpyay[staoxhiuifnbmxuytlc]fuawdkujedmkpeto
caowivzceqsclbyp[grpcqqthiebrabqwhxv]bzmazhewqmbuhjokm
uhrtxyxnakvjydnroc[fhnjxathwyyxszmo]zzukeuqdhxravrs[zqcltmosvkqcekap]gjartckwucksqzcn[smddsrvnfxqjxya]gkumdkzqxcqxfyhm
ldzhaqlkbxfagur[qvlstlwnkzbmxlxw]reflsfhdsosjaaesps[qajtodlxlfrbdlj]bxytsckpxumuoklw
ghjjrxtnytqatjfxwt[opmvopscrillueslb]zsxtxstrwnyzolxk[lyeeidvaghynwkckr]shhkellgnhsuekrzoc
vpliqrfetzttovx[nkmmjlsskjhnyxh]ayockmlevegaseq[auzorvghfdfuuajnt]poknhujvpctqrrycfun
vzgpmpjvlzbhzhlexp[zheyfmgekvhjsnmosaq]krmficowypbxwbztrn[rvoedtkjlfpxtaot]rxwejzlarsgdlayv
jfrznpvhlbchvre[obxfauzcchgnzksp]fgimlwasdrgqvquis[ewaqnfexmitmuxhqnp]graisawghismkouwfv
nqmcashwuluyxaxcw[fdqovhbtwijgklubmon]dgxewefrjkhrylq[maeguvhvptbgmjdwhxb]dkdmdobhsbyforzmqr
huwexxqnjlofulknxz[qnbpzxlpdlsqrti]sbmmwvryxqsrfzpm[ucizjfqroaflnixzbpr]ndztjtaeahzmkyords
mwlrbdybkjhgorutus[bmbedqpcsxwkganh]ttwjrjrvxsikepdbvgs[qycnjzrbeiiplxarls]atrevpowofauioaof[nlhyhaoljptrowlmyo]hmeaxvwasyaszlgq
tqsmjetgtzmxfgakjqs[cbnxrpnckgcndpcwiae]uavavaewuucokfrm[viufzfvvuiuuehyxcw]nkskrloinkwsoukw
roximfsrbnzyzjmn[bqugwcdliqyzyaqiupv]rpdidncsfgexyncbg[amzmtmqwzipkjfy]fqnscfsjmxjlpoccvfd[bpebfxoinyaqsgjpb]dykidfsbcykdobqe
rcmbmjwgmwathepxunw[uoieoiytmrywrjevift]ourmrqqatqnwmrisyu[bxodgsozbekrcuwf]gkaigbulsjxysdiawg[kczakejsrndvzdirs]ggjgbhegtgijrdz
xtksmozdsgsclsxrfh[afxjsmsjpuqnomb]onqkiyrogyrkykxjr[bhvnrdaenimevcx]snufewjwvfqkafjjzn[cquvjkzxpbfbghmnpwi]wjbdkkloxxgsgnmriw
doruvpwqkvibnww[uslnnvqcrwjlexech]cshujlmmujfjdtjw[pkbasqruzspzipwrqke]yypbzzqwoasgldn
aoxxznvrxfhzwyyq[byxxvystyyrlzvl]jnilbnasrzvgbbhrl
wvtujbbebuyuazangzc[moooepbzqolouuyxij]vhqrubkyyuypknfh[gvfucxhufyyjefei]axvrkaeaqlxxfip[fiazyighxscxhiwydc]acvifmzzltvluos
yzyfibzwjuddaoxc[gpjgkmckxctlttgcdcm]rmjohduchcituck[noozqqxrakiadwu]mipigxbhlbtngtpcpz
zipobscyynjrecng[jeekozoaoyuuqmroisx]tgffoyomlggbyjnnv[mcfybdsenqhygjo]dnzrpghyroqbcje[aoapyvfyscqfzhihddf]vplszbvbycwxqrhb
gcoyyfxpuufglqfsczx[ebjwlqjgtgkqdeike]xtuuxrrbgiwhwqdcyw
mdwjuxoulckloxfujkj[omieaeznetsnkeoroh]ggnwbuenkgeujmap[ghrtxfonaxyhfogpjub]ptyopzxhctssbwlpwy[xmpglsqcnihwzgbgm]yqmqddmugnlrbnqkgci
xeayvddumafiomemh[euwluehznzxvpmzbz]fxcevhwksvwhrvzid[maotzdveeldpyetguj]cixjfwlbbbrrqmnoklo
larctxbpbdnbpqyyz[vzooyuwrgpgtjtq]sgizsbcjteinyxto[jbqzsxejwwgrpcgzwrj]bpwcfwyglhtuxqmy
zbxohuvlboydqvqhhkd[wgcjvlrppivpnxifvk]kmpdiwdtpmrctyhy[pprsqaqxunduprjnjxx]zfbqlbdpmcgfwenem
ghcjhgkmyfejmua[mqsuukbcdvjmdnz]ixxelnebxjrtrdwzlkd[ikojyewznghqksregl]tkthqugytcsdudoggp
hdfwyjganjbjhbjvswz[bfaxlkjfrkakeedg]zrkxyzbozmchfqgz
inmdmdyssqhykuhn[vbjasprzyxaphygdg]ucbbhyvlsjjdqri
zdyejivfbywyaaqljp[sxmtwgwmwbqelhsg]jesgfubnghtsagcu[tofvxzmzzsnywhbx]ibnbzcdhusdiqhgika[sipfigjsngidlzxxneq]bljavpomkpqzrsuuo
uahcmotfanpvzru[opmqbnngxtudnuyc]lsvafzhwwwmoagl[kzpffwsffxozirgyz]lsbjnbzflbiprwuvurf
rzietxnbixgvzxnmzlj[iygcirkrgwwsgpcidzr]bfrwgfeyyatmalyjsl[dweehclvlbefvlcp]qurpnzinmyweipshzs[lgbfgdjhddmtvbzxu]ppxtzzkiizoqqguct
zfsvifntrvbjgdcuc[jjwqwhifqbxeqkbigcl]fmyuetebsksddti[hmopwdnxvmqwqflr]jidndiejmzoutjpkdm
qwnlstjkluchubgkttm[yyndjrkhfqrxuyglebo]xdltobqidrkstozk[shmmslerstluurc]fxkrzqnfjoalxcmssq[bjenpehkwbxpktb]eaallvedtajrnupomva
zxqdqrztephcpieqdi[rigecfyegojksvjmya]rgygzpdzmpvogeurni[odgdyrqmqgrcmhfcu]ggdgejoiritcrdxxu
ezhzkozgllmnompn[sqyilkceizeygqkwot]pdkuklrqdgtgoqap[yvadgqlkffoklshvf]hkgwcnlbadpbiuzvkaz[oozjtyzsxujalkwoo]dhntuiangtulscbzg
zvwmdxzivmtzpkmhnp[qduttqlbrhetmuj]vmykluzepgxxilmn[qgswpbooccvoxlg]ujndjzfubkxmvvdib[yrneuetnuktitut]vvwnzxosnenywomkyj
phuncbfvyiwxfour[oauntpjxaqvwvqn]liffvpoxrbljogpcwvw
usabjelvalpgdyiyn[hywbrqfeqwkizwnxf]ebpcgxloqmzflbeag[dxifrjggqwzokner]ndwzylxxlkdcpbk[kfergfdezgbceby]uscylihvxfbetfnog
afgmwhqdwessspzx[ssbmbckihwjmiaw]zbbiktbhykmehed
hforuldqhrolhqsm[gofgjhapikxnhhdn]xgdarfanlnonwdielb[hvntptxixclnlqphvq]hvvdpsmvsveyaiubt[hiiscphavjogadmj]bbfjdjeecrhhrspxdpq
djtyronibzvtixf[yvofthnckundxfe]eccattkkitxyotbziy[afdaacfefrerytfh]cquizrjfjtqgjozagid[xkbcgazeolbliwp]hukcarrfnjctdycpfb
egwoebxchfxxlrr[hxugiprrlfwmknw]cpmfgzxzakyhumd[evzzvvtjwwzwzywvk]lwcfpjlcgrbjszjvf
hktuhumsttqsgfltrdv[rctkgluikouomerrv]jblnggtkdhveufixx
ejjzogefxwuyadzthjb[ibrhegtzukygkfnziwt]utcbeamzzfkbrmqonlu[yofpkwiuewvtbswaet]zxkgoommtfxezcfcweb
wbauuixpbtjnuos[ozwhlzidaubnfiuiqa]nlkdtbovsytnvjz[ztfjpnzvymrefnt]nixbxdoogrxdvuxbxbr
xadpfckydqkmbvbj[vwdzgyfbjlyslafrp]mbozdmkfztxwailiuv[uttdatknprbzvjvucxh]cqcbkumzxiaqweqfiry
bsdbnkvvlwpezlhc[cdzdiuewblcmciggdgp]halpvjdbnpbdrnkz[ikoyxulwagjnwego]twyvbkffqxasqbomi[ajwtpvliyyssqjex]cfbqtoqqlggpufbfx
qoqtovwkavyaqbkwmd[vxuqdoobfxtanlwd]zklibywcjpksseelw[roqxvvoifjmxnarqvt]zeijltexwykdvpd
obkgwgtfxwjfrepg[slekjheburvgrunuaxf]cnhsvevmitpuwokwee
flulgpwvsikwhpzpza[pmlcfhtmvuiyoidfbfh]czcxxurdakbxizbbfb[blpwjusbzbdwugwbcv]vltmmzttxuhooid[hlbpbqjpqyclebkye]hgozvhgdplllxiio
oupstawbevsasbhv[ddvybaqnhfckfvdgabz]nooqiufueyoflccqzc[jyljuydjddholsx]bbejlommzienlhz[mpbmppjwfqrgucxdqxx]sjohlscgjoprsqt
augjtgfyoatluixgc[atdsbsouunywohfnk]dpghgakdvfscbapsm[nkodybopavlbeikalqj]myhpkcbsbkbjfgj
whzlsgvuspnzdunurbg[cypfmgrkqjeppudbdy]civtfkixnmrkqmchhg[ypyakrsygkyvmfmmyf]blihjslfkbrysntsl
xeyyjiqvduxcflt[xiqxiqeepbpkkydtzxs]vbpbdsaivyavnfwj[rduzjulshqiluheud]inliammiyxregzbsrkt
txvixsvhvmxxsomvo[hgdskyjskapgvyiqzsz]shvhmfrbpxbndsx[plvytalszauhmpkr]jyujmokrvxwmanzbxbi[mefmngrdhatojkpplcv]dttxfesvavgpkbtpri
pproajkxqwedocrc[muhbyboayoghprmbtxs]odroemzznotffsaxsmg[ykfnecchdltzosnyby]nozuvokzntxrnitq
rqimalibychumvzdq[siqhwfjimixscjmne]hkvxsavgjvpzkyay[nzbxnmxgmyuwcywvd]qkuzrfifsyvonaalxu
rymadifucrlickzorqr[phxxuxpffvnjgofl]zqfbhfmzbvhbmask
gzuklpopfcjdrxoekz[lwviuuoyojzggqjs]cyacdnvkgqqafcyprae[iyazavdiashvzwpgip]sztafbunqsyjtpz[fkwjsbllccbrrdpa]dijejdfyzqycvrdkl
nhmayligrdtlvyeo[laulduejrclodvnaoh]frxoepqtmqdzwwupiy
exzcpmjdjiagpvsvin[aontczoixbznfwsvss]hdlmrrdtbumlfvril[gcuizdwjbzyhttw]apadljkbcsylwgekv
pujkeovpnvnleypqz[ecxuhbtnrlnzojsxs]eyolbkoatzbwvnvwxlx
oefowwmlhqytnxaec[rdbjjilbmiazndcycr]dvjwgldyxfrzicw[fxpbshhafqifvyju]ygagsxtxwnsphgzqrpv
lhbebfasigqbhndgsux[drchunjaqzkcmefjys]nzloazwftxoemnmifox[gjpmyydbftxggnggadd]onlcnitfjniiekbiaz[swjdwdaikyykupgyg]ltwxeordcvjfarrhx
ukvzfltucnovohjidr[apslrphaneessxbpdx]cxrovjkruohahxshazw
xnsrwrjioindnxhxrrn[mvuraryghmwxppnlp]mconcxeyryuvfqcoy
opafehetqedyikso[vjnjwsjlbiknomzuu]pjurldelcuxkdlhehm
kvpcbopojkvzykdhm[ldleeqmztdnrohjm]vejwyvzvekairyhc
yrbrakwltaduyge[qwvsxbxwiretxirlsbt]hdnwansdelcvxptiou[uhibherodkibtww]aphfcrfnpewbrblyme[lfwjpxyosiappsd]rshmipxgjvorazj
tsymbomuywfpmdul[wgulyfhhwodplfi]xixmazxgewasngsv
ktywwprbuvuhmnpwfoa[fcuicnujrweusdoe]fuarbahbvkhqjibcfp
snhkrkibygzndryeblm[pykdztwnxrawqbevu]wwiwrwfcwtirdkjh
xhomjlsunzjzgkxc[qyxzsooayiqnuzljj]jftgbnqtumwipywdfrp
mhfgzwlocsrhbfkdbud[kwtnglxzzdwqcfw]ezvrdgdyjjqfwuv[abznvdwgiisyqjxvu]khcfgchqbgwflioa[upibqontzrahabnpi]tgjaagwvmqewmfyer
yfptdfhnebzhgpzism[tglibrfrnpfmydwbea]mmoqveuvvenorhnrw
ljztcdworsemcoe[yloilpxuumxdzzxl]dyawqaacdnjlttcz[dxyytbozmlibkocr]dxpindavjlezzpogz
bwkhzerttqexrgoea[ubnuzbvktcxsxednmu]zqjpbtbzdcfmidopdy[malphrsrebpeeuw]vwdlaafkntcaqmwjqc[abciktgfeaiptay]yqksuqwsuqtckkoyh
filqrpdsqqfgkcu[obiciozcvbatglnx]sjzgtjuddnazrzfcju[svrswvhpfraptqsxolt]nfcphmwaudhrnxkzc[ysohuzukkfqlskgkd]nynxljuswasofiaarc
desdobciyiqsycj[wzvqcbwfbneahei]svofzhyvvsrwasvvg[igvhymbudpcrdgjwv]qtyrjtghnbbtekl
fygnlyiuxapyciwwnbw[fhwxcrwprlaoiybnkbe]fxvtiehvhfgfwtsdfh[mreawqbzyvkbcnkyftm]rryknthocegscrdtbcw[ktbeedxfulszfogwnqi]kqwtzaemzwmsloi
zxroedxtywemimrje[fvzlxeqgczajhimr]lrhvziwtgglifto[buxquosscraxroklx]pryldzimioibwliygt[yvmeeklmyokbgexl]oqezpvcwnctcbskefas
dcowzgprrgvczwfx[zminxdmdflugwkkkk]vfoltgijbqlhjdohr
vtrfdkwipegmqbwrvo[kshaxjtaiuyicufl]zfkbjdxhihqmtjco
djidszgreaxdweqjk[rdjzkbmqtyolitmqhf]plltubpvwojnccsygfy[mewadohjaliobsdwezu]vmrkkqgbtfmwemn[erlreifagjhqavlxxh]yplrasxtqcyowlci
ctautcpnnufupce[qtydhgcjjqofrfay]lfahmjfjyppehyp[qzaxqkpopvwzqofe]rkcqkjpgptshvoucer[qmczzorygyrwbxiji]zljzfavjmwawfrfr
mwmkedorswoukdumznq[hdujfmdkyiznceknql]wgvbskjuuwmwrsvca
sdvjnkxypkzbwaam[jrjyjxcfvipcsfv]hqpkybfiuthhszpey[cxzhyjyccoulowr]bwjcdjlwidvcfkguaud
wfvvroenfriclccedd[aqkoeakjbakjprhnj]ytucldefderfpqaibsn[gjukmqtaxbygrygukiy]xfreqhtftbfsvsjstda
gmqthnogaadlkycgrv[qrgjpxucfcnthziuqmc]fqlchcfytukeoho
muwfuurxmlzrcgij[ifojpmgnfufvhbmmeu]ezcruchallsnspos[bwlnhfxtqvwcdjo]lnfuojduqnrbdyk[jhfihfozzosipwsyk]akukjehglqpancmiy
ultbxqkpivdepjvze[flhbwrxncynirgxwt]twqbnqiaivfwlqorpa
izvobuuojtimkzlsak[moodohlaudrwsto]cxjybpccizkmeau[dqaajcusqoaatpbojuh]pxlzqhwqdgetmjcm[jmjesiihxrtbmgwkcck]ywajslefzjxwyfivv
ymymmfpvyiyegjw[auyhltgyvzodazgd]twjkvzwomymmrhfthwc
romqbwenzvevhyq[ewpxvrduvqewryaoct]wxgowmsdxrxjnyj[obazseiipwfmbyxhkdv]gjalmcoqrquvdnmzacu[abzkksqdcduhkizuzxs]uzuazfdegdfqjmmr
frvysxhaafihjpza[uuwayzhynhgliyxcc]vdcjfobjuqddqibjef[iusgoufujvqkfjt]cejktzeuphymtswrxj[nthrscqmjniokzsq]tnsfuflhwdkvsrlm
rrybzahzqjlsnrf[aexlsirbdpwkrfhms]ftuaymthroqwnjlhwv[gugocacufksbdyqsfwn]ptivpdoxkvpbwaohlfr
ikdnaifadlcqtyfpq[ftwtatuewtwyxevw]klpnngjlhfuuwykwbqh
jcjepxytivozlscfk[pdosptbukdrtforgvxk]wdghlnuxqjdaztviyiz[mqtajavotnicuxco]vovuvrvnwoedhflabai
yaiokdeleeowglfd[qzhtllekpxcjvig]ohtsvsylelaafkxk
qkopuespenokczipnz[qmncizyvbxioknj]piygfwazneqkamiq[oebzwpkixhbywqc]tglnlkwhricqqzzbkuo[azpshyiwubdevjojg]fqlqjwtirppkilhplu
wpjdzojjjgthuvhs[ttvkvkootolwcilow]lvilrilboatpxwa
sqcunkrlvqeapsseomh[hcaleossxxtjalzts]dwokbxvvtiocokk[ziimvyrfcpcagbchp]lqsdomcpacsejdzcxw[tpekrtncgabhvirc]nqguzphabzalcgqjbmw
lchsqkntfaymwss[glcnjoqtmlubbldwxb]repxhlvahfruswno
gvwpylwrbvedenl[bsexdkrwujurnrhirju]eskvbigiwdmjthvhrw
uumyugkrepjyfna[clcqpswhmttsgtrnh]wnfqshojhbnuvkblcjh
hcwvxdxtuptlajr[svvedookmmgybok]dgfqpjqcewcjwqcw[rtkptmdbzfeqcyiha]xjnmaukpdrlznfxvfl[phdpcpgmzzlbeplqeyp]xfxopckbwdpteui
mxlmvngjychkbdad[nprwbbiggpyhrgjnox]kkkrpnnokeecsxwtfp[mscljzerlkqzmxsghg]mvwiwebrwurrppqw
bdgrunylqufybegh[hwkqigrllagcnatuzqe]tfooqltcwxznzoaot[hvdskwgtazfkqlbbbk]zlqphymjvcvgybaxo[uvougcsxvyieite]lryismkbwdzxmprwjmu
mtrggduulofkvbdmqj[oijictmaujkaxedjfm]kvriyuoautahkfmt
ljywcelytwxtjojhn[iopmxuupcuvfcgubem]alcwlvcmjgwoksp
ybgcqoheatckeypwgq[szypqmipvcfzxbl]obblmhvzjoiinqd[kvoyilelwmylaezhow]fforcawucbchzbjlrmu
txgcosxcdgywyfhgjm[etzfxsiksioqtrir]czbkwziihsrtlceuaj[ksksgvozuazlcgqcy]tcottzfkvhsmrsyvf
iggzhhbedhayxftelth[qznllaqmnrogfmdtbx]ualmvsfjwntzbzd
dfeuwphubioymbzuwo[tucongmmrqerhidwq]tjzrtrfhgixyspdsl[tygroajgdzxudheh]oumnugqbzgyilbrth[ejcdurppfugoluctx]rtxzchnbmwvfewg
kyzwhtfybawdrjkvoyl[fzrhzpdsmtmmmvuu]fgbiqggdekddtlpzvzh
irtlqtjyzstyynjfjt[zrlqdodytcoqczaib]brhvezqcuycqmta[uaofbaluqnucifngqd]eeprilhhysftrhp[zmdzijhtuxhysuaye]bqokznpdffiubikgf
nsrehcsbptmpdeskqi[rpcpoctimqyccgnpnfp]peakqjqlahqkqfgoc[irckfbpvcdodsmwm]oxnqnxhwmwflazjv
iuanxnzepawwipojp[bzoxbyrugitmuiutg]wtsagitdstugmsssbc[dvxwzoncffczplwcaw]gifhatzuqdvuwnupmja[wncssuyvhyawbmfpbdv]faluhtnnnvuiwbbudh
fpedlxzxifcuqmvxm[vrfcejeyfkhegliplkr]giqaenxejvscrlxbg[qctzkslosctnoamy]qyjmeunfiiuoxsid[xpbjwjejckcavehej]txgqklgnzqdtimmiqwc
iwkrzpmhsunofgrddx[ecssnqrcjyhmsfh]yrmuqswzgcbxnaa
lacpahmmufjghzen[zkbpbownspfqxnclzk]yjnyyjnabyhsrggji
vgxbpddjqotuvzbakan[vnagjxrcehlhbxwdw]kxuenaclhrihntgwjq[bgqywyrrhjzjqdnu]eirujssxedivdmvlsby
tsqxgzovbjzlwpcbv[rgaywjaothmsswcdrtp]owwnjohtsgegsgtah
xzxejmuyfhjmgoxfl[hyafuepnewepjpy]lbdbsoxevfzdpnwpfk
moucalsxxvhjiyoceol[gwxofnqdrtxzusk]qjosxisditclyvucbm
bjgdyrlrhtkbqrjohwj[gcmcelqjvjadxqnj]tlupekhzidsrscrf[oqadjqqatohbjwxrneo]ykhccsunlyamcmmk
vgihvcltopalggrjzsv[hmrksbhlxuzvtbnuss]yqpcbwauqeduyse[oojtsldylgtokmdwsy]intpovuqazkybvjim[qbqspjlovnizurecdj]fkxluehqgdogxdofnq
mhwhttcwzcntsbufi[afretswhwxhwkptb]srrajfoeahmhecarmu[wgjragqlbpfbfpd]epytkbjxmblfnkwhlhe
dgpphmjzkoobitcjyoo[nzkzbsfktzftpmgwdcd]nbezurwvzkhwskfq
epuokjzxtxphttxtkz[xcyaposdqcfkcxhncz]hcupnojktsvxrfwlyv
xfoshshomwdgssxla[uhshvhbfofuhdsqk]zbzynuiyfagqpemuplr
hycladrjbjuyieejeg[ajsfbpoakutelvhdak]hjejfrmmzslupsepozu
ksputfunecibpffwovl[xteycruesicuhzai]sqpunyzatnromjeq[xlzamstzzisboayh]gzlnqcjacsbkkmgzi[aonbwutxuesczgwnr]aflrcbdkkgoyumfakb
gjgmaueywnbqdvgf[tpheftnkpnlyujv]tvnqzdugoyjybxfpx[lnhefqkhesyicqqgvai]dvdgtlsayhtscupgikg[fyjgjzcrucldwdd]ohlycgvvdatuyvduhuo
emkefdmyurledfdd[dxzytfxcsdxgjcwxjzb]rqwwzvnosuhkcplv
fpmhvozxaaxsyxcpx[yohzimahvewgvzucn]ztkenzkvcryyrmo[drnglpsvnlefqhx]clawabytpjiwgqflfbv[xvqqglnkzkxlevq]dhpydxfqbclvcjtdcn
itvuciuufdkcgdqgo[mgwnpeydayczlvjegm]jyrwfakomakilgvhd[mslududkqwtcsojaosn]dssdnwxzapuchnxz
twopcscmaiqhzsepel[qhydrqfqwvjjvinlq]tfmaoxgmccymtrbecjk[zkuwqiccdgoubccjoc]pepwccwqlxzlvuhb
dingttjebuuxtxrxt[jmgffmivzzxvgvefk]bqxyaoqiukfungsvu[sidxinaokekzqpqz]hekuuswyvznavhuvk[lnmhqeaujpofmdzub]vcufrufbmgwvdwksqn
mlgkvlqtkpwzcjbrr[yzhdcawedycuwdw]ncjgthabbqmeuji
oqybrhgapxiiaxihexa[gerjxleappelousidd]dblyflqmoarwpne[enariawxfzzpeqdvj]lgjzpkhkrumhvap[rtcetzkiztcmyyjzs]adjuxkqsxrlyjgf
hqxmuovloocgcgjlajv[hjbhghstuvarcwhfy]wldxggmqrrhiwdc
yelxlqwqeiqqwwaitp[uservmlohjixnqtl]cocskteueenenkfmy[ehpleyhokmlzslrdlh]lyvwccjeqrqiofplw[pcsjxogpwmbhrpvvn]ncmxjsoxflyiderh
znmujbypnozpjpkqii[iydnrowiwhgazihmxxp]lvehdleutcqbwwan
lympkckqyhgbaumc[oodkeqjyhckceptyqui]ejkkqbitfscazcx
sxvzcdelbmcqawvour[jgrjmuzvknqddwawl]cfdxxgxsviiyckx
nrsjamicxprsigw[iywcxzvebsemowpdmn]tbmisagklgwliuuin[ztbbbdtyfonwumpl]cjmddkvsaxzaszisyy
tllvdxtvmesnmauwk[qaomhmguwvmsjbwrwz]gvzyhjymfhmheexe
jqiffwykdbqbfcz[nzzfstvzsrtshctbwt]uazcksxgiyuwlkbde[nvsnfriumhwznjfdual]beqjfgyanriagjl[mkwaqdkmtnrzfpszb]mrqgyvqvyqabnugoc
kyvjsbdoorblnmy[wxackciwbnwvsggfoxe]pbufyorljghrayitwnf[orktaokqgpeenjyk]xdldvupmoyqwylb[aljdjuvxqagigdbti]erzojwkjcoxvuztbqw
zuceocflmwjxczrua[gpdqtptmhzmrumm]lvmswwevpotdyrrztzl[pkzxcpcqxpbfmznn]zoaxhfddhvfzxmdreww[roilsmnfdmogsvyyr]inqfvvkesrzgzwsnwya
lihowzmdtujxkokt[czwvzrilryxqxqm]appqwnbyvtxjysxkh[wpjuzvceldxgvsx]hkyptytryliycwhpbkk
ccyquivxwnsmzvurzl[gatwkzfmiuzvlxqqyy]twruqhcerhppziydvey
kfmpvuwkfbczuahpr[uhtwcsydtbjjfcyu]mltkvudoyovjipwmptv
yzuinluayrwqgezu[qbeujtuehlcqhbz]qwvclzkjxuficbgqv[qrzlculckkjhunba]gemnanesaovxzxatvm
ytnrkypitsppgols[boldlbadecdiaeyp]miwxcsnjabbmlfz[nmfvanenygvwqmgpiei]dqwnubvfbwzdptj[ormimocwondmsyrk]eptdchejhezxzpqimj
bpvimxocqygiyfak[kocimiojschpxlmlbh]oeohxkrlnaramquwz[mvodjkrtgwsyshboxo]jmxqxvydlieugen[qsqvwfzcowdvxzeflfz]eoysyaomzucvprpm
uhanxfxnxmoedczj[pjqlsouqdhqhforcuk]wgqlbagmjmtimaewh[qlnvfdicashjzjjmmwe]wrtbmpniixypmei[hnikhifbzacymvga]cueedmtiokuuauro
rmwtcdtidmhhqvlooj[ibfeikfmamtpxld]tvqxdwcislwdijaa[znpzxccexnnkerzseb]cvyteeonwbckvkmw
xtrkdnwsvlqfpzb[fyqeealbxbpjxohdssv]eomkcxpzhdzzchmg[rszbjedcqvxmotecne]arebcunvopesercpsif
wpmgxfiikbeczkih[cjfseyjqbnprrzrc]vmofgvrwxiitjsy[cdbplfeqqrpvyoguuqp]gicntinbexxdcom[bhrrykkursqvyepyy]lhpnuchjkxczxxvqp
qnaldysjxpygshfd[ggbsrjqdcbppktpfk]rfapyzecbxeoluhop[njlupwxmsxpopefrwl]xhmjoasimqrdlgjwm
acajjiclnscuxdsyxv[axykpgkepnjhrhfgqvr]slbbdyluiqetchbrhrm
ryolywtcfhaxzpu[cihbqzqvoqwayjwqtx]cpnraqtbqozlcrvoxn[ippcsfxvbyrodbacgmg]gfmqhdjmgnfisex
etevnoklfebubfa[kjvpcomfcdacfhthi]nfqsxiilqrwqianlsex[ugqfrpggyrmumjf]utvcyluzwmzjygnta
tvqkpekrujjfpzlot[kgoaglxyitdkwjmf]mlihujxyrtwfmzup
ktqkqvqxohypotivf[nsytklzqsdqgtjsrved]beidsrlrqlaaykv[bhalrlzjhvbdtjcmig]awjesirwjnmfjdslc
axgwliaxadkosbsp[hpschybkdbrmhmm]sslipdgrubjiifxzze[sptnagunoyiasvcunvg]fywdxjoeyzvwrpinmf
rhpxrkwvbmiuoks[ynxkvorcjpyldmigt]juvdfreyownzxciopxa
qlmnvnzbswfkadrm[gvgyozcjgthimuxze]ewpsviwopsrqszjq[odmqbtcagnixpgasn]cywfvmbtfcixzjmyue[ekxllezjdqxkqfxkflf]smxhvcoojkrwvuiv
mrjroyadyadcyppfliq[xunpwmmutvwiewlkyye]ppcjwembftkaakdig[fycllhoijmljdas]ghnbcqzccvagpgplb[eafwmpftuwwwoln]qbxjdgsbyahqkxqzrlv
fzfcqlltfzjujqeym[jeaiiecptdpgfsfccuc]sfsekysmcjtdxjc
jjynfbiotihgcbrojww[vrxthptqnzbjegjxzru]yethaiycpixaqfb[bplbbjoveuznxlgvooa]izorgiwsvfgporxo[lnktkblkgpenjuqu]hsizqsxbuadccikdw
qgqbnxfvfobowmipa[pgiycstlgkcvsbi]nuvfvhbouoykamjuttp
evroxuhzulkndbn[lfllzavhyovpvvcvg]kihcrzllseowjwezs[vpvpwqtlbykudupl]qrmhrwziizlifhb
zgnewkpulzskmghubbx[matncbjczcjofajeilk]gimvlsfgxcdovxelxsu
zgznxyobzrrgfnipxlx[gsazrixylwsicyquamn]isxlagxgkbtgrbjknn[qxjewpiicycnpta]tghqdldoiwdennnuha[wpwsawddkuxonmxv]bmkekmujdpmibjrg
geeoheswegiuwrrmii[hbthbiwayyxkftmbayn]olgnlfwlixhqjgjvgsr
crxkwxwfcdjitekzrdm[duvbsycafjsvivy]ysrnkudiueyakhpydv[totferyeflbkxuz]nyrvffrgktfpmwsmaig
shfruolertwzhwvfv[oaeslwnysponjvpne]lzvqqieleintnev[jdhnbbkdwzksbijpsle]svtrwqftbwtkzzixrlf[wzxzoplqpcybbhhfz]klsezcnzpvgvbxqeedp
rodljmmftzgdnxxcufa[jgqmtuwqkermnrimyb]uouynscrkxdkjhrz[hpihpdzqgzcmawkdsw]dlvcgdmdmupcmuduu[xyjvfzjaypcbbeettvr]pnqhcmdgguswinpxmqo
yrcxqglagiyyhpt[fudlgwwllpsimkfp]esvhuezhtkwulzmut
qwiwjsxdiblovdjx[evezbqlggluydkth]xtoftegxpmgjsgn[dygxbbfgcnrlaebugya]jvcmiigduerloizkyzq[oyfqcvstibjtqcknk]sdykrdksunkdurm
mlublposwxvdmcasb[mmvoctlqinqyogj]lblnmvdegbddxjuuij[vlkyfhcwrywyksv]epprdwoppwnazhbfxs
xidpschespoxuwka[lifyliiagwhtynahwr]mophvutwbflkblhzp[ngfdfvwwlfuyujsy]pqgdfdrrwonjcsxyb[txlrkdplwmwanoxhveq]sirdziimdysnzdrzt
khglmzmqqlgtsoyuyk[ckwowqtfatmitmx]cqsnmpgwitnlycvr[hcjwrehoqrluifbx]dvorwhvznwutwctl
lsjtzcpwlhruhcyvu[ppankbohskraacy]xriyjykeufmypvpcg[khfkqffqnnzsskbvi]exldjyjnsnxqgfxg
cwilddndcerivvgcot[pwnjzedgzbwjhwdngiv]budzscutbkzehgi[swgapyqpuwuqitke]aihrettehkbulnndniz[ladvxuqplmfxnwm]zovkncitewbtnxao
nwkbypvbwxrhjccd[tzjkzmgvioaqorgsan]bghmwniqqnnugulkcq[devmzttwdxjayueapxz]pigrhvuthflwfvyghl
zxoysnouzggrhhygrn[wvovlnwttrpgnub]tflqcvvfrhwiikpfp[fmvlpmktaybiodqon]sawjgpmqugnvancar
sfhshdpjhpscqgmcx[elzcuconpnmipksf]qebfhzrzjddpkrwy[mtpfmfwynqlzlcavdjx]olgxbalbprtdnjl
ribazjlrsqqorxkipi[rkwdafpcbgzcvveipl]jtutooefoewtkwcolek[pddkdpvzyumbkuci]qyeuvqqxiqrwuzygf
eobvoofynuxzuaudo[icwrahzvyvejahwlbq]ewwnptijkewsppx[bmqxtgqmosyeyhcbsvv]ojsamjjroupnfxbygrm[yqqusonrkvfmwpiwo]nueolsbydgeyemas
vdmbxyiptwawwgfxzh[kmxqzdwjfyspqkptz]hkkuurdkmfzivckdwp[ncwldxetviygsqga]oxlfsqrbntyltzp
gewjydarttmsjtqn[zxbhrkxlalwtmmrgfag]ouqpvnvhrcsyaepju
iogmaqbbnpknpihgdzr[xddekzhpwasgjya]qvqeqqyfgmcjqlljhn[yqwhbjjgtlspllovxu]yzvhuxwuqjnqqwu[mnqqonpvybsaxob]emyjayuxxbvtumvsc
ompsdhuyibxinkeelcw[vcyphnznqaeqzcdm]iqpgmmktiakqfpiejnm
ciowlwsiatdaewieita[sjaasprpfvlolpah]bpeqtpttkceukaef[rprweenazfnwtmfqh]wedhtjlhyntjrqw[hyrqbnvfdzilazmclcl]cnzbapdwalrxcbd
duvtrfezztrbcbrpkwm[vtrqvfcxuueqcpbx]xmjukrhgfutvtcyd[ptqlpgejdqamrwxxbl]aavkmmqbqdkxyuwpllb[cvtooqdwzcluidljfni]pohomwwnjxhohmv
ieozeqgyrtjpfix[opyearfnbegqcgjqve]ljeerzciyhyvukdifu
awjmnojyjmqatcnnr[hdggsjlyjznqadyuwg]gvkbbwfvbtwwfjjnpa
dvtdsunzfozfzmgbost[cvhhdpznusqmedy]ayllrpvroikxhxetks
jyyboehdjvkufzixpf[ijsadnufldjduipx]zmcubrihovbjtdych[vtmkafgmqunhknoqttz]amdwppzqbnylhsi
gblfvnsmtqowxewqrzx[kzyxibskmbrkunl]nqajypwcmviecsn[fvewudrwzvqashspitb]docgbflbdpnxxtin
evhfjidivoswuxhsbd[wmxbybthkqklvtfekms]xnnifuivlakbrvkfaau[upixryknmsroqfh]tfaezdhmvigabvwfgt
dvdsnwpipghloop[diwimibgyehecqflqtd]tnfzbffdhkvhfsbhq[rtmprhoebqdxppae]gczergujhbzsgdxupd[ezswzkaawaqhjcdgfl]jgwotzkgibphpas
oyuvlfvippqkkfxsgsi[jkfszneoxbhkxlorzz]rmotcrnupuzltlqurcv
olonicnsustzovmd[kkmgnznlwjgwkkytz]usukziqukpwigcfvxw[uveqyxukqkusxuz]aqojtdccmpwlluelsyf[clqnppgmfzwrtlfh]obgkzmtyhlcounaf
bgntejhmisbzfrblik[nitcxhpegfmqugmlw]rcwxgxofqbishzhq[jyzbrgwyikdrbof]gdxdwgpsfmmqejfyodp
suumjpqhafxvgmgdokb[lmpsinjodlukkfk]jhehvjrbweyoeivfzt[ricjsiwyhcomnsgltrs]iysygfjrdfebsny[irlxudmuuykkcxj]wndlninlcnixabgs
xusauuaaldibtqcyn[hvjidaemmzaurmyyk]qxooscxoynakekchbj
xilzzdiyoqrwzcnwklx[jzmgqccfobvufhdfgha]lzkfzklxafmroamh[xxdzjoeflrhqibidync]kuodqrpntknogybhh
zfogxhqdfspdmvxtuwp[fshligclkdavscty]tkvaozljxenzeoj[txujxbzywfgqkyfrjh]fwwjvdiaceuyumeqscq
iqqislvjgveszvnb[qbfceykxhcelnwes]mgbeubhjgaydsrrps
unvvlzfszuuztae[ytbzbzacrvxlksvk]aeaoeugpmkydbixbmv[nzznffshspwmlkqig]hwamlnoeyfmzhrxmbi
eyrqyerdzuptlwfz[pgehfansstewngd]vdlfglsqchelite
irwhlxxczsizolo[mgrotoelpfspnben]xuboaosbbqvskeooh
mvvsstnbgtaripcmiv[lqhlubezzcqsqoh]ofqbajkawszexqw[pytqrosnsskcgmno]ceyhqvutvgwawrao
aehuceoazqppxdvj[fekwbrgjolkkssozjr]ovwtwkvvxtwlatlhc[anrzzudeipqtlgvtibj]djkyozdjetkxaxrg
qdkosvyshtjamlw[nvupkgnksmlfyivlaqz]vzjxmxzwetvndab[rjtknjbarestnsqar]emeeqkvpkwwwbpbyho[fxsxkmlskjyvniynt]yxdwuxqranfmwae
mpkajmbuiqyysjiqxg[gmhxmogelodamttt]aboupdcqcaggrmjwo[uqmzyshqeruzquxxez]agzfrbsajxlgzgfueb[dxxqiqrjkpgalcp]qcqyeyosztojwikdqo
cwzcxuvjuongdoellki[pqzhljdqxosuhdgqc]qqxxrckatnjwvmdjvty[qdlnrwhhbeldxrirock]kzsfmkvvjexhibpjfpv
xqxcttuxwhriomnnarc[hrkxvrjviqxxeih]ofnkwkzmwkwfbflu[bsjloysawmfoigzrsa]kjajcjknclhkjofvh[jtocrkwufebomaervq]hawuelpfzimwdnxens
axhzhgcgbqdeauomnjz[hbuvuiuidkykmvbd]yjddakntyygztrc[mgxbjwjbkzwnkybcgch]orbyhhpqxylsrzu[mygxsbzjoicfneimx]jddqvyyavgguqlqk
sstrdkfdyahmpmolvuh[nuhocbdkubnidqy]fnhfqdyorbtzefo
youjjtvznztbjozve[vcsiywlpdylxwpg]saiwvtogtdayorhni[bcbwjvcnlvrcqbeexf]cxmaphpnniedclqd[ilghtvdoebmgoykzmjc]gqxcmtfqougbpixu
jypsrripwfsirlizywh[qwqvrrfaltcifzgrzk]urwxtgxsivdxexc[hxqqrmnggugvdgdcle]sirkwolflgudrrwfvnr
jczbvdpvkmrklaxdh[iqwzvnjtjhmulvo]amkhoscjxrxkvtrlm[nlvnfnszosucrhvafm]dpkerwgcehqnmxmny[xabxqyrisiuhudad]egbjvaumucthookv
shephwsolmshfqhuslh[iqeoxejhscbjknjkgk]ytigxjcdexjgptz[mdcfmxfkyxnaaoixuv]ltysxdcxashhzrhfzcg[jrjzihjbmjzwwikgrj]zkrlixaauhydpmvpggc
hdwtqxvelsuakiujcgb[vrzoeqcoqwpdvdxrly]fieebtoboyeztrohbz[unoqhtonsyzptmpgo]bxsxkyquwwdwyhpxcan
wbxdrndbjpmgdewnt[hnmfgladivxjjrhgx]hhwhdeyhnhtngzasnm[eanqualmsluacqejow]wtycyvqujeitvrvtkhk[vfabcjjiloownkmsa]xqjgahkglpsjfcryzv
psxpjyoleoctcjgpwvw[qkiussudbvamcbw]hbauvxvnrwhyupg[jbuclksbbwmdnddkn]phqrldjcwlixcghiau
oeiqnisrrknnuqczk[qhtdnexhjbgdaplymaj]fqqywiecdftfcpfnkrd[lvlesddgirngtuo]mfvvfvlufkoqwpwl[hljsgiuexvjatvztcp]ixguvozijkebslzjaco
dktnilosvtkmvltdwd[vznigqxsgvlquhbquk]uinsbypzarhkgsgce
ljjdiiuiikwufjnnvjm[xjbujiikgaghrijcbsc]escofoimfyedoist[ltrrqmdcekykivhaz]xdiijidhpxdgqbtxue
lfwumqctskgwsfvhl[sgtnklskhazwypsys]bvjxbzrabgfrvyvyv[rlityjbenmcoigrfmfh]wczyjwqulaqxapozcnz[uqbunpfwhfrvgqcozw]ktvibesxhbrooqt
ammvknbggljpkwpr[vnrtrxiwcitskywiw]ubyickjafcfifgupssy[cbkzhebhjtdbsgct]cgefqdgpdpcjlzrz
wzpaqedqkmltsuij[jjuasmpwngjrynzettu]dtmgfvwtyxdfqce[usljscrncmnvrbb]tnevcveidnyskzs[ttmnmxqodycaikjio]qfhvrqvqpgjhkaaicj
apdywyijusgxzfj[sgbhrwbwywwisyg]ssiiosnfconncgiy
grownnednjxvuew[iniatygttcdaelocols]iyzwgdboxuadbrbooe[tojrecocburpdzi]oelyopkilwnsejur
hfdpohrtqqyfntpfk[trpnstnxymqupxjri]lheljryczqxgvqip
iielceqagqfksuqpzr[ollobpkbzanfxcjuhrz]jnxizyaoygzbzciu
njpftdmpmkjwcngeot[mocqjgcycgznvcqjv]aixpwfggjyqyemoz[fmklzletfvqdyvvg]mznoxpgwowvjjmus[prrehzdyfwwuxvhl]hqppujbqaizlzvv
vbjenrifdqsyzlwga[wmjenjnqufhqohvgc]uhrzouilmqjnjigwpa
vwooqueyzrusban[gjwcwiagfwpvrct]vfqlgxbhucjhvobi[bkbtechiapvschnh]vjzryzyisyzyzewdy
udumujkujngtkcfv[klinhdudyghspdsga]gxavvcsxqxvaziqrmsm[htseffbehxafyhoars]ghilivgeuuzjlmih[vtjpcrmvldjluqdazun]mebwzbxywmrfhet
cwkfdzyxoayxukcgdv[wamyytyfmfaucrko]dchdvtpdkeonmdqc
zklwcknfrvlblaamoo[ndrnobufquyjknl]dnxgeqvqwezfwky
zbqgtpvsqcteltrs[uwrmlyjkcidsfdpx]cgaobtbuuntwyuhxmjx
lbbyafbvhsilwmjivv[fkftqvaahnrokuhu]dvgaejsxgjuwiemu[yqopsyejqtvmlfxm]gzuulybydsrzhigldh
ficlcqjefsddeds[kfkmusacvnqualtppxh]drbsbqefpdoossbkyng[uvpyqnoidjnssjobt]gsheeufqtzrdsil[jbvevjzeugpmopo]nrgxwajuatycddzwr
xnhrhgadoziectoigmf[jwudbvxzwdfuubhjlt]lupnypmntyrvwqzlb[vvfvttkizuxshnhhw]lfdrjokdrbrcldjfs[wawjpqzozodmnmah]vdbjaoofkmhkjbphx
fsymutmdbqyguwut[qvxhywjtposhjgwuhxg]ftwhtxqxeicsrlfye
fglgkrjwulmkxbzolgn[vurpqcvuydmympiyofl]nbzudjasxeknjid
nbtrkgsywnudokk[vurfuvkjdvnsukh]vkmqsmcrotppqorkah
iqccpqvhiesnaohkhao[xykqfbmojjnscqhdv]aqlxkvudzlrncmpy
dtlwnznjqsixssrsaii[vkikcmtsepgtyqhica]ovcpoaucnwravbozsg
nobwzchgrycgkxc[tqoxhzxeorivdtdkde]ctdtkwzsvuxfgjtjg
zsknnbedctklyuxngn[jjzvkixpfmskcagh]fkvhsfuckghltyqk[hmygppkjpcdicxw]mnurqampwwoiiynr[jbkvqeqrhnksizlssff]xhkxiwlzgvjdfakjg
gqbxrvghncjdllxtge[bjuwjsvewzvrgcujf]tkrdrbempmwqujk[pmbtbgbrgzpxeoqsxw]nfvaaumgpjysgtvk
clfcvnwzcbfaqaj[prmpnpjwklodeukzznp]zukpytpqzgmlbvidv[qhfrkjlsbsqufgnet]pfhfcxzeiowmgiyksj
vogrpuzrevmatdbqqx[qolpybjnetsxcqfcvbc]ixxogojluwsdsldl[bztslfanuylwdld]xanhrzxetowrgift
dqrkbymiudzhkgf[spvsqvyntikovrefqc]bzltachhfylbrzl[znefllzixypjdkmfcxn]mtpikjxqsppxlal[oeyhdcnpxvhawqbmkzy]nxhshzdshsiercr
xmgedfiblpeazvgkss[cwbtqqjoaqbrgbptah]clzsinbtqsrkudymf
puwqcxmsuxnmneuzrhj[dbljkganxzmjvtxgr]ekmomoccimbpbieaf[khezmkkqdwkouzb]cpkfuyzfdfxhhhuhk
thfdbnkmqrektilpc[weshzvpsyofygysio]bffomelkkwvfsdxa[owhidyrjieeietzn]kmeqgnvyclngrcgquc[ieikyuuoliuiczq]nnqhogvlhwqipvpiao
zsdcvcbtwlzlzlmteky[nrqtpxoefofrjeaf]myjmnezlzkfcpmik
afyxnybelqewnebaai[ddjgeajpzswwdrg]qfwfqryofesysiuznz[ouajwvymsxmxzvgdx]ryuvawdhfmfvikye[kuovduidpcdyepuoq]didoelcmjebmytdyke
oopihddimztsopfcia[udmncuvhkvvbcmxzey]fpehwxjiczzhqcxxi[onmizmkoyhadrxpsemf]htycdbotvmomguwbttt[gjsdzuveiuvudbyakzw]ramxommwjmpkihl
bwlccfsaovlozdqpsv[dniiqfcldfhjiex]cdzbfrecwehrluxzprd[xpyzvlqwekcyglksq]dncoqoaakpgnbagf
uxoopzavjdqdkaz[exsbnpbaeuvusypih]qgojfhbprpoavcbxysa
mailxensjcsuodzpd[ftitdguigzeundytyp]fgoitzvujhkjynr[hnpcvussglqshxn]debsveizfcuroqrm[yeageekyjhilfwr]ozgpzusfpbyanxnzuak
vxjnjaguqlrwoxlhfbq[zlqpitkigwihrikvr]dysutdfrbljdzjgcw[eslbaxzslwoxscpgoy]sudodfmlfyuczzf[vsthktidtghtmazbip]jfyoxxiaowptvosevi
lgxmivlggzfdpductjg[qxgoioxsurcwayndy]uwlgoodqsjoxsjqqln
qognhfgzowjikeqz[nkwezojneylzwfdm]omduvysmcovvpvse[bwxvkzoqsykfils]jwgfmwxajhmggos
pvuwgxmpcrqknzpbkg[qbpmfthtmbkmljnsqs]zmplrxnulurhzvijupv[tgsommhtbbujbjpf]qaxqxdxmpqwduwwxpgg
lzlrgghqmetsmcxd[fjffxsqjqctkxnw]zlzlpvksrpnatxmh
ayirfkbsdyssjjpqmi[vpkvhbtreetyxstwcqp]rjbuxsgsrlqrdnpyg
ukqefgljywjmlce[nqjcndjjdwohtizoed]njfgjjqkdenohbwqm
kdwzhrslryuexdgbcr[hmbcvmrrmbsvyaii]bqprdkrgdlwjvoiyb[mqbaokwptkfmxzqr]wcauinrezkhduhcktrd
hbtuzqvyldtvwgyumzw[dibedlwdcjyfngungt]towfeyxyxixyxee[libuilcfsdkejjl]wzzxfhwcgawuhskreyh
oxjkoqahhqqcxcoxksg[bouywtiajyfmanxcx]xgqpjxtkaejvmqckkuf
prhqbaccndsoscdm[cuayhbnfywztddbvww]psgyhytgosopvbbp
dxdtcskiowtdomepjp[islofsowtuyqvcqwb]pjhyaudkqxxlwfoo
vdatepedgnvgpah[jbooucwxtveomnpmyx]ixgsuidbemgmahtlt
oncdjplunkvqphbyb[uvivlundxhdiwjncfq]dvhypguriulrangqwr
vipebvitwbccsnahjhu[kpwtbwddwqgyhnkjsv]acfaqhywmwbkmgh[nryplosnxtbkpwxtkfp]njzhnytzwlprvfcv
csvlzvkinldedsxt[dbxoceaaismltmspg]yomriudrxzmlbbbm[qilkpyxcxlvtfzqmw]rhwekeawwpyngqxzc[akqljrphobjicoco]utlunpkuptawrtfcccv
acfepkrkhnviixe[cvksybusnhacmfoy]tmqqmgfdharutrqvdpm
hjehtfbextjkaxilhaw[qvavsivlumfavaafhqz]ahdjvprlhlmuneewyxi[rzeuqtjkiuacirxsw]ucmfkrotfprypzuyqe[rutydtgtkppegdgjn]hmvzjyquxtydoujq
ntosjqtunrqfoboek[aogjyqyzxpdgopkpbx]sdvftoxtcjefotm[jivgsxjogxklwkhm]cahcjmgzepqebtn
omkznbrlrodmtmnhwsu[ysoinknpnzrjqkf]ybiqtlzoiohtldgoaud[fbzfiajeahzmiplcih]qimubctnnrmtwro
drdygweayxraomiblsc[oglpuxzweqpofwi]mbipxabkjqcdscltkh[axbvkumlaforzbqy]ircpsgstqyzpwnv
jefmuplsptisjqguywe[lkgtuysseapteszy]wzcehypttzjhjfp[nkwvzebjrydcwfkqne]tnmaxtrhvwvdnrhpxne
elfqfvbjutssktxpdo[paguttthfghhyktkjjy]wkpqdurcibsvviqfqpu
suzpbjqdiebctwhb[gwnbzgajwrorqcx]qoqdgemwbkdpsqgjds[qgozargzosdgbgo]hbsmqrwnlqsdans[vhppwpwwamtuurulc]ylczevsobuxtdhvyg
qfixarbnawmgjcga[dhgdmxcpwpvycmwl]mkqfghairqabhmokxk
srjvnnbutjaeikkbsd[flieajbdmghmuzp]ieimmehrnixqjynp[rjxiepmrhwrmrpi]yfrfmlgakaehvqm[hucfgczbwdpxxuhk]bvgmehildjqbjdu
qcmjtgmmgybxhde[fvpxdzdmzkhxdzjfkf]qfnaclxnryinmvpgr[pcsmctnmmrpxtfgi]oszbhmhynpzqvtxso[qhpljywydqpnksmwzdi]yqwxnvgcwsdwuluiouo
vhvuumgtzbrbgazpo[epktoekzvomswsqq]bbkntocwjpaxaoc[rnlzbqxqcuyltjxepz]iaelcpyexpoqavcbepy[azyksbvkvgmgimw]kvknvptkveiacqnzll
pkkcmeinlwpoupwpu[qtoyfabmibfrubvepwx]atgpzcehuidgikzn
srwntduyxjkpivzkgvl[hmenzrmnnisxgodof]lpuawirahbvibfki[gazzozitxhvxixvc]knbuydfpbjzupju[emzrzykcaeukvec]grtwlnuzmqivnvknug
vzlbpuiceftddittp[srespcesbfprkwuku]bslyxxcynfqywwu
icolypvmrgrhuvj[fgpeakrskxaljnakz]bqxravyjmdodsvhf[cjyehkcrdetiknsttv]dhoghrdxmmzxbjtbql
nowswrulawbgqkmcee[qsktncayiihoxiu]wtsjxnvcxdriviyn[tebqonpavhbfnwxvjc]tvpwgpgrozhtqtiy[lhagntjbctcsdejajh]aedpfftlvvtmaqneaxd
phiopnkoxulhkaddkxv[ueqfevwkcjwpcmsfspz]zkcoexersqysbtqdpc[nmcsonrswjxvdtuk]xdrsvfxrrdrfdbny
aosrkxvljnapvnux[ldzgwtxmjbynmlp]yrxxllppgosniqv[prtvqenfqapocxdrlst]gypcighnnppaytp[azueqhhtymzpujx]lsgvwvvgctkiyvlc
rketxmupdbmrircajep[xfmnkumekemjnwki]zurvxfxnrrvkmkrhbxh[lsrwyjtfjairiuwbaw]dyvmozkzkcvmunw
crxtvtdwdxejpebbv[xthcfmihpjqbhrvqfkd]hztqefpqdtgyhfzqsi[nlaeacaqscestvv]ylbteskdlwjfwru[morvntwyebnmswguff]othonakykxxajuj
zclhqcnlmxsurcrqaty[stohpulyrzcbabnydyp]veajkekzuxjmecdzym[ysujzinvkawzoqi]hfkcorxooelnfididyu
oejzfesyaxeittrdh[yziovimnkfkadiplm]arzmtikoiveyvlsdkwd
wvdwkqqmnretidj[smwnemzwzqhclpkud]yzguktkwahnuabs[bbyhgwmhhbpbwij]qstxwyfjjagyqvdaexg[nkerjbdjlikfgdv]qortpkyhpqvvebjdzw
apdkznwjfxwdrsm[fddlqepbyrbrfgmyeiy]fvymcxblcjkcvpcyup[szsfswjdzmcabwuz]hmutpmhknvwrlwbvs[vpfcztrelzjnqzq]gqbpttcrakuedsp
sujqaghlxszzfxf[jqybozaufdtanwa]rthiqanlennnowvdkm[elvfekcowitcout]ntjaqinnbwtqsctwrz[axpnqwfjmkocafoeadn]aplpjbnhkrcrbebmo
hzkbvadkdojwmdmdxq[ohmqkaainyaufipcso]zojzxelggufdascjz[zlxncckagxntpzqa]kindyikavjkmhopcnek
yjcsnegfsmmnfce[ueladqjdaqflfas]wcifctlledgnvodtlzw[zqswolvsfhpyrcivk]vemkuyjebqxyahb[ydjhmgjxmruwwmq]cufuqsyyytlgbpwrj
jkkrynqxqlgxukyfv[fugivxklerausdl]shcuiixkbmzymoxv[thtakgbdzvjsjsera]lmpwzqhthoottxvp
ncmijtczixmeyfuhspt[ixlxgrsyxrebpupt]sdoinvpfizdezpc[xckbxvncmseucrzjo]rzxfgqlionzaeocj
xmqnycsovydhyaqiv[iuvymmaguzbrtgs]zhvxodssnpnhajwzy
rqqzaaswdepcnnmqfif[pzkyyjprisjybnnjcq]kqpjhykszghcripq[vgdhuqujrkqljuc]qhtxqkqygazsvuh
qynvobsdeutfrvb[fddgwzhlhryauxzb]etznfbueibykerqfugr[rviezfaehsvigssm]nwhvctxhqvfdmgqe
ihonnjncwrkvglabk[pnjachlnpyonivmjtc]uoxellmcbixrdsisuhb[nkwsdmhisjdqurn]bowvauofupqfmxf[liiytxrcuwwnimdurys]acluoarkxopwppv
ipqsfckjkqxkxyuvxje[arswyomsnfueuwmcbev]mmlwwcviicdmllylq[jnqpolrlwmmccsd]nfobgtdlxveuuldt[uebjwwikiebtttgqss]ikdxnjdmzbrpqqvw
zhjywcsrtcadzdrby[ynasiklerbnlgidest]xhzwkwypktpkqgfyh[fuuxtaekwjpobdjfvdh]jcsrxmtbrqkerkrc
osahjtbzrqukvphpe[guutbgosbfkaurvuf]baiwluaouikebnlgf[cgssqcbscupvvadpbt]lxwmvxorsfcaorccxp[jcqzcrfdkncuoqj]gbgdolqdrauivfnsyti
vvqcdtcodesyomh[efjjzleahiejvczmsd]naeosnsaltqgjrk
yucpovujdwslgdczxzo[fbnfueoeatnphvv]gwegeafilsbwgor
thfmmzylspbxupt[asfhmdmkqwnqppnmu]awoxkgkgtrkdjzz
ghbifboivgelqxkfeo[gtpozhzqfntyyoodc]yjqcvpimanwiunamfh[aglylsuuakjkmqx]edfukuqcchtbhtblcf
qzonwqxjkpwqier[qmrnrkkwruteiijirkf]xhnrnahamaegfla[fzshmzjiczdyzqhwx]acjlrknukkbewao[afpeaepzoljqxcwvs]dlvdxhsoljmqgmvzf
mzibkpddgkilmcwcshm[sgpxutpcqniuckl]kqiwkwdgydpnjcj[exyhorurvawneziiy]njznkaphsmgisqyujms
xgzabblockmothpuxc[mhiwwhtpmtbxowbnp]aucpfqmnquiggenklcx
rnhfshqrlxczmrcz[agxxpteadztvdfeo]zogmjfpebldprrmqg[zppblhkevlkqlyie]mgovaojjsutbwtpzsm
kjgtqizmvuqerhb[dmhtzazyzqwjhpn]knmrbytrwrcsonmshb[oiazannnreojooa]hkhackgpdqgyqsgnb
orhnenfhsjyibqacq[tznvydkguvcwayiwmi]hejujxsitqcaabjwskl[qhpfmxgjdfgtgmy]ahilwlhjkfytezctsj[ewxepeeisacexgtc]paxwwhhpaukgjnafuwl
mhmfziehhppfqoocvju[hmfnlywpplffsxwzg]bkhkauhasnuoglve[oytxewvmknoqchvy]fyodxbpsytyeltnfsl[wojcbkfsswlcuqcz]izcrkyxzjclhkfuv
slabudcjhktddar[cvkvaakjffjjovgus]ahgxzdctihvboiarn
degyynefmxidnbw[zcfgkvupltxmbhroi]dbnaezqekcegyki[tjrnhpsmfftiscppybi]qgyifwlhvccshdiqfx
sxszfjmiathxoqnxg[smizlxpwmelqjlf]etoglecoddmflqma[hsggyxsxkhhshucgtnw]oqzadjxenphyexaqrb
kqwjndajvawmwxs[fskyhhktkilzwjtkt]ufpvkdnhygmuzfsfiso
iqdscwzpnnwehtqmwrd[fqbmsfrezrkhqcw]gqkpkiqhtrjpusoefg
bhwbuaqjofxcbuxrqub[aaanhuielrhxhlzscv]fkgimzkootysfzwcan[svktoznaqxkkibhigju]fmqhtjgxbrovymq
pjybsukpzvvyouum[rzeunjnideaseer]ltquzytuezonpowuhdn[wzwlbeegsgtwpzo]hqivrviswwfsdmpgnz[fhabjemewetsjrjhy]lgbwcozirgljoudhng
ampiucjqxwrzbdtcjnr[ufubjvykdfixyzqq]mcxabdvjzhohlcmcu[xihctxapmjpmrev]mggwuizzzxymhypmcw
pprbxhbjbnlqecvmu[ewuffgnuylwmrcvkbku]bntyrptthpmexiakh[lswyqkuxrfzokacp]rvkhcgbfnjivaagp[mnpbbcgrakjlmdqt]bujykhlbutiiqyke
xtcidzkptvkjakxl[kwjzzydtkvjmqdz]httbqtbiyxwryblrfd[cyjwthdmalqkqvso]knfncfebbbueoqze[zuruluaalfysbnmf]vodfiptptwqpnllvbdf
wtjthnkscjzzqrbpc[eirytrqekucxajz]ghycghnyntrthzkechc[eiylrukgxsqpetjfnv]xuiymnuzydlawjygi
rjrldatkdhvzvgcux[iuhectextisybzvz]vycerefkzhnmdyg
lqftkkvpvepilrmyty[uptcsbeqtmcljaziisb]himkwiqkrogoyhjpru[wxocqzrdgaclbeefd]mtytxwskqznxgpfex[whqbcssppfhqedhv]cbtiuzgbvptcticlbcg
pbotpqbiqdjzsmpbki[zqcshqinikcszjm]xjxijypculvuoavvg[nltkubwokrppvzifi]dmedgmkonytjzzk[obonilwwerhchueuf]mlfqiwmaicuecljj
exlndpqjplyfdbmvlji[fzzvnaszvmpwpdcovj]ymothxghgfddmzqtglj[wyfqyqwrhanponsr]ydpntagauckmdqpjb[icumanaybbefssdjnqz]owhsbdpufodsqezginf
ukfirftsouqdsgbgmht[nrkpwksebkijlha]zfkumnifusjysuzt
uyzxwkcgjfsekdhktx[qhgrmuyjmfmunghm]mgjbupndudwultdnnt[oczntpgnyanxxgdqx]oryrlqkmroilyca[xbevednhpnvzzwmrorm]bdozfrabvamfxae
toqvrteazudmppbrxct[cyiebroauwofshvceeo]fhoxdufwnvmlwhhp[xykvdatsfccxlfmn]zpqqflqttorrmjs
ltkcveeqyawjrryerqa[zxoihtpkswzjrhnbvz]cfpirvnjowhsnnbehd
gdiyzvnydjwhfzrimq[lvieihnyxtdrgrbs]kpotvolpjgjtfiqf[koloumkhoyktylql]cxgmdumzkygpppqe[aywuzxkrvrevgnnihh]uplcpitzxbcqkmfgsy
tskqojnfadpujfxym[xomwfoclpvyejczgyy]lkmawlhwgnpccotaetj[fvhbgpqqvasfykn]xfxmjfyoygcsbxl[ldveqjhkzxczzgxhbxh]tfpibohzhgrythjgqor
xkduagbswofivadpo[mxlqngyjwbqfsszj]xoxngqbxwsttknmtcyk
zvmlodxbacmwvdti[itdxiimzuvluomfxq]ymrkoyojdnsjqvl[dihqibcaznldgoteyx]thrrpohvatzogxrz
soetmauqgsswblf[hlkchnarzzrgjawosj]zsghpkoexwcujpakaou[wvfxggiskbpgntosh]zbohdymojoxhndfr[qhyzatgvedhoibktw]iggjhmravyoswvu
mwjmmmeiclpjmvishbx[dbmbrjcjcmbnqxq]mvhzexhgdmmnduc[yiccjcrvmzjvygs]uyvqfjmiyccasgzlz
dsfwjqahjoozkpei[olrrkslvxvijsyopa]jmzojmvqtzvkhaxukkv
kudhszsgsrenjqcrbp[ipvxqnbradyxoline]srcnihnhywqlietbgqv
eklfpuufieqqdfrgouk[ycxgdyairggpehtkim]sdfhxncpiqxguzlqw[ysjhhepmruqaegxp]wklvpveoxxfyizmf
apdypwjfmxhjgojtb[zojzoufhucunvjr]zjpuqiciaujfbjta[wlusnbuvcffrnac]ecaccicpvcmbomsvf
wenmnejyihmxaxdqwqw[rckytszqrgaxmjpbqh]pngxudjgdtbshebyv
ieyarudhbjrrevfodgm[grmjubbiqdodhae]mhzexlzijmzpltsxjfa
byfyxjxqlcpjxbpd[pdqkhutluqjoelb]pberlwpeqxmovie[zkholwknvgbfxcyymye]askmwovcktpqhcg
ccjcygsnanyvdss[frpxggwvfjuugdysypg]tuqczwtmobkusalqusm[ignjrlsysasfmzasa]nfpomrlygzjyylhvypi[lahpgasntfymdoub]rlvsrtudkvhtwhycf
omuyrkrubieiduzegr[gcigoszvylmdrlrc]jtlrlsgqxiqtciehh
hqeghunlieoqhetnh[unjtmdurovonejpsjtq]xtatdniykzzxpufps[ysaytzqvcxkvimhql]tyfkttaoythcttexrp
ciyuspkrywyyplmlro[myfyzvlzntivldrquq]eighmudngyiwlsme[eukgbrmtghntxpacth]pmvxbxswfexsnkxmm
gdbeqewbrhyfbfpeti[yvyiclmkwzelbqi]sktocytuvyvpcia
gnfkqxrtauwnkhfoyc[msfhopavdyhpvpttg]ewuyaxehxbyziwmxd[iyqrfiudsalpmpk]smpmubdejyevdggead
rqvcsivlxhfyboxj[flvvsnglektzosreb]yrfdzdgvkzgrxqoyv[rygmqeiccgtqqmni]frypfnzvhkzvlabrr
idyqowifirnwhkk[vloivxhtkdzjrbuuzmi]beozwodgehayklyr[cptxwcsgsapmprrp]hfrdeefhyehwwvghgdq[prcadfsulvamytpsfo]tyodjlxziwyqtqmi
tdwoqxlhhaqkdmv[cxayaazioswycmwj]pkenayaygxyrtqrqugi
vtqeqlrohgalpwrqig[bewbjgeryrvhzwetm]hpccsjcgunkysntpwp[yefsyqedopuhssgo]jjkkuwoyvhzzcmdlvv[uqczrglqumshdhkdkut]dlfilxdlomkvtjhv
fezgzsmmxdvhtmy[rrmbxexyopsrhxag]ezltorfyxclstzhp
ytcnqprainktcjei[phwarjaicrgistkt]qdtijjhbywixrie[llwwjrzrxhaqhie]ufaezqgmmdhhzjzrza
uyvaorvuqwbbexmafbj[tnpwadyyakeawtdextg]tiqechjccyyczpvbf[vaqfvvcbrowtjxyu]oqswjgtolyixytoj[ismczyxhizrzbbpscus]rtlaqgqrcxpjgmih
jzamkswiztvnelaqnqb[iptcqxmvbgyaeiwob]xnhehagwcwdgsvpomgt[jsasqvgectyfdja]dgjdtjlzbkyyckvy[fobafodakfhhiem]thozlpiakivgzzvemu
owfgxupnufaiuovcesw[jeskiymcmexnjbxrbp]obganlgvlqdczqrvwad
chsvqakwmnabitpotyv[eqeyowfftbjxdkpyf]cflqouimlafrxuqvh[vgjbvqafqyzexrzhr]mnywvcxtgsaifufkcu[rtjuztroxgmpkbnim]xsqyofncdrvdpin
kufzqdykjclolpveo[fopvuhisayecxlainzx]wvrhymidhtoldhb[vylhmdjqsdhokif]megnkxywjthliwepc
cqjpttuijfdzott[wubeiefulpuuhweqv]cqxbaudhnmrvrigogf
hkzaqueemmhessqjq[xofafbaefryhwyzzuoc]yyzaekuutvjrwnhonpk
zsgyhvutvjmrgnmar[kbxkhssdsmefafntsr]ocjxtkpqmugcvkopvsu[dsdwezhcblqssurfmlx]veiioiyfnncyfrdwyv
nsqgaufitxefakffd[brdfctppxqczvlohw]ntxmfmrsajxuqmo[pbalhistyzwnbfs]inapnupdvnwtlvvu
krtwywfktmbdobnq[msnsspogynsnwdb]efcftgrjdyygncnqdks
rrasplhwovftrffuw[txyylwsjezcxalx]voncsevbgofoiiolvk[axcouuspjtfzsekglc]qoutiffuqnorbpnlp
etyvjsjqwelcdzpnjxm[eetihszvjrmccshr]uskafocfyjorzhdx
rqfzvsuredndurz[ebgtddsixmgsugd]ilczpjzsukpyekhobu[eeciaduigoflustith]ohmscfdomzprzjncno
jjjarldpnxgwvlxve[yjoqlmnvtslexafgvbd]yngfttqfsebrcwtctf[bwevtymxqlrpqqaage]wdcaqtgkvmzesrjex[svnkfzogwcsyfxoxh]hvrsvxcpdxqmlfhb
ldwuplbjkimdskui[flisuphwbiqphsddaxk]eelzsgjnvecwedneyb
busmmdpbgxvdiytw[kwlhqlohknjgwfh]xgmkafonkyzffqtj
ngtpdikbtooilycy[dwpneelecozfzwwseg]kwkwssbtktxenqbnyfs[lekbaoqzpvjbnuvq]vhlbuorxxxxztocuiq[rscjyzvyznunxnun]jhipkmizwfpoxeuktk
leghszcprzadwpwlakv[cauvyhahnjycqgmslqr]pisyfnajcsrgnvkhcmj[ozrbuuodecumxzbsr]gtqbofuoteafyjk[sodglraziyxhcpm]lbzccqgejtsczvj
aiqnofheehbiqxqlg[wojpqldgrsrkqqpywb]dyxygexggvertuktz[iolnpmkijfefcsebi]okwjyjatnoyvlhe[zbfipzfoszigysxpwu]jitbvwjmknigdnlt
tvxhyndcnfrobfrdvo[vwbjbbozwjpolbmlkwd]kzsgbhkshipoxtfp[sylshvahmztsbngdl]emwcmnpjzydlvvknrhn[aarrocnhsmnzqgozo]uswudvvjntlhqjc
adbrrsdjlpyizfgvuc[qoimvkfjruwpheezeuk]gyjjepfgjpnyajypq
xgkzhzjlkwacqnihyns[bmprkvdabnasxzqzwg]hxwyywhnuntidvpg[mvqpemdfnvvdlpul]ttqocuncdebtomizabo
zztkzvwguaggryld[fgkabjmksknxlfhzpc]iysntrtaaweknzbxemc
ocwsupvhvpcgwehx[vnmhfmgubwbhhrmkp]hqpkkwxwwefzojltpph[bvsvcgwsztazzzjoxi]iasiueagvwjgmcugh
tkxywinosybkrutpu[eluxrinxkarduffy]brxgvdsoguiggjfemb[paaawmhcmdxneql]qtvmkmlldspsheyac
vzcnrbtoegbsuglk[rqhhdwpschucsvlnq]hzjzijxkcoxpwhi[glryptoeiosdosoj]fhduvpzlbptbehtt[yigihwrodvsulsrsh]numkgigkznkushjc
oexrobvxlwbqkrigz[nnbfhaheuublajo]pvlstoxdjdlbroezlbj[ykvlcsvqstxycpp]rxxgokhffgyioltc
cstzrhymnqxwtwpnvh[dzbyzhzvaooswlkdrof]dzxgsohzaxvkiwho
hftmeaqbiiefqtwklr[bmqfhgvsfrywauxq]brzoeoncrvljpjqxpjd
vbnuypzeryxltunvcb[ldnuxdvgfcbbysibhop]ejgwhaxwgnnbfide[okhykghpvystpufnxqr]umdmoixuvfqgecr[rkwsaizjzxjgmmftw]czzteyolfgwkrnkxid
nvflxkucsnbsltnp[iqhnmiyolnoxjzjzjvl]ctdsnjzjaflstsy
glmwwqvembkbsnvs[skbkkvnoycklltrnyrd]irlewhaeagdiojbr
gmzbjlrhyoqkiyrb[nezqwphjfpghjubnw]lflopkhihhamygznxv[zuecanynqmvceqxyy]kddyqjerkeuhuamjxcu
kwneigdpqhtznqaide[ncindqlugpdagtfzf]ctutcducslvhztsii
vhjlncnrshwikfm[amlxjsoevzrlkgoxnml]lztearcwiosrcmhfi[gkdbcfroyrgwylu]mwhzhimfdrflqqihaq
wlswesjcluvzurgrnul[iehnkjghqwvennpj]znqbjbnszpnklctx[pkxxihelrhfkiqizi]dlmwkrxyjxaumvtlbc[icgjedlkxpjwmauu]cpbstqjtdebbywkf
yxjwddyrzrzhqrarheo[dcayrrmkvazrzzlpqh]gkvbwuimfochtndis
cmqdgywvwqpfkixkga[zkcmkmqoxmpzued]iaerrfcfhcaidkkvwvm
uhwbwhbgkrzntdxrw[pchhzpiwclaasygyqn]oalmglktkidoijgyg[yugfmrxigwwqldfsfb]otdsjvxzdlsdhnyk
ctjuabhainyjydm[axxsgakjkreoeifx]qaphofrkpiflusbeecj
hdfthabpjjuxgoh[zskhkbvmwkfmqct]vmqfixzmyefzvza
wnihepbftegtdrtndsc[wtmfxwvxzxorhbj]oqlfpicrqpjgvmo[zyvhvkalgcwwjucnxq]ppatiiiatwbpyiwjr
ojaqpoarskgzmtrj[blfchukdercwzqa]anfsoaopkutqfqltry
ofijvkbfofbyadh[xmlicvxwtnufzpn]jetnmprdolywrbmjes
fosypykuipsqxaud[tbfwtcrdgvidqsg]tvmvfhrepppxxwme[qpmrvterftfxchiv]flnooydpykdzrtfck[omhwxcdomygkbaeqrfg]cwztbmysqwpqfuig
lvojllusjibvayrr[izfttqfhjethscsrghs]egzyjonmwdatznvzjw[mfxjaelqslyvkaqir]ckbkobhykxhocczot[oezwabicsuchjia]ivolkjcvilnlsdnk
acytktosnzjatmwue[medgjpfpvbiqgld]rjsbxcwqhrrklyfuu[xclxdxjcgjwkervy]mspnrnsznpccgcke[ptntxmnzdrorgoexbsg]bovvgignwezlpgoy
wdefvabtqsgstwhdxm[otahaybdinlnszsaan]xgjagsgrnziuqxjasw
cqkpuofhsousjfnlfxu[syvkhshtiyisqmrdp]vtvtzgdxigpsxcpdkt
qwagfdeyxorxoaphzt[kijseqropygskgre]tnpsgfihigocogn
nvppsgsgegzthtmpt[dsjjswqmzkoqtihud]toeoabpfknrnwqxk[hgyvhoktbvmdvwauue]pniilifxxtotvypye
noijjdbzbeowhtut[tlfprbqoqtftqnjjs]fwqyyfzzbzjeykhoje
rewfvmohscszlog[dwgnxketzlgefgf]fmvoxbzpxywaicq
pvtakzfeeithcogo[mbktbqqelkzddsmn]nuydimwmhdyhrls
qfzdrtjoipdlwkd[fsymmkclzvcdvqexr]yrhwcyjdzgwhmuijhth[zgturekjlobpmcje]eywzpwpfahsrwpwl[bgyprfkbmyaixrqj]fvhhmcltucokvqba
vbpnikyhvhqnemdo[lnyocyrozyteoxalil]phhqtzpbgpzrusr[yygaktzkmithtegl]cskivnspoecsaoi
obaxlisumjgehbkpea[ehzysfspgzssttpebuy]vwceybunjzvlqevd
fpanvbmzhlkcazo[wfnkxffkzmxnslov]gtifhhnlnnxkeaolr[pwkmfvowikzjctrje]anfzfrtlihlyutaq[vbujdswyelmwoudg]lckbqqgkglpkfnhu
ubsustsojocdyjv[obkxihfxtkbaeusurk]zmlqtgokothiokq
fpgjwchgmuuwpzquwf[xtluejeypvgynbsdgip]nyztcugwqufjpakuxkb[yanyavbmpeqlalnk]tknqteuqrnnorhcm[eshuljurljirasr]supqastijujykowxxhz
solyplfhwchyjtchjuk[wuwirpjuevkxulrs]axqqiqzteislutclbzo
oktlpryceitvhqqjqxq[ufupbpapoxovifhqp]xgrwutvfooowfaxs[yxoxzdoqyhxsiwcxrgm]swmalhlzrknfxgnamr
kmmguldgktbolgarsp[lxrqjtqbuhuthezfcfm]nhyafiyealodqrmagqq
jfowosecwpywmrwka[rlvhxlrwehljixaggho]tadphuxhvtyxkgvyru[kdwmctblkvpkral]ufydjpceosbxpcy[qkiwffygsjragvq]zlvqihgbbhdojkgjgj
fjnehklshlckrcdhxk[umipduxaengqrizo]obuxhxbrybwifedma
dzeftgulomkuwyrrm[aphjorxpuphqsqmp]nnslfcfiblaexsbftwi
eypbooqqyvqucqvyys[rcijvtatnyzpafpqhwi]jrpwrlhuiihzfwt
zikyfwsyxwrtrgdkjh[netvaemiverwhfctosi]xwdoncumksuzsryj
jxtpnxhjudmsotudd[lgvfscyjpngmela]wumifhvbwbmmticp[dvxmvcccimvvcrvpist]czyqdmwoqjgnfvjuxul
fvmjytywcfdqfmfvj[nhufehmupvzkcrtewz]hyxlzunwnjccnnphrsg[hrfqmrewnweuyulb]hmqxiwaqfebkvxhv
peqyzkuviznbwojhtys[svfilvdawzpmtygynd]fpfggygzketpcrrqx
ttcupspyysrbukznk[rpewzuewspsqthbqb]yszbsclsnmbgoazsfl
vwoufilgfhpaqfxt[dmlwugzgaywwzqb]rkwtuggupfsffridmux
faibpioziimdefafugx[unrfywlgqlxqmwtxrb]owzarstubtqbwwjlh
mvgbokjnhpcnsgcpm[vznublzcbsgzahkjprq]qdhqdlpftbetdzckvs
dgpkamepjkfizyaknmw[ctdimkbvwctjqcbl]euwsfdqpvfkrxuwr
rjcdwjzbrqqqqljqj[vsrppwgvlsokgpn]rxpddxouefplfnctudb
lhbnntitpjdtprbd[cctbkujpuoegzrijpus]xbkzdntmvzbzfxljvt[brlovkywclhnnoyrz]rhixzndklgudnxkr
byahaivirlqxulwdoe[otyasqivnfuwxmpn]vzsqfapigdecsmaqd
myozxxksdnucpxq[jgpjjngigboxsoy]tidzlszxsdbqxba[lctczcenpuntfjnf]hzdlcamkehorgpz
uoylyvyljpnzqimzgh[umieqlmcsmhnnxle]zvxwqjbaemhtoexyzr[gjyxtenkxacukadvhfh]kwagkgvaqklyfurjnar
rqzfgsolwpyfzeg[fqbhyjayacblhmm]egufazwxlncxundcyyw
eexntdgtjwjtizhlc[havetzocjnmfnpgzl]rmeusmuumcpbzodie[efuqzkuscnrbxwef]ehxrajahcfdggjyq
ozakiysvzkycefw[dcjsobqhxqyxnvwz]yuoszalpobgzxqk
pterhsdeyetokcbtzn[cdooadgsexdxfzjmo]xdxrkcynckoeirmjnlj[matsfmymdliwcqlqf]llnuahmiztvbbpise[egvzoittbupbbqrvd]bantcrmtkbvvbxi
tqpfhtrunndzpsd[zjzqvvckxscqzavcig]zquncdjejdyzegvcm[sxxdynlbdymictrfspg]smgkjimutkedknlppsa
byjykuzyigqofolpgf[cybrboapdfgimjwjm]oczicilrowczdlcy[tyaduotkhfvyatb]iklhgcjvfdyypdrdbz[dqkfqaadlcnxfofsvw]syuiaqaemufewlijxk
flbmovywhikcuedd[xyzunixgypmuhyj]loihlyylswpxtenh[jadvlnlzdpmoghiir]xbiwlfkwxtthlimngnl[vgtvhphgxfsshkgkb]vttcixaajhdcjnqx
xxxluypjxxutqoozzn[gufawigbmnhtmwhcgry]yaldvqcedheoocj
seczijwqqpigqcchnz[snihttcoqeotvsvxtsh]zzgbjkslldiespjeejy[dxpgxigvppgnnddyd]hcwgvtogqdyllyhkqj[hbkamssyyusrgbg]dnnseuhlwkwnycktlu
xeupsswdnrpzqvl[tmaszjcshsavymzuog]svjeaxmdkgbimlv
dktkcbqwdeomyrp[fqaiihosklfctvufhw]kscgwrylrgbrxjzogj[hqvwmstcpchcqkowtxp]xfooorpnwwfrqstxft[zclwozroattjxczqx]uwnclgxymympirm
yohglmwqjxpcgozvfc[ojnlrvpzwcwgnfbvf]uwjufnumsvqwxpg[wrfczzmahjdxdzhifs]psipfjeacaysvubcqqb[paeelhpmpjlvbal]buinqeedxmiijkxpcpk
ficdlwimcpzelkxcb[kyizgumxqprpckyyh]lcwwypjwqbzhtozovh
bycnifysnrtdseez[xombfbujijpsrccccl]tbvuubyduxnascxjkds[gteskflapsthkzigcet]otggllmgcgfgqloehf
wvrrowjovflnwpjhhrj[dqfmznuqmmttqtdqnp]wevjmhhfmorcrvxvw[cnjtxcdcketvdidcbu]icghhdkudxptbdcdhik
wquydkoyevtyfwqyimg[bhbhiqnxwfrcvqcsdq]hvcjbihyziwvmqr[phnejggzeulkkbdxb]uzpvcrhqhfkdkwvxcku[piqegxvplepyfjff]xqgfyfmlqqgcsnngmli
aiufvoznehafclsi[ynuiezokzxlhzsnlnmw]buhvbbmikiczqjlfhg[qfqcudscoobzjdwfyu]dcqxfcrpnhywlcabobo[piypuleecpciydz]xiendyljklimrwaexac
bmcenbqijebgornj[kskdxdmdlojqtjtw]kqpwfyitjbkfubsh
wjivpitbdiigvkhfpjf[ijhxqgwkoctfiyf]ezeuczihdpeegpnppj[rdcsrurelstudtzqv]afvyxjglfxybwff
rypyyznanxetdychyd[srdvpypvsmzquaeec]qzehxnsvvccjqbjres
disgynuubaeuiwg[qhmjwkqbmmjhjze]zgunyyctwtucdho[xljnbisahxahllyiob]astxdjwqultlphiijvh[zmhdobafwbzdndlrm]hwcwvfxwjynbaxidj
cdhvflnylxmmlsgo[oollmpblrqislxgmvvp]nivfytkylfpufcdxun[bocnmaazerwhgtzt]txxystvwvrsyoym[iafzkvskmhqjdtk]pgdgojbemypqbkofwf
sjtahdwpdhuosbqyss[lopwkbhedbpxtcw]bvtrmrjxtncfnrw
tdofrfbhpawcjokb[ynloiqgijuwanfekxsz]fdpwynqofzqumlrelfr[orxakqzzdjfnzlgywae]udzboibfngqztfguv
huwdaehvnyhbowsp[kbskeavlxslbvco]sekeunfcfnrsjqgqpcd[xrfzxupwqfrobegw]ndphbckizbunwqmykse[qyoqnkrhdydzuir]romctjjzwxjbxyqm
eyutpqnxiqygxwt[wxsiplbaidmlgph]vhlavtrefmbfpdfbju[owuuvbqjuailmgynkqa]setuzkegazwdjyzskty[oaqtnegjwglqnyw]pyizfgyjbebfacjexkh
bxpzupefyifcfhkv[fyllboalhcmvoctf]bvfifvthhaovzixpx[vtppcxdmlfbfgvgolil]gtyweatzcejbwtse[prplzrovjaeczsyxc]jkylsdulnhfilbsqh
eedtujnpvzzzdpgfrm[uopptnavfamhccc]qdnckczikmbwkxfmst
hzpjojvdukrnakxzkdv[gychyosqibeedkj]efhirtkgyzjnrqn[egmuiotfolnlyjg]nbleytvfmuvypkpabt
xadnnqlykhisnky[hvfudohkwpthdtyxe]xumogpuzbvdpbnapcw[gaavnafcpfbycdpvz]xlgtfefhzyskqazl
ohnpejtztddevoitaw[hoixesaghtpruyayyzu]ksyuxpootryqgsfctcx[yoazsorvwpkcrjqq]allrvqctxxhldwwzil[rxxioewpnqttrzaevnw]tjgvhfbpninpzwvxtl
qhapfqjbpzieybx[iobyolfvekomzeelsd]ygcprxtqzmwotja[pheachmbpziycyhykp]yhlmlzbdngqpvfcjt
egcxwspabytsgsbam[hewsugjwdvnywgjhrsb]gbxbpxonzzllmmkags[jylmvbwwjvmvkkgvusd]fxckijyjjwfrmlzp[eiohquiromkekgsbp]bpimyywlklqwdpfasc
iypuotjzbcsafzclwb[mudgawqgospvlepaexc]bsqftdoatnacbnpqk[bxaxwphnmcxlptaz]yhbsqduzzzkviyxmv[cfeyjhtefuxjqndg]rknngkyxrldxnqxfil
epqhofdmbeblgqjcpan[tuffplppwdkoimwbu]yiyfzqemymmtzevrvtb[vzuuiqvvudpedkbdgq]qzkbzuuvgzujipvh[etjfbbzkhkhvlslkjg]sqkdjmgjilbpvmr
cukbhochuhppwcuwwh[ziuieaxmtjrcovi]egmfefvbqztrinknvh[tcrdwnuqobusvhhhuw]llwltqrtuzujeuatp
uegokkxxfybcozva[hwnrfpsyzbclsubdc]kxssypkvfyghukcsted[uvtzwttuxxztqwwyjx]lhlyeezyttvgxgtz
vgriivdekqhhyzgmc[lkzxlushgdqezkwkbv]aqtzbkzcfxrkuwkw[aeubxxnhyhlolauhnu]qphfpphyptbmbvcyutk[xscabrjhmsfredzulrm]torgsvodiuuxkgcp
blygklicgpngtpgcldl[melaiuchcudinutcx]fldhqlhwyjqhgthjsrb[qnvfdzzszgaedjqky]amhauyjuhdistfgbipm[irrhdtrtvlhanuhfb]cszydrvyiahzwegkdiv
yrncnxrkuamoung[vteffidkspotxmwhna]lohvncugddeuevq[ueuixhkoouhzzfucs]xgwgddhczhiovgacg
gowzwidadczncgofqsa[gzkezmlagbaetlf]oochwgecelkuokyunem[slzawxgblqhorfpezd]chugkzdgaukccbeoi[apmckbkkvlblsel]tokgjnxyppksnep
zyqnagblhgoyiqihy[oisqkkmqfxdtvfx]qrpxcdxvmtlqbgvm[rsoqvutimhujjhbwaf]xtdayhoscopmejfxz[sqcpfrehprvngyagm]ecwgbravfceaajqg
nntkrxodbypdodgtj[lnlglurkrynztgae]twtxdcskknbsbinlnnu
meztofjunuxbkfx[cthbsibrfgxjyjawtv]ujhnboyhpoyjprrheg[qmjwvltvyjgntydrmeb]dsbnlksebapwyfrtr[aoyswieertsyvbfijuw]wfzftnldrfdpnmnn
aanwuubqnptyoryyrw[izbhposjoffhknmia]pmpudrwiwouwspqnozk[sojpnvluazibqcqkw]veawduaoceyxmzwbgd
aenjhairjysyrfylli[ksygiscororwmpcbpl]mdggayipjsxxfhz[zrovsdxuwyxjjbfm]vpmedxtfdporoono[zfnnenxocrbtapmnezl]odykztbwvuvlngxkwm
aetllelassgaxxhspd[knioznfojvtrwjtnvfj]zmdmmmgudgcrchsuufw[qowcvxqgjaoptskz]qyrfhavolkmidaul
gkevcmsegjotmpa[yjvykufplocymkaq]yhewirtmatswhjud
kaerzsgqzwhdrlzk[fgmfnhjaylhdvepgdr]smkwpurhnnhaqccuho[cznwafhuvozqolaruqx]ktiyadiryeclynr
qnfeguqpvoiadeipxs[tuodvfpmqdlndroq]ruumxxencwatfiv[otgvbhlyuhtbtyfews]swsjtpcysedmpsgwao
mpxuvhlsahhdmtwlhz[saxrupcdkcfpmpvzk]rctxchvmeqnqsxqizr[isqtziiuucctgioof]vdlchnruvtuupzvukfx
czxihwpinbwjaatnmx[quuiszmtsnqdsugbr]fhhhwhvrnenwekmyi[phwhrltyjkmdffqyu]woxrbiznmygdqbptf
qwqniztrmqkkiyg[yvknzntvwmikawjlgh]izdzijciztugcknoi[mqpjeordqprhefbbsdj]rtwjvqdagpycdsxtd
pyslrefucxvqpgtnfd[guaqdwpjlwhfmmyzxln]unlgsygdedtpfrpz[uxytlfxsaeouxxdpdb]ufpwpasnaiqyqnex[kiulyoykitwlllexti]cvxikzspuywpgaud
rbzuremuvpunjopiw[evldkwtjsfwgvdl]unsafmnksqehiore[ipvgyeheeuobibga]ohwjoehyibiihubwuo
zlxdszmzwikrjfjfh[rmzbjspugrnhysidi]impguvxjhbhtirmdihz[wlpaqqnimsearxzka]fftirrvfdqzoyusjucj
yvzxaecltitusbcfqv[witiggtqtgarfrq]bhnbijcfbhoqpojeuqw
peyeydbwowzleyebpqs[abxvydhobwmlksefjy]hntuuskjfvsfwnmh
gxdajcawzfzzhjbzpxm[nxdsexkhsbaviwzw]kojsiljoybqxuvi[razmescyfxecbmzc]fdayjgkrzsmzngiszt[sdqgfgolavfqmuzqag]uzbbbcwcizcmhntiom
gssllxegqicytbgko[imezntkypaaclprdo]hojadqftyszdiohirac[wcpiroednqmsrywvxsh]gkfmxwfuaykpwmdukm
iwdziuryoqkhqzukcbq[qdoppjrevjmjuod]jewewfyupjnuydkn[ysbuocvxflmhbdhlb]ggjdqbzqfekjbbf[ubywismzabwewsrl]fufmyromzqrxtxsijkl
tbmlgasrsqjxwto[mvoqzbghnwpunzvxu]wxnwrrzdalxjlflva
hlalpnzdmwlhuwewel[uqawlldafxwhejwbxj]vkktsmliwswarsq[isoseemfosjusoo]bjbjwogehxaqhasloxq[oktpqmpxmsnvbnsubz]ekgpiztxkkuvpszb
xfxkkivnffdwrqecja[lvgeafomwyqhlfd]uyvvthewoyqjyoo[dcoayhnhnhakcuv]sfucrodbqeqcqhpmc
iqfduwigwfxgkhbge[qojiewaocberonshm]toxtpcpkallieefn[swenxuejqehdfutw]oaiceeyuhhzpazuyaiw[gqbyuetdmvtttffowv]neqopgkvwqemnrmauc
bbwxyipchypnmsk[lefobpxeokqvfglny]rwdgvzdupkxjhppcqp[onrpulkcgonndkfq]eegboakcdoqrmdgfta
yxeegoeubfjhijn[pmdjdggehnbtvfqkdk]ofdoklopgeznrvssgdc[jidbyndormgpitjsl]ucucnufigpzjuuxdq[phajlefstzyysdkdrh]vziqmjzpeeqnqholz
pnlllqydepsbgkrhm[ltoscinqrrvkdyusds]qwwtxmmexgsfqgoh[uucslmiboquvlso]xmbeigfpdmodrodwbp
jatdtuzlcxvgwpryf[dvyuqxhxkurrpblehq]vowbsishfgkjtvicd[krvikdxyqlwdjjnd]mujppmtqzmeviflf[ihqppwgfywzrqyx]aobhudzykvgwwhirfiy
thmdermwtxojztany[xcohmubhlagpuew]lnlsiczemaohvjhhknx[spnegzrtgilojpnoxs]spnvmefqqzpdfzset
jccjsrpjiyokryde[gfwdanjjnbycygt]iqiuzghicmveelbxp[tzugzompmkteyydyeb]bkvntycebtvjlgour
rzskdzdoxsdqinbmjlv[fnwbduvtemtogsfi]oayebzmwazggkoo
hzpsgtucyxemkvmfxy[duxikzpqdgcmkbl]bluegvpkqmjiyzibglc[qruyknjgybyboyvmrsk]pqyrdevwrpeatgkyo
uubdyuzvtcfrrdl[stntntweakppdrbqk]yoiwxzsdefzihdnilx[vvvsontntjvgcvanni]sqdbtjoziwfolwbby
tdpetsinuufpbezbgpt[hpklzrbaryhnibm]ucetauqranqexnfdstk[sadfrrjazeweeec]jaozzdmvmylzatlon[gyrmfjwewarvlpsh]wfojorkgrvraihwpaf
sarrhlzjldgzhyuvefm[braqtukjacxtcbrgtx]rpfporiksxcacot[zezcjaonoyzxnbgd]jmrjkrugljonkzb
hclqtamrzmzkhhwcd[hcxqnplterhqgbude]kduskujldxotldizi[ashjjijtmbppyhgxo]ozdvjfhxmojeqagmoa[dppzupkveblwydh]qonltaesyzvczgyng
urvfscylyvpyvpqwl[akngblyladvcuwa]pauygcletxnisgriad[ovsqsgvuccmdzqcwn]jjugrvjyydebzrjghae
ohvihbfwdsvpzohtu[qsxghcyyscnxwgnspni]kxlgrkvsbjeomgckk
gzywjgljugwxnrv[mssfmontfbahkya]gfmnxglcggnbrpvuxv[poejydksxougrcw]tiqmbdmjniaqnqgptk
hillvlrgjsewmjkoha[iighatessfoqwexqdc]iqwztbnauifcazihogj[xgovsowyvdafqch]qfjgljkcgkdmrnlrrmv[hnjcrfgkftyitryole]muemrwwikauccsregut
vmdrttktgqkyovr[myycrednrrhozjdhiog]qrrfvxcqpthdfcls[nipthbalwkyqrmqy]xaprggoudqizdkqu
ofmohzqodnueziyemx[njkghrspckzhduwsrg]fxxnmxloclzfmlkebpl
naurkqfrkpbbfkmbe[cpttgjergcoemawxjtl]cdkngakkemsmtgtwyzn
xtwigprawkooqitoy[dzapkodeyqhkixy]zrtxkzjqgqeuagdie[vnieacbchbgexzaf]ezbpshpznqosvuk[mcmcfwuzlyodiqez]bojvjhtatwvmxsxhkbs
muiyjlnqtepriyly[cnrfxiwdlkrqsarpc]hdlysxsdtpqxquhnz
clmaeawlvsluxfrhl[rayxcpbervctzew]syqcakahftovtzcdl
ljjlywtzejfslouih[hmsyjqsqljnppyv]bxdissuzzauueguk[xhyiqeotzpbtzsrd]wapoxmkfmxhbykdv
duvdnbsaqzqemzc[kfefbyefuptincfaw]jhuvhgdqrnjwmlfrmr[niprevfcbwagwvewhj]hdhrwocbqysjstefldo[uelmkdqczcnlmaefjms]bwszcueianjsjhiywwh
yrfewhgpkihnhct[pxzsdirhdakahwdxteq]ygayoyiuikakdqo
wjrmypbsxqajzbtwl[pvltruknhkznchej]ypobvzyforzyiihvzq
pdchmvgzmxaspkcwkpp[kekolrkqgqcekeitv]xwpjbdcxgoelowm[wxdhdpqotthaeay]ovvuawitaqelckg
fcqvgochyglldipl[ryndsmjdhqvikwnexf]smwbuebgfzzmfftrdck[ynaegesquznhgmisvri]hwbktncquitjaqs
hcbbiznmlcfgdfjtgc[xqnepuustubktgck]jspcsloqtblxprd[mudjqeoagjqcfato]vgguzyxablhnrlye[rvzjejrpykdzzqcpgmc]okcylioamjhremephbh
ihlcdgalqwvznxl[afsqmxduvmdjftmrjeq]ekvaovqjvajxfdutwhv[zolonpiqednbtfpsrh]vurkbqdeglqdsml[jivoaiwnfpbgbzzc]neycassstykebswqao
bsgrhhzfgwsgzowrbj[mvkzjwkxsuwxnioolfq]yobngzosyzkmgrphxc
edoabezjjyzijqbgxup[lcxkqejwnnslgykokx]wihvmpynxyyhaysxvrq
wmbgvnekkdivugwirt[yuioeaoerarbpcmbwk]bdlohxkfgdbthtxlc[zqpipkuumpyyioewz]xssqnavbegcidoenex[xvcirztjwasastitiy]mmcxttawlbzdztesk
fmfwtjsguazrodvdy[uuzglafbhjlwujwr]rjttgtqakbrloqs
mjtlntwhjqjoxsbhk[adswsdpwqnvqtuj]uwzfdezklxcvhvhb[rzmgufbrcamkvsl]imtazflkqvdgqvfthc[pvktfhdynocqbhqb]qjtlmgsjspdfgoazn
hfeiexxrkdehqttaam[uinfvckvhatgmlblj]rhksgzqfcizyqqx[ofgjnqhqhveobpzva]qaxdjvvaibeenyuzpzl[ktwkynazrcnewdnb]yzmotgipaelgbsahicf
djhinybbfbbvidnyest[zougucdzxpenqpoi]vvxbocdotanwdrjks
poulgwkphlvqfjplgw[enhvwdoftxrnowdy]jfepitixnyjgvvl
agbtjztsonrgwzivf[igqgvjqttujviljk]pmqphqrfzfdiinxhy[hjpgkjjwxgfsiki]fqgfwrylhecwcoowxsi[fygonoznhkmzcjcpm]nwouwxzbpqmsxnfhedh
fnukiqycmrzcije[optroggxrsbsokabplj]vlepcfzbmvrqptyx
pdteouejbrhsicugggj[dipcyddhrktybch]rsynpfyiklwyhvlzoxz
yuxxurstojjfnoft[obornuhvvdtcyzj]kivbosojivpliva[twgyjecwqsxjmgi]hbphkpnfffzpbwjgf
iuauoxmsalkxobrgb[blehxxupivauaxkahxf]torbqoddhsksgtnps
sjgwxpuwloyujust[psqoquaifhrgmah]vpaddscloldhahh[hditsfewhihijrpf]ofjdasdbjvfrwefs
arpvdepqyadnevyphg[kbpdnghrphvogmn]wrzcskupnydzepdmxkp[beeaeyelchimtyrq]yppeqczzpjsntfytp[aofegesxpscjbehmcr]wkhyeeykbgemqgcynxs
ouluccjlcbcurdpkzg[flulmqooipvjzhip]qkxrrgvodksuivbspr
zfmcvmwchidwtgjmpoh[ecthaqwuytzvxcfk]pwvwrbzdjqdtxlq[fwbcqsvdosnolronvef]sbroultaoabvbtvh[ziihpfydzrkdqsz]uydoxylhbdlicydahf
wyvxswplnabvdoeshds[zhrpmmoiilsleemryd]pgkwuzialwbqkiw
ehkebgpllhheumhf[pfovxzqmiqoxdmywhc]qpzsvhisrjgjfqnliw
bzizropqhokoukoxz[ahvweuhqlrysrwu]sdmyzgqcevcixtomzch
kfyocamgrbgzslp[bclztdzvmbyetlgjk]llzxtjeauatwnnpkrvp[pxshjlevsleipkfkmf]xblovddfkfhviqulap[zhqfznscbngsaej]rjfncwzuuqwowdhfk
biaunelzsqaxohte[zyqygmhjmwigxsfi]lmdfmblocglcxaszya
ngxgqwjnobiygnm[jnhtcpyfpwpwkxapib]lyhgjgvcuwgbxgxwn[rovvgibkfcahiyn]dyojmojklujquiqfsj
tqdbdrqgfyumjwktbg[weesraucasfagyailb]ilhskphxtzaqesynmi[stfgxrouxicascniwpo]yfkxnhvrwkielncq
twgbfgwbpygvbfnyy[xhwmhyacxxleyadli]wffogpkjkmysxzlmpuv[qnjizoqydldcwubtux]askyjzovxsalrrgo
yunqqhjmfpqqycv[vamwyuzotttqgdzgj]lmuivwjmlbeqkay
qhquozlhiohsyzwv[utxfaionxyjgcnpulf]nkmfgjxfobxmrydyic
wehhwiznslzkyncnkc[dzxeftrnxfhrwprllke]imknddjnfrzanslzdz[dfqldjhkxhowubxs]ojzmgmludytadwespep
rbkqkcqoxrfczfwte[poemreldxewfaif]vehqkzgxcwmvocban[ffpechryektpzbdaivy]emfkcgsqpqkqxiitol
eidbkaxexnexudiembn[xyiztwlbqvoavomnlwv]rrfwfdixzpzvwkhwlw[kjinrqheqjsynha]pilasnmhghvvgaxor[nrgzhlsetahyskduscq]uazoholzvqjdaovgjr
ynlcechniybypvzubo[fupezmnrswguyjysfj]ckmilshpttvobgoux[hybhkdzvvhelhyvoynm]amrybybroexntrlcmvy
qpmlcmgstzjfincjh[axvarrnhwnkyucrz]wbbpucxtqbdjxsug[tutypessbhpshlyt]wwlkakvsggtbzcz[rypxpzrrmmohyowkja]aeuhylvosccpatslhp
hrdlnpgexbirsepd[waphktwkfccnylxg]hgukjgxutuzfovpazhx[jzgspycuftkivlpx]bhfazqqagtfpljr
ciyqjrkwqlwtuhh[lknvhwchhuntllyvjb]ontiepkrlphiydhyir[pdcojzrccoatarrqj]rwmyqonvfiexmbnjy[nhknsnxkwatatfhwa]qzlqiiovmuukmwypy
tjxbenxjlgozxrtqdp[fqimqatlktqjwjdzuoc]fedjvxnqivqaxkvcw[lskccrwcsxulkabzp]orszzlxhimwlzfawjw
yufbensvlqaxthui[vplidvdhajkxfkledbz]uposqezqxglywtlxgg
wacgjknueqomqccqnkf[erdhexyxtcmmvhums]bnywbavxkfzbqwlppv[bwdbqoqfxejqnsgjd]eafoepuyabzlznxw[etyfwvldfchsrdsjyec]apzomripffavakswd
conwdmtawpjnzrjlkrs[lfssaruafijkmgdp]izwehdqwarvfgxi[stkwrpsrwwucxlrpvd]sucqudlqvvklrfdgac[gelbgtycawlilemxamk]zmdjppqtsdlqfbhmm
ufwwjiajxhcorfa[hrdobejvqrdojftlnj]vamxyyehcgnupky
eonddfixsvjssautqun[kktlnrsxhmhwisd]drpflrvwelqqmdrcleu[vefzppqxcrtevyv]yeayirahatkufcjvax
gipuuaoxlxfkqld[kytubcrnjxvhdxjto]kwpqrvvtjopyigmq[urijeznvkopxtgkd]infdbnklnolvaqwwvo
bdqprkxthvsgqlp[qtcbdifrlnjdpxrb]xqmtwugptmssrivqb[zlkwptpsqnljxxod]esxomobcnfjuxxdmsmc[tifraqareavetzrpw]dlpsxjssqzyqwhd
ylwhvgowletbcqjgr[tnhoxqhrnytlbnwifx]pyzwjmotosezztkqd[ejfcslurfhiompqindp]kvbfdwfmwkiswfm
bqlhxpzchtvwcqc[jhpqckkyntskugvua]ylakfwmlerklrxq[wjrmeexzlljednrxho]rdobmdgxkucmdrk
ehtqwbiyigxjvkp[qujbspkhxogjrzskfm]qebesubhovwonqudy
sjqrkysnnbgtkhwe[ibgrjvqztrkknsr]mnbkbbxvfhsihzkbsqz[hxxhvxonqzrgcant]kbkvnbphoymseakbxjf[yjkdvhsscxggtyyk]tofzfukarcsahrmvs
ndepmgjnsgfsttp[rgrcqahcpnsyknjkd]uablhivltavxssnx[uwjmrokgisrjukeoh]wollclyotaektyjg[tzbziofnztlojbros]qvbgoapfzbecqwjsq
lspiukvizecamzh[vgaxbxgipyodtbxb]qpnkwuqxsgnihgd
khdzfhioeykvnvxuhic[lhfxiidbrwldhvfav]rwxsfwhshazzaxvk
coaljuoxfhvirzhedxp[femqrflktuakhveiiye]iabhkrebiawlktxmbr[pzvgzzcfzhswxitunrj]kqpbmoluwjetvhdcr[tyqdtrnkdmvdpuf]skrdeadiylehnbiyvws
qimxmesehwdrqskwitd[nvgxgwksihjcplpl]bxnyyafyzxludvyehd[hswtrhxmggpcpcvew]cucgudrfxfbietibgv
moiyvifvvucewfqu[wuzvazqcictmsbtq]nktfnkfjbsejorafo[vfreizeqljwshfafwdx]xrtbsdzcfkdmskiiuwj
kchuwlbokzivzlzvib[izbibinxysyjrvtapis]vugjoxtigdmbdqjn
xbclcahcqnbzwpvshao[qkamrpzzmssylpxb]tjsufvzaorutvdu
hraytavipeznkuoi[jmllyjddfakuxwfsx]ofoxhbhnucmiztrtcji[vebzprplbxwqnzllu]peaegqqeqbjikxff[jxzebruqgpoqmklz]liakpsmvutnpufovqlq
omtbdjlfagkxdlntz[mhwuaqvyldixapgoaec]aghmtjapinrxlvem
kbvvqlrdswbturvx[qpkrbbaxhpljnhlytou]xsogoxibyznqcpqgygn
orqcxbycauryvjxq[ijorpddboqkyznnnm]rvildjpthqvtdrzcq
hvttzyckbqjbyfdn[lzeulxlidymszjl]wbbmixifmqzkvypqola
eizqnqqixewedcvcit[ohtuntptfbovbsnl]uuswevyvyulevsfnw[etmfugdbznyzikdtx]euprxmmhcrdoefvfjg
pvxjhbwdlshqkth[gwmtamzhtucvbkmwacs]uyephbahzeptqmif
zitdlkpouvntzndz[iluwraejfdnwafe]fuevzmqlsflfcht[suumoqktussjsze]dawzltubgawnahpd
krskxctpuowviqiqxu[xunkhvqyyqiqhyx]rcdhdjoqrutobnjpimv
frsjlbcvuwydaobhii[bdatbysbolkcpzcxoyf]lwsfakbmjilithjrls[fhozecjhruquesmkca]oorqtbaamburjorhy[occzlzfhekgspeep]lilnnsqheytwakzah
ragajrztetigfkm[egetcjedsnrseahrxr]cblhtdmtcnoaank[fzhqephlcyygbwt]uyqlhhlhmnfyfcts
nklzxesmrrdlzyakdk[pfexuhulnvbmndvyat]xjvspjnesqugmkngn[vmzvdrheaknqmzyrc]xfncycggjiaqvirfvnn[aqeinzmbaijlafd]pjojbnvismokshrs
urteecaminrqiohs[rskgnsdfpksfznqpphc]yaxixbacbtysdrnwixf
ibvmhqpmnpzmghdtdpo[djdzntakacvezlr]jtdoweayvyiaskblc[qhwimwixemjmqsu]rzekezftftlqqovnq[hzeyrnhbrrducxz]ceiqewhcqqmqluro
joqwthpcrccoovxrvq[qjlcrltwaxkjenbbql]ovebjdqfnfkomjpswn[qhwrxhvbaattcrkvff]nmytfcchpqktagojhtf
jeeuutsrxjlqegcdlrm[chrtabpzdcoetzoopc]axdhgbwmwhhlrvc
djcujdyidkcgwygy[zfpuoobkfdetgiifrpf]uxzlkhxzqgiuyvuc[gboovijloiwizfuuye]wimticbreszjcpsls
ylpbdnvjaavulnhg[novahskycjcruokxbrc]gzsmxnvpupgxwhx
qdarjsoimlwxduyp[nghlzeghibocgcbhqb]vuoixghxxsxftuztlxs
ikdnbajyzpzbtzjdey[fiygpvlyluerdjvcdc]hheswtvpmtvjochdsih[kmjnhhmbpokaxsrf]byzdcdlvgyorjvkujyl[ttxlhbnifbfgmvs]onytmkodkklacgel
rcpgwlbaskiorvxhgsb[xikxwyiageqvilea]rhkkzuqtuxbhuygcxya[prteqotsqfyypus]mpdedamsijgmdktn[ptlcxgtlxfnvychnwe]mdjujbmrytfbzpslad
edjzqlaktolcrbwboup[bvmtkmfmidimoohq]kpsgyntrgidclnq[ohqjnvirkjlmztem]smtywugfaobbpvmzj[aksdrqczxftjrzuylmm]ffyrsvfwtqlmwbw
rkgutyhaonmyick[udryocpupaohqhrmmsk]lmusznhxbkbagotha
ebtiyamyxtfcakoku[tfggedpatfzjvirou]iwbguywvekoline
vjyzycrsfycfrookru[iszkkyvwngsskic]bnnqauaqcfxctnyofoi[tlegfofrqiuqlgkld]biryppugzufezftpjra
neipbfcjvrnrmpijwhq[eppjsmrnolpscnfowe]crsmezklwmkbysajb
quwdpyfsllgkwtj[ercxwsjcfkbpohokuc]isdjfklflnudrjetf[fuxsclqmfyplxxvao]xflfujjqnglxzxlxz
vfxrgmnvontljaodk[pwtwiqibbceehlnhf]lwzkbshrmagzhwqyq
ecfthornfevsngitzhb[pblbvztbbsbsxxuwec]jtjnnhwkekrgjanoxbe[osbstvuwyjietzx]xiordmxphcsjnzfnrwe
tcnlllsrvzoxupp[ficwiahpzqtauuk]whxfguillhkpxitoqq[ovsdwbddmfojvkqrxb]bfagfcimddodrtb[lghczsmdqufswoayezk]ctkmauzrnhgotbibbb
qahnaxgypnpjftgu[bghbgwqxwfnfrcybzd]qinmtddfxbpkhqnna[rheeshzhyxfbcfxkd]awwsrosrkyfqcvtx
siffwvlfljwbcndns[cawuqwatfhgwsphjn]twfwwneebgzxmqyrhbr[awxuvozbhlohuaxim]dykizkumcmmnwiwdx[dikxuxtmacvaxiwih]mscklmepmcgjemwtvv
nwnwxbeggraucwj[ygdjhwgskclfginltdy]ngfxeqsonadvobrnwne
ceulusceecbvzesfpia[etyucdrmmbsstudbfo]jjzwvaqsiovrgro[msadpldzcxurzije]mjrrrqwmyqxpdgmp
aiwctbwfathsnst[ymcmlyeojcaokgf]hchdxsyquapjjgncfq[adzpesdwzpvcksioys]rbfqvkxsicnkphd
hnbounecoxhinavuro[tdytxmzudgjmyxmm]fovpxazijvtvirqfrup[qbfsslqkpyioabrzhlz]htlcbtysbfxurnuqgs[nybjnpqgugmtfculk]zxdfwtbtbvhxyrtcodd
ecszlqenzswzeujn[aymhmhqkvzbuabtr]qasueshfbfducoit
bmvypnceplfbhhsko[eypvaebyvggpcmzum]ycwgnjvrjmdrkiao[hdkledypozrgbkexls]isuydppzigzqtfo[onvsgjzwozxcvgkukez]uhjisxtizfjiaebue
ljvtminczzipicxg[eqfvilzenlbztef]hpdptelqvvscyfqjbk
kofmsmvngqzdobeg[atcxvdptaufgfpec]rbyvvgagylqgryjmdz
qrqirixxxpivzyxidp[vanhxwefpeffrphvwm]awiajngjmxhscxctxt[hnmowanymdizdow]lqjbxcvbswqatxyp
baeknzdxlkxorrfi[tiqhvwvqoyavllfk]uqqdkslrjsueklu
usgfgiqvoudfsdyov[unqciexsmnreobavmoq]kcboezrfdmoqrgg
xrqjdugnwddstnr[gbnpzkldpjyfady]edvtrvipwheribydmaq[mwzdiuqdstogfjy]owanzbjqvaqgsgf
oumjseobbaxvipit[ukwqpfaqohsabpd]twomizennyccksgi[hszmrfksmdcycyda]connwmiollbtvgh
skyizttcnisqncq[lcxdhawnbdbcptj]ocvhdptvtfnwqcdmjff[sqbbfcaufseolqwcjt]xlnlzmuciirvedlni
nwlhzupppktailtktkb[bzdpulmwswdaqrv]kncfgfqmxoohevsxfp[vgabgahytpqzalhap]bbubtzxxzeysqyqp[nhpmkotpzfifrfpmk]fruxnzwuvonfoxc
yedymyfylbzvjfwst[woezxcgsurflqnrmvt]qsiblcwatgywwbktdmh
gnbeeaxxlvupyacdpl[dhgikxwvtnhllqs]dzsbgvmgvhcbygjkxz[qmayyikkpsqdoukt]kdfbifunpwlbhsh[qrqskqnysxtloxs]zudxossasajrdeanct
rhftgsygepdspzqbewd[lcmdbukbzwdesfroixj]oblwwxyfconxmhefjow[fvutwgcvuaemgzqanrz]xtiuegikggcimaobg[uhqwmtpowirexexim]txoyjvcawbfxprxf
viebpcquqeagmuavf[kxfkxsoijrjklkgtahh]gdxrwirjrvzjcykax
uptdisvspkluwgzkti[omvlmaxnyxyzwuian]pmieocovsvpfcveurx
ejmnzzuuduhzoze[xrdlxozvhgiofrc]sxtycslunhjmvejtkd[pakbfwkagujukiybe]adudpcxmlamtkwak
lqyqdhuldmtwbvydji[okhzffzbmlvqiko]wdcicvzpzkaowwqnztt
imnhospjiqsxihx[utoykmsvdetrkdxvzti]zgdfvtmfjggwyjef
lwsirsmcseswkfxh[izotdhmoodsvpsp]jivuksxahorpwcgxnn[plncjtzvyamfyxzst]nnpdtmoozfzuemdcenb
puavooykfwvhwzmkglt[xutftanpuhgsdznc]rvzdveoxydbctczqu[hetpqpdgohitmgtgyp]koiwybsyijhmmqxesqk
puivygxavmlrxwkst[qvtxsgezqcquyae]brdptsxbxnobkvcqclm[ibxfeuecufosgtzhxg]vziaqziqriftdfrpnll[bjfubyvxxrbsjbqvi]nnlbiuncvdtnnarm
tlzooyjugzfsomi[robsmcwkpeprtatddr]taktjvhztdlygkj[vbjvzeeznvmamus]sformulcgeirdihntt
zbcyicsjcmpicotmt[tbrfctpfnqspmvnv]edzcoymhzfqwbuyuyu[jhauxxgwnguurrviws]rfkagjqfdvhjiavoxtf[zdejarfvfodyslh]pzjedvtgzwflpduq
dhbhmlhsizoeldofqs[qcypvphfozxibpjdo]idntecorhucvlufrwu[naoixcxuqlgsytnt]ehsyusyugbmahyrn[djtckrolqitsztwtuq]urantneyeodhvorgsx
cnsrdanbfjubsdd[nwynwjxiyygvgdlx]gyyuqjjvumvquvzib
otivcdfzmsjivefwujc[yiveblxrayrkmfjwd]mbwaroznwihbnbmjp
fwanqgdmtlsezhtvat[bhxmmztvspchqvhovae]cnjyjntrcijkmnjwnlp[rziosbsufkiamqmqnmt]mvxhzoxxibbkezhzlks[hfessxjoefqfbgxhc]kdgmlomxtdfgdgku
ygxiiehdqiqtqjzj[cwbddmmlczrgdgpibge]tartaeajmndarksakye[qnurjchyeijxcsdpc]uguxoncwdrojsyszsib[mlwwasmjacumzfqr]sguglzsozcdjzlooexl
ytyzugjtaxtnwxkns[aclewmcdbbbwyyu]hlfhrgrigvwsdmdethb[osohbeuazmmffxyeq]ygmbsfwcmyqowdvh[pqpwyutdqwwunfqt]ppkundibovmqwjwyll
vcrftmfliijtpaqsoy[zcpypxlyshsruwbclj]mnwgypyvzdxnnie
fmfdmvxkdupjadbxh[tauggdjujfbeogtsgzs]pygzoyudakrlrlba
ysxiybmwpoygkyle[xaaughrlqulsertp]iukezabalczvwieegzj[wlycqpkbqptraajl]mjevizxosnolkxnfwxc[veialybabbpytrf]tpgpqighdqgphcwoysw
cnxnptbcjhgrxrtremt[tjguyerqizvuobq]honeukqpcsoiapswdgs[hcroutdslvvzypfklj]owxcxqehkqqyeflgi
ypgeqbggpntconrgr[fmsyjvaninmkfqekne]ykrmyjpfwlhnsvgehop[gvltviftpcixosamy]xlsyzevtwaokuvneo[nbfcynlfsbmmweiml]nxuzmhrwlucgvfy
zagsvkbkhcrkvnukl[pyfiiavqjgonrarga]antgzbmtohtndzgf[gkvovvdgppcnyjifrc]lxdhpometcwlkofze[fpxwacqdussynpwd]mymrmftjovoqtkuae
xrtjipuirgczdlrrlnu[xdczaqvzsfgavmzq]luocuzuztdgsyxbcy[agpcmbiyqxfntvnmzn]atjschwzmauidumzxru[gvmmftvwtfsvudtd]vhmononuocptbuvorau
fzozmcmcymohndlq[rnrgxsywctnmxxd]unfjafhfgeexfykym[xnldroqvnecyhhcwel]wagagwcqljxduzebjeb
efvejswssxdrqggx[iqwwyhgngmwzwsw]dlkdcjxurmpsoceomp[scbledaqpgsgynjo]rsdxazcyjgcubfxlbb
rlkrgjrxefztgtho[tphpsircgzsauqfew]ridnbmerksozxzwx[lcqwhfgiihdzgtgudp]whskzgdpjubkztb
qbtcopfgkbhzhhglhh[ostebaqylyggiyfptkw]bbuaatfqlpxstpgwg[nydgrdgyazzfwlagrz]fiiddplgxeyyntyeb
bogowskdtwkyhtdpzw[uxvrferconwfnnj]eukencoekwwahhefvs[xtrpjeahwpxbwgogfmh]axqvtgibzojnfcku[zhkpmdtwlogmypeqc]jzqywlhocshrdrlgd
rdmpdlidbkplejoikjc[iqzadghltpndooanzp]ltizdvolnhagtlvr[rqcrkoaqwfwjpsrj]rtlcwqisvkznpvrjrbi
ndbtkvzkgjsuyfibsn[gbfhvruiotbnbtvuxaa]xihrrhcnbnowthpdge
vxtgjsiuodbsuhg[updgogkqrntiedefvh]xwgrhmgmpzsxyen[tbhogopfepprmtewkm]fmrtnudhysikudz[rrdmqrctpwlcykzr]lpbvstnhcmvnfcpngja
eoaqeiqpsqdqkdvia[pdyuqgwuhxfiukmpvw]wsjyvdabhrdsxij[puikfklqhrmvfrwomu]zvbbuuromxgpnmpviw[fvfilnspmeoxozaba]yaouxfprxpkvkit
qpaksrcracxnyuozqc[evqvzzqomyzwufkvxx]vmbkqqkzjskcxbmbbp[alqaapbcvzuxchmaa]pzxrooiyfqprfaucxue
jmjvvyxljzznmaarmau[piytxuyakxaropkfnfb]txaaoeuvlqiwynhqlt
yrgxyekmldicpvo[wqcvsbptigcqvzoet]jjwvbjbshgmwttac[ymvjkuxxoojchqomnj]tsapoddljyrehrxrke[ajspkmvbrzxrxlpzw]hwymrguaqnefpsza
dmlshfvkrzncuuoo[fddyurlzqbpqdidtkrs]kcewmacglikdszapy[fltgxlltlvysvylrl]rgovwrvccixdullrof[bqkrpxjupbbrdnahf]ebmiiwmxkutltuxwrds
lzklscqfbovjmjbo[rhwheqhkaseohohelh]msyobgeiybsbyucus
olbjozztfeowxftbsx[oefyqpxsebyfawerwwb]uyfpnsvujqenwouagc
hwhbihujnzgayah[euifzicfxexpxir]lpgjmexgfyseevwjpqo[nniwslmnmrgybuelwb]khkudtujoigkyyjipu
okiwsdqqwbijptpjzl[ktibxjcdrjvsgxzlgg]cimquzswgbhabcf[gictypilnrboctfwls]oiofteanmgnauid
hdwokqbmfofrujxvf[gcrxxfsxmycedcfr]xwcmtasmlcvfmezvtk
gcxgyjgbqhtcqznfuoh[yitqnwqdcpkgwzayq]oqbiabducwietmxira[kuxdaeohprtnmpfniab]wddlljbeofkomijydzt
gnxobceomvkecom[oedsyavphnrvulwlqfk]klkcrpigniietqecrc
bgzhntrrxvjvhyqhf[tnyvbggtjvjfgratfo]hltqszvzgcutrdcvddq
sgzcemtrlzdjijht[wtvzogdoomtmhxcwckm]nmvftmtbucjnczm[hkqmnugntbrrsphbmn]yfvwwzebdqjkryhm[ydcjwepsqqrwnhkpup]tyssdovqgkhvvstvd
buhlborygnuuklh[haftitnpydnilqbqabe]gemzbfstwlhejmjoox[awjrajspxybgdkbl]nrkncxgvjhuwukw
suckcafpmeixlavp[ehmqotytcsxzagjq]vfwmytywcapfwlljl
vblctxriewmbbpxo[xsgdnvmcmfnuejlrtz]iltofzajbcezlpy[wnfixwfqqgseisa]buystfqzokvletbzv[woumxjkmiqqstnt]ciarbpnsahayntnv
cjsgiueunqlisps[zurvijydsqsdtktm]xhlpspwgqlwqfvx
bobcmszgphpejiwlwdm[wwjrxebfctqobojw]hyrcpguihwihhpmr
jlyvxnexbisiiwyjjf[pxpqjtfgwysrewmrv]xcfaninzgmdidqswt[spnysxcfdiwijvfqitl]wigmjtxvsmwlquxew
qqtluuthgrubwpqzr[kgebpbdpqekehnnuyuh]onnyuyxeqstunzueapk
sizavpqzmcfexfocoxn[dwcfbufvxxousaeah]hymczucocssffcj
ldupymvmttlywlxbbs[vsttjksdhwfdxclitx]hfvkvgmtmaxtifvo
tbgqiatbujypfbjha[catabtthtrydcjbt]aujolgbocqymyeqfr[apsuwlktuaukokmldw]qllsjhthoqdlpykgwz
zqtpkzchpnnmyzygsaf[zuokmkcncefsioenp]ynympbineurlgzkdys[nhrjzpmbwhwcsuowx]hzawgwukxrerbljm
navcmnriavzmexm[xdvtpfcjdxlbsyenvtx]byqzubujbhvpwfcme
kookhqsmbrpgpsbctfp[wlbmttbadvipoyrojd]cqmhhdfaunlqkre[gqmltgpxfyljdyo]zvzerdpqmktqmezf[npidrfvvtdeqgzhojn]hzehtqonmwoahdakvve
tanngpmswmpddgfpph[egmymqydmigpnpr]bymycsueiolsfyfey
uddmrzbeefaxbulsm[ieevtshivgygbvsiwpd]lbxhzadyduakugey[sqywcrjzoxbbgadoqne]xngapfdfzbwcrkd[gurtymibbzvsbxtpypw]elpexxrljomuxnybuxk
diqvdzizaoprrpzrovy[cbayiwiifklhjkw]somecbyhptpmhjvkrba[gczcezgzlsyowteraem]xkjkakyvwxbgmybzj[htxdiogfsahudae]hhbdrescqujtyeyo
kzrqpxxtetqkqqfxild[tenlubsvlvxwjgokm]zxfixurqybohvhfa
pjhbxnktknirbwjp[arlmosnekoqwtpysn]hexsbuespjgsrzbvpf[vaacxsepjnqxegwqq]owuxuohhzxqnoqepvha
pumaevegtbjlzsijtf[cjpsnszjnvoexufcgxy]dxngvevsnjzsbuask
azhhrcrptkuqsvxa[hwxldisbvxutspea]tiqwqugkmslokmixx[wzqlcgyfzacbyoguk]klpprvhtplelelsmx
dumehssexnwcppac[gucpccbmtrdgoee]zpcpjjuztjtgxxhzroz[iizviarbucshvccj]xlypepsxxhxphttgc
deujoayipwnugheu[nnyjneomcvpfrvfu]sfspbwylbnzbyqh[innsmlncnbxrbfuhu]tldwbficslnxpkzlrtw[kyfmnucfyrwlvbb]wedvxsifdxaysaw
lcvkjzckpkeyzyjgtwy[osncmhyofupofwscd]rysnhkmiqoqulyu[lqwjsxrgpkpkgxnvhf]ftmywmwfpckoadd
pixbxvhtlxjxzpm[nvmqocftgaxxgejke]npibmenishbqrxtavc[jzceumsoxcyqbfv]qcdqqbwcueyyqptc[egixgueerjonkmigr]teecwbxvwhgavdfjxi
vhtgslxovrpmlojcyiu[pngyxboltgfaskge]eawigmpxrezdxtau[osjcsdhppmqtqxixkg]gkxhhsphrnkjyxgmp[khnpkxghpkaxnvgxqe]zpedrsevlishcdbd
ixnbejxsfmcjmqh[pagzggnbjxxwktstf]hcjdsogfetpzoucuxg[gsnpjjdmrqzojcozi]csxsgebagjjgxqjx
mekdjtrwhgafduvnmwn[aaphpbnxrwwkhzxn]jqzcqvefysuegreqcw
wbpogjbyzelmxqeaazu[djdqdlmpfmezzehvjl]qdquppvgjweftqvph[equcifktaceuqwoakk]uxemheczqpboerwq
objhlxsujoqunmhip[bxpjvcdqedgvqrv]rvycwulyrrllbrxlbty
ckxcgnosnlskecyq[lcbisjdelotgldlea]edcebpmpxvvgktuxq[pewmfvnkiiulfehy]electgrfvkbxiic[emqhtmrsqfbebmykzv]jfdpefifxcptpfzvovc
leyueicungygchlce[fbclcyopnajqvxey]jcwvhehawbpflgddtn[xlozeiujqbiinjlvrt]ljmnnzlebbjbccao
mblrhofhihdiotvy[nfatavuoewnlsvc]gtuqdhyxielngaci
eyzlvgyolwwobcg[vaeslqvdrjthzho]zdakaychskakuufan
ukqgdhxdohzgrdfc[vfxeqopkydlzdehao]cormknsmtbidhgml[ceialgwruscjsapfc]erjsjeuxzxjokxct
szronkojjdgnfzkpqzq[xpzmblnarrtycgglkw]cixtddybdschdshenjl[gflkqtgzlxeesrfvx]erpfhhlwbsdasjljnqh
crndgetyvbvxhujqtu[svhcpjoxbaacvpqf]ohhkqbbwhtbcatwopz[nzfqzdbjhixrtpw]dpyfzrpxayfoglzji[aynmktzgxtegbucrw]igvfejgptghxddj
efswwtohurobgbpvlhr[sbgfgmsrjsrjblwr]xkswzbsgmboecxc[odmohossczkqjwtrdi]gvdjrovgilpgrdgt
qihgnzozzcedhgivz[wfzerbwlgrjbwolsz]ehnxlqolcgghtdfkeus[isyrflbjdelvbgz]eblyrmmkbobefzo[baowrnzmyctfmoylu]bzhtmcwxpcqhubyws
tjgkgtykbfdogfa[tixjoqenpxjbetz]oybvzsgugsucpvid[qukesagikwrrpuesq]xodwkyngdrxadgqz[sigwgfluzksbqqpvueq]rlgcptipyfrgihzn
tbilszajwwosrhs[rewcahkzssatddmv]wtusvesduewjvissr[efusbpnhwnrdjwgjthd]dunuqtpzocqwyqbysak
spvqcisucqxihmincf[csjfurernawvtia]vzarehconlkvnhbpsaa[mttsrsqoluowbizxrbk]pewqfgipuxqzsfj[qznswrhnuvmmqtbq]mbjqscwfpmkejjowy
eqeycwhpzzryclb[mvthqzizihyfvtdgon]maeannxtfakrfmg[xlxbqdqlglfspvyqrx]chjokbtqngjjsidqdyf[nnmqygvepumttyp]zipyquwulqtblevg
etutgnamoiukjadrf[phwftwicxcpgdegzkr]lafqcmydwbvsxlegc
kbwfmffiylhmwisrb[wvoulhoyvagzmgxmp]heupruovkypjtzkilqm
hjgmjhzizaeqewp[fepsjuqdjujbjpnooe]rnovsbmzwqtukgy
rlxvqkugtcovejm[vqlkivalxqfohnwz]afmwxjnymstqmem[ynyidmrgyujdkmjq]cliodisdvotckoatva[ysfxjtwokboitvhi]xfxomfghbnfnkobval
oxsmqxhljzdjqtx[eavkvuusdpcbrlwmr]kkpbxnnmuqigfvbrf[qrfzadqfcladouu]irmuceccvwsazcydh[kvkeafmibmbgpjoc]kgmkohjtzjqnfwxkv
hvvzujphepxjyypzp[isabpxdneywzpzr]rjbcrfhnidqlywbgvxf
ezfeilvlhanyhfvd[wgbqirhrycdzzbu]wpwvyghpwpfykgdt[drvcvbpndcvrcirig]qzcdvhfcxqdxubat
hjkktoruvvqmuauitf[dmygsosigufbzkm]rjbwsccifhzyhqk
zazrvwupbrzlepfcc[nzlsrlgeovdbndxwqv]yhjwjlnravqgraen
fqjubgphparanlll[avwevtaigfdxgjet]mgftlttzuhaqlvwqn[cnxupkaxahrlnjelty]yqgaieunjkxlhrha[xexqcuvkacjayozydc]blhjzcfcoyiozuajqxw
nacvyqozsyqgnvkvw[urqhhtybjqfpqqcrex]pxfufqzfghzxinnnlq[vbxhmpntjgivfgzgmq]vgsmxbkpphhjvzqdirx[mrnmmtbamdhoved]zziaxsjdqjfvqzq
hdrdsknkwrtejdgeqg[wbvycsdyecvuclhi]owhsjsujsqjachyh
jwfxtraepnpxwmziud[qhwoewcswwusdqcvfh]czaiemhwpbkflzqi[yntelahhkwcytedvpe]kpkuxgqygwicxoh[vuifmbkhbycxqiv]cfyzggvhpveafhduk
ngiytctkauehibctccr[coszigxgcttxzoqrhvn]hfrpsylypetiwrggzg[xwnfgwaxrjabzmsqquj]gxdqtprloqdojdthh
rhhicddiuxdobco[ihkmummwydkeoqp]seubufqphohblrkn
sgslfpeleveakroo[kgpoljsrrcfwlwyzb]zeacrfqqaortgdv[yoipuknesgpwoscvguw]ubrzxeqpijxuflgsgpt[allsdtgmdlnupofjb]brnjhlzxmijpicty
vbcaptabloujxkqwnsc[iujlwsczjefkoewao]yqwmtuetinhedenovhm
fcswktnxobrvovrjg[qsaxxwxgrenkdcpfvx]bmivhngglvcwxwgjz
nhmxhadaretplflb[eaaitxsycuqarue]zzdsqhjjnebzptm[znupjbepvjzujwj]djueiauiobywmclemio
lzgmurmbxidxqofgvy[nhpkiprmeusixtqhfid]zlpmcgmvjfsqhddfzu
aziympesgvakqhltci[qdofqedxvlvpyqat]txvwrspujxyuqsn
ezewtaywtinlcbrn[idtmhvforhdxgcdy]ohpcvnchsamehoewc
ayzzozmdklbhitpd[xwlznwdbvtciozoykoy]ainwvvxkreuvsgdatbm
kvacickhqbjjwkk[fryxetyntagtppzorb]gkqgbqhjykyewipbcj[zdaanxpihogooeeqby]lxdkkpostipynvh
nzngguddxyeihkkyt[wamdyvzgrnofprps]znzgitnmvvvrrzsb
vnbogcvphumewlx[cboxtlpwdmfbtfegkai]zlxznqxwahbghxz
stwxjgiqglghaaot[gdxpnepcgstafgt]psljddrwgewawdc[snbjvfbagexsbpyh]wqqhsxerdjilgln[jyqcqbxxikzmrguo]sophymnkilydvivcdk
kihnifnjfzhvlinqrqi[bcgxtjpdyxtgejzrdi]avzbrcqlbmaadrrvazb[ntmnrjhiklfwujlg]pifpvzbirqokamrmd[rbanfbdlrtmtkxca]udilckezqvrehkz
liradbqjmqeaifibll[yrfnryjrscfrxgazpzc]vxmlibidbmcwgoygn[ojkunzztsdudqhma]dvmtamzfaanvyivxqrq[yqypfcmwnezorcnbzy]wytsaklpzfftqat
fhaxbfjherqxbzbrtg[nabthakgwjarjsfhj]iokwyfrrjtwulhwi
asundudwctdvninxpag[opdvadcnjnbxptahj]scynlgwnmzdtmudu[bupcfcyqmmcwsqfffb]rjargbcgxvonfgjco
zwzcwjnudozdektxh[wesqhjkthgohlufhrf]mwqrvudkqiysxokugz[lcjiemidwqbdnohpd]psvhnbkuptpjicdmb[vfoerfpkymcjmhzicwm]pwykcpzewskfmho
zbhxhhqfeurqurm[buuctguwokorlkfq]extdceaqdkokhdaxzqj
qcrnmtdrftlnyciul[qvtjesglscjradq]tcoobnfosubnnrps[qafsnrpijrnjkemz]urgzkcxptagwndzug[olhgasghsicjvswx]higdtidzwjfzlfkmxbf
ymvlttwormrtliwoy[wrcafamahrcipugxxgy]mjzzpdkuowbrbqtmr
swwktdvpgkbbntq[jujwbyzbmzktmpag]uinhisqwpyszittfqe
qrlfgtcrpyanzwfeuhl[sstllbrafqeobsocmsc]gmfmnisxdoqqctof
znfoqfwiwmxdiixycul[tsxegdjmxscgpfllqvi]fhwwrpconfwceqv[gqpboszvyuduzehsun]hmydskzdmmifotkn[jurqmnkixknhmwj]vcjomeocgzfhftqq
wukfxspnkhedqdbtfti[cjcrwokxqxfqbvfatie]eaohmttcidinhxqtcu
usgxfhglhuknqauzic[jlhntqhcyjuoywthv]hbskrwccmtzgyby[pijipgraqquvxhso]hehkqohxirecivlxnvo[lawgvpbmozisammvpcx]vuchsyinsehynzm
dgnciyptfimtrbmfbcd[tedeoxadobgoobffh]iucidwknmfofwia[bbtbzcwjwiphlcruw]ukwczycabezutqdcc
huxitbsdoqaffnlyxyn[vzcnvdddtezaeymzrr]bmovgbcqswsdmjacezx[jjdtfpukrwhiafcy]fwlhrymiaolokojdkx[ftqdrarkfhfbelc]yfonqpoegjmmxkwhz
ldedcblvfbdacsy[rksxibwzdatluua]agxedenvctglzyvpu[qkwulxegyokwljso]akjfktolnkzwsnn[lfhdwjomyhroqkkzk]mtkhpnffxrrwipsrqet
ajwscynjeiagnubeew[ftyzkgsmsevmdkpyv]ufeszcwnhqpwsep[rinrtwoninoxbqvlgy]mzacylokxrhxtbyut
rdlragvdebqlteu[kitphkhhnrssleu]chisqrsnofxmmbegi
sjzglwvefnntfgofuax[htbkuezcjsfgohzynlp]wquzxtqerwxlperau[kqnbhymijqtvtzxbra]tcwbvbockcilgvn
bdqyqodloytjtcylu[xgwgnadrhxshcyhd]qshqmfdqpzbruygmmzc
pnwkymgknqqdwzmymmh[vcnetknxxjvihfrlvq]cujdvtwltkpkzwkc[owjyboqcsymigajgish]bdklpwzslsjvadacm[mmimdikciuetfjeece]dxwoxjenzguercr
vxgoxslogbrjaxbjg[qyyckvarfyidktepi]odfkcgodqdusnjs
nmumnqunfnuhvtucy[voatnmasscuvwjth]grckxjhdzzoqtpgwm[qwmgudaltzavyrchqy]bmxedeqkwkgoqyrmlx[uqzdpkjekjgfvlnfwh]tpsfewpellmljsakhea
dvvwqujegsgarow[rkjpzfvtrtlpcdlc]kvpqbvyshmoemkhvq[hzbtnbzhmgaufkfvwh]ipdgirduhpdkhcwzfid[jmxetzvqbkrhkices]yzrxhfcakriippr
xyijrstjowvehnp[ylbnnbclmipxjtxtbb]dtynyczfzgqozpa[rmontkapaesmlvuasig]qmuqzwqsoipzutdwz
bdwyvvnsxojfzifhkr[mfdopzhxfakffhoudpz]vqnrhwzqbahbztlynpi
hymeoolncfmkblqrd[ifbyrijjwxsjvmhql]vgybqqlmoilegcrcp
arqsuxhcivbxfiuf[jfqqzwkamooqvyj]awbpyjrtunzulggzmh[iipnlkhwzzmzcdi]ktvdnpdmzmkrqavxsxy[dnoqbxknjvouymfz]brcemvbpovqjdvps
sxhcuagminkkyodlma[zkcpbofatowxfdddhv]iydjxsbzyvvptmrivf[thuzxghsyyrkqbjozw]zicredtdvmavltqgeg
qgvauvsmewyfypvgx[bkzpxdkwztxbpak]ghwmldmcmotjcmun
ivnbdeggumwedodrru[ejwxagdnszmvpyxtsfv]eaabhawecgtctegy
nylnblglukusyetuly[annmbyywmkzxoxcubb]fwslxffcquyfzezst[exsgjgeufpzlscazuw]rebffdvzignmrpriw[qwsiovjdtaimkun]utobenmeyrtxlorxjx
eivxnczlgqbmybivjx[zrbbxnnjprbaknh]gtfbkkxqoowynpt
botxfdjpvcayvpxmf[jysydtitavnzahbeg]zwkgkehpvxtocktco[iodpobnripiqifmexh]zpnrcxntqwwwucz[nwrxbbqtsqmkaiysi]pecfziyavdcfehr
bmfbcrmibywamwmic[npcluivjtbtwmwxmx]mxyepxnjdabcuiexhwi
kezzmzrmfsmhwxfhy[euevwjfsullybtlul]edrcskoqqmtwbhhafnl
yywsnxvznbcockrn[fnmwrszfamgerfhocoa]uxfgnvtphthtmeuyy[houdomoboxleqhrf]zznqyqwslypolnqef[ttbcfuirmlnwevhzw]dmohemntzpwivaab
xfrmjbgozdwamlqe[rdrfdfobgryckvow]gzbnazpqaqxcjdro
vdxepylmqqekuqe[hagzuweczkaioxyz]sndgjumcegndnuwwukz[ymkpvinydrrvfare]oplwhupwenqwloy
paikbyhegnbvcqa[kawvebmxrhzszrncq]noltxgnszsqxfbxbrk
hwifnlppmjawmyb[gulsfllyemlqkcws]wfopsunpcakhzkz[fcpmxchdgicqido]tlvnxgdsecuxsux
yogujlygnpdyhkxpdf[bawcwagtpbuwaorpa]noyoqlkcbsytnzywva[zvdbrjsxhozvyrugdnr]yyehxcwcnepivtjntex
ukkuxsacdvwqkgwu[qfhnxatswcchleqaeg]qynrnkuwuynramm
srvnvdghsmgtyvvli[gujzqjtjtrdfeandy]rypduscceqqfodndh[bssbtbzcdoiygtdse]klhkfnjidkombeom
hrxpcidpccertdnde[iubpwxhlmbnofumjnk]tzjinnaqvzhuqmjgzqs[tbpdksrgbhbhscpnns]kgaslrsilgklgukanif
xhrwvvblyiyyjithaqj[nxzhuqjrftquwsq]juvsrstyudnsyjxqpko
qjjtuuqdjaovcgs[klwmohvmeyujgvauez]faqyixqvshgpkrgvac[hzjbtsvreecwygo]vluysvnbqjuroaondag[qqaysmxakrfjdrpvj]lteebmjrrlysmwocpg
fkemhtixlciygti[babpytzqdpoovfy]ptjooannebsdcfrs[ismooacbkqjciwrfw]wsawvmoxxzwzloxunq[wrjhadcbmeslujxk]zckevlidqnpsdordy
ikapdixlczlrtpab[xyfywwygclrvxmc]tugwitpyopgfhucrrp[zjnmpndgvwlqnsfnemv]xeahjahtuyjwjwxfdv
wjbljlhlkfhhkhrz[kfhvlihkiqprhjno]mhceaicjbnvajugy[rvkrsptmdupaylqsbv]nptyjetdstrwmqjav
nqcmyiscwhuiafdyg[njnrwedfdsnzkyg]rsxrirfayriqxvyqthn[alkdpteuyfothxvyeow]smfyaybytdibkus
msvwpibrptekclckgdd[gdowictxfvmjmdtyimm]nlrlpatlusnrqcydh[zqiivotvmzapjjdzhx]eqxxguxozcbzlfkktk[amsfzydattcuqolcoaw]exjpttscqgketzhe
uqiaugsvrqenozqcnry[hcmsmwdqjcoohwlu]morsyizcifxpoyzes[tdnfcmzkcxkltvom]jbkvbwcolkcpkxdlhy[joounotcqahwjvx]teeotmpwnuvnrgdxscb
xsejzfhwsziaedxovv[accbrvbghrsomiv]glmkioydimjfcneh[xejzphhekszjpec]qfetmjhsfagbzjurrr
qwmyiuonuwttopaz[esdvdnqxftkihzblcc]xxfxmkdxigfxfwadl
gnvhardsrapmlpmlg[gmliinpyvjenkrnnh]kovjprgbyfdknmnbfme[nhzmroniytmwwfp]falokmiuiibxhheszok
zcczeqrlhunbfsxu[ifzbbveczjlfwppp]pvtsdxzdoxrrlukmqmh
rbgkskquxcvswaf[xihgvfvaxkptizohvn]tbntgfbhclvkdael[zuxdeparbafjpwqvg]cpfuexhjmkrdurlbnis[vfmoasavisksmltggm]hsnrpmdkogfxnprmvxu
abttallvhutezhtr[beucmccowruviwqjxlo]slskvryjaodaowc[vqtmaqykahuvoqc]valnulizvgiciruetx[rbhcdafdupnswhn]bppfeuexkximknecfq
hlnjhkjucpmxmguhb[gtoyutdhjwfudqnra]pipjkprnypqtglf[phovsbawbyxsuwsyopo]phkewndekgucmrrbw
bikqggafubkrtyskep[eugvetcxkbfuajpuz]drgqdldmenwxyldlwd[klwzyogvokknfwdqw]ffojmxeeurqxasxgf[qdjndihaiuwjqie]uaatdignzrdeyjddxzg
ddjhxhnkcrmnaztvps[crzhufiibsjerulkslh]snirbjgmmerlrucjlv
ckxphmsmljtplee[mbrperwqumwnitb]aikxmbbxmgsmsfgeni
zwmouppnlfbatcigqkh[kahnxdhbhongbfgmtxy]kfictxvtzrwlzvxees
gfrgqbgweickiocqas[urgmzzgkrwpkfhpf]aazsfnctfvvdrrf
sgndtkclbxdovlte[ylbolooanippjrmyi]lfydwbjkfsgdrecxzn
gfypysbhqsgyoxrtxxp[vdfjphnhrphzphdia]ekhgpckheqjkjinexuu
tagvhpldzimodoca[odnlmmdinuwyazwif]hsresddnysmuldvv[zpnjyvabzrktghfvtfx]jbzsfhvzaglqkstj[leniqywipplvkues]zumzesiphmejqufbn
qhkrsmlwyoxfawk[egspgdlxbrdcwvoeje]pxuytqzjiabwebbmu
wsxvnbuosiwcutjct[nzthycbqcazrnqppb]keasqheprjcqwac
jyiifehztqkdshfuj[cddnloevonuheydyle]tftddpechuzfagnww
zyicuknwqxtzzzy[mqgzslkciigsugirbcu]vadteaxyvnpyhwbec[waifsdqtrcbdnvrl]dygogwgquwnouhc
jltdbxzvwoxlherhs[vuuwuslxdkthbcs]ujzniwntplzaaldguqb[zdcnhufvintzrxm]cunexbzfbuzomrv
huikyoqqhcabtgosej[tqbxkfxeqyclgcqqsu]thtunfddczjfocqmr[vddedigjifexfqgp]otvsknxemvtrpbxw
sgukpjkupqmgtmj[qmvzpbebkypfmje]howlgwptfegdnqp
wnomkfqdtyobjkmd[goockdzswfoumhiavf]noshgjhgufjxgxiro
ivzlyzlnqpslrbldxqw[qmlmhingxmcporfx]bccugkqyzoqaqbv[msgojkckxyuihysrhp]hdmzempetgwwycoy
xzyacqjyialgkmmcj[aqenwwtnrupdsmitna]bhbicwoaervlixo[cggrwmpqsyxfoidjm]yawyxhdkscodboohvvo
aoywrlzjkqkzcmmicvi[lhwojrkhqdearhac]zwhrxrrrmfpkjvrnd[zwdpqkomjgjvkcndhi]cxpctyvgnthrsarfhx[clnierazieohvgsy]eydbsvaautujuqqsr
zfozpdjsfxmbwyb[ignvlhfnrdhybkwhxq]qfxolqnfiyokzcbdy[ohvvpuipajnqwml]rybjvumgzqgzfveqjvy
gkvxesvhovzoekxbmgh[hjnizppxqxtlkdj]mqvvrcdepnalllarg[urffyistzzqlhimfhi]yhndztrezwcapskbkz
qbuqvobipnbazji[qypkenwigkvsjhfdhd]pafhisczyaozydialh
dkocroswvahrephwueh[qtiawejyhzlhsnlaxz]yyelniorfgcpgfxtle
uyuylzyqivmpinpi[nxooflqcmtftzosn]vwxiscnnmmujalwegzl
ewyjffqwxipurwkejav[yxcfacgyuuqpjqxgn]bsxufukndbljizkbo
lglancnskvgdozzuuy[eossyfcrfjnpqtim]mvjbtylaisjdcgyn
lxrbvlmepaibubsqlc[pnndwclekhualwxbpg]cxaynaselbcbisw[evtpqzovucquqbgg]lsscjpanobjuqlpkhtu
wqcqpnmdhfupmmaa[qawfetitfsotgsibhg]vanugoxziwlnbda[apowiuucwbqxkcxry]kithnvgmjbuevopx[okzohlobuxbbjxeul]wrcnqenrhpvmxzp
qwmlncrpjifxmtyxjil[evgtbhnhavfwyih]ganxbqprffolbtg[pxidrhwgdqsycynecqe]sukgwvxkhbzolomvx
vmgykxaeppaasupwolg[pqkilujgqcoxpzys]vtmypzwtqecvidu[nolweceicrhwtvov]uevlxruhysbiedfibc[ytdalspbuzpagzjr]yrkwrgdaptnoxcqqr
fgwnpezirnabdiwcknh[qnwczufxpwtomgr]umwdzmivstlmecryoh[ogyfrrqklslzcqoo]yohswnizpisqpvpyu[bmwnspsfofxvrvqkc]itdkhtuqsybuiom
ynbnpjgaoammxaoagp[xkivkmwwiejjbbgk]ongbnbtqtcxqipe
gxuxnshdgyttcjzvk[lsxpwpvsoquxuazidye]mfihmxgxumzfhnm
ngwlkbdsfkoopeugbf[zkcrhoyehnzszjl]jwkxolilixmiake[kcoazkmvlmmlxhlip]urmeqvldopqdrvrdd
hnlkmhqgkitizzp[dgtnogdyumxjgnh]gazsmgjzighgwpided[vaxfshfsqkmebtkceye]ndxcvfbzddvksncrr[clhmftvehwzwljbp]tooichznleiqlksnv
jgnvwreomaddorfbnna[oedwzjkpxolayry]wdkdtjlmdviveeog[tkbjzabxaqxvbnasst]lqttnyqfnirsajb
yiuwebgrrtctqhvq[dmddhqpukxspoiaua]egktbjgjcfzhltkjtyu
sbfvjniiethddwbjx[guajrdwgcphepysv]qntvmggllbcquzfu[qtlrmikwlmlzfpqufgk]tjwivdcycoacfcwwfyl
mxbvlmxjhiorcnni[ubvkvylqtxbchszgp]kzxkzbjtogzujapfq
aezkzdgfurigqcdxt[kkjkjuyowyhylcxzs]maogxmmqteaectjv[aocufmtewquabwa]wlidntwbxueqzbql
gngwphszdvmcnjj[qvbontopydlzjywvaiq]jbrgkevvbwzvkcpz
qtdsnkqlmcwenkzxodb[wqmskmdllfarzicsce]dmubpplnmipygwqjim[yejatlbffcwmlyrek]gsvwxfaeblczgpdvhhm
ktshrikjzljpacyux[omqqrcsqtbtdqsupfvm]bggungenwwenmztg[kacviemyqpqmwmiivp]petgeydeoygoknl
lvvozapyfvdohboxrt[sqedcfculzdrbsafvg]ioohxzwwppkserbkim[bytwtckhnlhtxgmes]uzwrmuczkofyfgv
ocskfzkwwmnkize[wnjrhvmcynlydnbvn]qbykllzinrgwfvod
eqnrivojtcjljsfcj[rlxxybjowtdptsg]rnnvkyrsxzytscf[mbykscjmwlryaiictd]gmfcxwtjljrpihljll[gxrwqhtelbnpguyvw]lpbbvcxyokowlqfih
sujejaymvqavyvhwpe[vzobezygmsxvqwnnu]dmuyhdixfuqfbnehqve[gwdapthzmbpwtui]hxhsorcfmtmrdqqrzf[dqrxkbkttpsjkqpbnl]qsmueuwxsrnejednm
vmqbwehpqesssnps[jkyzwrfofkfqkse]glwxlfrqaamjejrievu[jhbggigitejevdzgqsm]sqxbxgyvfpqtxrlbca
mlbhjbelhzgprdshat[zcytqxmfhuyriabyr]yzhvmpjfzkhgxavltdz
ctdohoakygysybf[loxbfdhctlnhggxpoq]bimosyslpbihbwqp[fahhvvdfkiiucdf]bbgugrcsmoasoxyymgz[wjhbkirawxanrqf]palckvdfnlhficazmwm
qoetptacgfcrdrstl[gpcfptpchpeiicbmfd]vsjqqgbwiqlndgmop
dmlzhkeleeqkgqvriu[qxzssbjfthbzhdf]inuernrmyomwyre
pcezyuyfhpyebmvanp[jccebfvhvicqksgwyqy]nssvudrlhkckath
mrpkkivxuuozfbxejfm[bkwbwzhwwkfqqlupltj]ngrlyucvbmdilkke[qlzntmxfkeapmlbumu]ynjqdpmonwypyjpalvh
tkqhdmjsbnhbvkdgo[jufmjoypjidudkbcvy]olrsjedkqdbeijypjp
brnhsqltbrizrohj[dlzumegwwcbonaa]llqtbxfulkgjeqw
vxjgwcccalsesmngkbk[owvdclfjsyhgchpt]zgqonnjsnsqxxvqzmqs[wsmtnxjpvzcdpobat]rkgwlaecswhucndgv
wkjmaneymsjdyjd[uvgaxovnqgsvamsbz]naumvynxlnbgksk[mmjeguwrwppdwmdjlm]puiytitjsyskwomrfqj
fquaiztteofhvsbcba[hvstcffflwbvchn]ntvqaedorhoikidi[cpypurqddikmaynmxzx]qkrvwfsppcglqejkn
cpjplvpmbumvgsduald[sowmjselnjpjwhav]flufpydujtzuzusyrr
jfhplkijkstxymvwgz[kbsytlilpsegzanvlee]ywcxnydvgcxzuibxvu[ayieqmzukhoxmcli]rsyubeqkgvobehe
ocsbswhjtvywugym[twhemgyfgdfegogpj]xamojomgxvyedia[rukhjizwdryazdtdsb]fdiecwglfmtfjqxocw
vywxxiyjfwsjhvjmk[mwjsyhoifeimjqtmx]ribwktjvuvxakqqznf[izcdtybzxfbyubfbckt]aocntguubagirsgvz
ursnbtivqkjfkcbls[ckjjoszuogsdnficmhy]wwzjkspwdvilshnzg[gzuoexgingreqktak]ywmfxtqooxdgqaa[bmucdllxdktiifoqp]pvxrfcknwxdjivyym
ebtozyepluaazxsuoi[mocwxdgmeyxmoulo]grazonsbnsnczptl[rusiwrrcbqpybtjfxt]ewazwwjculbvwjgc[jmoyjpbznvzlvnzu]ghwsmgrsqjgragu
cmbehdhyvukkufctwpl[toklbggcxvjerfqozbj]wqbacnegquxmszdul[ggzaznwywpswuxmlmg]swowxuqlmlfvxmznm
qbebmodvutfozxt[macysosjlpjhykkb]qdewwbokbiqofejcsj[ddzpouyuxgogajwmuk]iukkhkmjmrrkefycw
adaobhuodvmkfzrbk[ucroxtaavsmpvfd]nvrnzhxozidrgvf
yytzgmmuqrfqegalpow[eyefbjmsyximixd]sgxjxpfncigzmft[zuwduxnhjiidywvsm]qmdvambkreelttqmv[mqhlvabyxnmnjfpkigl]vuxmnunvxclyhkxi
qdgaknszcwxvyhlrfsr[kbbxnitytjopwtruar]ucanrksrycnoqlcvrd
nqwjdcnwfxkdglllft[gbawkxvzhyiprfenf]ysybkzwywpqwerm[cwsthmeytiuialllzxx]plcctxffnigyhdfmndc[kyyvjcfkxfofxfsrw]cwynasabqneione
kqthcqbvfsncuenmqx[rpokleyrpkohzefrw]txvckiapuezhimt[rrfglfzarznwgchlej]vpnrufinbaqrbjtu[hypcxgeuiotonfxvuf]cfpjwonfyqddtogr
aaxuojwascuilsqjt[aqpfsummtaolqpdi]qoqnuhfpinypgxiex[peasbtrzdkneuriyt]dbhohenosanaxkqqxq[fwvbczhithdxtbdpd]bmncqvxnaijxuexu
mgiepbqfrprbaqd[swsyfijoncrtrigly]bzdkfgrsmwamezhp[minqrxxklutrtrfxps]dacjpwxdrbxhumh
shdjdexuhgauroqwtmd[jpvifgjpgzmjlrnuyj]svvjpufybafcjsoppia[albycpxsvxdykattdos]ewhcfugwuovgnepvovv
ldwjwyzaqxwfrelh[rzkhymugnnpmowx]xufycgvikehdxxggp[mykgpsmatnpimovscqe]cpdwiemofukofnauyh[iicxbleijoxlvml]dxzlvafklkbfhqke
cqdtbwoinxghfrwulij[wwuuffpfxzcckuf]zeayaofaskxfueiq
odegrvwiwncavmxd[smgtzidklnmlnltytx]psknhjsrxwqdqlw[kmejoinwatytdkz]dfziwicdcmfwawwf
jzioqoutlwitjdcb[furuyivyebozkvcny]gfhakdfpfouliybsvk[vfrykghujsittpcxjnj]vjekmvdvwkaffrhhr
rclnyybawbizurp[cptbsqptpvcuchcyncy]rlqjeblagqogxwy[mwexxfjhkiyoihog]slgmmhvjhpomcvgabu[xgipgcmbydzmayywci]tptdbfqkemdnuzvuz
junsrcleteqbngabdh[loajbjvuielphzeel]yquxjlecdumepsr[lktbtwjmyeqrurys]ralurzrcthwtkenjtet
zgykbezaearyhzuxhta[pqtjhajbyttwqzfozi]dzodljvnchwsytat[wrdvidyboznzzbgvxc]fnpmjaiocpucgucwh[kiqymnngzdrlcncpw]xkjzheobflinqcxu
kbaghyebhrmquslcfc[ukdaffinqagmwhvhl]ruyaqrvavvfrzwiyit[jdhkzojqtxymxoaval]qfxsbqwjtsudcet
obscoqxaeartfjmeue[dtceaealpasuxsdoo]zhtpbqqfonksrcpu
bphcztpaoqfofau[wlhtxjzhyooevsax]pvktnvejsbjwsizugxj[aijfjqhoxneawmq]dlfbjynbvobrkyur[swgyiujwbafngtiql]nepaaduwebbpsrew
fsjxwoamqjhjvyyr[johjhabbsofojaxccga]tqcnhtvkimixbyiqt
lrasfxkclqtptlt[bmwhuwhzvfmwxxwla]xghbszjpdbdykjmfvhx[cerzilbrtilvfptwid]nkzdvndlbgkwkgzwatw[njpjupthwiwffesnct]cipyoqwmxtiugbyfmk
txfqpycfderhwnqtrp[cvtdbizqhlxikkw]nuxymppbyfdpayjxt[sfsnmgqrjqrlfxh]dgwdxoveamltzalgyw
ntfdficysbefpup[fvdhtaqmjosqoxosu]pwrbdoceiweqrfyrx[ftlwubetphczbxhx]jolpetpuszxjkxuupke[mbcbzrxeoqpibuyjsgg]cpdzzdzkwbucybc
pwwzjoakzydrvkyn[xisfgbgguunevtbg]ntzbwgeohmdvitrtdpj[fzkkujhplarmvzckn]whvdpxzietgdyfhok[hlmsjxrxxrdjfrzncyi]xvvkjroullhawqdj
pgazkqglbbjzrofkpy[mkeiyuwlxlmgmeugcbb]oguzgbkaasscxhict[lckibbhqnkatvzlqcw]ulilgiydzfsdwngr[qcrozfdctltxaatyajh]ojyzengehkhylgh
zdatmhxwkinjiumoy[qwhfmokowsvzgcngeax]uqebryzrbawakjz[ltilidihghatuhi]lljxtazlhxbrnvwsrc[updgoblisisvpdqngzo]tjvlrlfopjdoyoisim
tfguxgdgurymskwxk[ngtycndepeqrcif]gttrbjkhsbrfczdwxo[xulqdcmgztpjgiajnkn]pgwsbrzakmvblfsvlsd
lclevdvivjogclcmn[kpxlegarknivgdvfymk]kygexxjbzqppiywvxtz
zadpyjsswjcfimejbc[htbpkbzsmbkfeqww]ydwbivnpofvmzvw[archeurcpsapgylrf]teidjxdxdailsbb[nmoqxuhzymlxxqykol]zbesrnrszqdpsbchg
ykwptdjfydxfdue[svxdapsdzsvmsifz]omdvdqwkswiktcwkma[tprmxhwqpdycftzlsz]dyfcmpaaokppkzvoa
adfqjdussbzlxfvlg[hxktcqjmyqctyjnl]ouyrbuvumwwygdc
rrryoldbjkwnauaz[uarnttzxeuurzokpa]clkjazjocprwqti[krkcdnwldqexavrpo]fdegufvailefzfi[izadiszyerlbhwd]myayzynvrymyobbfdc
krttvoiaszqvnme[hlywolnuxbxjhzmnt]lwcvxyuuugaqribebi
yrznsouskotcing[jnttzbfwdrpszrcqr]dhxidpojntnwrrsjjc[dlvjkiqqyrrougz]bjhjvlhvrefihomycx[veomjtdhecgcvsshcwo]iboybnggfhdhymyukl
qtvgzpyhogqojzi[vtbmgswqkcpdzhxwzo]jsmnjadclhgsofgrq[lltxvswaeqdbvbyqj]gvrdvrgygzhbetbkjq
oqmbdnnrpqmjasc[hzdfeapdznngjzjchow]fdoxpevjbqngxrhhlhj
ujszwtyancoxbcga[qzpevsjkmozdbeqf]bdzegnfxtazxdna[wyinvjijbvudlvkwvg]mrgzfijgyouxyio[qehebkkwomsmozoojy]sqhbhyonrnjocbjzfl
hinhkyqfttbnnou[luuiucbkkrnwiuqbwb]ujfitmunviqwhkiziy[wqbetolmyaceofd]wbwbxudxttgmtuxjeo
schrxkylmxpwphllds[iijplekwtutqrdkmsrt]hvejiqeylhoxdpkxz[gbhczsfvoidbktsgbqu]rtfwgjnvhjhemkkvbm[lxojvsbvcnlbuofvwg]ruakyrabueflgsnict
fvqtupyapfmstztmbe[zxtzrmjxlmgshjlfywb]tdihozcziyvstvdtvd[ifzqxsyyhgstjwlr]xihkbuvismdtqtfm[xtxunrrzvtuhjlzoji]zotmlgbjircyvzgcxkd
shkjoyjuiufvxbluji[saofjqdwpwodltmra]xldohzmyameybbnw[zwaispolnanumhtz]hpobrxhytzqmkrkf
jgaozdtecqmpueg[bnfjhfyhdndzlkxrcb]esbfjomhfrfvzgm[wqvhdvpvrbsazqzgnw]lkmrymdcupndnoktuv
mehlgjudopvrolla[ghqzncojnxbdtupn]vacvkbpzsztmzhz[tcvqbgfvrehiycr]unpokrfctcwqexbgo[hbigocuneutkffaka]dwwclmxsripmvcluve
rkdurapdxvohktm[idaisubzmlljyfbblho]kkkxhnkaiaxxyivjsna
ujdjbvlqoavnuoeeilr[tpiehldutfyewbqv]crvmofwdjdesxrl
ptyvtwbbmoujjbvsf[avhpwnutnjkysjdubd]ysgpwvxugjswjzhw[fvgohaphbuqpbwzr]sqvpubqxxhmfxvlw
sslbaaxswqcqfln[nmdfjxyyrexvtxv]wavnexwpbgnrbrwyrf[deouszhzjkbxxrhvkn]xtfqfjexnqgdiddxh[tphqtpimimjxxkkndng]ncngkkzdnhmbqohupgr
kcowklgmyivdmreahg[nhhhjuxwoafzwur]jokzmfbbnzsobiahlhi[qgzkumabuuxqhki]ubnjasaqscrxdjy
ccofivnvzaxcise[erfolydklxltrildvth]sjprbxbfldbsozha[lrbdfwialwqinprra]wqresduonlpwaamhj[nmlgvtrcuqvsirfhwi]qjtgpekylrqmxxbm
fugomjlqyofxoij[prndifttmowgenapio]jpvcsgonnqmvqrxwo[yuioijkmnwkyiba]gtosuvsrcszwsotg[zvtndiccjofwagevdcb]qpdjgtopkcimpfyqw
zbzstwtngoozwdgtkme[mrcfdmgpywwvikyrto]ktlmqekphuekemo[wenupyuqahrgisu]wjyyqsuatrkzlohmo[judqmuzbdrqamof]qiovruvlcreoircteb
yyclnzxvjfymqgrzup[koyfzianzwtvdjga]jtfmxjxehvwejfl[xbebzfwcbmjrhka]oqnpqgevsokznwo[briagugdtzfswfbq]dmnccxrswiebtkwao
muxweanabaymbamknkz[abtqprtejlmchtpy]nmrtnrjxewbqynvbe[rtxnzbwcjbtmvob]segkftbvlvczkgubgp
hkihivjdrqvywhwt[xpciwwigazxeddp]vkaysmwlighihfka[lcyiuojfjmmhltubrj]spandymlggnmqiact[xizoxzguscxtsut]cmjecsmmjasgpvx
kasrdhbhmrlwiczlyp[sfvdefhihrtmmgele]voszgwzdjlvkejvrkn[ahwvipvknuyzrzbrmkk]yuhtxgfpaipuupqep[hezjazdypaguhxkwud]bsfgurgwdetewwg
mkxpacxlrpbfqio[axwgpntpusujnovkpxp]afzkmjvcysdkbfeli
mspmqxwmjhzxqmbhbj[zniufuwcidklzfpuoxs]uvlrvuhbhjhudvx
nrgtmsqbjxlnpsc[hpbskrvswufaucjmjv]pkuulesksyygynxyku
kmopgjfjwvvrfgvo[qsigvjyusqjqziiuwxf]ewkbjkiqfgdwhkot[tbrynegplyfllxcqaar]cybelgkyrndjodpf
wjzkfwmrsnyjitglauy[jnncpybddtktmehxz]hluaspiawjwywug[ujwjjttoevainaxqmer]gewchllvjclaahplb[haewxwlxjjnfggtg]uxmnawcpzfwhfiefo
jogfshkvmshdacro[anluswkewepuhbemk]rwfxbxtmtfgxatwj[lwqompcrkgqzkajgrqg]ckjftivpzkflgbifzx[autylalyokqqlxgu]chewqmwkwewmwoby
vhqxmrwadjsfoprv[imclvgvrtvqfbcllpr]kmgvgofdlkarrusoo
kwkqhpdsrkdlhuq[njldfvflplvygnihg]hikxtejykexrghupbqz[tanglgtyodyncabh]ennzrvfvgcnlehci
hmibwhrmzhcxvzgt[vrdwkryugziqxxfv]tcgmqhirboxwvyy[mjgojhlpjolsjtcu]tphrqucjxjpsdsi[ahqidqxdgeucevqinms]edzoyewnqweqkla
deizsskvkzcsohdf[plhmdlimpiduxfdyzv]iaodhxioxasudzv
aepgcwcwlpdqric[xyxiplpunvajsjk]dkragqziaqxgbwr
keocoxwzsscocdxcf[lvdnlggndlqzvxjo]cajmnvjxphmfopy[bxfnemakuysdjvhzv]ymuttirruskkndjlpw
rrfoglacqhfucnjkhsf[ejgwoteprdneomyqphi]gtsffeskyegnxzfkssz
awgoetenjdtwnpw[hflbiyqshareqvcc]qxwgczjnzceffwk[eumisjskpmnqfmox]dtsifzhnbdvlfaqdkwe
jezzkwqvkbbcskih[cxqpssjfttcropqrk]eqkohazzfagyqpjt[qveehpentvwwdazsmdc]enufhtsnszihemkf
zqokauntjcoqolc[kfjplmodgrkaeuuvq]fqicoryxfrkubee[fcncbrofqpyxdnejn]yebngpgxcbjnivisgza[bpwzrwupgpmtbhg]ufxyezblslkscovzaqd
vdrhbvkjchpslgpwwdt[cfslokjhwrpogwmf]qkxlvkrswbbbhudgk[ryazzfichahhigijhc]xbxrwruzjhyjlwxf[xlulxjmhxnhmkflqw]xtkuftnstlwxwiirwko
qwbqncrimtxfjspgyyn[ysolszsumngdzijn]stfhvhqwymtjpauip[lnucccqwwzenxlytrb]aumcvdswfuucagbkel[skoaaxgeqadxehwvjt]jrjzozvfrrjrsvmov
akweexwajqyahlpq[pjxilukjsvzjerrcdcb]qsptnuxrshmerfccxhb
xbnsmtgyhitmtounl[msqlrxysydxdydbtyho]varxjhsmmqlilsprkq
udmbexywtscnesd[azofuoboewwundyif]mykxybobvefathvqkfx
gjedwdykwqbxqpsb[nykqvlfsckqcgfhvbd]xdactphykfhbpjollax
tinuplnorykjcuete[qqwstzqrupgcliapi]durprlvdyucmbkhceq
zrfmusbfbogbrsin[gaayijtuqfbfnxb]cgjsibujnswdmuhfez[rhatyymizrxrqud]wpvajerbhxbtrva
tpjpjlmhvuorwnd[vnwdgopuigazzwytzbe]uaplhgdvedfaiboz[rqkafxfjjzjwbzwung]cqwjlakbfpqvxspia[chyrracxefgkuznb]chigmcxzjqnzsdn
badqhtkxeokdbres[wmdthitngyoujdumxfb]lnafdeqakaggcdttnq[acuhhjaemkakovqq]vfvloofttmvvolbpgb
myaunxirrlgywdtyrlp[nxinrircujeyezto]tdzynxmmbhjybgz[sxbjlwhbkhpplbveqk]oplketzgeeoczpadvhj
wtqjkfmtshufwfiux[njjvqujaetzgcihtxvi]fapfzhffwqovrvfpatr[hwjfoqsbiothjtrbg]sfwifkjkimjnyzaui
milzoncxkgtbsgtxgb[zvskfgfsgefelbjckwy]lrdralfxvtlupde[kvvibrstieyneglniu]pfyopkpteyovtkahwby
sjwqwumquvxpwokonnd[wooozqoxtlhwsfhtcic]tgzecomscwuxgazattf[dmaxzgxonbkehxgymq]xbqkxgbziuumwex[csesnsjiexhypqrxjj]dbscxozezqgzexrwci
yqgpqvteubzxsmjb[bntiezjqbiywrsq]nrgpewzpshvjwdx[qifsblzcgkiqfmele]oypyewwjmytlaujp
bxlsaiblatkrxpcr[xxnilxrehixaglra]apwnnbwgatzwgmr
rqsogjhjijafydmr[krhzamyodyfpbdv]jkjdjxgdszznhiv[ywihxdwlgdadayqm]cjvrvelwbegtiqswzqr[toujknandbegjga]wvdikqjnnxpuxtijios
dqlbbhlsllmcdejnme[fchpcehhwkjwkythfc]shnipixrreczdblufyb
pljkshxmvbpvswl[gbuflmmaywvbjwibfud]mexysgjrvoxovxtvici[svuosbkwxjzhvmztiq]cvfjfnisqtyomho[jvrshoymwbzcpgxtxl]ysdystgkeioszdbora
ooyljflrcdoujmfajfu[qvnbylveipljcmgrvl]cjfvbounfvjfpsxmbnj[mohdhwcdrykexihcgvb]gfzxjkkqdnspzbqb[jkoiqbqtbjxgezxvsgn]juvveztzrtcxhyp
ebfbaesgsxjbwhkmpxp[dzkhyyykwhayaztjt]xkxdjdlfvlzpqbb[tjdqvwygsgoldpffs]uwccbahfnjkhbfzcocf
uayfnudukxaldfgdvh[tshkbhbydlzzndsc]wtjmhgayuizllbngcr[tfglywxclqmgpeatsva]riocgxwsethrhbh[xnerbhkafskywvgxbdl]yzubvjedgzbpqqng
iensavdsekzfncu[frepnzfzbolseio]thbtyqsviqjozgq[mqobufwdnxkzqvqtgj]woxdzihysaypdxamitb[llqsjadcqlogalbice]xwrmwjiednucqqfuy
lgmcluvxcilrgacyc[ozvsjikotkgiepo]ximiftuuulbsghmm[ykwtdziaokecacpd]bvhsjkjycywcuitep
eoefpqghlbkskrhdhv[wkzmafhoocaswuz]iyiulabsaueugqys
noklaptafpgtvzb[hocgskfdbisxdlcdbq]sgwqzdhmwapbbjox[yyjutkzwybpoeea]xtnvxgftzjdwqhgh[nqgarhtwigpfriuq]etonjczcgfhclbf
tyqqeyfkxjcnjih[edtgzfrlpapwoyrnccx]fmsegnaucwnvsyrsj[lptzjaxumqhbwhmljyv]rugwpouagbvimws
enpywofbxruqkma[lesuqdferlsfxqis]tqkchirhakakvbgf[ytrxxjwygqwaauwjsg]ncrkbikcmvtbtrabvqb
nticpuumzthsihk[asrmrtlzizgsvnvcxny]wjntjizixwyedcrh
yjkotqgkximxcbpa[ttuenysknomggwwvvhe]htzkgoilhlqrpmbcvh[zucaclqaevmjqfuy]pfkvmsbcslkjxyydhk[obfcguogfxfimowk]eczitrwtnkfqyvxco
nbrsaktghjdxrhul[kmtgawzkmntyypqmw]jggmopgbovomadux[pkwngsqopjftulu]ymmfdmimjpxufntd[hnovhrnfsloivbbueip]oreyglwcjkylphqtwl
ufynjbkocygleqwskw[yuykssufmvmdkdntk]opbcqjxsioqpkzbtuhh
nkxtoheqxycxqbp[nmjgqytppiuscyylrm]ezhiobiihpmhkqjc[bewnvjufjzxgfwhy]hslvggdrixjquaigzp[dkaylzejrwivzcl]mxzgkigdgfhmczixkrq
fgcsqpmignjsbxxzt[zoatnmdxtjwltkazbep]wiadjhqakemepgfh[csuxhgjcqjsztsrwb]wdekgrxgngaaqcequ[kjlsrjjtidezpuitng]lhibpbcwjndstunhfff
ozgymklbikxnhme[bbbbemtxaxyxnnazaxm]jszcoclvxluigfgdlq[bkkxgjapnrpvovq]tdsakecfolgpiynztiu
tytomipjwhuqwshlvho[ewcfspufoolvxmeyodk]wrrxjaexfktctmwrkvc[fwdrputsdfepfvglfq]fqhmqffdtqahfpyelce[elfiaqrgaqxwpjbxcig]jmlxcfxgjkteodsufs
zdfxveufnuenptljiet[bxzgimeczdpygyen]ptmmjlitdsoncpjlwh
yfyzedhbbtpqiwmri[uqxjtkmjcivoqatycbc]etqdfgffuplikkgrug[ezipcwmudtfakrrif]kumvfsiqqyfrbcbvgf[upsfgrzgndzpzxhmx]aewrwjwdquhsagmgwah
tkhbexdnhdkmlogvk[rvuvfkiqrvxwewnhihc]yytysizvrtytoqznokd[cyxenputwxkuesw]qukaxyqfxbjvgdcy[rfvlqyyapixtzghha]sjazfjtokjizlxiim
ynwzzgtnjmfjhbys[enxaumsepjmyaapa]tctribvarqtdaceq[omcmnkckmzjjdhjiwvj]qlkbuktkubixegud[bbvvgpocsbliknv]nivyswbiijvnvvkuw
dwncikgxhzvktwgwa[nwmhqzwlvntxvjv]dmbsieiwdzgwecq[uvutvspxpxwfafv]vauzasizdqputolg[ncsglnqbwjshyxa]dtgwditcpcuncdcxn
kupmpwwjcwmmrhum[aakppoytxqucqfncv]gpuyruwkndprpqjqwup[lrcoaodsmpmlhnhnyq]zathwgfvwmumcjwaa
ivdparkbqlazewoujo[tzfulakdrwfncibtnza]titrajiplrfpbsar[rnjnbtkpwadofahdfvv]uwobxeoluadvnxyxwl
kkoyqwkjdgcvqaufnj[qucvzomguivuynsg]cbhahcwrhchflfuc[czlxnbidfvtovgdl]jmyougddwlejoyrfsfm[kcuqcjogcjrhvjpxx]khnizsdkqwzdzehlpe
wzeknwbkawxgvgtq[wmypojfjlgomvmk]tfwjzxvhrbxpkuyk
ivalkzrbqzhiqmjo[olluyctvwisrwwt]ndrunxditvvundvd
zezjmfpqesoftjufk[tdueprzpghkckpq]fnwlbwrhqmmayee
jpmhszgjuxnpjdsbtk[cpzosccgpfbvzuretl]nfpjzsqdvzkcszid[csygzwucakziegi]laqibhadzxurnulc[otxsegwpopkabmwbxzd]ymmsoiqsjnlnsvlsq
srgtzegqicrsutbpfsh[wfdoodrpmioayoa]kfqtpkwcfgyvjeyhvsj[yzcyshhziwjudxmm]xnmgrqxumondortjbye[nyajdyykzhnmolyv]zbdkvkbjavamxrafhbl
ifwabdpxckluvreesop[dsyliwtgkelyyam]hqwleigpcnogipr
bpaukztdyuwjkjrqj[dnslgwpwsanuxvtyn]fxkjtpifmtqzrlok[vfcgvkrunowkiilyok]ypgxcltrqbuzwiqom[ikzgjcafxhxmtgril]btdnvecxukjskjkndz
nghqjtbvhviyatzaz[guzxivxizjukrxwaf]vtggynfcmuttsnrvm[eqvzxmtlkaigaur]dmfhpohcbyjikjl[kxaapmbxolonwgbw]uektjdecblphouwitdv
fxefzaiaeclqyvka[srznplyazbvctgfdr]xakjubrnnbfykcep
rwlthwstbsaxphlsrz[ihywtcvcfdeczmy]lpxfewmiwnskbnv[ripgyxpgczfvxkzp]iltpwldaivxkwwcb[yiejtwqmnnnzywks]krnbkndouhoakztwzh
mwaxggiakwqnbihaaj[pxslpnutqpgdfvhvwgp]nhhnvftzfwdfnrqisfi[hgroxibwekbugif]btrhjqipvkpfvcf
xmxlpyuuqssmtmzqyb[ybwrbnrgkansaodfap]cihlwrfxgbaxddtja
fahbkbakvcwwazgioub[ouuvcmqsmykbkhfhj]gntumiippgacbcl
hqkuhmrurcqtkzusgu[drwgthikmebvdcjapw]vdxfpjwqlcvwpgsflb[mmaxekmyvkxfxye]nlusofrecbdvhbruu
tjyqhrxlyrubiuwl[voyszxwudonuwiptjoy]xggibveyrclwxsq[aolwexwhfxpwcuavvwr]bwkkcnpvsiynoeikmlb
cxpvpcjhfbokvuh[sdkkaewwgkvniqymkrl]emeetymmtcbrivitvn[bvyzmgaorsfbsmqoka]vodjpeovgjpofkq
nupojuxxbgjvlafg[uhfrugmmacqdsap]nxuunqzbasceyiz[ircwdmgmysazaya]qwsmsdywyhklvniiq
mxujioozxlybxvyjcmj[afimhsdzsmtxszd]fsckiqksntizegvxgz
htyhhcuqdfhhniloe[iqslmejacjbynzkw]nenyirdlormvppyym
jbphnkbvlextsaqnid[xdebmjhugwvnodt]spdqamgmvsuftfx
mpdupjaxozerpkit[pcivcugsbsqynoz]zrxxjvwswbpuylnxi[tjoxsullllulompfxhy]zobcdnaypuabmzfn[inubfyjlhoysdjath]vufswsypjkekcrb
qsbiexorinxuevkoad[tjzedsasyapfnvwa]qbfrkhbfmaxcgmovnif[evrexsygnumrldt]serpxomgczhbzjix
ukqzagjymparwzqvw[lnkduutsjulfxuqug]lvupmgsyiquqeepmgsv[ekenewopqmddlcqc]rhnwektxgccickla
ezrytvzepmzxbjapim[knaxuvqciriixgji]epksyimofrrkgawirz[tewvfyplzorvkyeog]bwnejljtelcigsqfx
fngkrmmwapuutwtn[pjrinpthoymdxemoe]qoxhlklweoscgcagw[pyrevdqrznakburr]fnsowwitbsxsdsdv[hzbrhpemwokvyhpohjw]jppmuxhrsdsmmprl
wfpphsvqgdaostxg[abwxepvuvujjmdbhees]uxitcdrdkyaqgtyrdr[rqdczpmmmisomtmop]lnqpzuqcyrdgzrcc[cvzwdsaeorgdzzklrx]ekwjqzkeolvlkkqtj
qzhiltifnugunsngzg[fxfhjhvijjnhnxkbl]bbaftchmgjrfuanns
isducdmcjzbiacltx[jvkepdvzknnyqegqte]zbuvzcrrsbjsqkf[dowjjsipssfisalqwmk]uzrmibeeevzeuxtb[ajzixsnzrxwpekzpy]weogtsmtsuxvjyhy
dnxhdwkvawccsfvncy[odsmukbcbpfyjqeau]ugusdxmjuxjosasg[ouwrwzplzttepynf]avhgcbmjesyqkzjgms
pwyizorvifedguhjqrg[zsafqttsqlygzwmqv]hxilzjvsuyfnyck[dnovwvccguuzizrjw]qgbluurgbxnollv
meqzvrprpthaebpd[htamsljskphtldx]riagbpmpasjnjefv[cvpfevyvpivbals]tgxiqxmhvqhhmrr[cgeamacqfrlrhaoz]vficakheeoprpbows
okkhpeexympjqvlamxu[mvjvngmxhkbiaygi]pnwoitpqlyqaiwdpf[ryfcbkcyzbvxuyngw]xxgknvjauivacqxr[tqmanixcxxbolxf]orhkvkwpyrwbymux
ipwcjobowzgrgzmnf[uahjinxxnmyyibzp]badwoisgtafnkgnp
bcbwbvyvqpozfig[twwsbwyhvfaddwo]jogvkczzowocmkwwlla[yedsazzkeklftvohfqz]tghtcjemmehumuyxar
bevtohpxkrlrjjen[jxnohlogvkugugmk]nrxomawkgbwlnqwb[rtjoeivssknwelkhv]dihcnpigtbnwfdlxhm
upuufvskhseazwfttq[kkipejrjmxwmqjsh]xquyqplziwgvkkiyv[iirqohxpmcxsjryb]ajblnptlfnukvae
sijztjuwnyftelgytm[mgirqlkcbaigiyx]wgbeoandnwaudhgvd[drhbrumogcajpxnvqov]vwandmoxgzsokgfs[xwgtfizcmyjrfzgejhv]nhckviycimfezwefw
gfgrgtizxajkaicjcc[mftrzuftzrgrwilsv]uckwgxywnamzjglbnts
znbgncjrhyxaxgd[xyyzkorhakwqubjzk]wrsdvjsrsdorwkgr[krrqukxrdobhkzmr]mdebvnlirbtdbavpj[adbczigmaoreudvgns]yqxeoeccdlpuwyvf
ymjcaobrviuqtvxjqq[jwpvalizcmbpfdjk]wmxpzhqvcavedvmhtn[llsefbpkphhetqhbj]qryznzcexwgvxni
ginmrsljkrcminltayt[iarzxlzixokzfxiazwl]aircthhepljgylm[wlorimkebaxcvcwanlh]bihvjtofcsnvuem
zdegfhthlaitfojyj[bltnoljmwcfdvle]gnadpzusiepwthtv[ieuoyrprfkwonhwjt]wwfphscvjchvrab
kdnddjueyrofzhjdzcs[asdqcpbunitvxrwi]usylnhwfapvczeb[ozrrpkegwtbkftyeusg]pncbcdrovovzozcazn
lkksyjqoayppxtvns[csiuzvhklkfijem]xpsmnkdmivkitka[djmnmzweqxrkfomzqhr]wkzmhoiasanmhez[wojpalkldcaopeg]murhvjrgpwxpbveekq
jawznxjorxwvflmkk[gafmrermlounwjqod]nalazknfqhepgnelal
wlszezwacdeehnlnoj[njlzbwkfnvnbwim]fydgpvvovkuardng[gqxvckevjodockykp]qsbtvwpwaaeatbd
bwwttxctuzuezxfdz[apvuanhzemgcupc]qcfxkvevimwvwpu[zhhorxgplrpuyabae]gzabsprhuhwrtkd[sqhumhfqwdgxthu]fyebhdninkahfyy
hhttjuhgvcgkisaqof[obpleewrfrrsgpumz]umcmeaytqjlqkyrawp[rhkhciyzmxciiysv]kszzqcmcylslhlpqjag
fnevugmjjescvvmbmt[bjzdquqohnusozz]fwlevkwzllmptbcelsh
hzqfveaxrqycvuolynx[ztsmaipixbuhbmv]ebvofyoeponbpip
utmnuyowmxipzhde[yuvqwfsuyhonciiepq]ynjvqvvifywnecwzdk[httqooeiilokkjghwjq]znixikpswkpgxcchuyg
goojhvcnizyiukzgmwb[euyvjdmnjjrkjwpu]puidllwqpsddlrhx
ysglduipsofxegb[kzrbdzimejxkyftyuz]aekosjomszyegyy[vpkwocloupebnjeo]ocdaynpnnytwrgkn
anheyoxddpkmqla[isqzqeuwwitvtqy]jnchwevvrgyznqsomum[kribzkkrxawjnfsmiux]mlerrnvwcydnfckydfm[hwouaafteeabtgflb]acwwvgztxwcanzizha
kaqernqhzefzthuc[tiuifctajhxawtoi]kyqdkeudzkihvfsn
vwwekuavrftztxb[aywyoempmajrdkxpsc]eibnjbszsfsapujqn[rxpcsihuzszefcdzl]gsahdvozzgxjhontxk
ymjyffbcgimsalujegr[dnppglortkqlowskj]wxwtxtdaaopcyvp[xfsnsdrlopdotuqx]sprrvphwennltlddiw
lguyxqxdnirprljpkec[gevtjwbiofgesdwil]phnydixjjjcprpxlpj
mgjnnftohavesepu[slwhvezajhvdukghl]hdhtlheqzqqrsqmfqyz
iapqmjgrjnecxylopbo[pnbvgmbhbcmcnpsf]opurzpqoyxdxfkud
efuoofbuyjoaqjd[achnmlslfvovmgt]xcuyvikslsewgqlx[gjxolnhgqhhglojjqhy]iarxidejlgphqwaei
uxpcurtzqgpgtzkvp[mibqtgwackcedfri]otnnsgolldyzdpbew[tmgiijgjuvjykwahml]xxgjgzmnicxmywdubrb[hwhcgbzhuoankdubft]rxqzywfyuliatahn
uhmufcxuptehmuf[sygthxldinztzudvs]bdxukzqaxeavvrbqmuz[wovugtpgwisttusjlet]tpfbcndafwhdnolv
kwknefvhmzbtjezkh[zcvncbptzekirhqo]qvgnyfkmrnxlgxzjjxl[twxzjkybjlrpurfmufa]lclhwuylibekjjxc
mspxottklkidvlomd[rhiachlbqgpdhfnxyc]ekkxgijnueonlkpfkm[dnwcjiihmpjqtmb]dkknlqniolowydd[dyqofryhvgracxeuivp]pbsgttbtgksqqevytrb
pjvdfpsdlampeztecfq[lpqshzeegwiouas]nwxqaoryigyvbby[iiddsczjoxentwv]weexunkmtaaufurjz[meywmosucyrxzlgxi]huqfmfpxdmcmqfk
abbhujqyoaphnruaih[yidrkxgrxeoarph]fvryghhzqrobkbsck[dnokdwmkbktlfoihxl]ttptfiadsswiwsfbvf
djwqivpbexyvdquh[qmmdydhjbmunyjixviv]nradabzesdavhasjbjs[lsabjblhocebvyhfee]hwbyvnzltgezasg
maxofygcnygnwefsb[gdfccusdbseqsqfwva]cxdmwhnjitaazhjftn[kcratndpffdnbopd]wocybndplnotqgctr[ymceqbtulsezvftsi]eggtzhqojksdjapnv
lzihlroqvmeohnun[wskcytlimfagjyd]tnehibbupupuhepqz[hschjdjtzbvavum]zstmglsltkovvckpmqr
syzoikkgzplleoaz[ccpsffhupzpuhjcw]kaswkcoyhlrayhikme[qnjnztjupvbwyns]ggmkqikeziailzpuv[ugqgbpunztgvsxsp]mntxaumliefzkpnia
dxnkgspqhyejogxstsk[jfgckouqypxttst]axtisjbtaviwafh
baxazxlkzlyzvbdvtlc[yhegkwrrluxcnaahyl]nyegiipdjrnjobyjp[ulhbizabyukfvhmdg]hgmxctzxzewckasi[fuvwuolxkcfdkmtcngk]xvmvoydeiuaeawcz
bkomgyefwkmwwpsayb[rozknmkljogphrqywyo]vlpasefojmrzbpox[epogjnrjrntbcnzha]okfkagkfyagcszueu[gjpfnuvnazbnqylfm]busunenasatqeieestf
dwlbzijjdujfhotvj[swplsznswlgnaud]bgedlfxgjbwxekq
ffjhdorivdezjdb[tqkfrzxthlxadqstmqe]ttmrscyvbrresartqnh[rfztsxgbedcdecgv]qxcsxdqhshsqtjtl
zwosebsoogknldkh[mkcucbphbvnaqyxjope]aibznttouadentsy[xfucuvnlnchuawcapcq]jqherkgzqodpzydtgu
xondkuknycfwyenkceu[ugjlxueqtcyhyhni]bbofydvkhtjgxxnyrc[gpnwoarvjltzyhhe]qebolgjnwnstokco
cygilweroxmbmbmx[hopxissehjarmezawol]exywzaffjuhehvmbm
nbndomwcaauiluzbg[qjxqxhccqsvtkwm]oazwbouchccdhtrbnbv[vetwfilwgnxxxrhxar]mrbcnwlpciwpizkxj
xuabbxdwkutpsogcfea[tgetfqpgstsxrokcemk]cbftstsldgcqbxf[vwjejomptmifhdulc]ejeroshnazbwjjzofbe|]
| rickerbh/AoC | AoC2016/src/AoC201607.hs | mit | 183,702 | 0 | 13 | 2,752 | 1,449 | 750 | 699 | 93 | 2 |
{-# LANGUAGE DeriveFunctor #-}
module Compiler.PreAST.Type.Statement where
import Compiler.Serializable
import Compiler.PreAST.Type.Symbol
import Compiler.PreAST.Type.Expression
--------------------------------------------------------------------------------
-- Statement
data Statement a = Assignment a (Expression a)
| Return (Expression a)
| Invocation a [Expression a]
| Compound [Statement a]
| Branch (Expression a) (Statement a) (Statement a)
| Loop (Expression a) (Statement a)
deriving Functor
instance (Serializable a, Sym a) => Serializable (Statement a) where
serialize (Assignment v e) = serialize v ++ " := " ++ serialize e
serialize (Return e) = "return " ++ serialize e
serialize (Invocation sym []) = serialize sym ++ "()"
serialize (Invocation sym exprs) = serialize sym ++ "(" ++ exprs' ++ ")"
where exprs' = intercalate' ", " exprs
serialize (Compound stmts) = paragraph $ compound stmts
serialize (Branch e s t) = paragraph $
0 >>>> ["if " ++ serialize e]
++ 1 >>>> ["then " ++ serialize s]
++ 1 >>>> ["else " ++ serialize s]
serialize (Loop e s) = paragraph $
0 >>>> ["while " ++ serialize e ++ " do"]
++ 1 >>>> [s]
| banacorn/mini-pascal | src/Compiler/PreAST/Type/Statement.hs | mit | 1,334 | 0 | 13 | 371 | 422 | 220 | 202 | 26 | 0 |
-- | This module provides utilities for rendering the 'Ann' type of the
-- API. 'Ann' gives extra structure to textual information provided by
-- the backend, by adding nested annotations atop the text.
--
-- In the current School of Haskell code, 'Ann' is used for source
-- errors and type info. This allows things like links to docs for
-- identifiers, and better styling for source errors.
--
-- This module also provides utilities for getting highlight spans from
-- code, via Ace. This allows the display of annotated info to highlight
-- the involved expressions / types, and pass these 'ClassSpans' into
-- 'renderAnn'.
module View.Annotation
( -- * Annotations
renderAnn
, annText
-- * Rendering IdInfo links
, renderCodeAnn
-- * Highlighting Code
, getHighlightSpans
, getExpHighlightSpans
, getTypeHighlightSpans
-- ** Utilities
, NoNewlines
, unNoNewlines
, mkNoNewlines
, mayMkNoNewlines
) where
import qualified Data.Text as T
import GHCJS.Foreign
import GHCJS.Marshal
import GHCJS.Types
import Import hiding (ix, to)
import Model (switchTab, navigateDoc)
--------------------------------------------------------------------------------
-- Annotations
-- | This renders an 'Ann' type, given a function for rendering the
-- annotations.
--
-- This rendering function takes the annotation, and is given the
-- 'React' rendering of the nested content. This allows it to add
-- parent DOM nodes / attributes, in order to apply the effect of the
-- annotation.
--
-- It also takes a 'ClassSpans' value, which is used at the leaf
-- level, to slice up the spans of text, adding additional class
-- annotations. This is used to add the results of code highlighting
-- to annotated info.
renderAnn
:: forall a.
ClassSpans
-> Ann a
-> (forall b. a -> React b -> React b)
-> React ()
renderAnn spans0 x0 f = void $ go 0 spans0 x0
where
go :: Int -> ClassSpans -> Ann a -> React (Int, ClassSpans)
go ix spans (Ann ann inner) = f ann $ go ix spans inner
go ix spans (AnnGroup []) = return (ix, spans)
go ix spans (AnnGroup (x:xs)) = do
(ix', spans') <- go ix spans x
go ix' spans' (AnnGroup xs)
go ix spans (AnnLeaf txt) = do
forM_ (sliceSpans ix txt spans) $ \(chunk, mclass) -> span_ $ do
forM_ mclass class_
text chunk
return (end, dropWhile (\(_, end', _) -> end' <= end) spans)
where
end = ix + T.length txt
annText :: Ann a -> Text
annText (Ann _ x) = annText x
annText (AnnGroup xs) = T.concat (map annText xs)
annText (AnnLeaf x) = x
--------------------------------------------------------------------------------
-- Rendering IdInfo links
-- | Renders a 'CodeAnn'. This function is intended to be passed in
-- to 'renderAnn', or used to implement a function which is passed
-- into it.
renderCodeAnn :: CodeAnn -> React a -> React a
renderCodeAnn (CodeIdInfo info) inner = span_ $ do
class_ "docs-link"
title_ (displayIdInfo info)
onClick $ \_ state -> do
navigateDoc state (Just info)
switchTab state DocsTab
inner
--------------------------------------------------------------------------------
-- Highlighting code
type ClassSpans = [(Int, Int, Text)]
-- NOTE: prefixing for expressions doesn't seem to make a difference
-- for the current highlighter, but it might in the future.
-- | Get the highlight spans of an expression.
getExpHighlightSpans :: NoNewlines -> IO ClassSpans
getExpHighlightSpans = getHighlightSpansWithPrefix $ mkNoNewlines "x = "
-- | Get the highlight spans of a type.
getTypeHighlightSpans :: NoNewlines -> IO ClassSpans
getTypeHighlightSpans = getHighlightSpansWithPrefix $ mkNoNewlines "x :: "
getHighlightSpansWithPrefix :: NoNewlines -> NoNewlines -> IO ClassSpans
getHighlightSpansWithPrefix prefix codeLine = do
let offset = T.length (unNoNewlines prefix)
spans <- getHighlightSpans "ace/mode/haskell" (prefix <> codeLine)
return $
dropWhile (\(_, to, _) -> to <= 0) $
map (\(fr, to, x) -> (fr - offset, to - offset, x)) spans
getHighlightSpans :: Text -> NoNewlines -> IO ClassSpans
getHighlightSpans mode (NoNewlines codeLine) =
highlightCodeHTML (toJSString mode) (toJSString codeLine) >>=
indexArray 0 >>=
fromJSRef >>=
maybe (fail "Failed to access highlighted line html") return >>=
divFromInnerHTML >>=
spanContainerToSpans >>=
fromJSRef >>=
maybe (fail "Failed to marshal highlight spans") return
foreign import javascript "function() { var node = document.createElement('div'); node.innerHTML = $1; return node; }()"
divFromInnerHTML :: JSString -> IO (JSRef Element)
foreign import javascript "highlightCodeHTML"
highlightCodeHTML :: JSString -> JSString -> IO (JSArray JSString)
foreign import javascript "spanContainerToSpans"
spanContainerToSpans :: JSRef Element -> IO (JSRef ClassSpans)
--------------------------------------------------------------------------------
-- NoNewlines: utility for code highlighting
-- TODO: should probably use source spans / allow new lines instead
-- of having this newtype...
-- | This newtype enforces the invariant that the stored 'Text' doesn't
-- have the character \"\\n\".
newtype NoNewlines = NoNewlines Text
deriving (Eq, Show, Monoid)
unNoNewlines :: NoNewlines -> Text
unNoNewlines (NoNewlines x) = x
mkNoNewlines :: Text -> NoNewlines
mkNoNewlines = fromMaybe (error "mkNoNewlines failed") . mayMkNoNewlines
mayMkNoNewlines :: Text -> Maybe NoNewlines
mayMkNoNewlines x | "\n" `T.isInfixOf` x = Nothing
mayMkNoNewlines x = Just (NoNewlines x)
| fpco/schoolofhaskell | soh-client/src/View/Annotation.hs | mit | 5,613 | 8 | 14 | 1,070 | 1,165 | 619 | 546 | -1 | -1 |
{-# htermination elemIndex :: (Eq a, Eq k) => (a, k) -> [(a, k)] -> Maybe Int #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_elemIndex_12.hs | mit | 94 | 0 | 3 | 20 | 5 | 3 | 2 | 1 | 0 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Data.ByteString.Char8 as B8
import Data.Char (toLower)
import Data.Monoid
import qualified Data.Text as T
import Myracloud
import Myracloud.Types hiding (value)
import Options.Applicative
import Servant.Common.BaseUrl
import System.Exit
data Options = Options
{ optGlobalCredentials :: Credentials
, optGlobalBaseUrl :: BaseUrl
, optCommand :: Command
} deriving (Show, Eq)
data DnsListOptions = DnsListOptions
{ dnsListSite :: Site
, dnsListPage :: Int
} deriving (Show, Eq)
data Command = Create T.Text DnsRecordCreate
| List DnsListOptions
deriving (Show, Eq)
credentialsOption :: Parser Credentials
credentialsOption = (,)
<$> byteStringOption
( long "access-key"
<> metavar "ACCESS"
<> help "API access key")
<*> byteStringOption
( long "secret-key"
<> metavar "SECRET"
<> help "API secret key")
schemeOption :: Parser Scheme
schemeOption = option schemeReadM
( long "scheme"
<> metavar "SCHEME"
<> help "scheme to use, either http or https"
<> value Https
<> showDefaultWith (map toLower . show))
where
schemeReadM :: ReadM Scheme
schemeReadM = str >>= \s -> case toLower <$> s of
"http" -> return Http
"https" -> return Https
_ -> readerError $
"‘" ++ s ++ "’ is not a valid scheme, use http or https instead"
baseUrlOption :: Parser BaseUrl
baseUrlOption = BaseUrl
<$> schemeOption
<*> strOption
( long "host"
<> metavar "HOST"
<> help "API server address"
<> value "api.myracloud.com"
<> showDefaultWith Prelude.id)
<*> option auto
( long "port"
<> metavar "PORT"
<> help "port to use for the server"
<> value 443
<> showDefault)
byteStringOption :: Mod OptionFields String -> Parser B8.ByteString
byteStringOption x = B8.pack <$> strOption x
textOption :: Mod OptionFields String -> Parser T.Text
textOption x = T.pack <$> strOption x
siteOption :: Mod OptionFields String -> Parser Site
siteOption x = Site <$> textOption x
dnsListOptions :: Parser DnsListOptions
dnsListOptions = (<*>) helper $ DnsListOptions
<$> siteOption
( long "domain"
<> metavar "DOMAIN"
<> help "domain to query the records for" )
<*> option auto
( long "page"
<> metavar "PAGE"
<> help "page number of the list of records"
<> value 1
<> showDefault)
dnsCreateOptions :: Parser DnsRecordCreate
dnsCreateOptions = (<*>) helper $ DnsRecordCreate
<$> textOption
( long "subdomain"
<> metavar "SUBDOMAIN"
<> help "name to create a record for, e.g. sub.example.com" )
<*> textOption
( long "value"
<> metavar "VALUE"
<> help "value for the record, e.g. 127.0.0.1")
<*> option auto
( long "ttl"
<> metavar "TTL"
<> help "TTL for the record, e.g. 300")
<*> textOption
( long "type"
<> metavar "TYPE"
<> help "record type, e.g. A")
<*> switch
( long "active"
<> help "whether the record should be made active")
domainOption :: Parser T.Text
domainOption = textOption
( long "domain"
<> metavar "DOMAIN"
<> help "domain name we're querying")
commandOptions :: Parser Command
commandOptions = subparser $
(command "create" (info (Create <$> domainOption <*> dnsCreateOptions)
(progDesc "Create a record for a domain")))
<>
(command "list" (info (List <$> dnsListOptions)
(progDesc "List records for a domain")))
globalOptions :: Parser Options
globalOptions = Options
<$> credentialsOption
<*> baseUrlOption
<*> commandOptions
opts :: ParserInfo Options
opts = info (helper <*> globalOptions)
(fullDesc <> progDesc "Command line interface to MYRACLOUD")
exit :: (Show a, Show b) => Either a b -> IO ()
exit (Left x) = putStrLn ("ERROR: Failed with " <> show x) >> exitFailure
exit (Right x) = print x >> exitSuccess
main :: IO ()
main = execParser opts >>= \case
Options creds baseUrl com -> case com of
Create s r -> runCreate creds r (Site s) baseUrl >>= exit
List (DnsListOptions {..}) ->
runList creds dnsListSite dnsListPage baseUrl >>= exit
| zalora/myrapi | src/Main.hs | mit | 4,358 | 0 | 15 | 1,126 | 1,181 | 590 | 591 | 130 | 3 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Betfair.APING.Types.InstructionReportStatus
( InstructionReportStatus(..)
) where
import Data.Aeson.TH (Options (omitNothingFields),
defaultOptions, deriveJSON)
import Protolude
import Text.PrettyPrint.GenericPretty
data InstructionReportStatus
= SUCCESS
| FAILURE
| TIMEOUT
deriving (Eq, Show, Generic, Pretty)
$(deriveJSON defaultOptions {omitNothingFields = True} ''InstructionReportStatus)
| joe9/betfair-api | src/Betfair/APING/Types/InstructionReportStatus.hs | mit | 739 | 0 | 9 | 163 | 108 | 68 | 40 | 19 | 0 |
module Main where
import Base
import Simple
import Infeasible
import Clustering
import Stupid
main :: IO ()
main
= do putStrLn "Simple"
simple
putStrLn "Infeasible"
infeasible
putStrLn "Clustering"
clustering
putStrLn "Stupid"
stupid
| amosr/limp-cbc | examples/Test.hs | mit | 296 | 0 | 7 | 94 | 70 | 33 | 37 | 16 | 1 |
module Handler.Github where
import Import
import Blaze.ByteString.Builder (copyByteString, toByteString)
getGithubR :: Handler ()
getGithubR = do
_ <- requireProfile
mdest <- lookupGetParam "dest"
dest <-
case mdest of
Nothing -> fmap ($ ProfileR) getUrlRender
Just dest -> return dest
getGithubDest dest >>= redirect
getGithubDest :: Text -> Handler Text
getGithubDest redirectUrl = do
y <- getYesod
render <- getUrlRender
return $ decodeUtf8 $ toByteString $
copyByteString "https://github.com/login/oauth/authorize" ++
renderQueryBuilder True
[ ("client_id", Just $ githubClientId y)
, ("redirect_uri", Just $ encodeUtf8 $ render (GithubCallbackR redirectUrl))
, ("scope", Just "repo user admin:public_key")
] ++ copyByteString "#github"
deleteGithubR :: Handler ()
deleteGithubR = do
Entity pid _ <- requireProfile
$runDB $ update pid [ProfileGithubAccessKey =. Nothing]
setMessage
[shamlet|
Github access revoked.
For your security, you should revoke the authentication token and SSH keys on the
<a href=https://github.com/settings/applications>GitHub application settings page#
\.
|]
render <- getUrlRender
redirect $ render ProfileR ++ "#github"
| fpco/schoolofhaskell.com | src/Handler/Github.hs | mit | 1,365 | 0 | 15 | 361 | 303 | 150 | 153 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module SyntheticWeb.Observer
( service
) where
import Control.Applicative ((<|>))
import Control.Monad (forM_)
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BS
import Data.Time (NominalDiffTime)
import Snap.Core ( Snap
, ifTop
, emptyResponse
, putResponse
, setContentType
, setResponseCode
, writeBS )
import Snap.Http.Server ( defaultConfig
, httpServe
, setPort )
import SyntheticWeb.Counter ( ByteCounter (..)
, CounterSet
, FrozenSet (..)
, GlobalCounter (..)
, PatternCounter (..)
, freeze
, toThroughput )
import Text.Printf (printf)
service :: Int -> CounterSet -> IO ()
service port counterSet = do
let config = setPort port defaultConfig
httpServe config $
ifTop (renderStatistics counterSet)
<|> resourceNotFound
renderStatistics :: CounterSet -> Snap ()
renderStatistics counterSet = do
frozenSet@(FrozenSet (_, _, patternCounters)) <- liftIO $ freeze counterSet
let response = setResponseCode 200 $
setContentType "text/html" emptyResponse
putResponse response
writeBS htmlHead
writeBS $ htmlDiv "pink" (globalStats frozenSet)
forM_ (zip patternCounters alterStyles) $ \(patternCounter, style) ->
writeBS $ htmlDiv style (patternStats frozenSet patternCounter)
writeBS htmlFoot
resourceNotFound :: Snap ()
resourceNotFound = do
let response = setResponseCode 404 $
setContentType "text/plain" emptyResponse
putResponse response
writeBS "The requested resource was not found"
htmlDiv :: String -> [BS.ByteString] -> BS.ByteString
htmlDiv style xs =
BS.unlines $ concat
[ [ BS.pack $ printf "<div id=\"%s\">" style
, "<pre style=\"font-family:Courier,monospace;\">" ]
, xs
, [ "</pre>"
, "</div>" ] ]
globalStats :: FrozenSet -> [BS.ByteString]
globalStats (FrozenSet (t, GlobalCounter {..}, _)) =
let (dlTpt, ulTpt) = toThroughput totalByteCount t
in [ "==========================================================="
, BS.pack $ printf " Uptime : %.2fs"
(timeToDouble t)
, BS.pack $ printf " Total pattern time : %.2fs"
(timeToDouble totalPatternTime)
, BS.pack $ printf " Total download : %ld bytes at %s"
(download totalByteCount) (show dlTpt)
, BS.pack $ printf " Total upload : %ld bytes at %s"
(upload totalByteCount) (show ulTpt)
, BS.pack $ printf " Total # activations : %ld" totalActivations
, BS.pack $ printf " Total sleep time : %.2fs (%.2f%% of total)"
(timeToDouble totalSleepTime)
(timeToDouble $
totalSleepTime `percentOf` totalPatternTime)
, BS.pack $ printf " Total latency time : %.2fs (%.2f%% of total)"
(timeToDouble totalLatencyTime)
(timeToDouble $
totalLatencyTime `percentOf` totalPatternTime)
]
patternStats :: FrozenSet -> PatternCounter -> [BS.ByteString]
patternStats (FrozenSet (t, GlobalCounter {..}, _)) PatternCounter {..} =
let (dlTpt, ulTpt) = toThroughput byteCount t
in [ "==========================================================="
, BS.pack $ printf " Name : %s" patternName
, BS.pack $ printf " Pattern time : %.2fs (%.2f%% of total)"
(timeToDouble patternTime)
(timeToDouble $
patternTime `percentOf` totalPatternTime)
, BS.pack $ printf " Pattern download : %ld bytes at %s"
(download byteCount) (show dlTpt)
, BS.pack $ printf " Pattern upload : %ld bytes at %s"
(upload byteCount) (show ulTpt)
, BS.pack $ printf " # activations : %ld (%.2f%% of total)"
activations
((fromIntegral activations `percentOf`
fromIntegral totalActivations) :: Double)
, BS.pack $ printf " Sleep time : %.2fs (%.2f%% of pattern)"
(timeToDouble sleepTime)
(timeToDouble $ sleepTime `percentOf` patternTime)
, BS.pack $ printf " Latency time : %.2fs (%.2f%% of pattern)"
(timeToDouble latencyTime)
(timeToDouble $ latencyTime `percentOf` patternTime)
]
htmlHead :: BS.ByteString
htmlHead = BS.unlines
[ "<!DOCTYPE html>"
, "<html>"
, "<title>Synthetic Web Statistics</title>"
, "<meta http-equiv=\"refresh\" content=\"1\"/>"
, "<style>"
, "#pink{background-color:pink;margin-top:-17px;}"
, "#blue{background-color:lightblue;margin-top:-17px;}"
, "#gray{background-color:lightgray;margin-top:-17px;}"
, "</style>"
, "</head>"
, "<body>"
]
htmlFoot :: BS.ByteString
htmlFoot = BS.unlines
[ "</body>"
, "</html>"
]
percentOf :: (Fractional a, Ord a) => a -> a -> a
percentOf t1 t2
| t2 > 0 = t1 / t2 * 100
| otherwise = 0
timeToDouble :: NominalDiffTime -> Double
timeToDouble = realToFrac
alterStyles :: [String]
alterStyles = concat $ repeat ["gray", "blue"]
| kosmoskatten/synthetic-web | src/SyntheticWeb/Observer.hs | mit | 5,709 | 0 | 13 | 1,904 | 1,226 | 657 | 569 | 127 | 1 |
module Carbon.DataStructures.Trees.SelfBalancingBinarySearchTree (Tree (..), create, from_list, to_list, remove, removeall, count, find, size, height, add, prettyprint, rotate_cw, rotate_ccw) where
import qualified Carbon.DataStructures.Trees.GenericBinaryTree as GenericBinaryTree
import Data.List (foldl')
import Debug.Trace
data Tree a
= Branch (Tree a) a (Tree a) Int Int
| Leaf
deriving (Show)
instance GenericBinaryTree.GenericBinaryTree Tree where
is_leaf Leaf = True
is_leaf _ = False
left (Branch left _ _ _ _) = left
right (Branch _ _ right _ _) = right
node (Branch _ node _ _ _) = node
details (Branch _ _ _ n h) = "N: " ++ (show n) ++ "; H: " ++ (show h)
from_list :: (Ord a) => [a] -> Tree a
from_list li = foldl' (\ tree val -> (add tree val)) create li
to_list :: Tree a -> [a]
to_list Leaf = []
to_list (Branch left node right n _) = (to_list left) ++ (replicate n node) ++ (to_list right)
create :: Tree a
create = Leaf
add :: (Ord a) => Tree a -> a -> Tree a
add (Branch left node right n _) val
= let (new_left, new_right, new_n)
| val < node = ((add left val), right, n)
| val > node = (left, (add right val), n)
| otherwise = (left, right, (n + 1))
in balance (Branch new_left node new_right new_n ((max (height new_left) (height new_right)) + 1))
add (Leaf) val = Branch Leaf val Leaf 1 0
balance :: Tree a -> Tree a
balance (Branch left node right n h)
= let
factor = balance_factor (Branch left node right n h)
sub_factor
| factor > 0 = balance_factor right
| factor < 0 = balance_factor left
| otherwise = 0
in if (factor /= 2 && factor /= -2)
then (Branch left node right n h)
else
let (new_left, new_right)
| factor * sub_factor > 0 = (left, right)
| factor == 2 = (left, (rotate right sub_factor))
| otherwise = ((rotate left sub_factor), right)
in rotate (Branch new_left node new_right n ((max (height new_left) (height new_right)) + 1)) factor
balance (Leaf) = Leaf
side :: Tree a -> Int -> Tree a
side (Branch left _ right _ _) s = if (s > 0) then right else left
remove :: (Ord a) => Tree a -> a -> Tree a
remove (Branch left node right n h) val
| ((val == node) && (n == 1)) = removeall (Branch left node right n h) val
| otherwise = balance $ Branch new_left node new_right new_n ((max (height new_left) (height new_right)) + 1)
where (new_left, new_right, new_n)
| val < node = ((remove left val), right, n)
| val > node = (left, (remove right val), n)
| otherwise = (left, right, n - 1)
remove (Leaf) _ = Leaf
removeall :: (Ord a) => Tree a -> a -> Tree a
removeall (Branch Leaf node Leaf n h) val
| node == val = Leaf
| otherwise = (Branch Leaf node Leaf n h)
removeall (Branch left node right n h) val
= balance $ Branch new_left new_node new_right new_n ((max (height new_left) (height new_right)) + 1)
where (new_left, new_right, new_node, new_n)
| val < node = ((removeall left val), right, node, n)
| val > node = (left, (removeall right val), node, n)
| otherwise = let
pop_'root (Leaf) _ = trace "POP ROOT LEAF" (Leaf, (node, n))
pop_'root (Branch Leaf node Leaf n _) _ = (Leaf, (node, n))
pop_'root (Branch _ node Leaf n _) 1 = (Leaf, (node, n))
pop_'root (Branch Leaf node _ n _) 0 = (Leaf, (node, n))
pop_'root (Branch left node right n _) side
= let
ret = pop_'root (if side == 0 then left else right) side
(left', right') = if side == 0 then ((fst ret), right) else (left, (fst ret))
in (balance (Branch left' node right' n ((max (height left') (height right')) + 1)), (snd ret))
factor = balance_factor (Branch left node right n h)
ret = if factor < 0 then (pop_'root left 1) else (pop_'root right 0)
root' = snd ret
(left', right') = if factor < 0 then ((fst ret), right) else (left, (fst ret)) -- TODO: optimize branch with earlier call?
in (left', right', (fst root'), (snd root')) --(left, right, 0)
removeall (Leaf) _ = Leaf
count :: (Ord a) => Tree a -> a -> Int
count (Branch left node right n _) val
| val == node = n
| val > node = count right val
| otherwise = count left val
count (Leaf) _ = 0
find :: Tree a -> (a -> Int) -> Int
find (Branch left node right n _) f
| f node == 0 = n
| f node < 0 = find right f
| f node > 0 = find left f
find (Leaf) _ = 0
size :: Tree a -> Int
size (Branch left _ right n _) = (size left) + (size right) + (min n 1)
size (Leaf) = 0
height :: Tree a -> Int
height (Branch _ _ _ _ h) = h
height (Leaf) = -1
prettyprint :: Show a => Tree a -> String
prettyprint (Leaf) = "{}"
prettyprint (Branch left node right n h) = GenericBinaryTree.prettyprint (Branch left node right n h)
balance_factor :: Tree a -> Int
balance_factor (Branch left _ right _ _) = (height right) - (height left)
balance_factor (Leaf) = 0
rotate :: Tree a -> Int -> Tree a
rotate (Branch left node right n h) rotation
| rotation > 0 = rotate_ccw (Branch left node right n h)
| rotation < 0 = rotate_cw (Branch left node right n h)
| otherwise = (Branch left node right n h)
rotate_cw :: Tree a -> Tree a
rotate_cw (Branch (Branch left_left left_node left_right left_n _) node right n _)
= Branch new_left left_node new_right left_n ((max (height new_left) (height new_right)) + 1)
where (new_left, new_right) = (left_left, (Branch left_right node right n ((max (height left_right) (height right)) + 1)))
rotate_ccw :: Tree a -> Tree a
rotate_ccw (Branch left node (Branch right_left right_node right_right right_n _) n _)
= Branch new_left right_node new_right right_n ((max (height new_left) (height new_right)) + 1)
where (new_left, new_right) = ((Branch left node right_left n ((max (height left) (height right_left)) + 1)), right_right) | Raekye/Carbon | haskell/src/Carbon/DataStructures/Trees/SelfBalancingBinarySearchTree.hs | mit | 5,693 | 31 | 20 | 1,237 | 2,819 | 1,464 | 1,355 | 119 | 9 |
module Main where
import Serve
import Handler.Scim.Portal
main = serve "13573" scimPortalHandler | stnma7e/scim_serv | portal/Main.hs | mit | 98 | 0 | 5 | 13 | 23 | 14 | 9 | 4 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : System.Socket.Unsafe
-- Copyright : (c) Lars Petersen 2015
-- License : MIT
--
-- Maintainer : info@lars-petersen.net
-- Stability : experimental
--------------------------------------------------------------------------------
module System.Socket.Unsafe (
Socket (..)
-- * Unsafe operations
-- ** unsafeSend
, unsafeSend
-- ** unsafeSendTo
, unsafeSendTo
-- ** unsafeReceive
, unsafeReceive
-- ** unsafeReceiveFrom
, unsafeReceiveFrom
-- ** unsafeGetSocketOption
, unsafeGetSocketOption
-- ** unsafeSetSocketOption
, unsafeSetSocketOption
-- * Waiting for events
-- ** waitRead
, waitRead
-- ** waitWrite
, waitWrite
-- ** waitConnected
, waitConnected
-- ** tryWaitRetryLoop
, tryWaitRetryLoop
) where
import Control.Concurrent.MVar
import Control.Exception ( throwIO )
import Control.Monad
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Marshal
import Foreign.Storable
import System.Posix.Types ( Fd(..) )
import System.Socket.Internal.Socket
import System.Socket.Internal.SocketOption
import System.Socket.Internal.Platform
import System.Socket.Internal.Exception
import System.Socket.Internal.Message
-- | Like `System.Socket.send`, but using `Ptr` and length instead of a `ByteString`.
--
-- This function is /unsafe/. @bufPtr@ must refer to a buffer which size is at least @bufSize@ bytes.
unsafeSend :: Socket a t p -> Ptr b -> CSize -> MessageFlags -> IO CInt
unsafeSend s bufPtr bufSize flags =
tryWaitRetryLoop s waitWrite (\fd-> c_send fd bufPtr bufSize flags )
-- | Like `System.Socket.sendTo`, but using `Ptr` and length instead of a `ByteString`.
--
-- This function is /unsafe/. @bufPtr@ must refer to a buffer which size is at least @bufSize@ bytes.
unsafeSendTo :: Socket f t p -> Ptr b -> CSize -> MessageFlags -> Ptr (SocketAddress f) -> CInt -> IO CInt
unsafeSendTo s bufPtr bufSize flags addrPtr addrSize =
tryWaitRetryLoop s waitWrite (\fd-> c_sendto fd bufPtr (fromIntegral bufSize) flags addrPtr addrSize)
-- | Like `System.Socket.receive`, but using `Ptr` and length instead of a `ByteString`.
--
-- This function is /unsafe/. @bufPtr@ must refer to a buffer which size is at least @bufSize@ bytes.
unsafeReceive :: Socket a t p -> Ptr b -> CSize -> MessageFlags -> IO CInt
unsafeReceive s bufPtr bufSize flags =
tryWaitRetryLoop s waitRead (\fd-> c_recv fd bufPtr bufSize flags)
-- | Like `System.Socket.receiveFrom`, but using `Ptr` and length instead of a `ByteString`.
--
-- This function is /unsafe/. @bufPtr@ must refer to a buffer which size is at least @bufSize@ bytes.
unsafeReceiveFrom :: Socket f t p -> Ptr b -> CSize -> MessageFlags -> Ptr (SocketAddress f) -> Ptr CInt -> IO CInt
unsafeReceiveFrom s bufPtr bufSize flags addrPtr addrSizePtr =
tryWaitRetryLoop s waitRead (\fd-> c_recvfrom fd bufPtr bufSize flags addrPtr addrSizePtr)
tryWaitRetryLoop :: Socket f t p -> (Socket f t p -> Int -> IO ()) -> (Fd -> Ptr CInt -> IO CInt) -> IO CInt
tryWaitRetryLoop s@(Socket mfd) wait action = loop 0
where
loop iteration = do
-- acquire lock on socket
mi <- withMVar mfd $ \fd-> alloca $ \errPtr-> do
when (fd < 0) (throwIO eBadFileDescriptor)
i <- action fd errPtr
if i < 0 then do
err <- SocketException <$> peek errPtr
unless (err == eWouldBlock || err == eAgain || err == eInterrupted)
(throwIO err)
return Nothing
else
-- The following is quite interesting for debugging:
-- when (iteration /= 0) (print iteration)
return (Just i)
-- lock on socket is release here
case mi of
Just i ->
return i
Nothing -> do
wait s iteration -- this call is (eventually) blocking
loop $! iteration + 1 -- tail recursion
| lpeterse/haskell-socket | src/System/Socket/Unsafe.hs | mit | 3,952 | 0 | 25 | 848 | 811 | 434 | 377 | 55 | 3 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Solver where
import Control.Monad
import Control.Monad.Loops
import Data.Bifunctor
import Data.List
import Data.List.HT
import Data.Monoid
import Data.Ratio
import qualified Gaussian as G
{-
Notes about this module:
for the purpose of solving small scale puzzles, `solveMatOne` looks good enough,
however this approach does not work in general if we cannot find the multiplicative inverse
of some number (which is usually the case for non-prime modulos).
While Gaussian module implements an approach that solves linear systems in general,
we have trouble converting a solution back to one that works under modulo.
-}
data Err i
= NoMultInv i
| Underdetermined
| Todo String
| Gaussian String
deriving (Show, Eq)
-- expect both input to be positive numbers.
extEuclidean :: Integral i => i -> i -> (i, (i, i))
extEuclidean a0 b0 = aux (a0, 1, 0) (b0, 0, 1)
where
aux (r0, s0, t0) y@(r1, s1, t1) =
if r1 == 0
then (r0, (s0, t0))
else aux y (r, s0 - q * s1, t0 - q * t1)
where
(q, r) = r0 `quotRem` r1
-- computes multiplicative inverse modulo p.
-- returns input value on failure.
multInv :: Integral i => i -> i -> Either i i
multInv p x =
if comm == 1
then
Right $
-- p * s + x * t = 1
t `mod` p
else Left x
where
(comm, (_s, t)) = extEuclidean p x
type ElimStepM i = [[i]] -> Either (Err i) (Maybe ([i], [[i]]))
solveMat' :: Integral i => (i -> ElimStepM i) -> i -> [[i]] -> Either (Err i) [i]
solveMat' fallback m mat = do
ut <- upperTriangular fallback m mat
pure $ reverse $ unfoldr (solveStep m) ([], reverse ut)
solveMat :: Integral i => i -> [[i]] -> Either (Err i) [i]
solveMat = solveMat' (\_ _ -> Left Underdetermined)
solveMatOne :: Integral i => i -> [[i]] -> Either (Err i) [i]
solveMatOne = solveMat' underDetFallback
solveMatGaussian :: Integral i => i -> [[i]] -> Either (Err i) [i]
solveMatGaussian m modMat = do
let tr orig i =
init orig
<> [if i == j then m else 0 | j <- [0 .. l -1]]
<> [last orig]
l = length modMat
mat = zipWith tr modMat [0 ..]
varCount = length (head mat) - 1
ut = G.upperTriangular ((fmap . fmap) fromIntegral mat)
filled =
G.fillTriangular varCount ut
rResults = reverse $ unfoldr G.solveStep ([], reverse filled)
dElim = foldr lcm 1 (fmap denominator rResults)
nResults = fmap (* fromInteger dElim) rResults
invM <- first (const (Gaussian "no inv")) $ multInv (toInteger m) dElim
when (any ((/= 1) . denominator) nResults) $
-- note: this shouldn't happen.
Left (Gaussian $ "denom /= 1: " <> show ut)
pure $ take l $ fmap ((`mod` m) . (* fromInteger invM) . fromInteger . numerator) nResults
-- try to get one solution out of an underdetermined system.
underDetFallback :: Integral i => i -> ElimStepM i
underDetFallback m eqns
| null eqns = stop
| isLhsSquare = do
{-
note that here we also have l >= 1.
-}
let fstNonZeroInd =
getFirst
. mconcat
. fmap (First . findIndex (\v -> v `mod` m /= 0))
$ eqns
case fstNonZeroInd of
Nothing ->
{-
Making this determined by fixing underdetermined variables to 0.
-}
let (hdL : tlL) =
fmap
(<> [0])
[[if r == c then 1 else 0 | c <- [1 .. l]] | r <- [1 .. l]]
in Right $ Just (hdL, fmap (drop 1) tlL)
Just nzInd -> do
let common = foldr gcd m (concat eqns)
m' = m `div` common
eqns' = (fmap . fmap) (`div` common) eqns
(doShuffle, unShuffle) = shuffler nzInd
eqns'' = fmap doShuffle eqns'
{-
This might seem to be a potential for infinite loop,
but we have prevented that by moving a column that contains
non-zero element to the front to make sure it's making progress.
Update: another case is when gcd is 1, in which case we leave it unhandled for now.
-}
when (common == 1) $
Left $ Todo (show nzInd)
rsPre <- solveMatOne m' eqns''
let rs = unShuffle rsPre
(hdL : tlL) =
zipWith
(\r lhs -> lhs <> [r])
rs
[[if r == c then 1 else 0 | c <- [1 .. l]] | r <- [1 .. l]]
Right $ Just (hdL, fmap (drop 1) tlL)
| otherwise = stop
where
stop = Left Underdetermined
l = length eqns
isLhsSquare = all ((== l + 1) . length) eqns
upperTriangular
:: forall i.
Integral i
=> (i -> ElimStepM i)
-> i
-> [[i]]
-> Either (Err i) [[i]]
upperTriangular fallback m = unfoldrM elimStepM
where
elimStepM :: ElimStepM i
elimStepM eqns = do
let alts = do
-- any equation without a zero on front
(e@(hd : _), es) <- removeEach eqns
guard $ gcd m hd == 1
pure (e, es)
case alts of
[] ->
if null eqns
then Right Nothing
else fallback m eqns
([], _) : _ -> Left Underdetermined
(e@(hd : _), es) : _ -> do
invHd <- first NoMultInv $ multInv m hd
let mul x y = (x * y) `mod` m
eNorm = fmap (mul invHd) (e :: [i])
norm eqn@(eh : _) =
if eh == 0
then eqn
else zipWith (\a b -> (a - b) `mod` m) eqn (fmap (mul eh) eNorm)
norm _ = error "length not unique"
pure $ Just (eNorm, fmap (drop 1 . norm) es)
solveStep :: Integral i => i -> ([i], [[i]]) -> Maybe (i, ([i], [[i]]))
solveStep _ (_, []) = Nothing
solveStep m (xs, hd : tl) = do
let x = (rhs - sum (zipWith (*) lhs xs)) `mod` m
1 : ys = hd
rhs = last ys
lhs = init ys
pure (x, (x : xs, tl))
shuffler :: Int -> ([a] -> [a], [a] -> [a])
shuffler i =
if i <= 0
then (id, id)
else
let doShuffle xs =
if i >= l
then xs
else
let (pres, h : tl) = splitAt i xs
in h : pres <> tl
where
l = length xs
unShuffle xs =
if i >= l
then xs
else
let (hd : ys) = xs
(ys0, ys1) = splitAt i ys
in ys0 <> (hd : ys1)
where
l = length xs
in (doShuffle, unShuffle)
| Javran/misc | gaussian-elim/src/Solver.hs | mit | 6,510 | 0 | 23 | 2,263 | 2,349 | 1,251 | 1,098 | 151 | 6 |
-- | Data.TSTP.V module.
-- Adapted from https://github.com/agomezl/tstp2agda.
module Data.TSTP.V
( V
( V )
) where
------------------------------------------------------------------------------
import Athena.Utils.PrettyPrint ( Pretty ( pretty ) )
import Athena.Translation.Utils ( stdName )
------------------------------------------------------------------------------
-- The following code is from:
-- https://github.com/DanielSchuessler/logic-TPTP
-- and is used with the propose of reuses his
-- alex/happy parser in a more simple way
-- | Variable
newtype V = V String
deriving (Eq, Ord, Read, Show)
instance Pretty V where
pretty (V a) = pretty . stdName $ a
| jonaprieto/athena | src/Data/TSTP/V.hs | mit | 696 | 0 | 8 | 113 | 108 | 67 | 41 | 11 | 0 |
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-}
{-# LANGUAGE CPP #-}
-- | Description : Shell scripting wrapper using @Shelly@ for the @notebook@, and
-- @console@ commands.
module IHaskell.IPython (
replaceIPythonKernelspec,
defaultConfFile,
getIHaskellDir,
getSandboxPackageConf,
subHome,
kernelName,
KernelSpecOptions(..),
defaultKernelSpecOptions,
) where
import IHaskellPrelude
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Char8 as CBS
import Control.Concurrent (threadDelay)
import System.Argv0
import qualified Shelly as SH
import qualified System.IO as IO
import qualified System.FilePath as FP
import System.Directory
import System.Exit (exitFailure)
import Data.Aeson (toJSON)
import Data.Aeson.Text (encodeToTextBuilder)
import Data.Text.Lazy.Builder (toLazyText)
import Control.Monad (mplus)
import qualified System.IO.Strict as StrictIO
import qualified Paths_ihaskell as Paths
import qualified GHC.Paths
import IHaskell.Types
import System.Posix.Signals
import StringUtils (replace, split)
data KernelSpecOptions =
KernelSpecOptions
{ kernelSpecGhcLibdir :: String -- ^ GHC libdir.
, kernelSpecDebug :: Bool -- ^ Spew debugging output?
, kernelSpecConfFile :: IO (Maybe String) -- ^ Filename of profile JSON file.
, kernelSpecInstallPrefix :: Maybe String
, kernelSpecUseStack :: Bool -- ^ Whether to use @stack@ environments.
}
defaultKernelSpecOptions :: KernelSpecOptions
defaultKernelSpecOptions = KernelSpecOptions
{ kernelSpecGhcLibdir = GHC.Paths.libdir
, kernelSpecDebug = False
, kernelSpecConfFile = defaultConfFile
, kernelSpecInstallPrefix = Nothing
, kernelSpecUseStack = False
}
-- | The IPython kernel name.
kernelName :: String
kernelName = "haskell"
kernelArgs :: [String]
kernelArgs = ["--kernel", kernelName]
ipythonCommand :: SH.Sh SH.FilePath
ipythonCommand = do
jupyterMay <- SH.which "jupyter"
return $
case jupyterMay of
Nothing -> "ipython"
Just _ -> "jupyter"
locateIPython :: SH.Sh SH.FilePath
locateIPython = do
mbinary <- SH.which "jupyter"
case mbinary of
Nothing -> SH.errorExit "The Jupyter binary could not be located"
Just ipython -> return ipython
-- | Run the IPython command with any arguments. The kernel is set to IHaskell.
ipython :: Bool -- ^ Whether to suppress output.
-> [Text] -- ^ IPython command line arguments.
-> SH.Sh String -- ^ IPython output.
ipython suppress args = do
liftIO $ installHandler keyboardSignal (CatchOnce $ return ()) Nothing
-- We have this because using `run` does not let us use stdin.
cmd <- ipythonCommand
SH.runHandles cmd args handles doNothing
where
handles = [SH.InHandle SH.Inherit, outHandle suppress, errorHandle suppress]
outHandle True = SH.OutHandle SH.CreatePipe
outHandle False = SH.OutHandle SH.Inherit
errorHandle True = SH.ErrorHandle SH.CreatePipe
errorHandle False = SH.ErrorHandle SH.Inherit
doNothing _ stdout _ = if suppress
then liftIO $ StrictIO.hGetContents stdout
else return ""
-- | Run while suppressing all output.
quietRun path args = SH.runHandles path args handles nothing
where
handles = [SH.InHandle SH.Inherit, SH.OutHandle SH.CreatePipe, SH.ErrorHandle SH.CreatePipe]
nothing _ _ _ = return ()
fp :: SH.FilePath -> FilePath
fp = T.unpack . SH.toTextIgnore
-- | Create the directory and return it.
ensure :: SH.Sh SH.FilePath -> SH.Sh SH.FilePath
ensure getDir = do
dir <- getDir
SH.mkdir_p dir
return dir
-- | Return the data directory for IHaskell.
ihaskellDir :: SH.Sh FilePath
ihaskellDir = do
home <- maybe (error "$HOME not defined.") SH.fromText <$> SH.get_env "HOME"
fp <$> ensure (return (home SH.</> ".ihaskell"))
notebookDir :: SH.Sh SH.FilePath
notebookDir = ensure $ (SH.</> "notebooks") <$> ihaskellDir
getIHaskellDir :: IO String
getIHaskellDir = SH.shelly ihaskellDir
defaultConfFile :: IO (Maybe String)
defaultConfFile = fmap (fmap fp) . SH.shelly $ do
filename <- (SH.</> "rc.hs") <$> ihaskellDir
exists <- SH.test_f filename
return $ if exists
then Just filename
else Nothing
replaceIPythonKernelspec :: KernelSpecOptions -> IO ()
replaceIPythonKernelspec kernelSpecOpts = SH.shelly $ do
verifyIPythonVersion
installKernelspec True kernelSpecOpts
-- | Verify that a proper version of IPython is installed and accessible.
verifyIPythonVersion :: SH.Sh ()
verifyIPythonVersion = do
cmd <- ipythonCommand
pathMay <- SH.which cmd
case pathMay of
Nothing -> badIPython
"No Jupyter / IPython detected -- install Jupyter 3.0+ before using IHaskell."
Just path -> do
stdout <- SH.silently (SH.run path ["--version"])
stderr <- SH.lastStderr
let majorVersion = join . fmap listToMaybe . parseVersion . T.unpack
case mplus (majorVersion stderr) (majorVersion stdout) of
Nothing -> badIPython $ T.concat
[ "Detected Jupyter, but could not parse version number."
, "\n"
, "(stdout = "
, stdout
, ", stderr = "
, stderr
, ")"
]
Just version -> when (version < 3) oldIPython
where
badIPython :: Text -> SH.Sh ()
badIPython message = liftIO $ do
IO.hPutStrLn IO.stderr (T.unpack message)
exitFailure
oldIPython = badIPython
"Detected old version of Jupyter / IPython. IHaskell requires 3.0.0 or up."
-- | Install an IHaskell kernelspec into the right location. The right location is determined by
-- using `ipython kernelspec install --user`.
installKernelspec :: Bool -> KernelSpecOptions -> SH.Sh ()
installKernelspec replace opts = void $ do
ihaskellPath <- getIHaskellPath
confFile <- liftIO $ kernelSpecConfFile opts
let kernelFlags :: [String]
kernelFlags =
["--debug" | kernelSpecDebug opts] ++
(case confFile of
Nothing -> []
Just file -> ["--conf", file])
++ ["--ghclib", kernelSpecGhcLibdir opts]
++ ["--stack" | kernelSpecUseStack opts]
let kernelSpec = KernelSpec
{ kernelDisplayName = "Haskell"
, kernelLanguage = kernelName
, kernelCommand = [ihaskellPath, "kernel", "{connection_file}"] ++ kernelFlags
}
-- Create a temporary directory. Use this temporary directory to make a kernelspec directory; then,
-- shell out to IPython to install this kernelspec directory.
SH.withTmpDir $ \tmp -> do
let kernelDir = tmp SH.</> kernelName
let filename = kernelDir SH.</> "kernel.json"
SH.mkdir_p kernelDir
SH.writefile filename $ LT.toStrict $ toLazyText $ encodeToTextBuilder $ toJSON kernelSpec
let files = ["kernel.js", "logo-64x64.png"]
forM_ files $ \file -> do
src <- liftIO $ Paths.getDataFileName $ "html/" ++ file
SH.cp (SH.fromText $ T.pack src) (tmp SH.</> kernelName SH.</> file)
ipython <- locateIPython
let replaceFlag = ["--replace" | replace]
installPrefixFlag = maybe ["--user"] (\prefix -> ["--prefix", T.pack prefix]) (kernelSpecInstallPrefix opts)
cmd = concat [["kernelspec", "install"], installPrefixFlag, [SH.toTextIgnore kernelDir], replaceFlag]
SH.silently $ SH.run ipython cmd
kernelSpecCreated :: SH.Sh Bool
kernelSpecCreated = do
ipython <- locateIPython
out <- SH.silently $ SH.run ipython ["kernelspec", "list"]
let kernelspecs = map T.strip $ T.lines out
return $ T.pack kernelName `elem` kernelspecs
-- | Replace "~" with $HOME if $HOME is defined. Otherwise, do nothing.
subHome :: String -> IO String
subHome path = SH.shelly $ do
home <- T.unpack <$> fromMaybe "~" <$> SH.get_env "HOME"
return $ replace "~" home path
-- | Get the path to an executable. If it doensn't exist, fail with an error message complaining
-- about it.
path :: Text -> SH.Sh SH.FilePath
path exe = do
path <- SH.which $ SH.fromText exe
case path of
Nothing -> do
liftIO $ putStrLn $ "Could not find `" ++ T.unpack exe ++ "` executable."
fail $ "`" ++ T.unpack exe ++ "` not on $PATH."
Just exePath -> return exePath
-- | Parse an IPython version string into a list of integers.
parseVersion :: String -> Maybe [Int]
parseVersion versionStr =
let versions = map readMay $ split "." versionStr
parsed = all isJust versions
in if parsed
then Just $ map fromJust versions
else Nothing
-- | Get the absolute path to this IHaskell executable.
getIHaskellPath :: SH.Sh FilePath
getIHaskellPath = do
-- Get the absolute filepath to the argument.
f <- T.unpack <$> SH.toTextIgnore <$> liftIO getArgv0
-- If we have an absolute path, that's the IHaskell we're interested in.
if FP.isAbsolute f
then return f
else
-- Check whether this is a relative path, or just 'IHaskell' with $PATH resolution done by
-- the shell. If it's just 'IHaskell', use the $PATH variable to find where IHaskell lives.
if FP.takeFileName f == f
then do
ihaskellPath <- SH.which "ihaskell"
case ihaskellPath of
Nothing -> error "ihaskell not on $PATH and not referenced relative to directory."
Just path -> return $ T.unpack $ SH.toTextIgnore path
else liftIO $ makeAbsolute f
#if !MIN_VERSION_directory(1, 2, 2)
-- This is included in later versions of `directory`, but we cannot use later versions because GHC
-- library depends on a particular version of it.
makeAbsolute :: FilePath -> IO FilePath
makeAbsolute = fmap FP.normalise . absolutize
where
absolutize path -- avoid the call to `getCurrentDirectory` if we can
| FP.isRelative path = fmap (FP.</> path) getCurrentDirectory
| otherwise = return path
#endif
getSandboxPackageConf :: IO (Maybe String)
getSandboxPackageConf = SH.shelly $ do
myPath <- getIHaskellPath
let sandboxName = ".cabal-sandbox"
if not $ sandboxName `isInfixOf` myPath
then return Nothing
else do
let pieces = split "/" myPath
sandboxDir = intercalate "/" $ takeWhile (/= sandboxName) pieces ++ [sandboxName]
subdirs <- map fp <$> SH.ls (SH.fromText $ T.pack sandboxDir)
let confdirs = filter (isSuffixOf ("packages.conf.d" :: String)) subdirs
case confdirs of
[] -> return Nothing
dir:_ ->
return $ Just dir
| sumitsahrawat/IHaskell | src/IHaskell/IPython.hs | mit | 10,974 | 0 | 20 | 2,728 | 2,561 | 1,324 | 1,237 | 223 | 4 |
module Monoid3 where
import Data.Semigroup
import Test.QuickCheck
import SemiGroupAssociativeLaw
import MonoidLaws
import ArbitrarySum
data Two a b = Two a b deriving (Eq, Show)
instance (Semigroup a, Semigroup b) => Semigroup (Two a b) where
(Two x1 y1) <> (Two x2 y2) = Two (x1 <> x2) (y1 <> y2)
instance (Semigroup a, Monoid a, Semigroup b, Monoid b) => Monoid (Two a b) where
mempty = Two mempty mempty
mappend = (<>)
instance (Arbitrary a, Arbitrary b) => Arbitrary (Two a b) where
arbitrary = Two <$> arbitrary <*> arbitrary
type TwoAssoc = Two (Sum Int) (Sum Int) -> Two (Sum Int) (Sum Int) -> Two (Sum Int) (Sum Int) -> Bool
main :: IO ()
main = do
quickCheck (semigroupAssoc :: TwoAssoc)
quickCheck (monoidLeftIdentity :: Two (Sum Int) (Sum Int) -> Bool)
quickCheck (monoidRightIdentity :: Two (Sum Int) (Sum Int) -> Bool) | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/Monoid3.hs | mit | 869 | 0 | 12 | 181 | 390 | 203 | 187 | 20 | 1 |
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, OverloadedStrings #-}
{-
compatibility with older GHC
-}
module Compiler.Compat ( PackageKey
, packageKeyString
, modulePackageKey
, stringToPackageKey
, primPackageKey
, mainPackageKey
, modulePackageName
, getPackageName
, getInstalledPackageName
, getPackageVersion
, getInstalledPackageVersion
, getPackageLibDirs
, getInstalledPackageLibDirs
, getPackageHsLibs
, getInstalledPackageHsLibs
, searchModule
, Version(..)
, showVersion
, isEmptyVersion
) where
import Module
import DynFlags
import FastString
import Prelude
import Packages hiding ( Version )
import Data.Binary
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Version as DV
-- we do not support version tags since support for them has
-- been broken for a long time anyway
newtype Version = Version { unVersion :: [Integer] }
deriving (Ord, Eq, Show, Binary)
showVersion :: Version -> Text
showVersion = T.intercalate "." . map (T.pack . show) . unVersion
isEmptyVersion :: Version -> Bool
isEmptyVersion = null . unVersion
convertVersion :: DV.Version -> Version
convertVersion v = Version (map fromIntegral $ versionBranch v)
type PackageKey = UnitId
packageKeyString :: UnitId -> String
packageKeyString = unitIdString
modulePackageKey :: Module -> UnitId
modulePackageKey = moduleUnitId
stringToPackageKey :: String -> InstalledUnitId
stringToPackageKey = stringToInstalledUnitId
primPackageKey :: UnitId
primPackageKey = primUnitId
mainPackageKey :: UnitId
mainPackageKey = mainUnitId
getPackageName :: DynFlags -> UnitId -> String
getPackageName dflags
= maybe "" ((\(PackageName n) -> unpackFS n) . packageName)
. lookupPackage dflags
getInstalledPackageName :: DynFlags -> InstalledUnitId -> String
getInstalledPackageName dflags
= maybe "" ((\(PackageName n) -> unpackFS n) . packageName)
. lookupInstalledPackage dflags
modulePackageName :: DynFlags -> Module -> String
modulePackageName dflags
= getPackageName dflags . moduleUnitId
getPackageVersion :: DynFlags -> UnitId -> Maybe Version
getPackageVersion dflags
= fmap (convertVersion . packageVersion)
. lookupPackage dflags
getInstalledPackageVersion :: DynFlags -> InstalledUnitId -> Maybe Version
getInstalledPackageVersion dflags
= fmap (convertVersion . packageVersion)
. lookupInstalledPackage dflags
getPackageLibDirs :: DynFlags -> UnitId -> [FilePath]
getPackageLibDirs dflags
= maybe [] libraryDirs . lookupPackage dflags
getInstalledPackageLibDirs :: DynFlags -> InstalledUnitId -> [FilePath]
getInstalledPackageLibDirs dflags
= maybe [] libraryDirs . lookupInstalledPackage dflags
getPackageHsLibs :: DynFlags -> UnitId -> [String]
getPackageHsLibs dflags
= maybe [] hsLibraries . lookupPackage dflags
getInstalledPackageHsLibs :: DynFlags -> InstalledUnitId -> [String]
getInstalledPackageHsLibs dflags
= maybe [] hsLibraries . lookupInstalledPackage dflags
searchModule :: DynFlags -> ModuleName -> [(String, UnitId)]
searchModule dflags
= map ((\k -> (getPackageName dflags k, k)) . moduleUnitId . fst)
-- $ fromLookupResult
-- $ lookupModuleWithSuggestions dflags mn Nothing
. lookupModuleInAllPackages dflags
| ghcjs/ghcjs | src/Compiler/Compat.hs | mit | 3,659 | 0 | 13 | 914 | 768 | 421 | 347 | 83 | 1 |
import Data.List (delete)
-- adorable solution by Mgccl
permute [] = [[]]
permute xs = concat $ map (\x-> map (x:) (permute (delete x xs))) xs
printColumn [] = putStrLn ""
printColumn (x:xs) = do
putStrLn $ unwords $ map show x
printColumn xs
n = 4
main = do
let l = [1..n]
let p = permute l
print $ product l
printColumn p
| forgit/Rosalind | perm.hs | gpl-2.0 | 358 | 1 | 13 | 99 | 180 | 87 | 93 | 13 | 1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
{- |
Module : $Header$
Description : Abstract syntax for EnCL
Copyright : (c) Dominik Dietrich, Ewaryst Schulz, DFKI Bremen 2010
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Ewaryst.Schulz@dfki.de
Stability : experimental
Portability : portable
This module contains the abstract syntax types for EnCL as well as the
predefined operator configuration.
-}
module CSL.AS_BASIC_CSL
( EXPRESSION (..) -- datatype for numerical expressions (e.g. polynomials)
, EXTPARAM (..) -- datatype for extended parameters (e.g. [I=0])
, BASIC_ITEM (..) -- Items of a Basic Spec
, BASIC_SPEC (..) -- Basic Spec
, SYMB_ITEMS (..) -- List of symbols
, SYMB (..) -- Symbols
, SYMB_MAP_ITEMS (..) -- Symbol map
, SYMB_OR_MAP (..) -- Symbol or symbol map
, OPNAME (..) -- predefined operator names
, OPID (..) -- identifier for operators
, ConstantName (..) -- names of user-defined constants
, OP_ITEM (..) -- operator declaration
, VAR_ITEM (..) -- variable declaration
, VarDecl (..) -- variable declaration in assignment
, OpDecl (..) -- operator declaration in assignment
, EPDecl (..) -- extparam declaration
, EPVal (..) -- extparam values
, getEPVarRef
, Domain -- domains for variable declarations
, EPDomain -- domains for extended parameter declarations
, GroundConstant (..) -- constants for domain formation
, cmpFloatToInt -- comparer for APFloat with APInt
, AssDefinition (..) -- A function or constant definition
, InstantiatedConstant(..) -- for function constants we need to store the
-- instantiation
, CMD (..) -- Command datatype
, OperatorState (..) -- Class providing operator lookup
, OpInfo (..) -- Type for Operator information
, BindInfo (..) -- Type for Binder information
, operatorInfo -- Operator information for pretty printing
-- and static analysis
, operatorInfoMap -- allows efficient lookup of ops by printname
, operatorInfoNameMap -- allows efficient lookup of ops by opname
, operatorBindInfoMap
, mergeOpArityMap -- for combining two operator arity maps
, getOpInfoMap
, getOpInfoNameMap
, getBindInfoMap
, lookupOpInfo
, lookupOpInfoForParsing
, lookupBindInfo
, APInt, APFloat -- arbitrary precision numbers
, toFraction, fromFraction
, OpInfoMap
, OpInfoNameMap
, BindInfoMap
, showOPNAME
, maxPrecedence
) where
import Common.Id as Id
import Common.AS_Annotation as AS_Anno
import qualified Data.Map as Map
import Data.Ratio
import CSL.TreePO
-- ---------------------------------------------------------------------------
-- * EnCL Basic Data Structures and utils
-- ---------------------------------------------------------------------------
-- Arbitrary precision numbers
type APInt = Integer
type APFloat = Rational
cmpFloatToInt :: APFloat -> APInt -> Ordering
cmpFloatToInt a b = compare a $ fromFraction b 1
fromFraction :: Integer -> Integer -> APFloat
fromFraction = (%)
toFraction :: APFloat -> (Integer, Integer)
toFraction r = (numerator r, denominator r)
-- | operator symbol declaration
data OP_ITEM = Op_item [Id.Token] Id.Range
deriving Show
-- | variable symbol declaration
data VAR_ITEM = Var_item [Id.Token] Domain Id.Range
deriving Show
newtype BASIC_SPEC = Basic_spec [AS_Anno.Annoted (BASIC_ITEM)]
deriving Show
data GroundConstant = GCI APInt | GCR APFloat deriving Show
cmpGCs :: GroundConstant -> GroundConstant -> Ordering
cmpGCs (GCI a) (GCI b) = compare a b
cmpGCs (GCR a) (GCR b) = compare a b
cmpGCs (GCI a) (GCR b) = swapCompare $ cmpFloatToInt b a
cmpGCs (GCR a) (GCI b) = cmpFloatToInt a b
instance Eq GroundConstant where
a == b = cmpGCs a b == EQ
instance Ord GroundConstant where
compare = cmpGCs
instance Continuous GroundConstant
type Domain = SetOrInterval GroundConstant
type EPDomain = ClosedInterval EPVal
-- | A constant or function definition
data AssDefinition = ConstDef EXPRESSION | FunDef [String] EXPRESSION
deriving (Eq, Ord, Show)
data InstantiatedConstant = InstantiatedConstant
{ constName :: ConstantName
, instantiation :: [EXPRESSION] } deriving (Show, Eq, Ord)
-- | basic items: an operator, extended parameter or variable declaration or an axiom
data BASIC_ITEM =
Op_decl OP_ITEM
| EP_decl [(Id.Token, EPDomain)]
| EP_domdecl [(Id.Token, APInt)]
| EP_defval [(Id.Token, APInt)]
| Var_decls [VAR_ITEM]
| Axiom_item (AS_Anno.Annoted CMD)
deriving Show
-- | Extended Parameter Datatype
data EXTPARAM = EP Id.Token String APInt deriving (Eq, Ord, Show)
data EPDecl = EPDecl Id.Token -- name
EPDomain -- a domain over which the ep ranges
(Maybe APInt) -- evtl. a default value
deriving (Eq, Ord, Show)
-- | Extended Parameter value may be an integer or a reference to an 'EPDomVal'.
-- This type is used for the domain specification of EPs (see 'EPDomain').
data EPVal = EPVal APInt | EPConstRef Id.Token deriving (Eq, Ord, Show)
getEPVarRef :: EPVal -> Maybe Id.Token
getEPVarRef (EPConstRef tok) = Just tok
getEPVarRef _ = Nothing
data OPNAME =
-- arithmetic operators
OP_mult | OP_div | OP_plus | OP_minus | OP_neg | OP_pow
-- roots, trigonometric and other operators
| OP_fthrt | OP_sqrt | OP_abs | OP_max | OP_min | OP_sign
| OP_cos | OP_sin | OP_tan | OP_cot | OP_Pi
| OP_reldist
-- special CAS operators
| OP_minimize | OP_minloc | OP_maximize | OP_maxloc | OP_factor | OP_approx
| OP_divide | OP_factorize | OP_int | OP_rlqe | OP_simplify | OP_solve
-- comparison predicates
| OP_neq | OP_lt | OP_leq | OP_eq | OP_gt | OP_geq | OP_convergence
| OP_reldistLe
-- containment predicate
| OP_in
-- special CAS constants
| OP_undef | OP_failure
-- boolean constants and connectives
| OP_false | OP_true | OP_not | OP_and | OP_or | OP_impl
-- quantifiers
| OP_ex | OP_all
-- types
| OP_hastype | OP_real
deriving (Eq, Ord)
instance Show OPNAME where
show = showOPNAME
showOPNAME :: OPNAME -> String
showOPNAME x =
case x of
OP_neq -> "!="
OP_mult -> "*"
OP_plus -> "+"
OP_minus -> "-"
OP_neg -> "-"
OP_div -> "/"
OP_lt -> "<"
OP_leq -> "<="
OP_eq -> "="
OP_gt -> ">"
OP_geq -> ">="
OP_Pi -> "Pi"
OP_pow -> "^"
OP_abs -> "abs"
OP_sign -> "sign"
OP_all -> "all"
OP_and -> "and"
OP_convergence -> "convergence"
OP_cos -> "cos"
OP_divide -> "divide"
OP_ex -> "ex"
OP_factor -> "factor"
OP_factorize -> "factorize"
OP_fthrt -> "fthrt"
OP_impl -> "impl"
OP_int -> "int"
OP_max -> "max"
OP_maximize -> "maximize"
OP_maxloc -> "maxloc"
OP_min -> "min"
OP_minimize -> "minimize"
OP_minloc -> "minloc"
OP_not -> "not"
OP_or -> "or"
OP_reldist -> "reldist"
OP_reldistLe -> "reldistLe"
OP_rlqe -> "rlqe"
OP_simplify -> "simplify"
OP_sin -> "sin"
OP_solve -> "solve"
OP_sqrt -> "sqrt"
OP_tan -> "tan"
OP_cot -> "cot"
OP_false -> "false"
OP_true -> "true"
OP_in -> "in"
OP_approx -> "approx"
OP_undef -> "undef"
OP_failure -> "fail"
OP_hastype -> "::"
OP_real -> "real"
data OPID = OpId OPNAME | OpUser ConstantName deriving (Eq, Ord, Show)
-- | We differentiate between simple constant names and indexed constant names
-- resulting from the extended parameter elimination.
data ConstantName = SimpleConstant String | ElimConstant String Int
deriving (Eq, Ord, Show)
{-
instance Show OPID where
show (OpId n) = show n
show (OpUser s) = show s
instance Show ConstantName where
show (SimpleConstant s) = s
show (ElimConstant s i) = if i > 0 then s ++ "__" ++ show i else s
-}
-- | Datatype for expressions
data EXPRESSION =
Var Id.Token
| Op OPID [EXTPARAM] [EXPRESSION] Id.Range
-- TODO: don't need lists anymore, they should be removed soon
| List [EXPRESSION] Id.Range
| Interval Double Double Id.Range
| Int APInt Id.Range
| Rat APFloat Id.Range
deriving (Eq, Ord, Show)
data VarDecl = VarDecl Id.Token (Maybe Domain) deriving (Show, Eq, Ord)
data OpDecl = OpDecl ConstantName [EXTPARAM] [VarDecl] Id.Range
deriving (Show, Eq, Ord)
-- TODO: add Range-support to this type
data CMD = Ass OpDecl EXPRESSION
| Cmd String [EXPRESSION]
| Sequence [CMD] -- program sequence
| Cond [(EXPRESSION, [CMD])]
| Repeat EXPRESSION [CMD] -- constraint, statements
deriving (Show, Eq, Ord)
-- | symbol lists for hiding
data SYMB_ITEMS = Symb_items [SYMB] Id.Range
-- pos: SYMB_KIND, commas
deriving (Show, Eq)
-- | symbol for identifiers
newtype SYMB = Symb_id Id.Token
-- pos: colon
deriving (Show, Eq)
-- | symbol maps for renamings
data SYMB_MAP_ITEMS = Symb_map_items [SYMB_OR_MAP] Id.Range
-- pos: SYMB_KIND, commas
deriving (Show, Eq)
-- | symbol map or renaming (renaming then denotes the identity renaming)
data SYMB_OR_MAP = Symb SYMB
| Symb_map SYMB SYMB Id.Range
-- pos: "|->"
deriving (Show, Eq)
-- ---------------------------------------------------------------------------
-- * Predefined Operators: info for parsing/printing and static analysis
-- ---------------------------------------------------------------------------
data BindInfo = BindInfo { bindingVarPos :: [Int] -- ^ argument positions of
-- binding variables
, boundBodyPos :: [Int] -- ^ argument positions of
-- bound terms
} deriving (Eq, Ord, Show)
data OpInfo = OpInfo { prec :: Int -- ^ precedence between 0 and maxPrecedence
, infx :: Bool -- ^ True = infix
, arity :: Int -- ^ the operator arity
, foldNAry :: Bool -- ^ True = fold nary-applications
-- during construction into binary ones
, opname :: OPNAME -- ^ The actual operator name
, bind :: Maybe BindInfo -- ^ More info for binders
} deriving (Eq, Ord, Show)
type ArityMap = Map.Map Int OpInfo
type OpInfoArityMap a = Map.Map a ArityMap
type OpInfoMap = OpInfoArityMap String
type OpInfoNameMap = OpInfoArityMap OPNAME
type BindInfoMap = Map.Map String OpInfo
-- | Merges two OpInfoArityMaps together with the first map as default map
-- and the second overwriting the default values
mergeOpArityMap :: Ord a => OpInfoArityMap a -> OpInfoArityMap a
-> OpInfoArityMap a
mergeOpArityMap = flip $ Map.unionWith Map.union
-- | Mapping of operator names to arity-'OpInfo'-maps (an operator may
-- behave differently for different arities).
getOpInfoMap :: (OpInfo -> String) -> [OpInfo] -> OpInfoMap
getOpInfoMap pf oinfo = foldl f Map.empty oinfo
where f m oi = Map.insertWith Map.union (pf oi)
(Map.fromList [(arity oi, oi)]) m
-- | Same as operatorInfoMap but with keys of type OPNAME instead of String
getOpInfoNameMap :: [OpInfo] -> OpInfoNameMap
getOpInfoNameMap oinfo = foldl f Map.empty oinfo
where f m oi = Map.insertWith Map.union (opname oi)
(Map.fromList [(arity oi, oi)]) m
-- | a special map for binders which have to be unique for each name
-- (no different arities).
getBindInfoMap :: [OpInfo] -> BindInfoMap
getBindInfoMap oinfo = foldl f Map.empty oinfo
where f m oi@(OpInfo{bind = Just _}) =
Map.insertWith cf (show $ opname oi) oi m
f m _ = m
cf a _ = error $ "operatorBindInfoMap: duplicate entry for "
++ (show $ opname a)
-- | opInfoMap for the predefined 'operatorInfo'
operatorInfoMap :: OpInfoMap
operatorInfoMap = getOpInfoMap (show . opname) operatorInfo
-- | opInfoNameMap for the predefined 'operatorInfo'
operatorInfoNameMap :: OpInfoNameMap
operatorInfoNameMap = getOpInfoNameMap operatorInfo
operatorBindInfoMap :: BindInfoMap
operatorBindInfoMap = getBindInfoMap operatorInfo
-- | Mapping of operator names to arity-'OpInfo'-maps (an operator may
-- behave differently for different arities).
operatorInfo :: [OpInfo]
operatorInfo =
let -- arity (-1 means flex), precedence, infix
toSgl n i p = OpInfo { prec = if p == 0 then maxPrecedence else p
, infx = p > 0
, arity = i
, opname = n
, foldNAry = False
, bind = Nothing
}
toSglBind n i bv bb =
OpInfo { prec = maxPrecedence
, infx = False
, arity = i
, opname = n
, foldNAry = False
, bind = Just $ BindInfo [bv] [bb]
}
-- arityX simple ops
aX i s = toSgl s i 0
-- arityflex simple ops
aflex = aX (-1)
-- arity2 binder
a2bind bv bb s = toSglBind s 2 bv bb
-- arity4 binder
a4bind bv bb s = toSglBind s 4 bv bb
-- arity2 infix with precedence
a2i p s = toSgl s 2 p
in map (aX 0) [ OP_failure, OP_undef, OP_Pi, OP_true, OP_false, OP_real ]
++ map (aX 1)
[ OP_neg, OP_cos, OP_sin, OP_tan, OP_cot, OP_sqrt, OP_fthrt
, OP_abs, OP_sign, OP_simplify, OP_rlqe, OP_factor
, OP_factorize ]
++ map (a2i 5) [ OP_hastype ]
++ map (a2bind 0 1) [ OP_ex, OP_all ]
++ map (a2i 30) [ OP_or, OP_impl ]
++ map (a2i 40) [ OP_and ]
++ map (a2i 50) [ OP_eq, OP_gt, OP_leq, OP_geq, OP_neq, OP_lt, OP_in]
++ map (a2i 60) [ OP_plus ]
++ map (a2i 70) [ OP_minus ]
++ map (a2i 80) [OP_mult]
++ map (a2i 90) [OP_div]
++ map (a2i 100) [OP_pow]
++ map (aX 2)
[ OP_int, OP_divide, OP_solve, OP_convergence, OP_reldist
, OP_approx]
++ map (aX 3) [OP_reldistLe]
++ map aflex [ OP_min, OP_max ]
++ map (a2bind 1 0) [ OP_maximize, OP_minimize ]
++ map (a4bind 1 0) [ OP_maxloc, OP_minloc ]
maxPrecedence :: Int
maxPrecedence = 120
-- ---------------------------------------------------------------------------
-- * OpInfo lookup utils
-- ---------------------------------------------------------------------------
class OperatorState a where
addVar :: a -> String -> a
addVar = const
isVar :: a -> String -> Bool
isVar _ _ = False
lookupOperator :: a
-> String -- ^ operator name
-> Int -- ^ operator arity
-> Either Bool OpInfo
lookupBinder :: a
-> String -- ^ binder name
-> Maybe OpInfo
instance OperatorState () where
lookupOperator _ = lookupOpInfoForParsing operatorInfoMap
lookupBinder _ = flip Map.lookup operatorBindInfoMap
instance OperatorState (OpInfoMap, BindInfoMap) where
lookupOperator = lookupOpInfoForParsing . fst
lookupBinder = flip Map.lookup . snd
-- | For the given name and arity we lookup an 'OpInfo', where arity=-1
-- means flexible arity. If an operator is registered for the given
-- string but not for the arity we return: Left True.
-- This function is designed for the lookup of operators in not statically
-- analyzed terms. For statically analyzed terms use lookupOpInfo.
lookupOpInfoForParsing :: OpInfoMap -- ^ map to be used for lookup
-> String -- ^ operator name
-> Int -- ^ operator arity
-> Either Bool OpInfo
lookupOpInfoForParsing oiMap op arit =
case Map.lookup op oiMap of
Just oim ->
case Map.lookup arit oim of
Just x -> Right x
Nothing ->
case Map.lookup (-1) oim of
Just x -> Right x
_ -> Left True
_ -> Left False
-- | For the given name and arity we lookup an 'OpInfo', where arity=-1
-- means flexible arity. If an operator is registered for the given
-- string but not for the arity we return: Left True.
lookupOpInfo :: OpInfoNameMap -> OPID -- ^ operator id
-> Int -- ^ operator arity
-> Either Bool OpInfo
lookupOpInfo oinm (OpId op) arit =
case Map.lookup op oinm of
Just oim ->
case Map.lookup arit oim of
Just x -> Right x
Nothing ->
case Map.lookup (-1) oim of
Just x -> Right x
_ -> Left True
_ -> error $ "lookupOpInfo: no opinfo for " ++ show op
lookupOpInfo _ (OpUser _) _ = Left False
-- | For the given name and arity we lookup an 'BindInfo', where arity=-1
-- means flexible arity.
lookupBindInfo :: OpInfoNameMap -> OPID -- ^ operator name
-> Int -- ^ operator arity
-> Maybe BindInfo
lookupBindInfo oinm (OpId op) arit =
case Map.lookup op oinm of
Just oim ->
case Map.lookup arit oim of
Just x -> bind x
_ -> Nothing
_ -> error $ "lookupBindInfo: no opinfo for " ++ show op
lookupBindInfo _ (OpUser _) _ = Nothing
| nevrenato/Hets_Fork | CSL/AS_BASIC_CSL.hs | gpl-2.0 | 18,108 | 0 | 25 | 5,560 | 3,753 | 2,110 | 1,643 | 343 | 51 |
type Op a x = x -> a | hmemcpy/milewski-ctfp-pdf | src/content/2.4/code/haskell/snippet03.hs | gpl-3.0 | 20 | 0 | 5 | 7 | 13 | 8 | 5 | 1 | 0 |
module Test.Control.Monad.Progress where
| Purview/purview | test/Test/Control/Monad/Progress.hs | gpl-3.0 | 42 | 0 | 3 | 4 | 8 | 6 | 2 | 1 | 0 |
module Math.Structure.Module
( LinearSemiringLeftAction
, LinearSemiringRightAction
, LeftModule
, RightModule
, Module
, NonUnitalLeftModule
, NonUnitalRightModule
, NonUnitalModule
, SemiLeftAlgebra
, SemiRightAlgebra
, SemiAlgebra
, LeftAlgebra
, RightAlgebra
, Algebra
, NonUnitalLeftAlgebra
, NonUnitalRightAlgebra
, NonUnitalAlgebra
)
where
import Math.Structure.Module.Algebra
import Math.Structure.Module.LinearAction
import Math.Structure.Module.Module
| martinra/algebraic-structures | src/Math/Structure/Module.hs | gpl-3.0 | 504 | 0 | 4 | 86 | 81 | 55 | 26 | 21 | 0 |
module Main where
import Data.Foldable
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Debug.Trace
centerDot :: Diagram B
centerDot = circle 0.5 # fc red
data Label = Label
{ label :: String
, posX :: Double
, posY :: Double
, parity :: Bool
}
boxed :: Label -> Diagram B
boxed Label{..} = foldl1 atop
[ text label
, rect 2 {-(fromIntegral 2(length label))-} 1.5 # fc lightgrey # lw none
]
flipTo :: Bool -> Double
flipTo b = if b then 1 else (-1)
atStep :: Int -> Label -> Diagram B
atStep n lbl@Label{..}
= let ratX = posX / abs posY in
let ratY = posY / abs posX in
let posX' = posX + 0.25 * fromIntegral n * ratX in
let posY' = posY + 0.25 * fromIntegral n * ratY in
if posX' < -11 || posX' > 11 then mempty else
if posY' < -6 || posY' > 6 then mempty else
translateX posX' $ translateY posY'
$ rotateBy (product [ signum (fromIntegral n)
, flipTo parity
, (-1)^n
, 1/32 ])
(boxed lbl)
myDiagram :: String -> String -> Int -> Diagram B
myDiagram fun typ n = fold
[ -- declaration fun : typ
atStep n $ Label fun (-7.5) 3 False
, translateX (-4.5) $ translateY 3 $ text ": Env"
, atStep n $ Label typ (-1.5) 3 True
, translateX 3 $ translateY 3 $ text "→ Tm → Tm"
-- equation fun (f $ t) = ...
, atStep n $ Label fun (-7.5) 1 False
, translateX (-4) $ translateY 1 $ text "(f $ t) ="
, atStep n $ Label fun (-0.5) 1 False
, translateX 1.5 $ translateY 1 $ text "f $ "
, atStep n $ Label fun 3.5 1 False
, translateX 5 $ translateY 1 $ text "t"
, rect 20 10 # fc white
] # clipped (rect 20 10)
reel :: [[Diagram B]]
reel =
let cols = [0..5]; rows = [0..1]; sloc = reverse cols; swor = reverse rows in
((myDiagram "ren" "Var" 0 <$ cols) <$ [""])
++ map (\ n -> map (myDiagram "ren" "Var" . (5*n+)) cols) rows
++ map (\ n -> map (myDiagram "sub" "Tm" . (5*n+)) sloc) swor
++ ((myDiagram "sub" "Tm" 0 <$ cols) <$ [""])
script :: Diagram B
script = foldl1 (===) $ map (foldl1 (|||)) reel
main :: IO ()
main = gifMain $ map (, 20) $ concat reel
| gallais/potpourri | haskell/stopmotion/src/Main.hs | gpl-3.0 | 2,162 | 0 | 22 | 610 | 967 | 496 | 471 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.Dataproc.Projects.Regions.Operations.SetIAMPolicy
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Sets the access control policy on the specified resource. Replaces any
-- existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and
-- PERMISSION_DENIED errors.
--
-- /See:/ <https://cloud.google.com/dataproc/ Cloud Dataproc API Reference> for @dataproc.projects.regions.operations.setIamPolicy@.
module Network.Google.Resource.Dataproc.Projects.Regions.Operations.SetIAMPolicy
(
-- * REST Resource
ProjectsRegionsOperationsSetIAMPolicyResource
-- * Creating a Request
, projectsRegionsOperationsSetIAMPolicy
, ProjectsRegionsOperationsSetIAMPolicy
-- * Request Lenses
, prosipXgafv
, prosipUploadProtocol
, prosipAccessToken
, prosipUploadType
, prosipPayload
, prosipResource
, prosipCallback
) where
import Network.Google.Dataproc.Types
import Network.Google.Prelude
-- | A resource alias for @dataproc.projects.regions.operations.setIamPolicy@ method which the
-- 'ProjectsRegionsOperationsSetIAMPolicy' request conforms to.
type ProjectsRegionsOperationsSetIAMPolicyResource =
"v1" :>
CaptureMode "resource" "setIamPolicy" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SetIAMPolicyRequest :>
Post '[JSON] Policy
-- | Sets the access control policy on the specified resource. Replaces any
-- existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and
-- PERMISSION_DENIED errors.
--
-- /See:/ 'projectsRegionsOperationsSetIAMPolicy' smart constructor.
data ProjectsRegionsOperationsSetIAMPolicy =
ProjectsRegionsOperationsSetIAMPolicy'
{ _prosipXgafv :: !(Maybe Xgafv)
, _prosipUploadProtocol :: !(Maybe Text)
, _prosipAccessToken :: !(Maybe Text)
, _prosipUploadType :: !(Maybe Text)
, _prosipPayload :: !SetIAMPolicyRequest
, _prosipResource :: !Text
, _prosipCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ProjectsRegionsOperationsSetIAMPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prosipXgafv'
--
-- * 'prosipUploadProtocol'
--
-- * 'prosipAccessToken'
--
-- * 'prosipUploadType'
--
-- * 'prosipPayload'
--
-- * 'prosipResource'
--
-- * 'prosipCallback'
projectsRegionsOperationsSetIAMPolicy
:: SetIAMPolicyRequest -- ^ 'prosipPayload'
-> Text -- ^ 'prosipResource'
-> ProjectsRegionsOperationsSetIAMPolicy
projectsRegionsOperationsSetIAMPolicy pProsipPayload_ pProsipResource_ =
ProjectsRegionsOperationsSetIAMPolicy'
{ _prosipXgafv = Nothing
, _prosipUploadProtocol = Nothing
, _prosipAccessToken = Nothing
, _prosipUploadType = Nothing
, _prosipPayload = pProsipPayload_
, _prosipResource = pProsipResource_
, _prosipCallback = Nothing
}
-- | V1 error format.
prosipXgafv :: Lens' ProjectsRegionsOperationsSetIAMPolicy (Maybe Xgafv)
prosipXgafv
= lens _prosipXgafv (\ s a -> s{_prosipXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
prosipUploadProtocol :: Lens' ProjectsRegionsOperationsSetIAMPolicy (Maybe Text)
prosipUploadProtocol
= lens _prosipUploadProtocol
(\ s a -> s{_prosipUploadProtocol = a})
-- | OAuth access token.
prosipAccessToken :: Lens' ProjectsRegionsOperationsSetIAMPolicy (Maybe Text)
prosipAccessToken
= lens _prosipAccessToken
(\ s a -> s{_prosipAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
prosipUploadType :: Lens' ProjectsRegionsOperationsSetIAMPolicy (Maybe Text)
prosipUploadType
= lens _prosipUploadType
(\ s a -> s{_prosipUploadType = a})
-- | Multipart request metadata.
prosipPayload :: Lens' ProjectsRegionsOperationsSetIAMPolicy SetIAMPolicyRequest
prosipPayload
= lens _prosipPayload
(\ s a -> s{_prosipPayload = a})
-- | REQUIRED: The resource for which the policy is being specified. See the
-- operation documentation for the appropriate value for this field.
prosipResource :: Lens' ProjectsRegionsOperationsSetIAMPolicy Text
prosipResource
= lens _prosipResource
(\ s a -> s{_prosipResource = a})
-- | JSONP
prosipCallback :: Lens' ProjectsRegionsOperationsSetIAMPolicy (Maybe Text)
prosipCallback
= lens _prosipCallback
(\ s a -> s{_prosipCallback = a})
instance GoogleRequest
ProjectsRegionsOperationsSetIAMPolicy
where
type Rs ProjectsRegionsOperationsSetIAMPolicy =
Policy
type Scopes ProjectsRegionsOperationsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient
ProjectsRegionsOperationsSetIAMPolicy'{..}
= go _prosipResource _prosipXgafv
_prosipUploadProtocol
_prosipAccessToken
_prosipUploadType
_prosipCallback
(Just AltJSON)
_prosipPayload
dataprocService
where go
= buildClient
(Proxy ::
Proxy ProjectsRegionsOperationsSetIAMPolicyResource)
mempty
| brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Operations/SetIAMPolicy.hs | mpl-2.0 | 6,160 | 0 | 16 | 1,298 | 783 | 459 | 324 | 122 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.IdentityToolkit.RelyingParty.SetProjectConfig
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Set project configuration.
--
-- /See:/ <https://developers.google.com/identity-toolkit/v3/ Google Identity Toolkit API Reference> for @identitytoolkit.relyingparty.setProjectConfig@.
module Network.Google.Resource.IdentityToolkit.RelyingParty.SetProjectConfig
(
-- * REST Resource
RelyingPartySetProjectConfigResource
-- * Creating a Request
, relyingPartySetProjectConfig
, RelyingPartySetProjectConfig
-- * Request Lenses
, rpspcPayload
) where
import Network.Google.IdentityToolkit.Types
import Network.Google.Prelude
-- | A resource alias for @identitytoolkit.relyingparty.setProjectConfig@ method which the
-- 'RelyingPartySetProjectConfig' request conforms to.
type RelyingPartySetProjectConfigResource =
"identitytoolkit" :>
"v3" :>
"relyingparty" :>
"setProjectConfig" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON]
IdentitytoolkitRelyingPartySetProjectConfigRequest
:>
Post '[JSON]
IdentitytoolkitRelyingPartySetProjectConfigResponse
-- | Set project configuration.
--
-- /See:/ 'relyingPartySetProjectConfig' smart constructor.
newtype RelyingPartySetProjectConfig =
RelyingPartySetProjectConfig'
{ _rpspcPayload :: IdentitytoolkitRelyingPartySetProjectConfigRequest
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'RelyingPartySetProjectConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rpspcPayload'
relyingPartySetProjectConfig
:: IdentitytoolkitRelyingPartySetProjectConfigRequest -- ^ 'rpspcPayload'
-> RelyingPartySetProjectConfig
relyingPartySetProjectConfig pRpspcPayload_ =
RelyingPartySetProjectConfig' {_rpspcPayload = pRpspcPayload_}
-- | Multipart request metadata.
rpspcPayload :: Lens' RelyingPartySetProjectConfig IdentitytoolkitRelyingPartySetProjectConfigRequest
rpspcPayload
= lens _rpspcPayload (\ s a -> s{_rpspcPayload = a})
instance GoogleRequest RelyingPartySetProjectConfig
where
type Rs RelyingPartySetProjectConfig =
IdentitytoolkitRelyingPartySetProjectConfigResponse
type Scopes RelyingPartySetProjectConfig =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient RelyingPartySetProjectConfig'{..}
= go (Just AltJSON) _rpspcPayload
identityToolkitService
where go
= buildClient
(Proxy :: Proxy RelyingPartySetProjectConfigResource)
mempty
| brendanhay/gogol | gogol-identity-toolkit/gen/Network/Google/Resource/IdentityToolkit/RelyingParty/SetProjectConfig.hs | mpl-2.0 | 3,457 | 0 | 13 | 706 | 308 | 189 | 119 | 55 | 1 |
{-# LANGUAGE BangPatterns
, CPP
, RecordWildCards
, TypeFamilies
, TypeOperators #-}
module Vision.Image.RGB.Type (
RGB, RGBPixel (..), RGBDelayed
) where
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>), (<*>))
#endif
import Data.Word
import Foreign.Storable (Storable (..))
import Foreign.Ptr (castPtr, plusPtr)
import Vision.Image.Class (Pixel (..))
import Vision.Image.Interpolate (Interpolable (..))
import Vision.Image.Type (Manifest, Delayed)
data RGBPixel = RGBPixel {
rgbRed :: {-# UNPACK #-} !Word8, rgbGreen :: {-# UNPACK #-} !Word8
, rgbBlue :: {-# UNPACK #-} !Word8
} deriving (Eq, Show)
type RGB = Manifest RGBPixel
type RGBDelayed = Delayed RGBPixel
instance Storable RGBPixel where
sizeOf _ = 3 * sizeOf (undefined :: Word8)
{-# INLINE sizeOf #-}
alignment _ = alignment (undefined :: Word8)
{-# INLINE alignment #-}
peek !ptr =
let !ptr' = castPtr ptr
in RGBPixel <$> peek ptr' <*> peek (ptr' `plusPtr` 1)
<*> peek (ptr' `plusPtr` 2)
{-# INLINE peek #-}
poke !ptr RGBPixel { .. } =
let !ptr' = castPtr ptr
in poke ptr' rgbRed >>
poke (ptr' `plusPtr` 1) rgbGreen >>
poke (ptr' `plusPtr` 2) rgbBlue
{-# INLINE poke #-}
instance Pixel RGBPixel where
type PixelChannel RGBPixel = Word8
pixNChannels _ = 3
{-# INLINE pixNChannels #-}
pixIndex !(RGBPixel r _ _) 0 = r
pixIndex !(RGBPixel _ g _) 1 = g
pixIndex !(RGBPixel _ _ b) _ = b
{-# INLINE pixIndex #-}
instance Interpolable RGBPixel where
interpol f a b =
let RGBPixel aRed aGreen aBlue = a
RGBPixel bRed bGreen bBlue = b
in RGBPixel {
rgbRed = f aRed bRed, rgbGreen = f aGreen bGreen
, rgbBlue = f aBlue bBlue
}
{-# INLINE interpol #-}
| RaphaelJ/friday | src/Vision/Image/RGB/Type.hs | lgpl-3.0 | 1,945 | 0 | 12 | 594 | 547 | 300 | 247 | 52 | 0 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
This is where all the real code for the cartographer lives.
-}
module Network.Eureka.Cartographer.HTTP (
Config(..),
withEureka,
website
) where
import Prelude hiding (lookup)
import Control.Exception (try, evaluate, SomeException)
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON(parseJSON), Value(Object), (.:),
Value(String))
import Data.ByteString (hGetContents)
import Data.Char (toLower)
import Data.GraphViz (DotGraph(DotGraph, strictGraph, directedGraph,
graphID, graphStatements), DotStatements(DotStmts, attrStmts, subGraphs,
nodeStmts, edgeStmts), ParseDotRepr, parseDotGraph, GraphvizOutput(Svg),
GraphvizCommand(Dot), graphvizWithHandle, DotNode(DotNode, nodeID,
nodeAttributes))
import Data.List.Split (splitOn)
import Data.Map (elems, lookup, keys)
import Data.Maybe (fromMaybe)
import Data.Text.Encoding (decodeUtf8)
import Data.Text.Lazy (Text)
import GHC.Generics (Generic)
import Network.Eureka (EurekaConfig(eurekaServerServiceUrls),
DataCenterInfo(DataCenterMyOwn, DataCenterAmazon), EurekaConnection,
InstanceConfig, def, discoverDataCenterAmazon, lookupAllApplications,
InstanceInfo(InstanceInfo, instanceInfoMetadata))
import Network.Eureka.Cartographer.TH (addCartographerMetadata)
import Network.HTTP.Client (newManager, defaultManagerSettings)
import Snap (Snap, writeBS, modifyResponse, setHeader, getParam)
import System.IO.Unsafe (unsafePerformIO)
import Text.Read (readMaybe)
import qualified Data.Map as Map (fromList)
import qualified Data.Text as T (unpack)
import qualified Data.Text.Lazy as TL (pack)
import qualified Network.Eureka as E (withEureka)
data Config = Config {
eureka :: CartographerEurekaConfig
} deriving (Generic)
instance FromJSON Config
data CartographerEurekaConfig
= EurekaDeveloper {
serviceUrls :: [String]
}
| EurekaAmazon {
serviceUrls :: [String]
} deriving Show
instance FromJSON CartographerEurekaConfig where
parseJSON (Object v) = do
datacenter <- v .: "datacenterType"
(String urls) <- v .: "serviceUrls"
return $ constructor datacenter (splitOn "," $ T.unpack urls)
where
constructor :: Text -> [String] -> CartographerEurekaConfig
constructor "developer" = EurekaDeveloper
constructor "amazon" = EurekaAmazon
constructor s = error (
"bad value for datacenterType config parameter: " ++ show s ++
". Valid values are 'developer' and 'amazon'."
)
parseJSON v = error $ "couldn't parse Eureka Config from: " ++ show v
{- |
Our own version of `withEureka`, which delegates to
`Network.Eureka.withEureka`
-}
withEureka
:: CartographerEurekaConfig
-> InstanceConfig
-> (EurekaConnection -> IO a)
-> IO a
withEureka EurekaAmazon {serviceUrls} instanceConfig a = do
dataCenter <- newManager defaultManagerSettings >>= discoverDataCenterAmazon
eurekaWithServiceUrls
serviceUrls
instanceConfig
(DataCenterAmazon dataCenter)
a
withEureka EurekaDeveloper {serviceUrls} instanceConfig a =
eurekaWithServiceUrls
serviceUrls
instanceConfig
DataCenterMyOwn
a
{- |
Helper for `withEureka`. Adds cartography metadata and delegates to
`E.withEureka`.
-}
eurekaWithServiceUrls
:: [String]
-> InstanceConfig
-> DataCenterInfo
-> (EurekaConnection -> IO a)
-> IO a
eurekaWithServiceUrls urls =
E.withEureka eurekaConfig . $(addCartographerMetadata "cartography.dot")
where
eurekaConfig = def {
eurekaServerServiceUrls = Map.fromList [("default", urls)]
}
{- |
The actual snap website that generates the pretty pictures.
-}
website :: EurekaConnection -> Snap ()
website eConn = do
apps <- liftIO (lookupAllApplications eConn)
(serveDotGraph . addNodes (keys apps) . joinInstances . concat . elems) apps
where
emptyGraph :: DotGraphT
emptyGraph = DotGraph {
strictGraph = True,
directedGraph = True,
graphID = Nothing,
graphStatements = DotStmts {
attrStmts = [],
subGraphs = [],
nodeStmts = [],
edgeStmts = []
}
}
addNodes :: [String] -> DotGraphT -> DotGraphT
addNodes nodes graph@DotGraph {graphStatements} =
graph {
graphStatements = foldr addNode graphStatements nodes
}
addNode :: String -> DotStatementsT -> DotStatementsT
addNode node stmts@DotStmts {nodeStmts} = stmts {
nodeStmts =
let nodeId = TL.pack (fmap toLower node) in
DotNode {nodeID = nodeId, nodeAttributes = []} : nodeStmts
}
joinInstances :: [InstanceInfo] -> DotGraphT
joinInstances = foldr joinInstance emptyGraph
joinInstance :: InstanceInfo -> DotGraphT -> DotGraphT
joinInstance inst dot =
joinGraph dot (instToGraph inst)
joinGraph :: DotGraphT -> DotGraphT -> DotGraphT
joinGraph
graph@DotGraph {graphStatements = s1}
DotGraph {graphStatements = s2} =
graph {graphStatements = joinStatements s1 s2}
joinStatements :: DotStatementsT -> DotStatementsT -> DotStatementsT
joinStatements s1 s2 = DotStmts {
attrStmts = attrStmts s1 ++ attrStmts s2,
subGraphs = subGraphs s1 ++ subGraphs s2,
nodeStmts = nodeStmts s1 ++ nodeStmts s2,
edgeStmts = edgeStmts s1 ++ edgeStmts s2
}
instToGraph :: InstanceInfo -> DotGraphT
instToGraph InstanceInfo {instanceInfoMetadata} =
maybe emptyGraph parseGraph (lookup "cartography" instanceInfoMetadata)
parseGraph :: String -> DotGraphT
parseGraph dotStr =
case parseDotGraphEither (TL.pack dotStr) of
Left _ -> emptyGraph
Right g -> g
serveDotGraph :: DotGraphT -> Snap ()
serveDotGraph graph = do
graphType <- getGraphType
modifyResponse (setHeader "Content-Type" "image/svg+xml")
writeBS =<< liftIO (graphvizWithHandle graphType graph Svg hGetContents)
{- |
Figures out the graph type based on the query string param "graphType".
-}
getGraphType :: Snap GraphvizCommand
getGraphType = do
typeM <- getParam "graphType"
return $ case typeM of
Nothing -> Dot
Just str ->
fromMaybe Dot (readMaybe (T.unpack (decodeUtf8 str)))
{- |
Shorthand type for dot graphs.
-}
type DotGraphT = DotGraph Text
{- |
Shorthand type for graph statements
-}
type DotStatementsT = DotStatements Text
{- |
Parse a dot graph using Either. Sadly, `parseDotGraph` in the graphviz
package is not total and throws a value error on bad input. Since
we can only catch the error in the IO monad, we are forced to use
`unsafePerformIO` to make this function total. This is safe because
it doesn't matter when, or how many times, this gets executed, and
there are no external side effects.
-}
parseDotGraphEither :: (ParseDotRepr dg n) => Text -> Either String (dg n)
parseDotGraphEither dotStr = unsafePerformIO $ do
graphE <- try (evaluate (parseDotGraph dotStr))
return $ case graphE of
Left e -> Left (show (e :: SomeException))
Right graph -> Right graph
| SumAll/haskell-cartographer-server | src/Network/Eureka/Cartographer/HTTP.hs | apache-2.0 | 7,188 | 0 | 17 | 1,486 | 1,685 | 937 | 748 | 156 | 2 |
module FFMpegCommandSpec where
import Test.HUnit
import FFMpegCommand
runFFMpegCommandTests = runTestTT tests
tests = TestList [ TestLabel "Test Single Time" testSingleTime
, TestLabel "Test Two Times" testTwoTimes ]
testSingleTime = TestCase (
assertEqual "test.mkv 00:00:01" (Just "ffmpeg -i test.mkv -ss 00:00:00.000 -t 00:00:01.000 0.mp4 -i test.mkv -ss 00:00:01.000 1.mp4") (generateCommand "test.mkv" "mp4" "" ["00:00:01"]) )
testTwoTimes = TestCase (
assertEqual "test.mkv 00:00:01 00:00:02" (Just "ffmpeg -i test.mkv -ss 00:00:00.000 -t 00:00:01.000 0.mp4 -i test.mkv -ss 00:00:01.000 -t 00:00:02.000 1.mp4 -i test.mkv -ss 00:00:02.000 2.mp4") (generateCommand "test.mkv" "mp4" "" ["00:00:01", "00:00:02"]) )
testExtraCommands = TestCase (
assertEqual "test.mkv 00:00:01 00:00:02" (Just "ffmpeg -i test.mkv -c:v libx264 -ss 00:00:00.000 -t 00:00:01.000 0.mp4 -i test.mkv -c:v libx264 -ss 00:00:01.000 -t 00:00:02.000 1.mp4 -i test.mkv -c:v libx264 -ss 00:00:02.000 2.mp4") (generateCommand "test.mkv" "mp4" "-c:v libx264" ["00:00:01", "00:00:02"]) )
| connrs/ffsplitgen | test/FFMpegCommandSpec.hs | apache-2.0 | 1,087 | 0 | 10 | 162 | 167 | 88 | 79 | 12 | 1 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module CourseStitch.Models.Tables (
module CourseStitch.Models.Types,
module CourseStitch.Models.Tables
)where
import Data.Text (Text)
import Data.ByteString.Char8 (ByteString)
import Database.Persist.TH
import CourseStitch.Models.Types
{- See the following page in the Yesod book for a description of what these
- quasiquotes generate.
- http://www.yesodweb.com/book/persistent#persistent_code_generation -}
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Resource json
title Text
media Text
url Text
UniqueResourceUrl url
course Text
summary Text
preview Text
keywords Text
deriving Show
Concept json
topic TopicId Maybe
title Text
UniqueConceptTitle title
deriving Show Eq
Topic json
title Text
summary Text
UniqueTopicTitle title
deriving Show Eq
Relationship json
resource ResourceId
relationship RelationshipType
concept ConceptId
UniqueResourceConcept resource concept
deriving Show Eq
User
name Text
UniqueUserName name
hash ByteString
deriving Show
Session
user UserId
token Token
deriving Show
ResourceMastery json
user UserId
resource ResourceId
UniqueMasteryUserResource user resource
deriving Show
ConceptMastery json
user UserId
concept ConceptId
UniqueMasteryUserConcept user concept
deriving Show
|]
| coursestitch/coursestitch-api | lib/CourseStitch/Models/Tables.hs | apache-2.0 | 1,841 | 0 | 7 | 447 | 91 | 61 | 30 | 18 | 0 |
-- http://www.codewars.com/kata/5467e4d82edf8bbf40000155
module DescendingOrder where
import Data.List
descendingOrder :: Integer -> Integer
descendingOrder = foldl (\acc n -> acc * 10 + n) 0 . sortBy (flip compare) . map (`mod`10) . takeWhile (>0) . iterate (`div`10)
| Bodigrim/katas | src/haskell/7-Descending-Order.hs | bsd-2-clause | 271 | 0 | 13 | 39 | 97 | 55 | 42 | 4 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QSystemTrayIcon_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:18
Warning : this file is machine generated - do not modify.
--}
-----------------------------------------------------------------------------
module Qtc.Gui.QSystemTrayIcon_h where
import Foreign.C.Types
import Qtc.Enums.Base
import Qtc.Classes.Base
import Qtc.Classes.Qccs_h
import Qtc.Classes.Core_h
import Qtc.ClassTypes.Core
import Qth.ClassTypes.Core
import Qtc.Classes.Gui_h
import Qtc.ClassTypes.Gui
import Foreign.Marshal.Array
instance QunSetUserMethod (QSystemTrayIcon ()) where
unSetUserMethod qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 0) (toCInt evid)
foreign import ccall "qtc_QSystemTrayIcon_unSetUserMethod" qtc_QSystemTrayIcon_unSetUserMethod :: Ptr (TQSystemTrayIcon a) -> CInt -> CInt -> IO (CBool)
instance QunSetUserMethod (QSystemTrayIconSc a) where
unSetUserMethod qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 0) (toCInt evid)
instance QunSetUserMethodVariant (QSystemTrayIcon ()) where
unSetUserMethodVariant qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 1) (toCInt evid)
instance QunSetUserMethodVariant (QSystemTrayIconSc a) where
unSetUserMethodVariant qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 1) (toCInt evid)
instance QunSetUserMethodVariantList (QSystemTrayIcon ()) where
unSetUserMethodVariantList qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 2) (toCInt evid)
instance QunSetUserMethodVariantList (QSystemTrayIconSc a) where
unSetUserMethodVariantList qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
qtc_QSystemTrayIcon_unSetUserMethod cobj_qobj (toCInt 2) (toCInt evid)
instance QsetUserMethod (QSystemTrayIcon ()) (QSystemTrayIcon x0 -> IO ()) where
setUserMethod _eobj _eid _handler
= do
funptr <- wrapSetUserMethod_QSystemTrayIcon setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetUserMethod_QSystemTrayIcon_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
qtc_QSystemTrayIcon_setUserMethod cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return ()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> IO ()
setHandlerWrapper x0
= do
x0obj <- objectFromPtr_nf x0
if (objectIsNull x0obj)
then return ()
else _handler x0obj
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
foreign import ccall "qtc_QSystemTrayIcon_setUserMethod" qtc_QSystemTrayIcon_setUserMethod :: Ptr (TQSystemTrayIcon a) -> CInt -> Ptr (Ptr (TQSystemTrayIcon x0) -> IO ()) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()
foreign import ccall "wrapper" wrapSetUserMethod_QSystemTrayIcon :: (Ptr (TQSystemTrayIcon x0) -> IO ()) -> IO (FunPtr (Ptr (TQSystemTrayIcon x0) -> IO ()))
foreign import ccall "wrapper" wrapSetUserMethod_QSystemTrayIcon_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))
instance QsetUserMethod (QSystemTrayIconSc a) (QSystemTrayIcon x0 -> IO ()) where
setUserMethod _eobj _eid _handler
= do
funptr <- wrapSetUserMethod_QSystemTrayIcon setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetUserMethod_QSystemTrayIcon_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
qtc_QSystemTrayIcon_setUserMethod cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return ()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> IO ()
setHandlerWrapper x0
= do
x0obj <- objectFromPtr_nf x0
if (objectIsNull x0obj)
then return ()
else _handler x0obj
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
instance QsetUserMethod (QSystemTrayIcon ()) (QSystemTrayIcon x0 -> QVariant () -> IO (QVariant ())) where
setUserMethod _eobj _eid _handler
= do
funptr <- wrapSetUserMethodVariant_QSystemTrayIcon setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetUserMethodVariant_QSystemTrayIcon_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
qtc_QSystemTrayIcon_setUserMethodVariant cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return ()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))
setHandlerWrapper x0 x1
= do
x0obj <- objectFromPtr_nf x0
x1obj <- objectFromPtr_nf x1
rv <- if (objectIsNull x0obj)
then return $ objectCast x0obj
else _handler x0obj x1obj
withObjectPtr rv $ \cobj_rv -> return cobj_rv
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
foreign import ccall "qtc_QSystemTrayIcon_setUserMethodVariant" qtc_QSystemTrayIcon_setUserMethodVariant :: Ptr (TQSystemTrayIcon a) -> CInt -> Ptr (Ptr (TQSystemTrayIcon x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()
foreign import ccall "wrapper" wrapSetUserMethodVariant_QSystemTrayIcon :: (Ptr (TQSystemTrayIcon x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))) -> IO (FunPtr (Ptr (TQSystemTrayIcon x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))))
foreign import ccall "wrapper" wrapSetUserMethodVariant_QSystemTrayIcon_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))
instance QsetUserMethod (QSystemTrayIconSc a) (QSystemTrayIcon x0 -> QVariant () -> IO (QVariant ())) where
setUserMethod _eobj _eid _handler
= do
funptr <- wrapSetUserMethodVariant_QSystemTrayIcon setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetUserMethodVariant_QSystemTrayIcon_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
qtc_QSystemTrayIcon_setUserMethodVariant cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return ()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))
setHandlerWrapper x0 x1
= do
x0obj <- objectFromPtr_nf x0
x1obj <- objectFromPtr_nf x1
rv <- if (objectIsNull x0obj)
then return $ objectCast x0obj
else _handler x0obj x1obj
withObjectPtr rv $ \cobj_rv -> return cobj_rv
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
instance QunSetHandler (QSystemTrayIcon ()) where
unSetHandler qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
withCWString evid $ \cstr_evid ->
qtc_QSystemTrayIcon_unSetHandler cobj_qobj cstr_evid
foreign import ccall "qtc_QSystemTrayIcon_unSetHandler" qtc_QSystemTrayIcon_unSetHandler :: Ptr (TQSystemTrayIcon a) -> CWString -> IO (CBool)
instance QunSetHandler (QSystemTrayIconSc a) where
unSetHandler qobj evid
= withBoolResult $
withObjectPtr qobj $ \cobj_qobj ->
withCWString evid $ \cstr_evid ->
qtc_QSystemTrayIcon_unSetHandler cobj_qobj cstr_evid
instance QsetHandler (QSystemTrayIcon ()) (QSystemTrayIcon x0 -> QObject t1 -> QEvent t2 -> IO (Bool)) where
setHandler _eobj _eid _handler
= do
funptr <- wrapSetHandler_QSystemTrayIcon1 setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetHandler_QSystemTrayIcon1_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
withCWString _eid $ \cstr_eid ->
qtc_QSystemTrayIcon_setHandler1 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)
setHandlerWrapper x0 x1 x2
= do x0obj <- qSystemTrayIconFromPtr x0
x1obj <- qObjectFromPtr x1
x2obj <- objectFromPtr_nf x2
let rv =
if (objectIsNull x0obj)
then return False
else _handler x0obj x1obj x2obj
rvf <- rv
return (toCBool rvf)
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
foreign import ccall "qtc_QSystemTrayIcon_setHandler1" qtc_QSystemTrayIcon_setHandler1 :: Ptr (TQSystemTrayIcon a) -> CWString -> Ptr (Ptr (TQSystemTrayIcon x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()
foreign import ccall "wrapper" wrapSetHandler_QSystemTrayIcon1 :: (Ptr (TQSystemTrayIcon x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)) -> IO (FunPtr (Ptr (TQSystemTrayIcon x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)))
foreign import ccall "wrapper" wrapSetHandler_QSystemTrayIcon1_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))
instance QsetHandler (QSystemTrayIconSc a) (QSystemTrayIcon x0 -> QObject t1 -> QEvent t2 -> IO (Bool)) where
setHandler _eobj _eid _handler
= do
funptr <- wrapSetHandler_QSystemTrayIcon1 setHandlerWrapper
stptr <- newStablePtr (Wrap _handler)
funptr_d <- wrapSetHandler_QSystemTrayIcon1_d setHandlerWrapper_d
withObjectPtr _eobj $ \cobj_eobj ->
withCWString _eid $ \cstr_eid ->
qtc_QSystemTrayIcon_setHandler1 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
return()
where
setHandlerWrapper :: Ptr (TQSystemTrayIcon x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)
setHandlerWrapper x0 x1 x2
= do x0obj <- qSystemTrayIconFromPtr x0
x1obj <- qObjectFromPtr x1
x2obj <- objectFromPtr_nf x2
let rv =
if (objectIsNull x0obj)
then return False
else _handler x0obj x1obj x2obj
rvf <- rv
return (toCBool rvf)
setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
setHandlerWrapper_d funptr stptr funptr_d
= do when (stptr/=ptrNull)
(freeStablePtr (castPtrToStablePtr stptr))
when (funptr/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr))
when (funptr_d/=ptrNull)
(freeHaskellFunPtr (castPtrToFunPtr funptr_d))
return ()
instance QeventFilter_h (QSystemTrayIcon ()) ((QObject t1, QEvent t2)) where
eventFilter_h x0 (x1, x2)
= withBoolResult $
withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
withObjectPtr x2 $ \cobj_x2 ->
qtc_QSystemTrayIcon_eventFilter cobj_x0 cobj_x1 cobj_x2
foreign import ccall "qtc_QSystemTrayIcon_eventFilter" qtc_QSystemTrayIcon_eventFilter :: Ptr (TQSystemTrayIcon a) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO CBool
instance QeventFilter_h (QSystemTrayIconSc a) ((QObject t1, QEvent t2)) where
eventFilter_h x0 (x1, x2)
= withBoolResult $
withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
withObjectPtr x2 $ \cobj_x2 ->
qtc_QSystemTrayIcon_eventFilter cobj_x0 cobj_x1 cobj_x2
| keera-studios/hsQt | Qtc/Gui/QSystemTrayIcon_h.hs | bsd-2-clause | 13,411 | 0 | 18 | 2,866 | 4,196 | 2,003 | 2,193 | -1 | -1 |
module Spring13.Week4.Week4Spec where
import Test.Hspec
import Test.QuickCheck
import Spring13.Week4.Week4
main :: IO ()
main = hspec spec
spec :: Spec
spec =
do describe "fun1'" $
do it "property" $
do property $ \xs -> fun1' xs == fun1 (xs :: [Integer])
describe "fun2'" $
do it "cases" $
do fun2' 1 `shouldBe` fun2 1
fun2' 10 `shouldBe` fun2 10
fun2' 82 `shouldBe` fun2 82
fun2' 113 `shouldBe` fun2 113
describe "foldTree" $
do it "cases" $
do foldTree [] `shouldBe` (Leaf :: Tree Char)
foldTree "A" `shouldBe` Node 0 Leaf 'A' Leaf
foldTree "ABCDEFGHIJ" `shouldBe`
Node 3
(Node 2
(Node 1 (Node 0 Leaf 'D' Leaf) 'G' Leaf)
'I'
(Node 1 (Node 0 Leaf 'A' Leaf) 'E' Leaf))
'J'
(Node 2
(Node 1 (Node 0 Leaf 'B' Leaf) 'F' Leaf)
'H'
(Node 0 Leaf 'C' Leaf))
describe "foldTree'" $
do it "cases" $
do foldTree' [] `shouldBe` (Leaf :: Tree Char)
foldTree' "A" `shouldBe` Node 0 Leaf 'A' Leaf
foldTree' "ABCDEFGHIJ" `shouldBe`
Node 3
(Node 2
(Node 1 (Node 0 Leaf 'A' Leaf) 'B' Leaf)
'C'
(Node 1 (Node 0 Leaf 'D' Leaf) 'E' Leaf))
'F'
(Node 2
(Node 1 (Node 0 Leaf 'G' Leaf) 'H' Leaf)
'I'
(Node 0 Leaf 'J' Leaf))
describe "xor" $
do it "cases" $
do xor [False,True,False] `shouldBe` True
xor [False,True,False,False,True] `shouldBe` False
it "property" $
do property $
\xs ->
xor xs ==
if even (length $
filter (\x -> x)
(xs :: [Bool]))
then False
else True
| bibaijin/cis194 | test/Spring13/Week4/Week4Spec.hs | bsd-3-clause | 2,272 | 0 | 22 | 1,173 | 705 | 350 | 355 | 60 | 2 |
{-# LANGUAGE DataKinds #-}
module Data.SoftHeap.SHselect(shSelect) where
import Data.SoftHeap
import Control.Monad.ST
import Data.Natural
sOne=SSucc SZero
sTwo=SSucc sOne
sThree=SSucc sTwo
--returns
partition :: (Ord k) => [k] -> k -> Int
partition l x = undefined
slice :: Int -> Int -> [k] -> [k]
slice from to xs = take (to - from + 1) (drop from xs)
--TODO finish
shSelect :: (Ord k) => [k] -> Int -> k
shSelect l k
| k==1 = minimum l
| otherwise = runST $ do
h<-heapify sThree l
let third=(length l) `div` 3
x<-shSelectLoop h third
let xIndex=partition l x
if k < xIndex then return $ shSelect (slice 0 (xIndex-1) l) k else return $ shSelect (slice xIndex (k-xIndex+1) l) k
shSelectLoop :: (Ord k) => SoftHeap' s k t -> Int -> ST s k
shSelectLoop h 0=do
x<-findMin h
deleteMin h
let (Finite ret)=fst x
return ret
shSelectLoop h times=do
deleteMin' h
shSelectLoop h (times-1)
heapify' :: (Ord k) => [k] -> SoftHeap' s k t -> ST s ()
heapify' [] h=return ()
heapify' (x:xs) h=insert' h x>>heapify' xs h
heapify :: (Ord k) => SNat t -> [k] -> ST s (SoftHeap' s k (Finite t))
heapify t l=makeHeap t>>=(\h->heapify' l h>>return h)
| formrre/soft-heap-haskell | soft-heap/src/Data/SoftHeap/SHselect.hs | bsd-3-clause | 1,213 | 0 | 16 | 289 | 629 | 314 | 315 | 35 | 2 |
{-# LANGUAGE LambdaCase, RankNTypes #-}
module Sloch
( LangToSloc
, PathToLangToSloc
, sloch
, summarize
, summarize'
) where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Map.Extras (adjustWithDefault)
import Dirent (makeDirent, direntsAtDepth)
import Language (Language)
import Sloch.Dirent (SlochDirent(..), slochDirents)
type PathToLangToSloc = Map FilePath LangToSloc
type LangToSloc = Map Language [(FilePath, Int)]
sloch :: Int -> Bool -> FilePath -> IO PathToLangToSloc
sloch depth include_dotfiles path =
makeDirent include_dotfiles path >>= \case
Nothing -> return M.empty
Just dirent -> do
let dirents = direntsAtDepth depth dirent
slochDirents dirents >>= return . summarize
-- | Summarize a list of SlochDirents, where each element is summarized and put
-- into a summary map. Each element is therefore the context with which the
-- children (if they exist) shall be inserted into the map with.
summarize :: [SlochDirent] -> PathToLangToSloc
summarize = foldr step M.empty
where
step :: SlochDirent -> PathToLangToSloc -> PathToLangToSloc
step (SlochDirentFile path lang count) = M.insert path $ M.singleton lang [(path, count)]
step (SlochDirentDir path children) = M.insert path $ summarize' children
-- | Similar to summarize, but flattens a list of dirents into a single
-- LangToSloc map. No context (or "root" dirent) is associated with any of the
-- dirents in the list - they are all simply folded up uniformly.
summarize' :: [SlochDirent] -> LangToSloc
summarize' = foldr step M.empty
where
step :: SlochDirent -> LangToSloc -> LangToSloc
step (SlochDirentFile path lang count) = adjustWithDefault (x:) lang [x] where x = (path,count)
step (SlochDirentDir _ children) = M.unionWith (++) $ summarize' children
| mitchellwrosen/Sloch | src/sloch/Sloch.hs | bsd-3-clause | 1,888 | 0 | 14 | 396 | 439 | 240 | 199 | 32 | 2 |
module Traduisons.Client where
import Control.Monad.Except
import Control.Monad.State
import qualified Data.Map as M
import Data.List
import Data.List.Split
import Traduisons.API
import Traduisons.Types
import Traduisons.Util
helpMsg :: String
helpMsg = "Help yourself."
runTest :: String -> ExceptT TraduisonsError IO (Maybe Message, AppState)
runTest input = do
let commands = concatMap parseInput $ splitOn ";" input
runCommands Nothing commands
createAppState :: ExceptT TraduisonsError IO AppState
createAppState = liftIO mkTraduisonsState >>= new
where new = return . AppState (Language "auto") (Language "en") [] M.empty
updateLanguageMap :: AppState -> ExceptT TraduisonsError IO AppState
updateLanguageMap appState = do
let tState = asTraduisonsState appState
langResponse <- lift $ runTraduisons tState getLanguagesForTranslate -- unfuck this and replace with the library I added.
langs <- M.insert "auto" "auto" <$> liftEither langResponse
return appState { asLanguageNameCodes = langs }
parseInput :: String -> [Command]
parseInput ('/':s) = SwapLanguages : parseInput s
parseInput "\EOT" = [Exit]
parseInput "?" = [Help]
parseInput "" = []
parseInput ('|':s) = [SetToLanguage s]
parseInput s
| "/" `isSuffixOf` s = SwapLanguages : parseInput (init s)
| "|" `isInfixOf` s = let (from, '|':to) = break (== '|') s
f ctor l = [ctor l | not (null l)]
in f SetFromLanguage from ++ f SetToLanguage to
| otherwise = [Translate s]
runCommands :: Maybe AppState -> [Command]
-> ExceptT TraduisonsError IO (Maybe Message, AppState)
runCommands appState cmds = do
let app = foldM (const runCommand) Nothing cmds
initial <- maybe createAppState return appState
runStateT app initial
runCommand :: Command -> StateT AppState (ExceptT TraduisonsError IO) (Maybe Message)
runCommand c = do
msg <- runCommand' c
modify (\a -> a { asHistory = (c, msg) : asHistory a })
return msg
runCommand' :: Command -> StateT AppState (ExceptT TraduisonsError IO) (Maybe Message)
runCommand' Exit = throwError $ TErr TraduisonsExit "Exit"
runCommand' Help = get >>= throwError . TErr TraduisonsHelp . renderLanguageNames
runCommand' SwapLanguages = get >>= \aS -> from aS >> to aS
where from = runCommand' . SetFromLanguage . getLanguage . asToLang
to = runCommand' . SetToLanguage . getLanguage . asFromLang
runCommand' (SetFromLanguage l) = const Nothing <$> modify setFromLang
where setFromLang appState = appState { asFromLang = Language l }
runCommand' (SetToLanguage l) = const Nothing <$> modify setToLang
where setToLang appState = appState { asToLang = Language l }
runCommand' (Translate rawMsg) = do
AppState fromLang' _ _ _ _ <- get
when (getLanguage fromLang' == "auto") $ void $ runCommand' (DetectLanguage rawMsg)
AppState fromLang toLang _ _ _ <- get
let message = Message fromLang rawMsg
withTokenRefresh $ translate toLang message
runCommand' (DetectLanguage rawMsg) = do
result <- withTokenRefresh (detectLanguage rawMsg)
case result of
Nothing -> throwError $ TErr LanguageDetectionError "Failed to detect language"
Just l -> runCommand' (SetFromLanguage (getLanguage l))
renderError :: TraduisonsError -> String
renderError (TErr flag msg) = case flag of
ArgumentOutOfRangeException -> "Bad language code: " ++ msg
LanguageDetectionError -> "Unable to detect language: " ++ msg
ArgumentException -> "Renewing expired token..."
TraduisonsHelp -> msg
e -> show e ++ ": " ++ msg
renderLanguageNames :: AppState -> String
renderLanguageNames (AppState (Language fL) (Language tL) _ m _) =
case (fName, tName) of
(Just f, Just t) -> f ++ "|" ++ t
_ -> ""
where fName = M.lookup fL m
tName = M.lookup tL m
| bitemyapp/traduisons-hs | src/Traduisons/Client.hs | bsd-3-clause | 3,789 | 0 | 14 | 724 | 1,271 | 629 | 642 | 82 | 5 |
module Lang.Csharp where
import Lang.Value
import Generic.Control.Function
import Generic.Data.Bool
import Generic.Data.Either
import Generic.Data.List
import Generic.Data.Maybe
import Generic.Data.Number
import Generic.Data.Tuple
import qualified Prelude
data Csharp
type Cs a = Val Csharp a
instance Prelude.Show (Primitive Csharp) where
show (Fun ys body) =
case ys of
[] -> body
x:xs ->
let b = if Prelude.null xs then body else Prelude.show (Fun xs body :: Primitive Csharp)
cc = (Prelude.++)
in x `cc` " => " `cc` b
-- * Csharp instances for AwesomePrelude 'data types'
instance FunC (Val Csharp) where
lam f = "lam" `Name` Lam f
app f g = "app" `Name` App f g
fix f = "fix" `Name` fun1 ["f", ""] "f(fix(f))" (lam f)
instance BoolC (Val Csharp) where
true = "true" `Name` con "true"
false = "fales" `Name` con "false"
bool t e b = "bool" `Name` fun3 ["t", "e", "b"] "b ? t : e" t e b
instance NumC (Val Csharp) where
a + b = "add" `Name` fun2 ["a", "b"] "a + b" a b
a - b = "sub" `Name` fun2 ["a", "b"] "a - b" a b
a * b = "mul" `Name` fun2 ["a", "b"] "a * b" a b
a / b = "div" `Name` fun2 ["a", "b"] "a / b" a b
num x = con (Prelude.show x)
instance TupleC (Val Csharp) where
mkTuple a b = "mkTuple" `Name` fun2 ["a", "b"] "new Tuple(a, b)" a b
tuple f t = "tuple" `Name` fun2 ["f", "t"] "f(t.Item1, t.Item2)" (lam2 f) t
instance MaybeC (Val Csharp) where
nothing = "nothing" `Name` con "new Nothing()"
just x = "just" `Name` fun1 ["x"] "new Just(x)" x
maybe n j m = "maybe" `Name` fun3 ["n", "j", "m"] "m.maybe(" n (lam j) m
instance EitherC (Val Csharp) where
left l = "left" `Name` fun1 ["l"] "new Left(l)" l
right r = "right" `Name` fun1 ["r"] "{ right : x }" r
either l r e = "either" `Name` fun3 ["l", "r", "e"] "m.left ? l(x.left) : r(x.right)" (lam l) (lam r) e
instance ListC (Val Csharp) where
nil = "nil" `Name` con "new Nil()"
cons x xs = "cons" `Name` fun2 ["x", "xs"] "new Cons(x, xs)" x xs
list b f xs = "list" `Name` fun3 ["a", "f", "xs"] "xs.nil ? b : f(x.head, x.tail)" b (lam2 f) xs
-- * Csharp instances of AwesomePrelude 'type classes'
instance Eq (Val Csharp) Bool where
a == b = "eq" `Name` fun2 ["a", "b"] "a == b" a b
a /= b = "neq" `Name` fun2 ["a", "b"] "a /= b" a b
instance (Eq (Val Csharp) a, Eq (Val Csharp) b) => Eq (Val Csharp) (a, b) where
a == b = "eq" `Name` fun2 ["a", "b"] "a == b" a b
a /= b = "neq" `Name` fun2 ["a", "b"] "a /= b" a b
instance Eq (Val Csharp) a => Eq (Val Csharp) [a] where
a == b = "eq" `Name` fun2 ["a", "b"] "a == b" a b
a /= b = "neq" `Name` fun2 ["a", "b"] "a /= b" a b
| tomlokhorst/AwesomePrelude | src/Lang/Csharp.hs | bsd-3-clause | 2,713 | 0 | 16 | 685 | 1,206 | 651 | 555 | -1 | -1 |
module System.Taffybar.Widget.Text.MemoryMonitor (textMemoryMonitorNew, showMemoryInfo) where
import Control.Monad.IO.Class ( MonadIO )
import qualified Data.Text as T
import qualified Text.StringTemplate as ST
import System.Taffybar.Information.Memory
import System.Taffybar.Widget.Generic.PollingLabel ( pollingLabelNew )
import qualified GI.Gtk
import Text.Printf ( printf )
-- | Creates a simple textual memory monitor. It updates once every polling
-- period (in seconds).
textMemoryMonitorNew :: MonadIO m
=> String -- ^ Format. You can use variables: "used", "total", "free", "buffer",
-- "cache", "rest", "available", "swapUsed", "swapTotal", "swapFree".
-> Double -- ^ Polling period in seconds.
-> m GI.Gtk.Widget
textMemoryMonitorNew fmt period = do
label <- pollingLabelNew period (showMemoryInfo fmt 3 <$> parseMeminfo)
GI.Gtk.toWidget label
showMemoryInfo :: String -> Int -> MemoryInfo -> T.Text
showMemoryInfo fmt prec info =
let template = ST.newSTMP fmt
labels = [ "used"
, "total"
, "free"
, "buffer"
, "cache"
, "rest"
, "available"
, "swapUsed"
, "swapTotal"
, "swapFree"
]
actions = [ memoryUsed
, memoryTotal
, memoryFree
, memoryBuffer
, memoryCache
, memoryRest
, memoryAvailable
, memorySwapUsed
, memorySwapTotal
, memorySwapFree
]
actions' = map (toAuto prec .) actions
stats = [f info | f <- actions']
template' = ST.setManyAttrib (zip labels stats) template
in ST.render template'
toAuto :: Int -> Double -> String
toAuto prec value = printf "%.*f%s" p v unit
where value' = max 0 value
mag :: Int
mag = if value' == 0 then 0 else max 0 $ min 2 $ floor $ logBase 1024 value'
v = value' / 1024 ** fromIntegral mag
unit = case mag of
0 -> "MiB"
1 -> "GiB"
2 -> "TiB"
_ -> "??B" -- unreachable
p :: Int
p = max 0 $ floor $ fromIntegral prec - logBase 10 v
| teleshoes/taffybar | src/System/Taffybar/Widget/Text/MemoryMonitor.hs | bsd-3-clause | 2,323 | 0 | 11 | 821 | 505 | 281 | 224 | 55 | 5 |
module TodoFormat
(
MyTime
, hasTime
, whenToRec
, unWhen
, whenToDay
, whenToTime
, whenToDayOfMonth
, whenToDayOfWeek
, whenToDuration
, matchDay
, compareTime
, toMyTime
, toMyTimeAllDay
, daily
, monthly
, weekly
, yearly
, dailyFull
, monthlyFull
, weeklyFull
, yearlyFull
, dailyFromTo
, fromTo
)
where
import Data.Time.LocalTime
import Data.Time.Calendar.WeekDate
import Data.Time.Calendar
data Recurrence = NotRecurrent | Monthly | Yearly | Weekly | Daily | DailyRange LocalTime LocalTime deriving (Show, Eq)
data MyDuration = FullDay | NoDuration | EndTime LocalTime deriving (Eq)
data MyTime = TheTime MyDuration Recurrence LocalTime deriving (Eq)
--data When = When Recurrence LocalTime | AllDay Recurrence LocalTime | AllDayRange When When | OnlyDay Day deriving (Show, Eq)
thrd (_, _, z) = z
snd' (_, z, _) = z
{-
instance Eq When where
(When Weekly x) == (OnlyDay y) = thrd (toWeekDate (localDay x)) == thrd (toWeekDate (y))
(OnlyDay x) == (When Weekly y) = thrd (toWeekDate (x)) == thrd (toWeekDate (localDay y))
(OnlyDay x) == (When _ y) = x == localDay y
(When _ x) == (OnlyDay y) = y == localDay x
(OnlyDay x) == (AllDay _ y) = x == localDay y
(AllDay _ x) == (OnlyDay y) = localDay x == y
-}
hasTime (TheTime NoDuration _ _) = True
hasTime _ = False
whenToRec (TheTime NoDuration r _) = r
whenToRec (TheTime FullDay r _) = r
whenToRec (TheTime _ r _) = r
unWhen (TheTime NoDuration _ x) = x
unWhen (TheTime _ _ x) = x
whenToDay :: MyTime -> Day
whenToDay = localDay . unWhen
whenToTime :: MyTime -> TimeOfDay
whenToTime = localTimeOfDay . unWhen
whenToDayOfWeek :: MyTime -> Int
whenToDayOfWeek = thrd . toWeekDate . whenToDay
whenToDayOfMonth :: MyTime -> Int
whenToDayOfMonth = thrd . toGregorian . whenToDay
whenToDuration :: MyTime -> MyDuration
whenToDuration (TheTime d _ _ ) = d
matchDay :: Day -> MyTime -> Bool
matchDay d (TheTime (EndTime t) _ t') = localDay t' <= d && d <= localDay t
matchDay y x = case whenToRec x of
Weekly -> thrd (toWeekDate y) == thrd (toWeekDate d)
Monthly -> thrd (toGregorian y) == thrd (toGregorian d)
Yearly -> (thrd (toGregorian y) == thrd (toGregorian d)) && (snd' (toGregorian y) == snd' (toGregorian d))
DailyRange t' t -> localDay t' <= d && d <= localDay t
Daily -> True
_ -> y == d
where d = whenToDay x
instance Ord MyTime where
compare (TheTime NoDuration _ x) (TheTime NoDuration _ y) = compare x y
compare (TheTime FullDay _ x) (TheTime FullDay _ y) = compare x y
compare (TheTime NoDuration _ x) (TheTime FullDay _ y) = if localDay x == localDay y then GT else compare x y
compare (TheTime FullDay _ x) (TheTime NoDuration _ y) = if localDay x == localDay y then LT else compare x y
compareTime :: MyTime -> MyTime -> Ordering
compareTime (TheTime NoDuration _ x) (TheTime NoDuration _ y) = compare (localTimeOfDay x) (localTimeOfDay y)
compareTime (TheTime NoDuration _ x) (TheTime _ _ y) = GT
compareTime (TheTime _ _ x) (TheTime NoDuration _ y) = LT
compareTime (TheTime _ _ x) (TheTime _ _ y) = EQ
toMyTimeAllDay = TheTime FullDay NotRecurrent
toMyTime = TheTime NoDuration NotRecurrent
weekly = TheTime NoDuration Weekly
monthly = TheTime NoDuration Monthly
daily = TheTime NoDuration Daily
yearly = TheTime NoDuration Yearly
weeklyFull = TheTime FullDay Weekly
monthlyFull = TheTime FullDay Monthly
dailyFull = TheTime FullDay Daily
yearlyFull = TheTime FullDay Yearly
dailyFromTo x y = TheTime NoDuration (DailyRange x y) x
fromTo f1 f2 = TheTime (EndTime f2) NotRecurrent f1
| sejdm/smartWallpaper | src/TodoFormat.hs | bsd-3-clause | 3,701 | 0 | 13 | 849 | 1,159 | 602 | 557 | 82 | 6 |
-- | Double-buffered storage
--
-- This module provides a safer alternative to the methods of the classes
-- 'Manifestable' and 'Manifestable2':
--
-- * 'store' instead of 'manifest'
-- * 'store2' instead of 'manifest2'
-- * 'setStore' instead of 'manifestStore'
-- * 'setStore2' instead of 'manifestStore2'
--
-- Consider the following example:
--
-- > bad = do
-- > arr <- newArr 20
-- > vec1 <- manifest arr (1...20)
-- > vec2 <- manifest arr $ map (*10) $ reverse vec1
-- > printf "%d\n" $ sum vec2
--
-- First the vector @(1...20)@ is stored into @arr@. Then the result is used to
-- compute a new vector which is also stored into @arr@. So the storage is
-- updated while it is being read from, leading to unexpected results.
--
-- Using this module, we can make a small change to the program:
--
-- > good = do
-- > st <- newStore 20
-- > vec1 <- store st (1...20)
-- > vec2 <- store st $ map (*10) $ reverse vec1
-- > printf "%d\n" $ sum vec2
--
-- Now the program works as expected; i.e. gives the same result as the normal
-- Haskell expression
--
-- > sum $ map (*10) $ reverse [1..20]
--
-- The price we have to pay for safe storage is that @`newStore` l@ allocates
-- twice as much memory as @`newArr` l@. However, none of the other functions in
-- this module allocate any memory.
--
-- Note that this module does not protect against improper use of
-- 'unsafeFreezeStore'. A vector from a frozen 'Store' is only valid as long as
-- the 'Store' is not updated.
module Feldspar.Data.Buffered
( Store
, newStore
, unsafeFreezeStore
, unsafeFreezeStore2
, setStore
, setStore2
, store
, store2
, loopStore
, loopStore2
) where
-- By only allowing `Store` to be created using `newStore`, we ensure that
-- `unsafeSwapArr` is only used in a safe way (on two arrays allocated in the
-- same scope).
import Prelude ()
import Control.Monad.State
import Feldspar.Representation
import Feldspar.Run
import Feldspar.Data.Vector
-- | Double-buffered storage
data Store a = Store
{ activeBuf :: Arr a
, freeBuf :: Arr a
}
-- | Create a new double-buffered 'Store', initialized to a 0x0 matrix
--
-- This operation allocates two arrays of the given length.
newStore :: (Syntax a, MonadComp m) => Data Length -> m (Store a)
newStore l = Store <$> newNamedArr "store" l <*> newNamedArr "store" l
-- | Read the contents of a 'Store' without making a copy. This is generally
-- only safe if the the 'Store' is not updated as long as the resulting vector
-- is alive.
unsafeFreezeStore :: (Syntax a, MonadComp m) =>
Data Length -> Store a -> m (Manifest a)
unsafeFreezeStore l = unsafeFreezeSlice l . activeBuf
-- | Read the contents of a 'Store' without making a copy (2-dimensional
-- version). This is generally only safe if the the 'Store' is not updated as
-- long as the resulting vector is alive.
unsafeFreezeStore2 :: (Syntax a, MonadComp m)
=> Data Length -- ^ Number of rows
-> Data Length -- ^ Number of columns
-> Store a
-> m (Manifest2 a)
unsafeFreezeStore2 r c Store {..} =
nest r c <$> unsafeFreezeSlice (r*c) activeBuf
-- | Cheap swapping of the two buffers in a 'Store'
swapStore :: Syntax a => Store a -> Run ()
swapStore Store {..} = unsafeSwapArr activeBuf freeBuf
-- | Write a 1-dimensional vector to a 'Store'. The operation may become a no-op
-- if the vector is already in the 'Store'.
setStore :: (Manifestable Run vec a, Finite vec, Syntax a) =>
Store a -> vec -> Run ()
setStore st@Store {..} vec = case viewManifest vec of
Just iarr
| unsafeEqArrIArr activeBuf iarr ->
iff (iarrOffset iarr == arrOffset activeBuf)
(return ())
saveAndSwap
-- We don't check if `iarr` is equal to the free buffer, because that
-- would mean that we're trying to overwrite a frozen buffer while
-- reading it, which should lead to undefined behavior.
_ -> saveAndSwap
where
saveAndSwap = manifestStore freeBuf vec >> swapStore st
-- | Write a 2-dimensional vector to a 'Store'. The operation may become a no-op
-- if the vector is already in the 'Store'.
setStore2 :: (Manifestable2 Run vec a, Finite2 vec, Syntax a) =>
Store a -> vec -> Run ()
setStore2 st@Store {..} vec = case viewManifest2 vec of
Just arr
| let iarr = unnest arr
, unsafeEqArrIArr activeBuf iarr ->
iff (iarrOffset iarr == arrOffset activeBuf)
(return ())
saveAndSwap
-- See comment to `setStore`
_ -> saveAndSwap
where
saveAndSwap = manifestStore2 freeBuf vec >> swapStore st
-- | Write the contents of a vector to a 'Store' and get it back as a
-- 'Manifest' vector
store :: (Manifestable Run vec a, Finite vec, Syntax a) =>
Store a -> vec -> Run (Manifest a)
store st vec = setStore st vec >> unsafeFreezeStore (length vec) st
-- | Write the contents of a vector to a 'Store' and get it back as a
-- 'Manifest2' vector
store2 :: (Manifestable2 Run vec a, Finite2 vec, Syntax a) =>
Store a -> vec -> Run (Manifest2 a)
store2 st vec = setStore2 st vec >> unsafeFreezeStore2 r c st
where
(r,c) = extent2 vec
loopStore
:: ( Syntax a
, Manifestable Run vec1 a
, Finite vec1
, Manifestable Run vec2 a
, Finite vec2
)
=> Store a
-> IxRange (Data Length)
-> (Data Index -> Manifest a -> Run vec1)
-> vec2
-> Run (Manifest a)
loopStore st rng body init = do
setStore st init
lr <- initRef $ length init
for rng $ \i -> do
l <- unsafeFreezeRef lr
next <- body i =<< unsafeFreezeStore l st
setStore st next
setRef lr $ length next
l <- unsafeFreezeRef lr
unsafeFreezeStore l st
loopStore2
:: ( Syntax a
, Manifestable2 Run vec1 a
, Finite2 vec1
, Manifestable2 Run vec2 a
, Finite2 vec2
)
=> Store a
-> IxRange (Data Length)
-> (Data Index -> Manifest2 a -> Run vec1)
-> vec2
-> Run (Manifest2 a)
loopStore2 st rng body init = do
setStore2 st init
rr <- initRef $ numRows init
cr <- initRef $ numCols init
for rng $ \i -> do
r <- unsafeFreezeRef rr
c <- unsafeFreezeRef cr
next <- body i =<< unsafeFreezeStore2 r c st
setStore2 st next
setRef rr $ numRows next
setRef cr $ numCols next
r <- unsafeFreezeRef rr
c <- unsafeFreezeRef cr
unsafeFreezeStore2 r c st
| kmate/raw-feldspar | src/Feldspar/Data/Buffered.hs | bsd-3-clause | 6,440 | 0 | 14 | 1,613 | 1,388 | 701 | 687 | -1 | -1 |
{-|
Funsat aims to be a reasonably efficient modern SAT solver that is easy to
integrate as a backend to other projects. SAT is NP-complete, and thus has
reductions from many other interesting problems. We hope this implementation is
efficient enough to make it useful to solve medium-size, real-world problem
mapped from another space. We also have taken pains test the solver rigorously
to encourage confidence in its output.
One particular nicetie facilitating integration of Funsat into other projects
is the efficient calculation of an /unsatisfiable core/ for unsatisfiable
problems (see the "Funsat.Resolution" module). In the case a problem is
unsatisfiable, as a by-product of checking the proof of unsatisfiability,
Funsat will generate a minimal set of input clauses that are also
unsatisfiable.
Another is the ability to compile high-level circuits into CNF. Seen the
"Funsat.Circuit" module.
* 07 Jun 2008 21:43:42: N.B. because of the use of mutable arrays in the ST
monad, the solver will actually give _wrong_ answers if you compile without
optimisation. Which is okay, 'cause that's really slow anyway.
[@Bibliography@]
* ''Abstract DPLL and DPLL Modulo Theories''
* ''Chaff: Engineering an Efficient SAT solver''
* ''An Extensible SAT-solver'' by Niklas Een, Niklas Sorensson
* ''Efficient Conflict Driven Learning in a Boolean Satisfiability Solver''
by Zhang, Madigan, Moskewicz, Malik
* ''SAT-MICRO: petit mais costaud!'' by Conchon, Kanig, and Lescuyer
-}
module Funsat.Solver
#ifndef TESTING
( -- * Interface
solve
, solve1
, Solution(..)
-- ** Verification
, verify
, VerifyError(..)
-- ** Configuration
, FunsatConfig(..)
, defaultConfig
-- * Solver statistics
, Stats(..)
, ShowWrapped(..)
, statTable
, statSummary
)
#endif
where
{-
This file is part of funsat.
funsat is free software: it is released under the BSD3 open source license.
You can find details of this license in the file LICENSE at the root of the
source tree.
Copyright 2008 Denis Bueno
-}
import Control.Arrow( (&&&) )
import Control.Exception( assert )
import Control.Monad.Error hiding ( (>=>), forM_, runErrorT )
import Control.Monad.MonadST( MonadST(..) )
import Control.Monad.ST.Strict
import Control.Monad.State.Lazy hiding ( (>=>), forM_ )
import Data.Array.ST
import Data.Array.Unboxed
import Data.Foldable hiding ( sequence_ )
import Data.Graph.Inductive.Tree
import Data.Int( Int64 )
import Data.List( nub, tails, sortBy, sort )
import Data.Maybe
import Data.Ord( comparing )
import Data.STRef
import Data.Sequence( Seq )
-- import Debug.Trace (trace)
import Funsat.Monad
import Funsat.Utils
import Funsat.Utils.Internal
import Funsat.Resolution( ResolutionTrace(..), initResolutionTrace )
import Funsat.Types
import Funsat.Types.Internal
import Prelude hiding ( sum, concatMap, elem, foldr, foldl, any, maximum )
import Funsat.Resolution( ResolutionError(..) )
import Text.Printf( printf )
import qualified Data.Foldable as Fl
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Sequence as Seq
import qualified Data.Set as Set
import qualified Funsat.Resolution as Resolution
import qualified Text.Tabular as Tabular
-- * Interface
-- | Run the DPLL-based SAT solver on the given CNF instance. Returns a
-- solution, along with internal solver statistics and possibly a resolution
-- trace. The trace is for checking a proof of `Unsat', and thus is only
-- present when the result is `Unsat'.
solve :: FunsatConfig -> CNF -> (Solution, Stats, Maybe ResolutionTrace)
solve cfg fIn =
-- To solve, we simply take baby steps toward the solution using solveStep,
-- starting with an initial assignment.
-- trace ("input " ++ show f) $
either (error "solve: invariant violated") id $
runST $
evalSSTErrMonad
(do initialAssignment <- liftST $ newSTUArray (V 1, V (numVars f)) 0
(a, isUnsat) <- initialState initialAssignment
if isUnsat then reportSolution (Unsat a)
else stepToSolution initialAssignment >>= reportSolution)
SC{ cnf = f{ clauses = Set.empty }, dl = []
, watches = undefined, learnt = undefined
, propQ = Seq.empty, trail = [], level = undefined
, stats = FunStats{numConfl = 0,numConflTotal = 0,numDecisions = 0,numImpl = 0}
, reason = Map.empty, varOrder = undefined
, resolutionTrace = PartialResolutionTrace 1 [] [] Map.empty
, dpllConfig = cfg }
where
f = preprocessCNF fIn
-- If returns True, then problem is unsat.
initialState :: MAssignment s -> FunMonad s (IAssignment, Bool)
initialState m = do
initialLevel <- liftST $ newSTUArray (V 1, V (numVars f)) noLevel
modify $ \s -> s{ level = initialLevel }
initialWatches <- liftST $ newSTArray (L (- (numVars f)), L (numVars f)) []
modify $ \s -> s{ watches = initialWatches }
initialLearnts <- liftST $ newSTArray (L (- (numVars f)), L (numVars f)) []
modify $ \s -> s{ learnt = initialLearnts }
initialVarOrder <- liftST $ newSTUArray (V 1, V (numVars f)) initialActivity
modify $ \s -> s{ varOrder = VarOrder initialVarOrder }
-- Watch each clause, making sure to bork if we find a contradiction.
(`catchError`
(const $ funFreeze m >>= \a -> return (a,True))) $ do
forM_ (clauses f)
(\c -> do cid <- nextTraceId
isConsistent <- watchClause m (c, cid) False
when (not isConsistent)
-- conflict data is ignored here, so safe to fake
(do traceClauseId cid ; throwError (L 0, [], 0)))
a <- funFreeze m
return (a, False)
-- | Solve with the default configuration `defaultConfig'.
solve1 :: CNF -> (Solution, Stats, Maybe ResolutionTrace)
solve1 = solve defaultConfig
-- | This function applies `solveStep' recursively until SAT instance is
-- solved, starting with the given initial assignment. It also implements the
-- conflict-based restarting (see `FunsatConfig').
stepToSolution :: MAssignment s -> FunMonad s Solution
stepToSolution assignment = do
step <- solveStep assignment
useRestarts <- gets (configUseRestarts . dpllConfig)
isTimeToRestart <- uncurry ((>=)) `liftM`
gets ((numConfl . stats) &&& (configRestart . dpllConfig))
case step of
Left m -> do when (useRestarts && isTimeToRestart)
(do _stats <- extractStats
-- trace ("Restarting...") $
-- trace (statSummary stats) $
resetState m)
stepToSolution m
Right s -> return s
where
resetState m = do
modify $ \s -> let st = stats s in s{ stats = st{numConfl = 0} }
-- Require more conflicts before next restart.
modifySlot dpllConfig $ \s c ->
s{ dpllConfig = c{ configRestart = ceiling (configRestartBump c
* fromIntegral (configRestart c))
} }
lvl <- gets level >>= funFreeze
undoneLits <- takeWhile (\l -> lvl ! (var l) > 0) `liftM` gets trail
forM_ undoneLits $ const (undoOne m)
modify $ \s -> s{ dl = [], propQ = Seq.empty }
compactDB
funFreeze m >>= simplifyDB
reportSolution :: Solution -> FunMonad s (Solution, Stats, Maybe ResolutionTrace)
reportSolution s = do
stats <- extractStats
case s of
Sat _ -> return (s, stats, Nothing)
Unsat _ -> do
resTrace <- constructResTrace s
return (s, stats, Just resTrace)
-- | A default configuration based on the formula to solve.
--
-- * restarts every 100 conflicts
--
-- * requires 1.5 as many restarts after restarting as before, each time
--
-- * VSIDS to be enabled
--
-- * restarts to be enabled
defaultConfig :: FunsatConfig
defaultConfig = Cfg { configRestart = 100 -- fromIntegral $ max (numVars f `div` 10) 100
, configRestartBump = 1.5
, configUseVSIDS = True
, configUseRestarts = True
, configCut = FirstUipCut }
-- * Preprocessing
-- | Some kind of preprocessing.
--
-- * remove duplicates
preprocessCNF :: CNF -> CNF
preprocessCNF f = f{clauses = simpClauses (clauses f)}
where simpClauses = Set.map nub -- rm dups
-- | Simplify the clause database. Eventually should supersede, probably,
-- `preprocessCNF'.
--
-- Precondition: decision level 0.
simplifyDB :: IAssignment -> FunMonad s ()
simplifyDB mFr = do
-- For each clause in the database, remove it if satisfied; if it contains a
-- literal whose negation is assigned, delete that literal.
n <- numVars `liftM` gets cnf
s <- get
liftST . forM_ [V 1 .. V n] $ \i -> when (mFr!i /= 0) $ do
let l = L (mFr!i)
filterL _i = map (\(p, c, cid) -> (p, filter (/= negate l) c, cid))
-- Remove unsat literal `negate l' from clauses.
-- modifyArray (watches s) l filterL
modifyArray (learnt s) l filterL
-- Clauses containing `l' are Sat.
-- writeArray (watches s) (negate l) []
writeArray (learnt s) (negate l) []
-- * Internals
-- | The DPLL procedure is modeled as a state transition system. This
-- function takes one step in that transition system. Given an unsatisfactory
-- assignment, perform one state transition, producing a new assignment and a
-- new state.
solveStep :: MAssignment s -> FunMonad s (Either (MAssignment s) Solution)
solveStep m = do
funFreeze m >>= solveStepInvariants
conf <- gets dpllConfig
let selector = if configUseVSIDS conf then select else selectStatic
maybeConfl <- bcp m
mFr <- funFreeze m
voArr <- gets (varOrderArr . varOrder)
voFr <- FrozenVarOrder `liftM` funFreeze voArr
s <- get
stepForward $
-- Check if unsat.
unsat maybeConfl s ==> postProcessUnsat maybeConfl
-- Unit propagation may reveal conflicts; check.
>< maybeConfl >=> backJump m
-- No conflicts. Decide.
>< selector mFr voFr >=> decide m
where
-- Take the step chosen by the transition guards above.
stepForward Nothing = (Right . Sat) `liftM` funFreeze m
stepForward (Just step) = do
r <- step
case r of
Nothing -> (Right . Unsat) `liftM` funFreeze m
Just m -> return . Left $ m
-- | /Precondition:/ problem determined to be unsat.
--
-- Records id of conflicting clause in trace before failing. Always returns
-- `Nothing'.
postProcessUnsat :: Maybe (Lit, Clause, ClauseId) -> FunMonad s (Maybe a)
postProcessUnsat maybeConfl = do
traceClauseId $ (thd . fromJust) maybeConfl
return Nothing
where
thd (_,_,i) = i
-- | Check data structure invariants. Unless @-fno-ignore-asserts@ is passed,
-- this should be optimised away to nothing.
solveStepInvariants :: IAssignment -> FunMonad s ()
{-# INLINE solveStepInvariants #-}
solveStepInvariants _m = assert True $ do
s <- get
-- no dups in decision list or trail
assert ((length . dl) s == (length . nub . dl) s) $
assert ((length . trail) s == (length . nub . trail) s) $
return ()
-- ** Internals
-- | Value of the `level' array if corresponding variable unassigned. Had
-- better be less that 0.
noLevel :: Level
noLevel = -1
-- *** Boolean constraint propagation
-- | Assign a new literal, and enqueue any implied assignments. If a conflict
-- is detected, return @Just (impliedLit, conflictingClause)@; otherwise
-- return @Nothing@. The @impliedLit@ is implied by the clause, but conflicts
-- with the assignment.
--
-- If no new clauses are unit (i.e. no implied assignments), simply update
-- watched literals.
bcpLit :: MAssignment s
-> Lit -- ^ Assigned literal which might propagate.
-> FunMonad s (Maybe (Lit, Clause, ClauseId))
bcpLit m l = do
ws <- gets watches ; ls <- gets learnt
clauses <- liftST $ readArray ws l
learnts <- liftST $ readArray ls l
liftST $ do writeArray ws l [] ; writeArray ls l []
-- Update wather lists for normal & learnt clauses; if conflict is found,
-- return that and don't update anything else.
(`catchError` return . Just) $ do
{-# SCC "bcpWatches" #-} forM_ (tails clauses) (updateWatches
(\ f l -> liftST $ modifyArray ws l (const f)))
{-# SCC "bcpLearnts" #-} forM_ (tails learnts) (updateWatches
(\ f l -> liftST $ modifyArray ls l (const f)))
return Nothing -- no conflict
where
-- updateWatches: `l' has been assigned, so we look at the clauses in
-- which contain @negate l@, namely the watcher list for l. For each
-- annotated clause, find the status of its watched literals. If a
-- conflict is found, the at-fault clause is returned through Left, and
-- the unprocessed clauses are placed back into the appropriate watcher
-- list.
{-# INLINE updateWatches #-}
updateWatches _ [] = return ()
updateWatches alter (annCl@(watchRef, c, cid) : restClauses) = do
mFr :: IAssignment <- funFreeze m
q <- liftST $ do (x, y) <- readSTRef watchRef
return $ if x == l then y else x
-- l,q are the (negated) literals being watched for clause c.
if negate q `isTrueUnder` mFr -- if other true, clause already sat
then alter (annCl:) l
else
case find (\x -> x /= negate q && x /= negate l
&& not (x `isFalseUnder` mFr)) c of
Just l' -> do -- found unassigned literal, negate l', to watch
liftST $ writeSTRef watchRef (q, negate l')
alter (annCl:) (negate l')
Nothing -> do -- all other lits false, clause is unit
incNumImpl
alter (annCl:) l
isConsistent <- enqueue m (negate q) (Just (c, cid))
when (not isConsistent) $ do -- unit literal is conflicting
alter (restClauses ++) l
clearQueue
throwError (negate q, c, cid)
-- | Boolean constraint propagation of all literals in `propQ'. If a conflict
-- is found it is returned exactly as described for `bcpLit'.
bcp :: MAssignment s -> FunMonad s (Maybe (Lit, Clause, ClauseId))
bcp m = do
q <- gets propQ
if Seq.null q then return Nothing
else do
p <- dequeue
bcpLit m p >>= maybe (bcp m) (return . Just)
-- *** Decisions
-- | Find and return a decision variable. A /decision variable/ must be (1)
-- undefined under the assignment and (2) it or its negation occur in the
-- formula.
--
-- Select a decision variable, if possible, and return it and the adjusted
-- `VarOrder'.
select :: IAssignment -> FrozenVarOrder -> Maybe Var
{-# INLINE select #-}
select = varOrderGet
selectStatic :: IAssignment -> a -> Maybe Var
{-# INLINE selectStatic #-}
selectStatic m _ = find (`isUndefUnder` m) (range . bounds $ m)
-- | Assign given decision variable. Records the current assignment before
-- deciding on the decision variable indexing the assignment.
decide :: MAssignment s -> Var -> FunMonad s (Maybe (MAssignment s))
decide m v = do
let ld = L (unVar v)
(SC{dl=dl}) <- get
-- trace ("decide " ++ show ld) $ return ()
incNumDecisions
modify $ \s -> s{ dl = ld:dl }
enqueue m ld Nothing
return $ Just m
-- *** Backtracking
-- | The current returns the learned clause implied by the first unique
-- implication point cut of the conflict graph.
backJump :: MAssignment s
-> (Lit, Clause, ClauseId)
-- ^ @(l, c)@, where attempting to assign @l@ conflicted with
-- clause @c@.
-> FunMonad s (Maybe (MAssignment s))
backJump m c@(_, _conflict, _) = get >>= \(SC{dl=dl, reason=_reason}) -> do
_theTrail <- gets trail
-- trace ("********** conflict = " ++ show c) $ return ()
-- trace ("trail = " ++ show _theTrail) $ return ()
-- trace ("dlits (" ++ show (length dl) ++ ") = " ++ show dl) $ return ()
-- ++ "reason: " ++ Map.showTree _reason
-- ) (
incNumConfl ; incNumConflTotal
levelArr <- gets level >>= funFreeze
-- levelArr <- do s <- get
-- funFreeze (level s)
(learntCl, learntClId, newLevel) <- analyse m levelArr dl c
s <- get
let numDecisionsToUndo = length dl - newLevel
dl' = drop numDecisionsToUndo dl
undoneLits = takeWhile (\lit -> levelArr ! (var lit) > newLevel) (trail s)
forM_ undoneLits $ const (undoOne m) -- backtrack
mFr <- funFreeze m
assert (numDecisionsToUndo > 0) $
assert (not (null learntCl)) $
assert (learntCl `isUnitUnder` mFr) $
modify $ \s -> s{ dl = dl' } -- undo decisions
-- trace ("new mFr: " ++ showAssignment mFr) $ return ()
-- TODO once I'm sure this works I don't need getUnit, I can just use the
-- uip of the cut.
watchClause m (learntCl, learntClId) True
mFr <- funFreeze m
enqueue m (getUnit learntCl mFr) (Just (learntCl, learntClId))
-- learntCl is asserting
return $ Just m
-- | Analyse a the conflict graph and produce a learned clause. We use the
-- First UIP cut of the conflict graph.
--
-- May undo part of the trail, but not past the current decision level.
analyse :: MAssignment s -> FrozenLevelArray -> [Lit] -> (Lit, Clause, ClauseId)
-> FunMonad s (Clause, ClauseId, Int)
-- ^ learned clause and new decision level
analyse m levelArr dlits (cLit, cClause, cCid) = do
conf <- gets dpllConfig
mFr <- funFreeze m
st <- get
-- let conflGraph = mkConflGraph mFr levelArr (reason st) dlits (cLit, cClause)
-- :: ConflictGraph Gr
-- trace ("graphviz graph:\n" ++ graphviz' conflGraph) $ return ()
-- trace ("cut: " ++ show firstUIPCut) $ return ()
-- trace ("topSort: " ++ show topSortNodes) $ return ()
-- trace ("dlits (" ++ show (length dlits) ++ "): " ++ show dlits) $ return ()
-- trace ("learnt: " ++ show (map (\l -> (l, levelArr!(var l))) learntCl, newLevel)) $ return ()
-- outputConflict "conflict.dot" (graphviz' conflGraph) $ return ()
-- return $ (learntCl, newLevel)
a <- case configCut conf of
FirstUipCut -> firstUIPBFS m (numVars . cnf $ st) (reason st)
DecisionLitCut -> error "decisionlitcut unimplemented"
-- let lastDecision = fromMaybe $ find (\
-- trace ("learned: " ++ show a) $ return ()
return a
where
-- BFS by undoing the trail backward. From Minisat paper. Returns
-- conflict clause and backtrack level.
firstUIPBFS :: MAssignment s -> Int -> ReasonMap
-> FunMonad s (Clause, ClauseId, Int)
firstUIPBFS m nVars reasonMap = do
resolveSourcesR <- liftST $ newSTRef [] -- trace sources
let addResolveSource clauseId =
liftST $ modifySTRef resolveSourcesR (clauseId:)
-- Literals we should process.
seenArr <- liftST $ newSTUArray (V 1, V nVars) False
counterR <- liftST $ newSTRef (0 :: Int) -- Number of unprocessed current-level
-- lits we know about.
pR <- liftST $ newSTRef cLit -- Invariant: literal from current dec. lev.
out_learnedR <- liftST $ newSTRef []
out_btlevelR <- liftST $ newSTRef 0
let reasonL l = if l == cLit then (cClause, cCid)
else
let (r, rid) =
Map.findWithDefault (error "analyse: reasonL")
(var l) reasonMap
in (r `without` l, rid)
(`doWhile` (liftM (> 0) (liftST $ readSTRef counterR))) $
do p <- liftST $ readSTRef pR
let (p_reason, p_rid) = reasonL p
traceClauseId p_rid
addResolveSource p_rid
forM_ p_reason (bump . var)
-- For each unseen reason,
-- > from the current level, bump counter
-- > from lower level, put in learned clause
liftST . forM_ p_reason $ \q -> do
seenq <- readArray seenArr (var q)
when (not seenq) $
do writeArray seenArr (var q) True
if levelL q == currentLevel
then modifySTRef counterR (+ 1)
else if levelL q > 0
then do modifySTRef out_learnedR (q:)
modifySTRef out_btlevelR $ max (levelL q)
else return ()
-- Select next literal to look at:
(`doWhile` (liftST (readSTRef pR >>= readArray seenArr . var)
>>= return . not)) $ do
p <- head `liftM` gets trail -- a dec. var. only if the counter =
-- 1, i.e., loop terminates now
liftST $ writeSTRef pR p
undoOne m
-- Invariant states p is from current level, so when we're done
-- with it, we've thrown away one lit. from counting toward
-- counter.
liftST $ modifySTRef counterR (\c -> c - 1)
p <- liftST $ readSTRef pR
liftST $ modifySTRef out_learnedR (negate p:)
bump . var $ p
out_learned <- liftST $ readSTRef out_learnedR
out_btlevel <- liftST $ readSTRef out_btlevelR
learnedClauseId <- nextTraceId
storeResolvedSources resolveSourcesR learnedClauseId
traceClauseId learnedClauseId
return (out_learned, learnedClauseId, out_btlevel)
-- helpers
currentLevel = length dlits
levelL l = levelArr!(var l)
storeResolvedSources rsR clauseId = do
rsReversed <- liftST $ readSTRef rsR
modifySlot resolutionTrace $ \s rt ->
s{resolutionTrace =
rt{resSourceMap =
Map.insert clauseId (reverse rsReversed) (resSourceMap rt)}}
-- | Delete the assignment to last-assigned literal. Undoes the trail, the
-- assignment, sets `noLevel', undoes reason.
--
-- Does /not/ touch `dl'.
undoOne :: MAssignment s -> FunMonad s ()
{-# INLINE undoOne #-}
undoOne m = do
trl <- gets trail
lvl <- gets level
case trl of
[] -> error "undoOne of empty trail"
(l:trl') -> do
liftST $ m `unassign` l
liftST $ writeArray lvl (var l) noLevel
modify $ \s ->
s{ trail = trl'
, reason = Map.delete (var l) (reason s) }
-- | Increase the recorded activity of given variable.
bump :: Var -> FunMonad s ()
{-# INLINE bump #-}
bump v = varOrderMod v (+ varInc)
-- | Constant amount by which a variable is `bump'ed.
varInc :: Double
varInc = 1.0
-- *** Impossible to satisfy
-- | /O(1)/. Test for unsatisfiability.
--
-- The DPLL paper says, ''A problem is unsatisfiable if there is a conflicting
-- clause and there are no decision literals in @m@.'' But we were deciding
-- on all literals *without* creating a conflicting clause. So now we also
-- test whether we've made all possible decisions, too.
unsat :: Maybe a -> FunsatState s -> Bool
{-# INLINE unsat #-}
unsat maybeConflict (SC{dl=dl}) = isUnsat
where isUnsat = (null dl && isJust maybeConflict)
-- or BitSet.size bad == numVars cnf
-- ** Helpers
-- *** Clause compaction
-- | Keep the smaller half of the learned clauses.
compactDB :: FunMonad s ()
compactDB = do
n <- numVars `liftM` gets cnf
lArr <- gets learnt
clauses <- liftST $ (nub . Fl.concat) `liftM`
forM [L (- n) .. L n]
(\v -> do val <- readArray lArr v ; writeArray lArr v []
return val)
let clauses' = take (length clauses `div` 2)
$ sortBy (comparing (length . (\(_,s,_) -> s))) clauses
liftST $ forM_ clauses'
(\ wCl@(r, _, _) -> do
(x, y) <- readSTRef r
modifyArray lArr x $ const (wCl:)
modifyArray lArr y $ const (wCl:))
-- *** Unit propagation
-- | Add clause to the watcher lists, unless clause is a singleton; if clause
-- is a singleton, `enqueue's fact and returns `False' if fact is in conflict,
-- `True' otherwise. This function should be called exactly once per clause,
-- per run. It should not be called to reconstruct the watcher list when
-- propagating.
--
-- Currently the watched literals in each clause are the first two.
--
-- Also adds unique clause ids to trace.
watchClause :: MAssignment s
-> (Clause, ClauseId)
-> Bool -- ^ Is this clause learned?
-> FunMonad s Bool
{-# INLINE watchClause #-}
watchClause m (c, cid) isLearnt = do
case c of
[] -> return True
[l] -> do result <- enqueue m l (Just (c, cid))
levelArr <- gets level
liftST $ writeArray levelArr (var l) 0
when (not isLearnt) (
modifySlot resolutionTrace $ \s rt ->
s{resolutionTrace=rt{resTraceOriginalSingles=
(c,cid):resTraceOriginalSingles rt}})
return result
_ -> do let p = (negate (c !! 0), negate (c !! 1))
_insert annCl@(_, cl) list -- avoid watching dup clauses
| any (\(_, c) -> cl == c) list = list
| otherwise = annCl:list
r <- liftST $ newSTRef p
let annCl = (r, c, cid)
addCl arr = do modifyArray arr (fst p) $ const (annCl:)
modifyArray arr (snd p) $ const (annCl:)
get >>= liftST . addCl . (if isLearnt then learnt else watches)
return True
-- | Enqueue literal in the `propQ' and place it in the current assignment.
-- If this conflicts with an existing assignment, returns @False@; otherwise
-- returns @True@. In case there is a conflict, the assignment is /not/
-- altered.
--
-- Also records decision level, modifies trail, and records reason for
-- assignment.
enqueue :: MAssignment s
-> Lit
-- ^ The literal that has been assigned true.
-> Maybe (Clause, ClauseId)
-- ^ The reason for enqueuing the literal. Including a
-- non-@Nothing@ value here adjusts the `reason' map.
-> FunMonad s Bool
{-# INLINE enqueue #-}
-- enqueue _m l _r | trace ("enqueue " ++ show l) $ False = undefined
enqueue m l r = do
mFr <- funFreeze m
case l `statusUnder` mFr of
Right b -> return b -- conflict/already assigned
Left () -> do
liftST $ m `assign` l
-- assign decision level for literal
gets (level &&& (length . dl)) >>= \(levelArr, dlInt) ->
liftST (writeArray levelArr (var l) dlInt)
modify $ \s -> s{ trail = l : (trail s)
, propQ = propQ s Seq.|> l }
when (isJust r) $
modifySlot reason $ \s m -> s{reason = Map.insert (var l) (fromJust r) m}
return True
-- | Pop the `propQ'. Error (crash) if it is empty.
dequeue :: FunMonad s Lit
{-# INLINE dequeue #-}
dequeue = do
q <- gets propQ
case Seq.viewl q of
Seq.EmptyL -> error "dequeue of empty propQ"
top Seq.:< q' -> do
modify $ \s -> s{propQ = q'}
return top
-- | Clear the `propQ'.
clearQueue :: FunMonad s ()
{-# INLINE clearQueue #-}
clearQueue = modify $ \s -> s{propQ = Seq.empty}
-- *** Dynamic variable ordering
-- | Modify priority of variable; takes care of @Double@ overflow.
varOrderMod :: Var -> (Double -> Double) -> FunMonad s ()
varOrderMod v f = do
vo <- varOrderArr `liftM` gets varOrder
vActivity <- liftST $ readArray vo v
when (f vActivity > 1e100) $ rescaleActivities vo
liftST $ writeArray vo v (f vActivity)
where
rescaleActivities vo = liftST $ do
indices <- range `liftM` getBounds vo
forM_ indices (\i -> modifyArray vo i $ const (* 1e-100))
-- | Retrieve the maximum-priority variable from the variable order.
varOrderGet :: IAssignment -> FrozenVarOrder -> Maybe Var
{-# INLINE varOrderGet #-}
varOrderGet mFr (FrozenVarOrder voFr) =
-- find highest var undef under mFr, then find one with highest activity
(`fmap` goUndef highestIndex) $ \start -> goActivity start start
where
highestIndex = snd . bounds $ voFr
maxActivity v v' = if voFr!v > voFr!v' then v else v'
-- @goActivity current highest@ returns highest-activity var
goActivity !(V 0) !h = h
goActivity !v@(V n) !h = if v `isUndefUnder` mFr
then goActivity (V $! n-1) (v `maxActivity` h)
else goActivity (V $! n-1) h
-- returns highest var that is undef under mFr
goUndef !(V 0) = Nothing
goUndef !v@(V n) | v `isUndefUnder` mFr = Just v
| otherwise = goUndef (V $! n-1)
-- | Generate a new clause identifier (always unique).
nextTraceId :: FunMonad s Int
nextTraceId = do
counter <- gets (resTraceIdCount . resolutionTrace)
modifySlot resolutionTrace $ \s rt ->
s{ resolutionTrace = rt{ resTraceIdCount = succ counter }}
return $! counter
-- | Add the given clause id to the trace.
traceClauseId :: ClauseId -> FunMonad s ()
traceClauseId cid = do
modifySlot resolutionTrace $ \s rt ->
s{resolutionTrace = rt{ resTrace = [cid] }}
-- *** Generic state transition notation
-- | Guard a transition action. If the boolean is true, return the action
-- given as an argument. Otherwise, return `Nothing'.
(==>) :: (Monad m) => Bool -> m a -> Maybe (m a)
{-# INLINE (==>) #-}
(==>) b amb = guard b >> return amb
infixr 6 ==>
-- | @flip fmap@.
(>=>) :: (Monad m) => Maybe a -> (a -> m b) -> Maybe (m b)
{-# INLINE (>=>) #-}
(>=>) = flip fmap
infixr 6 >=>
-- | Choice of state transitions. Choose the leftmost action that isn't
-- @Nothing@, or return @Nothing@ otherwise.
(><) :: (Monad m) => Maybe (m a) -> Maybe (m a) -> Maybe (m a)
a1 >< a2 =
case (a1, a2) of
(Nothing, Nothing) -> Nothing
(Just _, _) -> a1
_ -> a2
infixl 5 ><
-- *** Misc
initialActivity :: Double
initialActivity = 1.0
instance Error (Lit, Clause, ClauseId) where noMsg = (L 0, [], 0)
instance Error () where noMsg = ()
data VerifyError =
SatError [(Clause, Either () Bool)]
-- ^ Indicates a unsatisfactory assignment that was claimed
-- satisfactory. Each clause is tagged with its status using
-- 'Funsat.Types.Model'@.statusUnder@.
| UnsatError ResolutionError
-- ^ Indicates an error in the resultion checking process.
deriving (Show)
-- | Verify the solution. In case of `Sat', checks that the assignment is
-- well-formed and satisfies the CNF problem. In case of `Unsat', runs a
-- resolution-based checker on a trace of the SAT solver.
verify :: Solution -> Maybe ResolutionTrace -> CNF -> Maybe VerifyError
verify sol maybeRT cnf =
-- m is well-formed
-- Fl.all (\l -> m!(V l) == l || m!(V l) == negate l || m!(V l) == 0) [1..numVars cnf]
case sol of
Sat m ->
let unsatClauses = toList $
Set.filter (not . isTrue . snd) $
Set.map (\c -> (c, c `statusUnder` m)) (clauses cnf)
in if null unsatClauses
then Nothing
else Just . SatError $ unsatClauses
Unsat _ ->
case Resolution.checkDepthFirst (fromJust maybeRT) of
Left er -> Just . UnsatError $ er
Right _ -> Nothing
where isTrue (Right True) = True
isTrue _ = False
---------------------------------------
-- Statistics & trace
data Stats = Stats
{ statsNumConfl :: Int64
-- ^ Number of conflicts since last restart.
, statsNumConflTotal :: Int64
-- ^ Number of conflicts since beginning of solving.
, statsNumLearnt :: Int64
-- ^ Number of learned clauses currently in DB (fluctuates because DB is
-- compacted every restart).
, statsAvgLearntLen :: Double
-- ^ Avg. number of literals per learnt clause.
, statsNumDecisions :: Int64
-- ^ Total number of decisions since beginning of solving.
, statsNumImpl :: Int64
-- ^ Total number of unit implications since beginning of solving.
}
-- | The show instance uses the wrapped string.
newtype ShowWrapped = WrapString { unwrapString :: String }
instance Show ShowWrapped where show = unwrapString
instance Show Stats where show = show . statTable
-- | Convert statistics to a nice-to-display tabular form.
statTable :: Stats -> Tabular.Table ShowWrapped
statTable s =
Tabular.mkTable
[ [WrapString "Num. Conflicts"
,WrapString $ show (statsNumConflTotal s)]
, [WrapString "Num. Learned Clauses"
,WrapString $ show (statsNumLearnt s)]
, [WrapString " --> Avg. Lits/Clause"
,WrapString $ show (statsAvgLearntLen s)]
, [WrapString "Num. Decisions"
,WrapString $ show (statsNumDecisions s)]
, [WrapString "Num. Propagations"
,WrapString $ show (statsNumImpl s)] ]
-- | Converts statistics into a tabular, human-readable summary.
statSummary :: Stats -> String
statSummary s =
show (Tabular.mkTable
[[WrapString $ show (statsNumConflTotal s) ++ " Conflicts"
,WrapString $ "| " ++ show (statsNumLearnt s) ++ " Learned Clauses"
++ " (avg " ++ printf "%.2f" (statsAvgLearntLen s)
++ " lits/clause)"]])
extractStats :: FunMonad s Stats
extractStats = do
s <- gets stats
learntArr <- get >>= funFreeze . learnt
let learnts = (nub . Fl.concat)
[ map (sort . (\(_,c,_) -> c)) (learntArr!i)
| i <- (range . bounds) learntArr ] :: [Clause]
stats =
Stats { statsNumConfl = numConfl s
, statsNumConflTotal = numConflTotal s
, statsNumLearnt = fromIntegral $ length learnts
, statsAvgLearntLen =
fromIntegral (foldl' (+) 0 (map length learnts))
/ fromIntegral (statsNumLearnt stats)
, statsNumDecisions = numDecisions s
, statsNumImpl = numImpl s }
return stats
constructResTrace :: Solution -> FunMonad s ResolutionTrace
constructResTrace sol = do
s <- get
watchesIndices <- range `liftM` liftST (getBounds (watches s))
origClauseMap <-
foldM (\origMap i -> do
clauses <- liftST $ readArray (watches s) i
return $
foldr (\(_, clause, clauseId) origMap ->
Map.insert clauseId clause origMap)
origMap
clauses)
Map.empty
watchesIndices
let singleClauseMap =
foldr (\(clause, clauseId) m -> Map.insert clauseId clause m)
Map.empty
(resTraceOriginalSingles . resolutionTrace $ s)
anteMap =
foldr (\l anteMap -> Map.insert (var l) (getAnteId s (var l)) anteMap)
Map.empty
(litAssignment . finalAssignment $ sol)
return
(initResolutionTrace
(head (resTrace . resolutionTrace $ s))
(finalAssignment sol))
{ traceSources = resSourceMap . resolutionTrace $ s
, traceOriginalClauses = origClauseMap `Map.union` singleClauseMap
, traceAntecedents = anteMap }
where
getAnteId s v = snd $
Map.findWithDefault (error $ "no reason for assigned var " ++ show v)
v (reason s)
| dbueno/funsat | src/Funsat/Solver.hs | bsd-3-clause | 35,895 | 0 | 26 | 10,425 | 8,319 | 4,385 | 3,934 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Bench
-- Copyright : Johan Tibell 2011
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is the entry point into running the benchmarks in a built
-- package. It performs the \"@.\/setup bench@\" action. It runs
-- benchmarks designated in the package description.
module Distribution.Simple.Bench
( bench
) where
import Prelude ()
import Distribution.Compat.Prelude
import qualified Distribution.PackageDescription as PD
import Distribution.Simple.BuildPaths
import Distribution.Simple.Compiler
import Distribution.Simple.InstallDirs
import qualified Distribution.Simple.LocalBuildInfo as LBI
import Distribution.Simple.Setup
import Distribution.Simple.UserHooks
import Distribution.Simple.Utils
import Distribution.Text
import System.Exit ( ExitCode(..), exitFailure, exitSuccess )
import System.Directory ( doesFileExist )
import System.FilePath ( (</>), (<.>) )
-- | Perform the \"@.\/setup bench@\" action.
bench :: Args -- ^positional command-line arguments
-> PD.PackageDescription -- ^information from the .cabal file
-> LBI.LocalBuildInfo -- ^information from the configure step
-> BenchmarkFlags -- ^flags sent to benchmark
-> IO ()
bench args pkg_descr lbi flags = do
let verbosity = fromFlag $ benchmarkVerbosity flags
benchmarkNames = args
pkgBenchmarks = PD.benchmarks pkg_descr
enabledBenchmarks = map fst (LBI.enabledBenchLBIs pkg_descr lbi)
-- Run the benchmark
doBench :: PD.Benchmark -> IO ExitCode
doBench bm =
case PD.benchmarkInterface bm of
PD.BenchmarkExeV10 _ _ -> do
let cmd = LBI.buildDir lbi </> PD.benchmarkName bm
</> PD.benchmarkName bm <.> exeExtension
options = map (benchOption pkg_descr lbi bm) $
benchmarkOptions flags
name = PD.benchmarkName bm
-- Check that the benchmark executable exists.
exists <- doesFileExist cmd
unless exists $ die $
"Error: Could not find benchmark program \""
++ cmd ++ "\". Did you build the package first?"
notice verbosity $ startMessage name
-- This will redirect the child process
-- stdout/stderr to the parent process.
exitcode <- rawSystemExitCode verbosity cmd options
notice verbosity $ finishMessage name exitcode
return exitcode
_ -> do
notice verbosity $ "No support for running "
++ "benchmark " ++ PD.benchmarkName bm ++ " of type: "
++ show (disp $ PD.benchmarkType bm)
exitFailure
unless (PD.hasBenchmarks pkg_descr) $ do
notice verbosity "Package has no benchmarks."
exitSuccess
when (PD.hasBenchmarks pkg_descr && null enabledBenchmarks) $
die $ "No benchmarks enabled. Did you remember to configure with "
++ "\'--enable-benchmarks\'?"
bmsToRun <- case benchmarkNames of
[] -> return enabledBenchmarks
names -> for names $ \bmName ->
let benchmarkMap = zip enabledNames enabledBenchmarks
enabledNames = map PD.benchmarkName enabledBenchmarks
allNames = map PD.benchmarkName pkgBenchmarks
in case lookup bmName benchmarkMap of
Just t -> return t
_ | bmName `elem` allNames ->
die $ "Package configured with benchmark "
++ bmName ++ " disabled."
| otherwise -> die $ "no such benchmark: " ++ bmName
let totalBenchmarks = length bmsToRun
notice verbosity $ "Running " ++ show totalBenchmarks ++ " benchmarks..."
exitcodes <- traverse doBench bmsToRun
let allOk = totalBenchmarks == length (filter (== ExitSuccess) exitcodes)
unless allOk exitFailure
where
startMessage name = "Benchmark " ++ name ++ ": RUNNING...\n"
finishMessage name exitcode = "Benchmark " ++ name ++ ": "
++ (case exitcode of
ExitSuccess -> "FINISH"
ExitFailure _ -> "ERROR")
-- TODO: This is abusing the notion of a 'PathTemplate'. The result isn't
-- necessarily a path.
benchOption :: PD.PackageDescription
-> LBI.LocalBuildInfo
-> PD.Benchmark
-> PathTemplate
-> String
benchOption pkg_descr lbi bm template =
fromPathTemplate $ substPathTemplate env template
where
env = initialPathTemplateEnv
(PD.package pkg_descr) (LBI.localUnitId lbi)
(compilerInfo $ LBI.compiler lbi) (LBI.hostPlatform lbi) ++
[(BenchmarkNameVar, toPathTemplate $ PD.benchmarkName bm)]
| sopvop/cabal | Cabal/Distribution/Simple/Bench.hs | bsd-3-clause | 5,187 | 0 | 22 | 1,661 | 974 | 496 | 478 | 87 | 5 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Data.Logic.Boolean.Class where
import Control.Applicative
import Data.Functor.Identity
import Data.Functor.Compose
class Boolean r where
tt :: r
ff :: r
fromBool :: Bool -> r
fromBool b = if b then tt else ff
data AnyBoolean = AnyBoolean
{ getBoolean :: forall r. Boolean r => r
}
instance Boolean AnyBoolean where
tt = AnyBoolean tt
ff = AnyBoolean ff
-- Boolean instances {{{
instance Boolean Bool where
tt = True
ff = False
instance Boolean r => Boolean (Identity r) where
tt = pure tt
ff = pure ff
instance Boolean (f (g r)) => Boolean (Compose f g r) where
tt = Compose tt
ff = Compose ff
instance Boolean r => Boolean (Maybe r) where
tt = pure tt
ff = pure ff
instance Boolean r => Boolean [r] where
tt = pure tt
ff = pure ff
instance Boolean r => Boolean (Either a r) where
tt = pure tt
ff = pure ff
instance Boolean r => Boolean (a -> r) where
tt = pure tt
ff = pure ff
instance Boolean r => Boolean (IO r) where
tt = pure tt
ff = pure ff
instance
( Boolean r
, Boolean s
) => Boolean (r,s) where
tt = ( tt , tt )
ff = ( ff , ff )
instance
( Boolean r
, Boolean s
, Boolean t
) => Boolean (r,s,t) where
tt = ( tt , tt , tt )
ff = ( ff , ff , ff )
instance
( Boolean r
, Boolean s
, Boolean t
, Boolean u
) => Boolean (r,s,t,u) where
tt = ( tt , tt , tt , tt )
ff = ( ff , ff , ff , ff )
instance
( Boolean r
, Boolean s
, Boolean t
, Boolean u
, Boolean v
) => Boolean (r,s,t,u,v) where
tt = ( tt , tt , tt , tt , tt )
ff = ( ff , ff , ff , ff , ff )
-- }}}
| kylcarte/finally-logical | src/Data/Logic/Boolean/Class.hs | bsd-3-clause | 1,653 | 0 | 11 | 464 | 711 | 391 | 320 | 70 | 0 |
module Paths_AutoComplete (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import Data.Version (Version(..))
import System.Environment (getEnv)
version :: Version
version = Version {versionBranch = [0,1], versionTags = []}
bindir, libdir, datadir, libexecdir :: FilePath
bindir = "/home/satvik/.cabal/bin"
libdir = "/home/satvik/.cabal/lib/AutoComplete-0.1/ghc-7.0.3"
datadir = "/home/satvik/.cabal/share/AutoComplete-0.1"
libexecdir = "/home/satvik/.cabal/libexec"
getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath
getBinDir = catch (getEnv "AutoComplete_bindir") (\_ -> return bindir)
getLibDir = catch (getEnv "AutoComplete_libdir") (\_ -> return libdir)
getDataDir = catch (getEnv "AutoComplete_datadir") (\_ -> return datadir)
getLibexecDir = catch (getEnv "AutoComplete_libexecdir") (\_ -> return libexecdir)
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)
| satvikc/Trie | dist/build/autogen/Paths_AutoComplete.hs | bsd-3-clause | 1,013 | 0 | 10 | 144 | 277 | 159 | 118 | 22 | 1 |
import System.Environment
import System.Directory
import System.IO
import Control.Exception
import qualified Data.ByteString.Lazy as B
main = do
(fileName1:fileName2:_) <- getArgs
copy fileName1 fileName2
copy source dest = do
contents <- B.readFile source
bracketOnError
(openTempFile "." "temp")
(\(tempName, tempHandle) -> do
hClose tempHandle
removeFile tempName)
(\(tempName, tempHandle) -> do
B.hPutStr tempHandle contents
hClose tempHandle
renameFile tempName dest)
| ku00/h-book | src/ByteStringCopy.hs | bsd-3-clause | 575 | 0 | 13 | 157 | 165 | 83 | 82 | 19 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
import System.Console.CmdArgs
import Data.Word
import Contract.Types
import Contract.Symbols
data Arguments = Arguments { symbol :: Symbol
, startTime :: TimeOffset
, startRate :: Rate
, points :: Word32
} deriving (Show, Data, Typeable)
arguments = Arguments
{ symbol = eurusd &= typ "Symbol" &= help "Symbol for which to generate data"
, startTime = 0 &= typ "TimeOffset" &= help "Time of first tick"
, startRate = 5555555 &= typ "Rate" &= help "Rate of first tick"
, points = 100 &= typ "Word32" &= help "Number of ticks to generate"
} &= summary "Random Data Generator version 0.0.1"
main = print =<< cmdArgs arguments
| thlorenz/Pricetory | src/spikes/CmdArgsSample.hs | bsd-3-clause | 830 | 0 | 10 | 280 | 177 | 96 | 81 | 17 | 1 |
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables#-}
module UUTReader where
import Control.Monad
import Data.String.Utils
import Language.Haskell.TH
import GHC.Generics
import Sized
import Arbitrary
import TemplateAllv
import TemplateArbitrary
import TemplateSized
import UUT
import UUTReaderUtilities
import UUTReaderUtilitiesDeep
-------------call to gen_all and gen_arbitrary -------------------------------------
$(gen_allv_str_listQ (notDefTypesQMonad (get_f_inp_types (head uutMethods))))
-------------call to gen_sized and gen_arbitrary -------------------------------------
$(gen_sized_str_listQ (notDefTypesQMonad (get_f_inp_types (head uutMethods))))
------------------main test function------------------------------------------------
test_UUT = test
--------------Printing the ending information---------------------------------------
printInfoTuple (xs,ys,zs) = printInfo xs ys zs
printInfo xs ys zs = "Testing the function " ++ uutName ++ " generating a total of " ++ (show (length ys)) ++
" test cases of which " ++ (show (length zs)) ++ " passed the precondition "
++ "\n\n\nTest cases:" ++ (printTestCases ys)
++ "\n\n\nTest cases that passed the precondition:" ++ (printTestCases zs) ++
if ((length $ filter (== True) xs) == (length xs)) then " None of them failed"
else "\n\n\nAnd these are the ones that failed.\n" ++ (printInfoAux xs zs)
printInfoAux [] [] = ""
printInfoAux (x:xs) (y:ys)
| (x == True) = (printInfoAux xs ys)
| otherwise = (show y) ++ "\n" ++ (printInfoAux xs ys)
printTestCases [] = ""
printTestCases (y:ys) = (show y) ++ ", " ++ (printTestCases ys)
----------------------test function-------------------------------------
test = prueba listArgs
where listArgs = (smallest :: $(inputT (head uutMethods)))
| pegartillo95/CaseGenerator | src/UUTReader.hs | bsd-3-clause | 1,873 | 0 | 17 | 339 | 451 | 240 | 211 | 32 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module Application (
app
) where
import Control.Exception
import Control.Monad (when)
import Data.Default.Class
import Data.Int (Int64)
import Data.Monoid
import Data.Pool (Pool)
import Data.Text.Lazy as Text
import Database.PostgreSQL.Simple (Connection)
import Network.HTTP.Types.Status
import Network.Wai (Application, Middleware)
import Network.Wai.Middleware.RequestLogger (Destination(Handle),
mkRequestLogger, RequestLoggerSettings(destination, outputFormat),
OutputFormat(CustomOutputFormat))
import Network.Wai.Middleware.Static
import System.IO
import Text.Blaze.Html.Renderer.Text (renderHtml)
import Text.Blaze.Html5 (Html)
import Views.DomainList (domainListT)
import Views.DomainPrivileges (domainPrivilegesT)
import Views.ErrorPage (errorPageT)
import Views.GroupList (groupListT)
import Views.Homepage (homepageT)
import Views.MemberList (memberListT)
import Views.PrivilegeRules (privilegeRulesT)
import Views.Search (searchResultsT)
import Web.Scotty.Trans
import DB
import Entities
import LogFormat (logFormat)
import SproxyError
app :: Pool Connection -> FilePath -> IO Application
app c p = do
logger <- mkRequestLogger def{ destination = Handle stderr
, outputFormat = CustomOutputFormat logFormat }
scottyAppT id (sproxyWeb c p logger)
sproxyWeb :: Pool Connection -> FilePath -> Middleware -> ScottyT SproxyError IO ()
sproxyWeb pool dataDirectory logger = do
middleware logger
middleware (staticPolicy (hasPrefix "static" >-> addBase dataDirectory))
-- error page for uncaught exceptions
defaultHandler handleEx
get "/" $ homepage pool
post "/search" $ searchUserH pool
post "/delete-user" $ deleteUserH pool
post "/rename-user" $ renameUserH pool
-- groups
get "/groups" $ groupList pool -- this is the group listing page
get "/groups.json" $ jsonGroupList pool -- json endpoint returning an array of group names
post "/groups" $ jsonUpdateGroup pool -- endpoint where we POST requests for modifications of groups
-- group
get "/group/:group/members" $ memberList pool -- list of members for a group
post "/group/:group/members" $ jsonPostMembers pool -- endpoint for POSTing updates to the member list
-- domains
get "/domains" $ domainList pool -- list of domains handled by sproxy
post "/domains" $ jsonUpdateDomain pool -- endpoint for POSTing updates
-- privileges for a given domain
get "/domain/:domain/privileges" $ domainPrivileges pool -- listing of privileges available on a domain
get "/domain/:domain/privileges.json" $ jsonDomainPrivileges pool -- json endpoint, array of privilege names
post "/domain/:domain/privileges" $ jsonPostDomainPrivileges pool -- endpoint for POSTing updates
-- rules for a given privilege on a given domain
get "/domain/:domain/privilege/:privilege/rules" $ privilegeRules pool -- listing of paths/methods associated to a privilege
post "/domain/:domain/privilege/:privilege/rules" $ jsonPostRule pool -- endpoint for POSTing updates about these
-- add/remove group privileges
post "/domain/:domain/group_privileges" $ handleGPs pool -- endpoint for POSTing privilege granting/removal for groups
blaze :: Html -> ActionT SproxyError IO ()
blaze = Web.Scotty.Trans.html . renderHtml
handleEx :: SproxyError -> ActionT SproxyError IO ()
handleEx = errorPage
errorPage :: SproxyError -> ActionT SproxyError IO ()
errorPage err = blaze (errorPageT err)
homepage :: Pool Connection -> ActionT SproxyError IO ()
homepage _ = blaze homepageT
------------------------------------------
-- handlers related to the group list page
------------------------------------------
-- POST /groups
jsonUpdateGroup :: Pool Connection -> ActionT SproxyError IO ()
jsonUpdateGroup pool = do
(operation :: Text) <- param "operation"
(t, n) <- case operation of
"add" -> do
g <- param "group"
checked pool (addGroup g)
"del" -> do
g <- param "group"
checked pool (removeGroup g)
"upd" -> do
old <- param "old"
new <- param "new"
checked pool (updateGroup old new)
_ -> status badRequest400 >> return ("incorrect operation", -1)
outputFor t n
-- GET /groups
groupList :: Pool Connection -> ActionT SproxyError IO ()
groupList pool = do
groups <- Prelude.map Prelude.head `fmap` withDB pool getGroups
blaze (groupListT groups)
-- GET /groups.json
jsonGroupList :: Pool Connection -> ActionT SproxyError IO ()
jsonGroupList pool = do
groups <- Prelude.map Prelude.head `fmap` withDB pool getGroups
json groups
---------------------------------------------------
-- handlers related to the group members list page
---------------------------------------------------
-- GET /group/:group
memberList :: Pool Connection -> ActionT SproxyError IO ()
memberList pool = do
groupName <- param "group"
members <- Prelude.map Prelude.head `fmap` withDB pool (getMembersFor groupName)
blaze (memberListT members groupName)
-- POST /group/:group/members
jsonPostMembers :: Pool Connection -> ActionT SproxyError IO ()
jsonPostMembers pool = do
groupName <- param "group"
(operation :: Text) <- param "operation"
(t, n) <- case operation of
"add" -> do
m <- param "member"
checked pool (addMemberTo m groupName)
"del" -> do
m <- param "member"
checked pool (removeMemberOf m groupName)
"upd" -> do
old <- param "old"
new <- param "new"
checked pool (updateMemberOf old new groupName)
_ -> status badRequest400 >> return ("incorrect operation", -1)
outputFor t n
--------------------------------------
-- handlers related to the domain list
--------------------------------------
-- GET /domains
domainList :: Pool Connection -> ActionT SproxyError IO ()
domainList pool = do
domains <- Prelude.map Prelude.head `fmap` withDB pool getDomains
blaze (domainListT domains)
-- POST /domains
jsonUpdateDomain :: Pool Connection -> ActionT SproxyError IO ()
jsonUpdateDomain pool = do
(operation :: Text) <- param "operation"
(t, n) <- case operation of
"add" -> do
d <- param "domain"
checked pool (addDomain d)
"del" -> do
d <- param "domain"
checked pool (removeDomain d)
"upd" -> do
old <- param "old"
new <- param "new"
checked pool (updateDomain old new)
_ -> status badRequest400 >> return ("incorrect operation", -1)
outputFor t n
-------------------------------------------------------------------------
-- handlers related to the list of possible privileges for a given domain
-------------------------------------------------------------------------
-- GET /domain/:domain/privileges
domainPrivileges :: Pool Connection -> ActionT SproxyError IO ()
domainPrivileges pool = do
domain <- param "domain"
privileges <- Prelude.map Prelude.head `fmap` withDB pool (getDomainPrivileges domain)
groups <- Prelude.map Prelude.head `fmap` withDB pool getGroups
groupPrivs <- withDB pool (getGroupPrivsFor domain)
blaze (domainPrivilegesT domain privileges groups groupPrivs)
-- GET /domain/:domain/privileges.json
jsonDomainPrivileges :: Pool Connection -> ActionT SproxyError IO ()
jsonDomainPrivileges pool = do
domain <- param "domain"
privileges <- Prelude.map Prelude.head `fmap` withDB pool (getDomainPrivileges domain)
json privileges
-- POST /domain/:domain/group_privileges
handleGPs :: Pool Connection -> ActionT SproxyError IO ()
handleGPs pool = do
domain <- param "domain"
(operation :: Text) <- param "operation"
(t, n) <- case operation of
"add" -> do
grp <- param "group"
priv <- param "privilege"
checked pool (addGPFor domain grp priv)
"del" -> do
grp <- param "group"
priv <- param "privilege"
checked pool (deleteGPOf domain grp priv)
_ -> status badRequest400 >> return ("incorrect operation", -1)
outputFor t n
-- POST /domain/:domain/privileges
jsonPostDomainPrivileges :: Pool Connection -> ActionT SproxyError IO ()
jsonPostDomainPrivileges pool = do
domain <- param "domain"
(operation :: Text) <- param "operation"
(t, n) <- case operation of
"add" -> do
p <- param "privilege"
checked pool (addPrivilegeToDomain p domain)
"del" -> do
p <- param "privilege"
checked pool (removePrivilegeOfDomain p domain)
"upd" -> do
old <- param "old"
new <- param "new"
checked pool (updatePrivilegeOfDomain old new domain)
_ -> status badRequest400 >> return ("incorrect operation", -1)
outputFor t n
-------------------------------------------------------------------------------
-- handlers related to the rules associated to a given privilege on some domain
-------------------------------------------------------------------------------
-- GET /domain/:domain/privilege/:privilege/rules
privilegeRules :: Pool Connection -> ActionT SproxyError IO ()
privilegeRules pool = do
-- TODO: check that the domain and privilege exist
domain <- param "domain"
privilege <- param "privilege"
rules <- withDB pool (getRules domain privilege)
blaze (privilegeRulesT domain privilege rules)
-- POST /domain/:domain/privilege/:privilege/rules
jsonPostRule :: Pool Connection -> ActionT SproxyError IO ()
jsonPostRule pool = do
-- TODO: check that the domain and privilege exist
domain <- param "domain"
privilege <- param "privilege"
operation <- param "operation"
case operation :: Text of
"add" -> addRule domain privilege
"del" -> delRule domain privilege
"upd" -> updRule domain privilege
_ -> status badRequest400 >> text "bad operation"
where
addRule domain privilege = do
path <- param "path"
method <- param "method"
(t, n) <- checked pool
(addRuleToPrivilege domain privilege path method)
outputFor t n
delRule domain privilege = do
path <- param "path"
method <- param "method"
(t, n) <- checked pool
(deleteRuleFromPrivilege domain privilege path method)
outputFor t n
updRule domain privilege = do
what <- param "what"
when (what /= "path" && what /= "method") $ text "invalid 'what'"
let updFunc = if what == "path" then updatePathFor else updateMethodFor
old <- param ("old" <> what)
new <- param ("new" <> what)
otherField <- param $ if what == "path" then "method" else "path"
(t, n) <- checked pool
(updFunc domain privilege new old otherField)
outputFor t n
-- | POST /search, search string in "search_query"
searchUserH :: Pool Connection -> ActionT SproxyError IO ()
searchUserH pool = do
searchStr <- param "search_query"
matchingEmails <- withDB pool (searchUser searchStr)
blaze (searchResultsT searchStr matchingEmails)
-- | POST /delete-user, email to delete in "user_email"
deleteUserH :: Pool Connection -> ActionT SproxyError IO ()
deleteUserH pool = do
userEmail <- param "user_email"
(t, n) <- checked pool (removeUser userEmail)
outputFor t n
-- | POST /rename-user:
-- - old email in "old_email"
-- - new email in "new_email"
renameUserH :: Pool Connection -> ActionT SproxyError IO ()
renameUserH pool = do
oldEmail <- param "old_email"
newEmail <- param "new_email"
(resp, n) <- checked pool (renameUser oldEmail newEmail)
outputFor resp n
-- utility functions
outputFor :: Text -> Int64 -> ActionT SproxyError IO ()
outputFor t 0 = status badRequest400 >> text ("no: " <> t)
outputFor t (-1) = status badRequest400 >> text ("error: " <> t)
outputFor t _ = text t
checked :: Pool Connection
-> (Connection -> IO Int64) -- request
-> ActionT SproxyError IO (Text, Int64)
checked pool req =
withDB pool req'
where req' c = handle (\(e :: SomeException) -> return (Text.pack (show e), -1))
( ("",) <$> req c )
| zalora/sproxy-web | src/Application.hs | mit | 12,687 | 0 | 15 | 3,040 | 3,267 | 1,582 | 1,685 | 245 | 6 |
{-# LANGUAGE TemplateHaskell, FunctionalDependencies, FlexibleContexts #-}
-- {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
{-| Creates a client out of list of RPC server components.
-}
{-
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-}
module Ganeti.THH.HsRPC
( RpcClientMonad
, runRpcClient
, mkRpcCall
, mkRpcCalls
) where
import Control.Applicative
import Control.Monad
import Control.Monad.Base
import Control.Monad.Error
import Control.Monad.Reader
import Language.Haskell.TH
import qualified Text.JSON as J
import Ganeti.BasicTypes
import Ganeti.Errors
import Ganeti.JSON (fromJResultE)
import Ganeti.THH.Types
import Ganeti.UDSServer
-- * The monad for RPC clients
-- | The monad for all client RPC functions.
-- Given a client value, it runs the RPC call in IO and either retrieves the
-- result or the error.
newtype RpcClientMonad a =
RpcClientMonad { runRpcClientMonad :: ReaderT Client ResultG a }
instance Functor RpcClientMonad where
fmap f = RpcClientMonad . fmap f . runRpcClientMonad
instance Applicative RpcClientMonad where
pure = RpcClientMonad . pure
(RpcClientMonad f) <*> (RpcClientMonad k) = RpcClientMonad (f <*> k)
instance Monad RpcClientMonad where
return = RpcClientMonad . return
(RpcClientMonad k) >>= f = RpcClientMonad (k >>= runRpcClientMonad . f)
instance MonadBase IO RpcClientMonad where
liftBase = RpcClientMonad . liftBase
instance MonadIO RpcClientMonad where
liftIO = RpcClientMonad . liftIO
instance MonadError GanetiException RpcClientMonad where
throwError = RpcClientMonad . throwError
catchError (RpcClientMonad k) h =
RpcClientMonad (catchError k (runRpcClientMonad . h))
-- * The TH functions to construct RPC client functions from RPC server ones
-- | Given a client run a given client RPC action.
runRpcClient :: (MonadBase IO m, MonadError GanetiException m)
=> RpcClientMonad a -> Client -> m a
runRpcClient = (toErrorBase .) . runReaderT . runRpcClientMonad
callMethod :: (J.JSON r, J.JSON args) => String -> args -> RpcClientMonad r
callMethod method args = do
client <- RpcClientMonad ask
let request = buildCall method (J.showJSON args)
liftIO $ sendMsg client request
response <- liftIO $ recvMsg client
toError $ parseResponse response
>>= fromJResultE "Parsing RPC JSON response" . J.readJSON
-- | Given a server RPC function (such as from WConfd.Core), creates
-- the corresponding client function. The monad of the result type of the
-- given function is replaced by 'RpcClientMonad' and the new function
-- is implemented to issue a RPC call to the server.
mkRpcCall :: Name -> Q [Dec]
mkRpcCall name = do
let bname = nameBase name
fname = mkName bname -- the name of the generated function
(args, rtype) <- funArgs <$> typeOfFun name
rarg <- argumentType rtype
let ftype = foldr (\a t -> AppT (AppT ArrowT a) t)
(AppT (ConT ''RpcClientMonad) rarg) args
body <- [| $(curryN $ length args) (callMethod $(stringE bname)) |]
return [ SigD fname ftype
, ValD (VarP fname) (NormalB body) []
]
-- Given a list of server RPC functions creates the corresponding client
-- RPC functions.
--
-- See 'mkRpcCall'
mkRpcCalls :: [Name] -> Q [Dec]
mkRpcCalls = liftM concat . mapM mkRpcCall
| ribag/ganeti-experiments | src/Ganeti/THH/HsRPC.hs | gpl-2.0 | 3,961 | 0 | 15 | 735 | 738 | 391 | 347 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- |
-- Module : Network.AWS.Data.Numeric
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : provisional
-- Portability : non-portable (GHC extensions)
--
module Network.AWS.Data.Numeric where
import Control.Lens
import Control.Monad
import Data.Aeson.Types
import Data.Data (Data, Typeable)
import Data.Monoid
import Data.Scientific
import GHC.Generics (Generic)
import Network.AWS.Data.ByteString
import Network.AWS.Data.Query
import Network.AWS.Data.Text
import Network.AWS.Data.XML
import Numeric.Natural
import Prelude
newtype Nat = Nat { unNat :: Natural }
deriving
( Eq
, Ord
, Read
, Show
, Enum
, Num
, Real
, Integral
, Data
, Typeable
, Generic
, ToByteString
, FromText
, ToText
, FromXML
, ToXML
, ToQuery
)
_Nat :: Iso' Nat Natural
_Nat = iso unNat Nat
instance FromJSON Nat where
parseJSON = parseJSON >=> go
where
go n = case floatingOrInteger n of
Left (_ :: Double) -> fail (floatErr n)
Right i
| n < 0 -> fail (negateErr n)
| otherwise -> return . Nat $ fromInteger i
floatErr = mappend "Cannot convert float to Natural: " . show
negateErr = mappend "Cannot convert negative number to Natural: " . show
instance ToJSON Nat where
toJSON = Number . flip scientific 0 . toInteger . unNat
| fmapfmapfmap/amazonka | core/src/Network/AWS/Data/Numeric.hs | mpl-2.0 | 1,925 | 0 | 14 | 692 | 370 | 205 | 165 | 50 | 1 |
{-# LANGUAGE FlexibleContexts, GeneralizedNewtypeDeriving, OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Module : Network.MPD.Core
-- Copyright : (c) Ben Sinclair 2005-2009, Joachim Fasting 2010
-- License : MIT (see LICENSE)
-- Maintainer : Joachim Fasting <joachifm@fastmail.fm>
-- Stability : alpha
--
-- The core datatypes and operations are defined here, including the
-- primary instance of the 'MonadMPD' class, 'MPD'.
module Network.MPD.Core (
-- * Classes
MonadMPD(..),
-- * Data types
MPD, MPDError(..), ACKType(..), Response, Host, Port, Password,
-- * Running
withMPDEx,
-- * Interacting
getResponse, kill,
) where
import Network.MPD.Util
import Network.MPD.Core.Class
import Network.MPD.Core.Error
import Data.Char (isDigit)
import qualified Control.Exception as E
import Control.Exception.Safe (catch, catchAny)
import Control.Monad (ap, unless)
import Control.Monad.Except (ExceptT(..),runExceptT, MonadError(..))
import Control.Monad.Reader (ReaderT(..), ask)
import Control.Monad.State (StateT, MonadIO(..), modify, gets, evalStateT)
import qualified Data.Foldable as F
import System.IO (IOMode(..))
import Network.Socket
( Family(..)
, SockAddr(..)
, SocketType(..)
, addrAddress
, addrFamily
, addrProtocol
, addrSocketType
, connect
, defaultHints
, getAddrInfo
, socket
, socketToHandle
, withSocketsDo
)
import System.IO (Handle, hPutStrLn, hReady, hClose, hFlush)
import System.IO.Error (isEOFError, tryIOError, ioeGetErrorType)
import Text.Printf (printf)
import qualified GHC.IO.Exception as GE
import qualified Prelude
import Prelude hiding (break, drop, dropWhile, read)
import Data.ByteString.Char8 (ByteString, isPrefixOf, break, drop, dropWhile)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.UTF8 as UTF8
--
-- Data types.
--
type Host = String
type Port = Integer
--
-- IO based MPD client implementation.
--
-- | The main implementation of an MPD client. It actually connects
-- to a server and interacts with it.
--
-- To use the error throwing\/catching capabilities:
--
-- > import Control.Monad.Except (throwError, catchError)
--
-- To run IO actions within the MPD monad:
--
-- > import Control.Monad.Trans (liftIO)
newtype MPD a =
MPD { runMPD :: ExceptT MPDError
(StateT MPDState
(ReaderT (Host, Port) IO)) a
} deriving (Functor, Monad, MonadIO, MonadError MPDError)
instance Applicative MPD where
(<*>) = ap
pure = return
instance MonadMPD MPD where
open = mpdOpen
close = mpdClose
send = mpdSend
getPassword = MPD $ gets stPassword
setPassword pw = MPD $ modify (\st -> st { stPassword = pw })
getVersion = MPD $ gets stVersion
-- | Inner state for MPD
data MPDState =
MPDState { stHandle :: Maybe Handle
, stPassword :: String
, stVersion :: (Int, Int, Int)
}
-- | A response is either an 'MPDError' or some result.
type Response = Either MPDError
-- | The most configurable API for running an MPD action.
withMPDEx :: Host -> Port -> Password -> MPD a -> IO (Response a)
withMPDEx host port pw x = withSocketsDo $
runReaderT (evalStateT (runExceptT . runMPD $ open >> (x <* close)) initState)
(host, port)
where initState = MPDState Nothing pw (0, 0, 0)
mpdOpen :: MPD ()
mpdOpen = MPD $ do
(host, port) <- ask
runMPD close
addr:_ <- liftIO $ getAddr host port
sock <- liftIO $ socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
mHandle <- liftIO (safeConnectTo (sock,(addrAddress addr)))
modify (\st -> st { stHandle = mHandle })
F.forM_ mHandle $ \_ -> runMPD checkConn >>= (`unless` runMPD close)
where
getAddr addr@('/':_) _ = return [
defaultHints { addrFamily = AF_UNIX
, addrSocketType = Stream
, addrAddress = SockAddrUnix addr
}
]
getAddr host port = getAddrInfo (Just defaultHints) (Just host) (Just $ show port)
safeConnectTo (sock,addr) =
(connect sock addr) >> (Just <$> socketToHandle sock ReadWriteMode)
`catchAny` const (return Nothing)
checkConn = do
singleMsg <- send ""
let [msg] = singleMsg
if "OK MPD" `isPrefixOf` msg
then MPD $ checkVersion $ parseVersion msg
else return False
checkVersion Nothing = throwError $ Custom "Couldn't determine MPD version"
checkVersion (Just version)
| version < requiredVersion =
throwError $ Custom $ printf
"MPD %s is not supported, upgrade to MPD %s or above!"
(formatVersion version) (formatVersion requiredVersion)
| otherwise = do
modify (\st -> st { stVersion = version })
return True
where
requiredVersion = (0, 19, 0)
parseVersion = parseTriple '.' parseNum . dropWhile (not . isDigit)
formatVersion :: (Int, Int, Int) -> String
formatVersion (x, y, z) = printf "%d.%d.%d" x y z
mpdClose :: MPD ()
mpdClose =
MPD $ do
mHandle <- gets stHandle
F.forM_ mHandle $ \h -> do
modify $ \st -> st{stHandle = Nothing}
r <- liftIO $ sendClose h
F.forM_ r throwError
where
sendClose handle =
(hPutStrLn handle "close" >> hReady handle >> hClose handle >> return Nothing)
`catch` handler
handler err
| isEOFError err = return Nothing
| otherwise = (return . Just . ConnectionError) err
mpdSend :: String -> MPD [ByteString]
mpdSend str = send' `catchError` handler
where
handler err
| ConnectionError e <- err, isRetryable e = mpdOpen >> send'
| otherwise = throwError err
send' :: MPD [ByteString]
send' = MPD $ gets stHandle >>= maybe (throwError NoMPD) go
go handle = (liftIO . tryIOError $ do
unless (null str) $ B.hPutStrLn handle (UTF8.fromString str) >> hFlush handle
getLines handle [])
>>= either (\err -> modify (\st -> st { stHandle = Nothing })
>> throwError (ConnectionError err)) return
getLines :: Handle -> [ByteString] -> IO [ByteString]
getLines handle acc = do
l <- B.hGetLine handle
if "OK" `isPrefixOf` l || "ACK" `isPrefixOf` l
then (return . reverse) (l:acc)
else getLines handle (l:acc)
-- | Re-connect and retry for these Exceptions.
isRetryable :: E.IOException -> Bool
isRetryable e = or [ isEOFError e, isResourceVanished e ]
-- | Predicate to identify ResourceVanished exceptions.
-- Note: these are GHC only!
isResourceVanished :: GE.IOException -> Bool
isResourceVanished e = ioeGetErrorType e == GE.ResourceVanished
--
-- Other operations.
--
-- | Kill the server. Obviously, the connection is then invalid.
kill :: (MonadMPD m) => m ()
kill = send "kill" >> return ()
-- | Send a command to the MPD server and return the result.
getResponse :: (MonadMPD m) => String -> m [ByteString]
getResponse cmd = (send cmd >>= parseResponse) `catchError` sendpw
where
sendpw e@(ACK Auth _) = do
pw <- getPassword
if null pw then throwError e
else send ("password " ++ pw) >>= parseResponse
>> send cmd >>= parseResponse
sendpw e =
throwError e
-- Consume response and return a Response.
parseResponse :: (MonadError MPDError m) => [ByteString] -> m [ByteString]
parseResponse xs
| null xs = throwError $ NoMPD
| "ACK" `isPrefixOf` x = throwError $ parseAck x
| otherwise = return $ Prelude.takeWhile ("OK" /=) xs
where
x = head xs
-- Turn MPD ACK into the corresponding 'MPDError'
parseAck :: ByteString -> MPDError
parseAck s = ACK ack (UTF8.toString msg)
where
ack = case code of
2 -> InvalidArgument
3 -> InvalidPassword
4 -> Auth
5 -> UnknownCommand
50 -> FileNotFound
51 -> PlaylistMax
52 -> System
53 -> PlaylistLoad
54 -> Busy
55 -> NotPlaying
56 -> FileExists
_ -> UnknownACK
(code, _, msg) = splitAck s
-- Break an ACK into (error code, current command, message).
-- ACKs are of the form:
-- ACK [error@command_listNum] {current_command} message_text\n
splitAck :: ByteString -> (Int, ByteString, ByteString)
splitAck s = (read code, cmd, msg)
where
(code, notCode) = between '[' '@' s
(cmd, notCmd) = between '{' '}' notCode
msg = drop 1 $ dropWhile (' ' ==) notCmd
-- take whatever is between 'f' and 'g'.
between a b xs = let (_, y) = break (== a) xs
in break (== b) (drop 1 y)
| bens/libmpd-haskell | src/Network/MPD/Core.hs | lgpl-2.1 | 9,335 | 0 | 17 | 2,877 | 2,467 | 1,353 | 1,114 | 181 | 12 |
module Tandoori.GHC.Parse (parseMod, getDecls) where
import Tandoori.GHC.Internals
import HsSyn (hsmodDecls)
import Parser (parseModule)
import Lexer (unP, mkPState, ParseResult(..))
import StringBuffer (hGetStringBuffer)
import DynFlags (defaultDynFlags)
getDecls mod = hsmodDecls $ unLoc mod
parseMod src_filename = do buf <- hGetStringBuffer src_filename
let loc = mkSrcLoc (mkFastString src_filename) 1 0
dflags = defaultDynFlags
case unP Parser.parseModule (mkPState dflags buf loc) of
POk pst rdr_module -> return rdr_module
PFailed srcspan message -> error $ showSDoc message
| bitemyapp/tandoori | src/Tandoori/GHC/Parse.hs | bsd-3-clause | 746 | 0 | 12 | 235 | 187 | 99 | 88 | 14 | 2 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.GHC
-- Copyright : Isaac Jones 2003-2007
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is a fairly large module. It contains most of the GHC-specific code for
-- configuring, building and installing packages. It also exports a function
-- for finding out what packages are already installed. Configuring involves
-- finding the @ghc@ and @ghc-pkg@ programs, finding what language extensions
-- this version of ghc supports and returning a 'Compiler' value.
--
-- 'getInstalledPackages' involves calling the @ghc-pkg@ program to find out
-- what packages are installed.
--
-- Building is somewhat complex as there is quite a bit of information to take
-- into account. We have to build libs and programs, possibly for profiling and
-- shared libs. We have to support building libraries that will be usable by
-- GHCi and also ghc's @-split-objs@ feature. We have to compile any C files
-- using ghc. Linking, especially for @split-objs@ is remarkably complex,
-- partly because there tend to be 1,000's of @.o@ files and this can often be
-- more than we can pass to the @ld@ or @ar@ programs in one go.
--
-- Installing for libs and exes involves finding the right files and copying
-- them to the right places. One of the more tricky things about this module is
-- remembering the layout of files in the build directory (which is not
-- explicitly documented) and thus what search dirs are used for various kinds
-- of files.
module Distribution.Simple.GHC (
getGhcInfo,
configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe,
replLib, replExe,
startInterpreter,
installLib, installExe,
libAbiHash,
hcPkgInfo,
registerPackage,
componentGhcOptions,
componentCcGhcOptions,
getLibDir,
isDynamic,
getGlobalPackageDB,
pkgRoot
) where
import qualified Distribution.Simple.GHC.IPI641 as IPI641
import qualified Distribution.Simple.GHC.IPI642 as IPI642
import qualified Distribution.Simple.GHC.Internal as Internal
import Distribution.Simple.GHC.ImplInfo
import Distribution.PackageDescription as PD
( PackageDescription(..), BuildInfo(..), Executable(..), Library(..)
, allExtensions, libModules, exeModules
, hcOptions, hcSharedOptions, hcProfOptions )
import Distribution.InstalledPackageInfo
( InstalledPackageInfo )
import qualified Distribution.InstalledPackageInfo as InstalledPackageInfo
( InstalledPackageInfo_(..) )
import Distribution.Simple.PackageIndex (InstalledPackageIndex)
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(..), ComponentLocalBuildInfo(..)
, absoluteInstallDirs, depLibraryPaths )
import qualified Distribution.Simple.Hpc as Hpc
import Distribution.Simple.InstallDirs hiding ( absoluteInstallDirs )
import Distribution.Simple.BuildPaths
import Distribution.Simple.Utils
import Distribution.Package
( PackageName(..) )
import qualified Distribution.ModuleName as ModuleName
import Distribution.Simple.Program
( Program(..), ConfiguredProgram(..), ProgramConfiguration
, ProgramSearchPath
, rawSystemProgramStdout, rawSystemProgramStdoutConf
, getProgramInvocationOutput, requireProgramVersion, requireProgram
, userMaybeSpecifyPath, programPath, lookupProgram, addKnownProgram
, ghcProgram, ghcPkgProgram, haddockProgram, hsc2hsProgram, ldProgram )
import qualified Distribution.Simple.Program.HcPkg as HcPkg
import qualified Distribution.Simple.Program.Ar as Ar
import qualified Distribution.Simple.Program.Ld as Ld
import qualified Distribution.Simple.Program.Strip as Strip
import Distribution.Simple.Program.GHC
import Distribution.Simple.Setup
( toFlag, fromFlag, configCoverage, configDistPref )
import qualified Distribution.Simple.Setup as Cabal
( Flag(..) )
import Distribution.Simple.Compiler
( CompilerFlavor(..), CompilerId(..), Compiler(..), compilerVersion
, PackageDB(..), PackageDBStack, AbiTag(..) )
import Distribution.Version
( Version(..), anyVersion, orLaterVersion )
import Distribution.System
( Platform(..), OS(..) )
import Distribution.Verbosity
import Distribution.Text
( display )
import Distribution.Utils.NubList
( NubListR, overNubListR, toNubListR )
import Language.Haskell.Extension (Extension(..), KnownExtension(..))
import Control.Monad ( unless, when )
import Data.Char ( isDigit, isSpace )
import Data.List
import qualified Data.Map as M ( fromList )
import Data.Maybe ( catMaybes )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) )
#endif
import Data.Version ( showVersion )
import System.Directory
( doesFileExist, getAppUserDataDirectory, createDirectoryIfMissing )
import System.FilePath ( (</>), (<.>), takeExtension,
takeDirectory, replaceExtension,
splitExtension, isRelative )
import qualified System.Info
-- -----------------------------------------------------------------------------
-- Configuring
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration
-> IO (Compiler, Maybe Platform, ProgramConfiguration)
configure verbosity hcPath hcPkgPath conf0 = do
(ghcProg, ghcVersion, conf1) <-
requireProgramVersion verbosity ghcProgram
(orLaterVersion (Version [6,4] []))
(userMaybeSpecifyPath "ghc" hcPath conf0)
let implInfo = ghcVersionImplInfo ghcVersion
-- This is slightly tricky, we have to configure ghc first, then we use the
-- location of ghc to help find ghc-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcPkgProg, ghcPkgVersion, conf2) <-
requireProgramVersion verbosity ghcPkgProgram {
programFindLocation = guessGhcPkgFromGhcPath ghcProg
}
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath conf1)
when (ghcVersion /= ghcPkgVersion) $ die $
"Version mismatch between ghc and ghc-pkg: "
++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " "
++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion
-- Likewise we try to find the matching hsc2hs and haddock programs.
let hsc2hsProgram' = hsc2hsProgram {
programFindLocation = guessHsc2hsFromGhcPath ghcProg
}
haddockProgram' = haddockProgram {
programFindLocation = guessHaddockFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' conf2
languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions <- Internal.getExtensions verbosity implInfo ghcProg
ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
let ghcInfoMap = M.fromList ghcInfo
let comp = Compiler {
compilerId = CompilerId GHC ghcVersion,
compilerAbiTag = NoAbiTag,
compilerCompat = [],
compilerLanguages = languages,
compilerExtensions = extensions,
compilerProperties = ghcInfoMap
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
conf4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap conf3
return (comp, compPlatform, conf4)
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find
-- the corresponding tool; e.g. if the tool is ghc-pkg, we try looking
-- for a versioned or unversioned ghc-pkg in the same dir, that is:
--
-- > /usr/local/bin/ghc-pkg-ghc-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg(.exe)
--
guessToolFromGhcPath :: Program -> ConfiguredProgram
-> Verbosity -> ProgramSearchPath
-> IO (Maybe FilePath)
guessToolFromGhcPath tool ghcProg verbosity searchpath
= do let toolname = programName tool
path = programPath ghcProg
dir = takeDirectory path
versionSuffix = takeVersionSuffix (dropExeExtension path)
guessNormal = dir </> toolname <.> exeExtension
guessGhcVersioned = dir </> (toolname ++ "-ghc" ++ versionSuffix)
<.> exeExtension
guessVersioned = dir </> (toolname ++ versionSuffix)
<.> exeExtension
guesses | null versionSuffix = [guessNormal]
| otherwise = [guessGhcVersioned,
guessVersioned,
guessNormal]
info verbosity $ "looking for tool " ++ toolname
++ " near compiler in " ++ dir
exists <- mapM doesFileExist guesses
case [ file | (file, True) <- zip guesses exists ] of
-- If we can't find it near ghc, fall back to the usual
-- method.
[] -> programFindLocation tool verbosity searchpath
(fp:_) -> do info verbosity $ "found " ++ toolname ++ " in " ++ fp
return (Just fp)
where takeVersionSuffix :: FilePath -> String
takeVersionSuffix = takeWhileEndLE isSuffixChar
isSuffixChar :: Char -> Bool
isSuffixChar c = isDigit c || c == '.' || c == '-'
dropExeExtension :: FilePath -> FilePath
dropExeExtension filepath =
case splitExtension filepath of
(filepath', extension) | extension == exeExtension -> filepath'
| otherwise -> filepath
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find a
-- corresponding ghc-pkg, we try looking for both a versioned and unversioned
-- ghc-pkg in the same dir, that is:
--
-- > /usr/local/bin/ghc-pkg-ghc-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg(.exe)
--
guessGhcPkgFromGhcPath :: ConfiguredProgram
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
guessGhcPkgFromGhcPath = guessToolFromGhcPath ghcPkgProgram
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find a
-- corresponding hsc2hs, we try looking for both a versioned and unversioned
-- hsc2hs in the same dir, that is:
--
-- > /usr/local/bin/hsc2hs-ghc-6.6.1(.exe)
-- > /usr/local/bin/hsc2hs-6.6.1(.exe)
-- > /usr/local/bin/hsc2hs(.exe)
--
guessHsc2hsFromGhcPath :: ConfiguredProgram
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
guessHsc2hsFromGhcPath = guessToolFromGhcPath hsc2hsProgram
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find a
-- corresponding haddock, we try looking for both a versioned and unversioned
-- haddock in the same dir, that is:
--
-- > /usr/local/bin/haddock-ghc-6.6.1(.exe)
-- > /usr/local/bin/haddock-6.6.1(.exe)
-- > /usr/local/bin/haddock(.exe)
--
guessHaddockFromGhcPath :: ConfiguredProgram
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
guessHaddockFromGhcPath = guessToolFromGhcPath haddockProgram
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
getGhcInfo verbosity ghcProg = Internal.getGhcInfo verbosity implInfo ghcProg
where
Just version = programVersion ghcProg
implInfo = ghcVersionImplInfo version
-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramConfiguration
-> IO InstalledPackageIndex
getPackageDBContents verbosity packagedb conf = do
pkgss <- getInstalledPackages' verbosity [packagedb] conf
toPackageIndex verbosity pkgss conf
-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramConfiguration
-> IO InstalledPackageIndex
getInstalledPackages verbosity packagedbs conf = do
checkPackageDbEnvVar
checkPackageDbStack packagedbs
pkgss <- getInstalledPackages' verbosity packagedbs conf
index <- toPackageIndex verbosity pkgss conf
return $! hackRtsPackage index
where
hackRtsPackage index =
case PackageIndex.lookupPackageName index (PackageName "rts") of
[(_,[rts])]
-> PackageIndex.insert (removeMingwIncludeDir rts) index
_ -> index -- No (or multiple) ghc rts package is registered!!
-- Feh, whatever, the ghc test suite does some crazy stuff.
-- | Given a list of @(PackageDB, InstalledPackageInfo)@ pairs, produce a
-- @PackageIndex@. Helper function used by 'getPackageDBContents' and
-- 'getInstalledPackages'.
toPackageIndex :: Verbosity
-> [(PackageDB, [InstalledPackageInfo])]
-> ProgramConfiguration
-> IO InstalledPackageIndex
toPackageIndex verbosity pkgss conf = do
-- On Windows, various fields have $topdir/foo rather than full
-- paths. We need to substitute the right value in so that when
-- we, for example, call gcc, we have proper paths to give it.
topDir <- getLibDir' verbosity ghcProg
let indices = [ PackageIndex.fromList (map (Internal.substTopDir topDir) pkgs)
| (_, pkgs) <- pkgss ]
return $! (mconcat indices)
where
Just ghcProg = lookupProgram ghcProgram conf
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
getLibDir verbosity lbi =
dropWhileEndLE isSpace `fmap`
rawSystemProgramStdoutConf verbosity ghcProgram
(withPrograms lbi) ["--print-libdir"]
getLibDir' :: Verbosity -> ConfiguredProgram -> IO FilePath
getLibDir' verbosity ghcProg =
dropWhileEndLE isSpace `fmap`
rawSystemProgramStdout verbosity ghcProg ["--print-libdir"]
-- | Return the 'FilePath' to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath
getGlobalPackageDB verbosity ghcProg =
dropWhileEndLE isSpace `fmap`
rawSystemProgramStdout verbosity ghcProg ["--print-global-package-db"]
checkPackageDbEnvVar :: IO ()
checkPackageDbEnvVar =
Internal.checkPackageDbEnvVar "GHC" "GHC_PACKAGE_PATH"
checkPackageDbStack :: PackageDBStack -> IO ()
checkPackageDbStack (GlobalPackageDB:rest)
| GlobalPackageDB `notElem` rest = return ()
checkPackageDbStack rest
| GlobalPackageDB `notElem` rest =
die $ "With current ghc versions the global package db is always used "
++ "and must be listed first. This ghc limitation may be lifted in "
++ "future, see http://hackage.haskell.org/trac/ghc/ticket/5977"
checkPackageDbStack _ =
die $ "If the global package db is specified, it must be "
++ "specified first and cannot be specified multiple times"
-- GHC < 6.10 put "$topdir/include/mingw" in rts's installDirs. This
-- breaks when you want to use a different gcc, so we need to filter
-- it out.
removeMingwIncludeDir :: InstalledPackageInfo -> InstalledPackageInfo
removeMingwIncludeDir pkg =
let ids = InstalledPackageInfo.includeDirs pkg
ids' = filter (not . ("mingw" `isSuffixOf`)) ids
in pkg { InstalledPackageInfo.includeDirs = ids' }
-- | Get the packages from specific PackageDBs, not cumulative.
--
getInstalledPackages' :: Verbosity -> [PackageDB] -> ProgramConfiguration
-> IO [(PackageDB, [InstalledPackageInfo])]
getInstalledPackages' verbosity packagedbs conf
| ghcVersion >= Version [6,9] [] =
sequence
[ do pkgs <- HcPkg.dump (hcPkgInfo conf) verbosity packagedb
return (packagedb, pkgs)
| packagedb <- packagedbs ]
where
Just ghcProg = lookupProgram ghcProgram conf
Just ghcVersion = programVersion ghcProg
getInstalledPackages' verbosity packagedbs conf = do
str <- rawSystemProgramStdoutConf verbosity ghcPkgProgram conf ["list"]
let pkgFiles = [ init line | line <- lines str, last line == ':' ]
dbFile packagedb = case (packagedb, pkgFiles) of
(GlobalPackageDB, global:_) -> return $ Just global
(UserPackageDB, _global:user:_) -> return $ Just user
(UserPackageDB, _global:_) -> return $ Nothing
(SpecificPackageDB specific, _) -> return $ Just specific
_ -> die "cannot read ghc-pkg package listing"
pkgFiles' <- mapM dbFile packagedbs
sequence [ withFileContents file $ \content -> do
pkgs <- readPackages file content
return (db, pkgs)
| (db , Just file) <- zip packagedbs pkgFiles' ]
where
-- Depending on the version of ghc we use a different type's Read
-- instance to parse the package file and then convert.
-- It's a bit yuck. But that's what we get for using Read/Show.
readPackages
| ghcVersion >= Version [6,4,2] []
= \file content -> case reads content of
[(pkgs, _)] -> return (map IPI642.toCurrent pkgs)
_ -> failToRead file
| otherwise
= \file content -> case reads content of
[(pkgs, _)] -> return (map IPI641.toCurrent pkgs)
_ -> failToRead file
Just ghcProg = lookupProgram ghcProgram conf
Just ghcVersion = programVersion ghcProg
failToRead file = die $ "cannot read ghc package database " ++ file
-- -----------------------------------------------------------------------------
-- Building
-- | Build a library with GHC.
--
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildLib = buildOrReplLib False
replLib = buildOrReplLib True
buildOrReplLib :: Bool -> Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO ()
buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
libName <- case componentLibraries clbi of
[libName] -> return libName
[] -> die "No library name found when building library"
_ -> die "Multiple library names found when building library"
let libTargetDir = buildDir lbi
whenVanillaLib forceVanilla =
when (forceVanilla || withVanillaLib lbi)
whenProfLib = when (withProfLib lbi)
whenSharedLib forceShared =
when (forceShared || withSharedLib lbi)
whenGHCiLib = when (withGHCiLib lbi && withVanillaLib lbi)
ifReplLib = when forRepl
comp = compiler lbi
ghcVersion = compilerVersion comp
implInfo = getImplInfo comp
(Platform _hostArch hostOS) = hostPlatform lbi
hole_insts = map (\(k,(p,n)) -> (k, (InstalledPackageInfo.packageKey p,n)))
(instantiatedWith lbi)
(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
let runGhcProg = runGHC verbosity ghcProg comp
libBi <- hackThreadedFlag verbosity
comp (withProfLib lbi) (libBuildInfo lib)
let isGhcDynamic = isDynamic comp
dynamicTooSupported = supportsDynamicToo comp
doingTH = EnableExtension TemplateHaskell `elem` allExtensions libBi
forceVanillaLib = doingTH && not isGhcDynamic
forceSharedLib = doingTH && isGhcDynamic
-- TH always needs default libs, even when building for profiling
-- Determine if program coverage should be enabled and if so, what
-- '-hpcdir' should be.
let isCoverageEnabled = fromFlag $ configCoverage $ configFlags lbi
-- Component name. Not 'libName' because that has the "HS" prefix
-- that GHC gives Haskell libraries.
cname = display $ PD.package $ localPkgDescr lbi
distPref = fromFlag $ configDistPref $ configFlags lbi
hpcdir way
| isCoverageEnabled = toFlag $ Hpc.mixDir distPref way cname
| otherwise = mempty
createDirectoryIfMissingVerbose verbosity True libTargetDir
-- TODO: do we need to put hs-boot files into place for mutually recursive
-- modules?
let cObjs = map (`replaceExtension` objExtension) (cSources libBi)
baseOpts = componentGhcOptions verbosity lbi libBi clbi libTargetDir
vanillaOpts = baseOpts `mappend` mempty {
ghcOptMode = toFlag GhcModeMake,
ghcOptNumJobs = numJobs,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptSigOf = hole_insts,
ghcOptInputModules = toNubListR $ libModules lib,
ghcOptHPCDir = hpcdir Hpc.Vanilla
}
profOpts = vanillaOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptHiSuffix = toFlag "p_hi",
ghcOptObjSuffix = toFlag "p_o",
ghcOptExtra = toNubListR $ hcProfOptions GHC libBi,
ghcOptHPCDir = hpcdir Hpc.Prof
}
sharedOpts = vanillaOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptFPic = toFlag True,
ghcOptHiSuffix = toFlag "dyn_hi",
ghcOptObjSuffix = toFlag "dyn_o",
ghcOptExtra = toNubListR $ hcSharedOptions GHC libBi,
ghcOptHPCDir = hpcdir Hpc.Dyn
}
linkerOpts = mempty {
ghcOptLinkOptions = toNubListR $ PD.ldOptions libBi,
ghcOptLinkLibs = toNubListR $ extraLibs libBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi,
ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi,
ghcOptInputFiles = toNubListR
[libTargetDir </> x | x <- cObjs]
}
replOpts = vanillaOpts {
ghcOptExtra = overNubListR
Internal.filterGhciFlags $
(ghcOptExtra vanillaOpts),
ghcOptNumJobs = mempty
}
`mappend` linkerOpts
`mappend` mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptOptimisation = toFlag GhcNoOptimisation
}
vanillaSharedOpts = vanillaOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcStaticAndDynamic,
ghcOptDynHiSuffix = toFlag "dyn_hi",
ghcOptDynObjSuffix = toFlag "dyn_o",
ghcOptHPCDir = hpcdir Hpc.Dyn
}
unless (forRepl || null (libModules lib)) $
do let vanilla = whenVanillaLib forceVanillaLib (runGhcProg vanillaOpts)
shared = whenSharedLib forceSharedLib (runGhcProg sharedOpts)
useDynToo = dynamicTooSupported &&
(forceVanillaLib || withVanillaLib lbi) &&
(forceSharedLib || withSharedLib lbi) &&
null (hcSharedOptions GHC libBi)
if useDynToo
then do
runGhcProg vanillaSharedOpts
case (hpcdir Hpc.Dyn, hpcdir Hpc.Vanilla) of
(Cabal.Flag dynDir, Cabal.Flag vanillaDir) -> do
-- When the vanilla and shared library builds are done
-- in one pass, only one set of HPC module interfaces
-- are generated. This set should suffice for both
-- static and dynamically linked executables. We copy
-- the modules interfaces so they are available under
-- both ways.
copyDirectoryRecursive verbosity dynDir vanillaDir
_ -> return ()
else if isGhcDynamic
then do shared; vanilla
else do vanilla; shared
whenProfLib (runGhcProg profOpts)
-- build any C sources
unless (null (cSources libBi)) $ do
info verbosity "Building C Sources..."
sequence_
[ do let baseCcOpts = Internal.componentCcGhcOptions verbosity implInfo
lbi libBi clbi libTargetDir filename
vanillaCcOpts = if isGhcDynamic
-- Dynamic GHC requires C sources to be built
-- with -fPIC for REPL to work. See #2207.
then baseCcOpts { ghcOptFPic = toFlag True }
else baseCcOpts
profCcOpts = vanillaCcOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptObjSuffix = toFlag "p_o"
}
sharedCcOpts = vanillaCcOpts `mappend` mempty {
ghcOptFPic = toFlag True,
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptObjSuffix = toFlag "dyn_o"
}
odir = fromFlag (ghcOptObjDir vanillaCcOpts)
createDirectoryIfMissingVerbose verbosity True odir
runGhcProg vanillaCcOpts
unless forRepl $
whenSharedLib forceSharedLib (runGhcProg sharedCcOpts)
unless forRepl $ whenProfLib (runGhcProg profCcOpts)
| filename <- cSources libBi]
-- TODO: problem here is we need the .c files built first, so we can load them
-- with ghci, but .c files can depend on .h files generated by ghc by ffi
-- exports.
ifReplLib $ do
when (null (libModules lib)) $ warn verbosity "No exposed modules"
ifReplLib (runGhcProg replOpts)
-- link:
unless forRepl $ do
info verbosity "Linking..."
let cProfObjs = map (`replaceExtension` ("p_" ++ objExtension))
(cSources libBi)
cSharedObjs = map (`replaceExtension` ("dyn_" ++ objExtension))
(cSources libBi)
cid = compilerId (compiler lbi)
vanillaLibFilePath = libTargetDir </> mkLibName libName
profileLibFilePath = libTargetDir </> mkProfLibName libName
sharedLibFilePath = libTargetDir </> mkSharedLibName cid libName
ghciLibFilePath = libTargetDir </> Internal.mkGHCiLibName libName
libInstallPath = libdir $ absoluteInstallDirs pkg_descr lbi NoCopyDest
sharedLibInstallPath = libInstallPath </> mkSharedLibName cid libName
stubObjs <- fmap catMaybes $ sequence
[ findFileWithExtension [objExtension] [libTargetDir]
(ModuleName.toFilePath x ++"_stub")
| ghcVersion < Version [7,2] [] -- ghc-7.2+ does not make _stub.o files
, x <- libModules lib ]
stubProfObjs <- fmap catMaybes $ sequence
[ findFileWithExtension ["p_" ++ objExtension] [libTargetDir]
(ModuleName.toFilePath x ++"_stub")
| ghcVersion < Version [7,2] [] -- ghc-7.2+ does not make _stub.o files
, x <- libModules lib ]
stubSharedObjs <- fmap catMaybes $ sequence
[ findFileWithExtension ["dyn_" ++ objExtension] [libTargetDir]
(ModuleName.toFilePath x ++"_stub")
| ghcVersion < Version [7,2] [] -- ghc-7.2+ does not make _stub.o files
, x <- libModules lib ]
hObjs <- Internal.getHaskellObjects implInfo lib lbi
libTargetDir objExtension True
hProfObjs <-
if (withProfLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
libTargetDir ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if (withSharedLib lbi)
then Internal.getHaskellObjects implInfo lib lbi
libTargetDir ("dyn_" ++ objExtension) False
else return []
unless (null hObjs && null cObjs && null stubObjs) $ do
rpaths <- getRPaths lbi clbi
let staticObjectFiles =
hObjs
++ map (libTargetDir </>) cObjs
++ stubObjs
profObjectFiles =
hProfObjs
++ map (libTargetDir </>) cProfObjs
++ stubProfObjs
ghciObjFiles =
hObjs
++ map (libTargetDir </>) cObjs
++ stubObjs
dynamicObjectFiles =
hSharedObjs
++ map (libTargetDir </>) cSharedObjs
++ stubSharedObjs
-- After the relocation lib is created we invoke ghc -shared
-- with the dependencies spelled out as -package arguments
-- and ghc invokes the linker with the proper library paths
ghcSharedLinkArgs =
mempty {
ghcOptShared = toFlag True,
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptInputFiles = toNubListR dynamicObjectFiles,
ghcOptOutputFile = toFlag sharedLibFilePath,
-- For dynamic libs, Mac OS/X needs to know the install location
-- at build time. This only applies to GHC < 7.8 - see the
-- discussion in #1660.
ghcOptDylibName = if (hostOS == OSX
&& ghcVersion < Version [7,8] [])
then toFlag sharedLibInstallPath
else mempty,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptNoAutoLinkPackages = toFlag True,
ghcOptPackageDBs = withPackageDB lbi,
ghcOptPackages = toNubListR $
Internal.mkGhcOptPackages clbi ,
ghcOptLinkLibs = toNubListR $ extraLibs libBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi,
ghcOptRPaths = rpaths
}
info verbosity (show (ghcOptPackages ghcSharedLinkArgs))
whenVanillaLib False $ do
Ar.createArLibArchive verbosity lbi vanillaLibFilePath staticObjectFiles
whenProfLib $ do
Ar.createArLibArchive verbosity lbi profileLibFilePath profObjectFiles
whenGHCiLib $ do
(ldProg, _) <- requireProgram verbosity ldProgram (withPrograms lbi)
Ld.combineObjectFiles verbosity ldProg
ghciLibFilePath ghciObjFiles
whenSharedLib False $
runGhcProg ghcSharedLinkArgs
-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramConfiguration -> Compiler
-> PackageDBStack -> IO ()
startInterpreter verbosity conf comp packageDBs = do
let replOpts = mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptPackageDBs = packageDBs
}
checkPackageDbStack packageDBs
(ghcProg, _) <- requireProgram verbosity ghcProgram conf
runGHC verbosity ghcProg comp replOpts
-- | Build an executable with GHC.
--
buildExe, replExe :: Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Executable -> ComponentLocalBuildInfo -> IO ()
buildExe = buildOrReplExe False
replExe = buildOrReplExe True
buildOrReplExe :: Bool -> Verbosity -> Cabal.Flag (Maybe Int)
-> PackageDescription -> LocalBuildInfo
-> Executable -> ComponentLocalBuildInfo -> IO ()
buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi
exe@Executable { exeName = exeName', modulePath = modPath } clbi = do
(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
let comp = compiler lbi
implInfo = getImplInfo comp
runGhcProg = runGHC verbosity ghcProg comp
exeBi <- hackThreadedFlag verbosity
comp (withProfExe lbi) (buildInfo exe)
-- exeNameReal, the name that GHC really uses (with .exe on Windows)
let exeNameReal = exeName' <.>
(if takeExtension exeName' /= ('.':exeExtension)
then exeExtension
else "")
let targetDir = (buildDir lbi) </> exeName'
let exeDir = targetDir </> (exeName' ++ "-tmp")
createDirectoryIfMissingVerbose verbosity True targetDir
createDirectoryIfMissingVerbose verbosity True exeDir
-- TODO: do we need to put hs-boot files into place for mutually recursive
-- modules? FIX: what about exeName.hi-boot?
-- Determine if program coverage should be enabled and if so, what
-- '-hpcdir' should be.
let isCoverageEnabled = fromFlag $ configCoverage $ configFlags lbi
distPref = fromFlag $ configDistPref $ configFlags lbi
hpcdir way
| isCoverageEnabled = toFlag $ Hpc.mixDir distPref way exeName'
| otherwise = mempty
-- build executables
srcMainFile <- findFile (exeDir : hsSourceDirs exeBi) modPath
rpaths <- getRPaths lbi clbi
let isGhcDynamic = isDynamic comp
dynamicTooSupported = supportsDynamicToo comp
isHaskellMain = elem (takeExtension srcMainFile) [".hs", ".lhs"]
cSrcs = cSources exeBi ++ [srcMainFile | not isHaskellMain]
cObjs = map (`replaceExtension` objExtension) cSrcs
baseOpts = (componentGhcOptions verbosity lbi exeBi clbi exeDir)
`mappend` mempty {
ghcOptMode = toFlag GhcModeMake,
ghcOptInputFiles = toNubListR
[ srcMainFile | isHaskellMain],
ghcOptInputModules = toNubListR
[ m | not isHaskellMain, m <- exeModules exe]
}
staticOpts = baseOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcStaticOnly,
ghcOptHPCDir = hpcdir Hpc.Vanilla
}
profOpts = baseOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptHiSuffix = toFlag "p_hi",
ghcOptObjSuffix = toFlag "p_o",
ghcOptExtra = toNubListR $
hcProfOptions GHC exeBi,
ghcOptHPCDir = hpcdir Hpc.Prof
}
dynOpts = baseOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptHiSuffix = toFlag "dyn_hi",
ghcOptObjSuffix = toFlag "dyn_o",
ghcOptExtra = toNubListR $
hcSharedOptions GHC exeBi,
ghcOptHPCDir = hpcdir Hpc.Dyn
}
dynTooOpts = staticOpts `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcStaticAndDynamic,
ghcOptDynHiSuffix = toFlag "dyn_hi",
ghcOptDynObjSuffix = toFlag "dyn_o",
ghcOptHPCDir = hpcdir Hpc.Dyn
}
linkerOpts = mempty {
ghcOptLinkOptions = toNubListR $ PD.ldOptions exeBi,
ghcOptLinkLibs = toNubListR $ extraLibs exeBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs exeBi,
ghcOptLinkFrameworks = toNubListR $ PD.frameworks exeBi,
ghcOptInputFiles = toNubListR
[exeDir </> x | x <- cObjs],
ghcOptRPaths = rpaths
}
replOpts = baseOpts {
ghcOptExtra = overNubListR
Internal.filterGhciFlags
(ghcOptExtra baseOpts)
}
-- For a normal compile we do separate invocations of ghc for
-- compiling as for linking. But for repl we have to do just
-- the one invocation, so that one has to include all the
-- linker stuff too, like -l flags and any .o files from C
-- files etc.
`mappend` linkerOpts
`mappend` mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptOptimisation = toFlag GhcNoOptimisation
}
commonOpts | withProfExe lbi = profOpts
| withDynExe lbi = dynOpts
| otherwise = staticOpts
compileOpts | useDynToo = dynTooOpts
| otherwise = commonOpts
withStaticExe = (not $ withProfExe lbi) && (not $ withDynExe lbi)
-- For building exe's that use TH with -prof or -dynamic we actually have
-- to build twice, once without -prof/-dynamic and then again with
-- -prof/-dynamic. This is because the code that TH needs to run at
-- compile time needs to be the vanilla ABI so it can be loaded up and run
-- by the compiler.
-- With dynamic-by-default GHC the TH object files loaded at compile-time
-- need to be .dyn_o instead of .o.
doingTH = EnableExtension TemplateHaskell `elem` allExtensions exeBi
-- Should we use -dynamic-too instead of compiling twice?
useDynToo = dynamicTooSupported && isGhcDynamic
&& doingTH && withStaticExe
&& null (hcSharedOptions GHC exeBi)
compileTHOpts | isGhcDynamic = dynOpts
| otherwise = staticOpts
compileForTH
| forRepl = False
| useDynToo = False
| isGhcDynamic = doingTH && (withProfExe lbi || withStaticExe)
| otherwise = doingTH && (withProfExe lbi || withDynExe lbi)
linkOpts = commonOpts `mappend`
linkerOpts `mappend` mempty {
ghcOptLinkNoHsMain = toFlag (not isHaskellMain)
}
-- Build static/dynamic object files for TH, if needed.
when compileForTH $
runGhcProg compileTHOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
unless forRepl $
runGhcProg compileOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
-- build any C sources
unless (null cSrcs) $ do
info verbosity "Building C Sources..."
sequence_
[ do let opts = (Internal.componentCcGhcOptions verbosity implInfo lbi exeBi
clbi exeDir filename) `mappend` mempty {
ghcOptDynLinkMode = toFlag (if withDynExe lbi
then GhcDynamicOnly
else GhcStaticOnly),
ghcOptProfilingMode = toFlag (withProfExe lbi)
}
odir = fromFlag (ghcOptObjDir opts)
createDirectoryIfMissingVerbose verbosity True odir
runGhcProg opts
| filename <- cSrcs ]
-- TODO: problem here is we need the .c files built first, so we can load them
-- with ghci, but .c files can depend on .h files generated by ghc by ffi
-- exports.
when forRepl $ runGhcProg replOpts
-- link:
unless forRepl $ do
info verbosity "Linking..."
runGhcProg linkOpts { ghcOptOutputFile = toFlag (targetDir </> exeNameReal) }
-- | Calculate the RPATHs for the component we are building.
--
-- Calculates relative RPATHs when 'relocatable' is set.
getRPaths :: LocalBuildInfo
-> ComponentLocalBuildInfo -- ^ Component we are building
-> IO (NubListR FilePath)
getRPaths lbi clbi | supportRPaths hostOS = do
libraryPaths <- depLibraryPaths False (relocatable lbi) lbi clbi
let hostPref = case hostOS of
OSX -> "@loader_path"
_ -> "$ORIGIN"
relPath p = if isRelative p then hostPref </> p else p
rpaths = toNubListR (map relPath libraryPaths)
return rpaths
where
(Platform _ hostOS) = hostPlatform lbi
-- The list of RPath-supported operating systems below reflects the
-- platforms on which Cabal's RPATH handling is tested. It does _NOT_
-- reflect whether the OS supports RPATH.
-- E.g. when this comment was written, the *BSD operating systems were
-- untested with regards to Cabal RPATH handling, and were hence set to
-- 'False', while those operating systems themselves do support RPATH.
supportRPaths Linux = True
supportRPaths Windows = False
supportRPaths OSX = True
supportRPaths FreeBSD = False
supportRPaths OpenBSD = False
supportRPaths NetBSD = False
supportRPaths DragonFly = False
supportRPaths Solaris = False
supportRPaths AIX = False
supportRPaths HPUX = False
supportRPaths IRIX = False
supportRPaths HaLVM = False
supportRPaths IOS = False
supportRPaths Android = False
supportRPaths Ghcjs = False
supportRPaths Hurd = False
supportRPaths (OtherOS _) = False
-- Do _not_ add a default case so that we get a warning here when a new OS
-- is added.
getRPaths _ _ = return mempty
-- | Filter the "-threaded" flag when profiling as it does not
-- work with ghc-6.8 and older.
hackThreadedFlag :: Verbosity -> Compiler -> Bool -> BuildInfo -> IO BuildInfo
hackThreadedFlag verbosity comp prof bi
| not mustFilterThreaded = return bi
| otherwise = do
warn verbosity $ "The ghc flag '-threaded' is not compatible with "
++ "profiling in ghc-6.8 and older. It will be disabled."
return bi { options = filterHcOptions (/= "-threaded") (options bi) }
where
mustFilterThreaded = prof && compilerVersion comp < Version [6, 10] []
&& "-threaded" `elem` hcOptions GHC bi
filterHcOptions p hcoptss =
[ (hc, if hc == GHC then filter p opts else opts)
| (hc, opts) <- hcoptss ]
-- | Extracts a String representing a hash of the ABI of a built
-- library. It can fail if the library has not yet been built.
--
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo
-> Library -> ComponentLocalBuildInfo -> IO String
libAbiHash verbosity _pkg_descr lbi lib clbi = do
libBi <- hackThreadedFlag verbosity
(compiler lbi) (withProfLib lbi) (libBuildInfo lib)
let
comp = compiler lbi
vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (buildDir lbi))
`mappend` mempty {
ghcOptMode = toFlag GhcModeAbiHash,
ghcOptPackageKey = toFlag (pkgKey lbi),
ghcOptInputModules = toNubListR $ exposedModules lib
}
sharedArgs = vanillaArgs `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptFPic = toFlag True,
ghcOptHiSuffix = toFlag "dyn_hi",
ghcOptObjSuffix = toFlag "dyn_o",
ghcOptExtra = toNubListR $ hcSharedOptions GHC libBi
}
profArgs = vanillaArgs `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptHiSuffix = toFlag "p_hi",
ghcOptObjSuffix = toFlag "p_o",
ghcOptExtra = toNubListR $ hcProfOptions GHC libBi
}
ghcArgs = if withVanillaLib lbi then vanillaArgs
else if withSharedLib lbi then sharedArgs
else if withProfLib lbi then profArgs
else error "libAbiHash: Can't find an enabled library way"
--
(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
hash <- getProgramInvocationOutput verbosity
(ghcInvocation ghcProg comp ghcArgs)
return (takeWhile (not . isSpace) hash)
componentGhcOptions :: Verbosity -> LocalBuildInfo
-> BuildInfo -> ComponentLocalBuildInfo -> FilePath
-> GhcOptions
componentGhcOptions = Internal.componentGhcOptions
componentCcGhcOptions :: Verbosity -> LocalBuildInfo
-> BuildInfo -> ComponentLocalBuildInfo
-> FilePath -> FilePath
-> GhcOptions
componentCcGhcOptions verbosity lbi =
Internal.componentCcGhcOptions verbosity implInfo lbi
where
comp = compiler lbi
implInfo = getImplInfo comp
-- -----------------------------------------------------------------------------
-- Installing
-- |Install executables for GHC.
installExe :: Verbosity
-> LocalBuildInfo
-> InstallDirs FilePath -- ^Where to copy the files to
-> FilePath -- ^Build location
-> (FilePath, FilePath) -- ^Executable (prefix,suffix)
-> PackageDescription
-> Executable
-> IO ()
installExe verbosity lbi installDirs buildPref
(progprefix, progsuffix) _pkg exe = do
let binDir = bindir installDirs
createDirectoryIfMissingVerbose verbosity True binDir
let exeFileName = exeName exe <.> exeExtension
fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
installBinary dest = do
installExecutableFile verbosity
(buildPref </> exeName exe </> exeFileName)
(dest <.> exeExtension)
when (stripExes lbi) $
Strip.stripExe verbosity (hostPlatform lbi) (withPrograms lbi)
(dest <.> exeExtension)
installBinary (binDir </> fixedExeBaseName)
-- |Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity
-> LocalBuildInfo
-> FilePath -- ^install location
-> FilePath -- ^install location for dynamic libraries
-> FilePath -- ^Build location
-> PackageDescription
-> Library
-> ComponentLocalBuildInfo
-> IO ()
installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do
-- copy .hi files over:
whenVanilla $ copyModuleFiles "hi"
whenProf $ copyModuleFiles "p_hi"
whenShared $ copyModuleFiles "dyn_hi"
-- copy the built library files over:
whenVanilla $ mapM_ (installOrdinary builtDir targetDir) vanillaLibNames
whenProf $ mapM_ (installOrdinary builtDir targetDir) profileLibNames
whenGHCi $ mapM_ (installOrdinary builtDir targetDir) ghciLibNames
whenShared $ mapM_ (installShared builtDir dynlibTargetDir) sharedLibNames
where
install isShared srcDir dstDir name = do
let src = srcDir </> name
dst = dstDir </> name
createDirectoryIfMissingVerbose verbosity True dstDir
if isShared
then do when (stripLibs lbi) $ Strip.stripLib verbosity
(hostPlatform lbi) (withPrograms lbi) src
installExecutableFile verbosity src dst
else installOrdinaryFile verbosity src dst
installOrdinary = install False
installShared = install True
copyModuleFiles ext =
findModuleFiles [builtDir] [ext] (libModules lib)
>>= installOrdinaryFiles verbosity targetDir
cid = compilerId (compiler lbi)
libNames = componentLibraries clbi
vanillaLibNames = map mkLibName libNames
profileLibNames = map mkProfLibName libNames
ghciLibNames = map Internal.mkGHCiLibName libNames
sharedLibNames = map (mkSharedLibName cid) libNames
hasLib = not $ null (libModules lib)
&& null (cSources (libBuildInfo lib))
whenVanilla = when (hasLib && withVanillaLib lbi)
whenProf = when (hasLib && withProfLib lbi)
whenGHCi = when (hasLib && withGHCiLib lbi)
whenShared = when (hasLib && withSharedLib lbi)
-- -----------------------------------------------------------------------------
-- Registering
hcPkgInfo :: ProgramConfiguration -> HcPkg.HcPkgInfo
hcPkgInfo conf = HcPkg.HcPkgInfo { HcPkg.hcPkgProgram = ghcPkgProg
, HcPkg.noPkgDbStack = v < [6,9]
, HcPkg.noVerboseFlag = v < [6,11]
, HcPkg.flagPackageConf = v < [7,5]
, HcPkg.useSingleFileDb = v < [7,9]
}
where
v = versionBranch ver
Just ghcPkgProg = lookupProgram ghcPkgProgram conf
Just ver = programVersion ghcPkgProg
registerPackage
:: Verbosity
-> InstalledPackageInfo
-> PackageDescription
-> LocalBuildInfo
-> Bool
-> PackageDBStack
-> IO ()
registerPackage verbosity installedPkgInfo _pkg lbi _inplace packageDbs =
HcPkg.reregister (hcPkgInfo $ withPrograms lbi) verbosity
packageDbs (Right installedPkgInfo)
pkgRoot :: Verbosity -> LocalBuildInfo -> PackageDB -> IO FilePath
pkgRoot verbosity lbi = pkgRoot'
where
pkgRoot' GlobalPackageDB =
let Just ghcProg = lookupProgram ghcProgram (withPrograms lbi)
in fmap takeDirectory (getGlobalPackageDB verbosity ghcProg)
pkgRoot' UserPackageDB = do
appDir <- getAppUserDataDirectory "ghc"
let ver = compilerVersion (compiler lbi)
subdir = System.Info.arch ++ '-':System.Info.os
++ '-':showVersion ver
rootDir = appDir </> subdir
-- We must create the root directory for the user package database if it
-- does not yet exists. Otherwise '${pkgroot}' will resolve to a
-- directory at the time of 'ghc-pkg register', and registration will
-- fail.
createDirectoryIfMissing True rootDir
return rootDir
pkgRoot' (SpecificPackageDB fp) = return (takeDirectory fp)
-- -----------------------------------------------------------------------------
-- Utils
isDynamic :: Compiler -> Bool
isDynamic = Internal.ghcLookupProperty "GHC Dynamic"
supportsDynamicToo :: Compiler -> Bool
supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too"
| seereason/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | 50,626 | 0 | 23 | 15,600 | 9,499 | 4,990 | 4,509 | 800 | 19 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Trans.State.Strict
-- Copyright : (c) Andy Gill 2001,
-- (c) Oregon Graduate Institute of Science and Technology, 2001
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : ross@soi.city.ac.uk
-- Stability : experimental
-- Portability : portable
--
-- Strict state monads, passing an updatable state through a computation.
-- See below for examples.
--
-- In this version, sequencing of computations is strict.
-- For a lazy version, see "Control.Monad.Trans.State.Lazy", which
-- has the same interface.
--
-- Some computations may not require the full power of state transformers:
--
-- * For a read-only state, see "Control.Monad.Trans.Reader".
--
-- * To accumulate a value without using it on the way, see
-- "Control.Monad.Trans.Writer".
-----------------------------------------------------------------------------
module Control.Monad.Trans.State.Strict (
-- * The State monad
State,
state,
runState,
evalState,
execState,
mapState,
withState,
-- * The StateT monad transformer
StateT(..),
evalStateT,
execStateT,
mapStateT,
withStateT,
-- * State operations
get,
put,
modify,
gets,
-- * Lifting other operations
liftCallCC,
liftCallCC',
liftCatch,
liftListen,
liftPass,
-- * Examples
-- ** State monads
-- $examples
-- ** Counting
-- $counting
-- ** Labelling trees
-- $labelling
) where
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Data.Functor.Identity
import Control.Applicative
import Control.Monad
import Control.Monad.Fix
-- ---------------------------------------------------------------------------
-- | A state monad parameterized by the type @s@ of the state to carry.
--
-- The 'return' function leaves the state unchanged, while @>>=@ uses
-- the final state of the first computation as the initial state of
-- the second.
type State s = StateT s Identity
-- | Construct a state monad computation from a function.
-- (The inverse of 'runState'.)
state :: Monad m
=> (s -> (a, s)) -- ^pure state transformer
-> StateT s m a -- ^equivalent state-passing computation
state f = StateT (return . f)
-- | Unwrap a state monad computation as a function.
-- (The inverse of 'state'.)
runState :: State s a -- ^state-passing computation to execute
-> s -- ^initial state
-> (a, s) -- ^return value and final state
runState m = runIdentity . runStateT m
-- | Evaluate a state computation with the given initial state
-- and return the final value, discarding the final state.
--
-- * @'evalState' m s = 'fst' ('runState' m s)@
evalState :: State s a -- ^state-passing computation to execute
-> s -- ^initial value
-> a -- ^return value of the state computation
evalState m s = fst (runState m s)
-- | Evaluate a state computation with the given initial state
-- and return the final state, discarding the final value.
--
-- * @'execState' m s = 'snd' ('runState' m s)@
execState :: State s a -- ^state-passing computation to execute
-> s -- ^initial value
-> s -- ^final state
execState m s = snd (runState m s)
-- | Map both the return value and final state of a computation using
-- the given function.
--
-- * @'runState' ('mapState' f m) = f . 'runState' m@
mapState :: ((a, s) -> (b, s)) -> State s a -> State s b
mapState f = mapStateT (Identity . f . runIdentity)
-- | @'withState' f m@ executes action @m@ on a state modified by
-- applying @f@.
--
-- * @'withState' f m = 'modify' f >> m@
withState :: (s -> s) -> State s a -> State s a
withState = withStateT
-- ---------------------------------------------------------------------------
-- | A state transformer monad parameterized by:
--
-- * @s@ - The state.
--
-- * @m@ - The inner monad.
--
-- The 'return' function leaves the state unchanged, while @>>=@ uses
-- the final state of the first computation as the initial state of
-- the second.
newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
-- | Evaluate a state computation with the given initial state
-- and return the final value, discarding the final state.
--
-- * @'evalStateT' m s = 'liftM' 'fst' ('runStateT' m s)@
evalStateT :: (Monad m) => StateT s m a -> s -> m a
evalStateT m s = do
(a, _) <- runStateT m s
return a
-- | Evaluate a state computation with the given initial state
-- and return the final state, discarding the final value.
--
-- * @'execStateT' m s = 'liftM' 'snd' ('runStateT' m s)@
execStateT :: (Monad m) => StateT s m a -> s -> m s
execStateT m s = do
(_, s') <- runStateT m s
return s'
-- | Map both the return value and final state of a computation using
-- the given function.
--
-- * @'runStateT' ('mapStateT' f m) = f . 'runStateT' m@
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
mapStateT f m = StateT $ f . runStateT m
-- | @'withStateT' f m@ executes action @m@ on a state modified by
-- applying @f@.
--
-- * @'withStateT' f m = 'modify' f >> m@
withStateT :: (s -> s) -> StateT s m a -> StateT s m a
withStateT f m = StateT $ runStateT m . f
instance (Functor m) => Functor (StateT s m) where
fmap f m = StateT $ \ s ->
fmap (\ (a, s') -> (f a, s')) $ runStateT m s
instance (Functor m, Monad m) => Applicative (StateT s m) where
pure = return
(<*>) = ap
instance (Functor m, MonadPlus m) => Alternative (StateT s m) where
empty = mzero
(<|>) = mplus
instance (Monad m) => Monad (StateT s m) where
return a = state $ \s -> (a, s)
m >>= k = StateT $ \s -> do
(a, s') <- runStateT m s
runStateT (k a) s'
fail str = StateT $ \_ -> fail str
instance (MonadPlus m) => MonadPlus (StateT s m) where
mzero = StateT $ \_ -> mzero
m `mplus` n = StateT $ \s -> runStateT m s `mplus` runStateT n s
instance (MonadFix m) => MonadFix (StateT s m) where
mfix f = StateT $ \s -> mfix $ \ ~(a, _) -> runStateT (f a) s
instance MonadTrans (StateT s) where
lift m = StateT $ \s -> do
a <- m
return (a, s)
instance (MonadIO m) => MonadIO (StateT s m) where
liftIO = lift . liftIO
-- | Fetch the current value of the state within the monad.
get :: (Monad m) => StateT s m s
get = state $ \s -> (s, s)
-- | @'put' s@ sets the state within the monad to @s@.
put :: (Monad m) => s -> StateT s m ()
put s = state $ \_ -> ((), s)
-- | @'modify' f@ is an action that updates the state to the result of
-- applying @f@ to the current state.
--
-- * @'modify' f = 'get' >>= ('put' . f)@
modify :: (Monad m) => (s -> s) -> StateT s m ()
modify f = state $ \s -> ((), f s)
-- | Get a specific component of the state, using a projection function
-- supplied.
--
-- * @'gets' f = 'liftM' f 'get'@
gets :: (Monad m) => (s -> a) -> StateT s m a
gets f = state $ \s -> (f s, s)
-- | Uniform lifting of a @callCC@ operation to the new monad.
-- This version rolls back to the original state on entering the
-- continuation.
liftCallCC :: ((((a,s) -> m (b,s)) -> m (a,s)) -> m (a,s)) ->
((a -> StateT s m b) -> StateT s m a) -> StateT s m a
liftCallCC callCC f = StateT $ \s ->
callCC $ \c ->
runStateT (f (\a -> StateT $ \ _ -> c (a, s))) s
-- | In-situ lifting of a @callCC@ operation to the new monad.
-- This version uses the current state on entering the continuation.
-- It does not satisfy the laws of a monad transformer.
liftCallCC' :: ((((a,s) -> m (b,s)) -> m (a,s)) -> m (a,s)) ->
((a -> StateT s m b) -> StateT s m a) -> StateT s m a
liftCallCC' callCC f = StateT $ \s ->
callCC $ \c ->
runStateT (f (\a -> StateT $ \s' -> c (a, s'))) s
-- | Lift a @catchError@ operation to the new monad.
liftCatch :: (m (a,s) -> (e -> m (a,s)) -> m (a,s)) ->
StateT s m a -> (e -> StateT s m a) -> StateT s m a
liftCatch catchError m h =
StateT $ \s -> runStateT m s `catchError` \e -> runStateT (h e) s
-- | Lift a @listen@ operation to the new monad.
liftListen :: Monad m =>
(m (a,s) -> m ((a,s),w)) -> StateT s m a -> StateT s m (a,w)
liftListen listen m = StateT $ \s -> do
((a, s'), w) <- listen (runStateT m s)
return ((a, w), s')
-- | Lift a @pass@ operation to the new monad.
liftPass :: Monad m =>
(m ((a,s),b) -> m (a,s)) -> StateT s m (a,b) -> StateT s m a
liftPass pass m = StateT $ \s -> pass $ do
((a, f), s') <- runStateT m s
return ((a, s'), f)
{- $examples
Parser from ParseLib with Hugs:
> type Parser a = StateT String [] a
> ==> StateT (String -> [(a,String)])
For example, item can be written as:
> item = do (x:xs) <- get
> put xs
> return x
>
> type BoringState s a = StateT s Identity a
> ==> StateT (s -> Identity (a,s))
>
> type StateWithIO s a = StateT s IO a
> ==> StateT (s -> IO (a,s))
>
> type StateWithErr s a = StateT s Maybe a
> ==> StateT (s -> Maybe (a,s))
-}
{- $counting
A function to increment a counter.
Taken from the paper \"Generalising Monads to Arrows\",
John Hughes (<http://www.cse.chalmers.se/~rjmh/>), November 1998:
> tick :: State Int Int
> tick = do n <- get
> put (n+1)
> return n
Add one to the given number using the state monad:
> plusOne :: Int -> Int
> plusOne n = execState tick n
A contrived addition example. Works only with positive numbers:
> plus :: Int -> Int -> Int
> plus n x = execState (sequence $ replicate n tick) x
-}
{- $labelling
An example from /The Craft of Functional Programming/, Simon
Thompson (<http://www.cs.kent.ac.uk/people/staff/sjt/>),
Addison-Wesley 1999: \"Given an arbitrary tree, transform it to a
tree of integers in which the original elements are replaced by
natural numbers, starting from 0. The same element has to be
replaced by the same number at every occurrence, and when we meet
an as-yet-unvisited element we have to find a \'new\' number to match
it with:\"
> data Tree a = Nil | Node a (Tree a) (Tree a) deriving (Show, Eq)
> type Table a = [a]
> numberTree :: Eq a => Tree a -> State (Table a) (Tree Int)
> numberTree Nil = return Nil
> numberTree (Node x t1 t2)
> = do num <- numberNode x
> nt1 <- numberTree t1
> nt2 <- numberTree t2
> return (Node num nt1 nt2)
> where
> numberNode :: Eq a => a -> State (Table a) Int
> numberNode x
> = do table <- get
> (newTable, newPos) <- return (nNode x table)
> put newTable
> return newPos
> nNode:: (Eq a) => a -> Table a -> (Table a, Int)
> nNode x table
> = case (findIndexInList (== x) table) of
> Nothing -> (table ++ [x], length table)
> Just i -> (table, i)
> findIndexInList :: (a -> Bool) -> [a] -> Maybe Int
> findIndexInList = findIndexInListHelp 0
> findIndexInListHelp _ _ [] = Nothing
> findIndexInListHelp count f (h:t)
> = if (f h)
> then Just count
> else findIndexInListHelp (count+1) f t
numTree applies numberTree with an initial state:
> numTree :: (Eq a) => Tree a -> Tree Int
> numTree t = evalState (numberTree t) []
> testTree = Node "Zero" (Node "One" (Node "Two" Nil Nil) (Node "One" (Node "Zero" Nil Nil) Nil)) Nil
> numTree testTree => Node 0 (Node 1 (Node 2 Nil Nil) (Node 1 (Node 0 Nil Nil) Nil)) Nil
sumTree is a little helper function that does not use the State monad:
> sumTree :: (Num a) => Tree a -> a
> sumTree Nil = 0
> sumTree (Node e t1 t2) = e + (sumTree t1) + (sumTree t2)
-}
| jwiegley/ghc-release | libraries/transformers/Control/Monad/Trans/State/Strict.hs | gpl-3.0 | 11,638 | 0 | 17 | 2,874 | 2,281 | 1,276 | 1,005 | 120 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- Module : Network.AWS.IAM.GetGroup
-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
-- License : This Source Code Form is subject to the terms of
-- the Mozilla Public License, v. 2.0.
-- A copy of the MPL can be found in the LICENSE file or
-- you can obtain it at http://mozilla.org/MPL/2.0/.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : experimental
-- Portability : non-portable (GHC extensions)
--
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- | Returns a list of users that are in the specified group. You can paginate
-- the results using the 'MaxItems' and 'Marker' parameters.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_GetGroup.html>
module Network.AWS.IAM.GetGroup
(
-- * Request
GetGroup
-- ** Request constructor
, getGroup
-- ** Request lenses
, ggGroupName
, ggMarker
, ggMaxItems
-- * Response
, GetGroupResponse
-- ** Response constructor
, getGroupResponse
-- ** Response lenses
, ggrGroup
, ggrIsTruncated
, ggrMarker
, ggrUsers
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
data GetGroup = GetGroup
{ _ggGroupName :: Text
, _ggMarker :: Maybe Text
, _ggMaxItems :: Maybe Nat
} deriving (Eq, Ord, Read, Show)
-- | 'GetGroup' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'ggGroupName' @::@ 'Text'
--
-- * 'ggMarker' @::@ 'Maybe' 'Text'
--
-- * 'ggMaxItems' @::@ 'Maybe' 'Natural'
--
getGroup :: Text -- ^ 'ggGroupName'
-> GetGroup
getGroup p1 = GetGroup
{ _ggGroupName = p1
, _ggMarker = Nothing
, _ggMaxItems = Nothing
}
-- | The name of the group.
ggGroupName :: Lens' GetGroup Text
ggGroupName = lens _ggGroupName (\s a -> s { _ggGroupName = a })
-- | Use this only when paginating results, and only in a subsequent request
-- after you've received a response where the results are truncated. Set it to
-- the value of the 'Marker' element in the response you just received.
ggMarker :: Lens' GetGroup (Maybe Text)
ggMarker = lens _ggMarker (\s a -> s { _ggMarker = a })
-- | Use this only when paginating results to indicate the maximum number of
-- groups you want in the response. If there are additional groups beyond the
-- maximum you specify, the 'IsTruncated' response element is 'true'. This parameter
-- is optional. If you do not include it, it defaults to 100.
ggMaxItems :: Lens' GetGroup (Maybe Natural)
ggMaxItems = lens _ggMaxItems (\s a -> s { _ggMaxItems = a }) . mapping _Nat
data GetGroupResponse = GetGroupResponse
{ _ggrGroup :: Group
, _ggrIsTruncated :: Maybe Bool
, _ggrMarker :: Maybe Text
, _ggrUsers :: List "member" User
} deriving (Eq, Read, Show)
-- | 'GetGroupResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'ggrGroup' @::@ 'Group'
--
-- * 'ggrIsTruncated' @::@ 'Maybe' 'Bool'
--
-- * 'ggrMarker' @::@ 'Maybe' 'Text'
--
-- * 'ggrUsers' @::@ ['User']
--
getGroupResponse :: Group -- ^ 'ggrGroup'
-> GetGroupResponse
getGroupResponse p1 = GetGroupResponse
{ _ggrGroup = p1
, _ggrUsers = mempty
, _ggrIsTruncated = Nothing
, _ggrMarker = Nothing
}
-- | Information about the group.
ggrGroup :: Lens' GetGroupResponse Group
ggrGroup = lens _ggrGroup (\s a -> s { _ggrGroup = a })
-- | A flag that indicates whether there are more user names to list. If your
-- results were truncated, you can make a subsequent pagination request using
-- the 'Marker' request parameter to retrieve more user names in the list.
ggrIsTruncated :: Lens' GetGroupResponse (Maybe Bool)
ggrIsTruncated = lens _ggrIsTruncated (\s a -> s { _ggrIsTruncated = a })
-- | If IsTruncated is 'true', then this element is present and contains the value
-- to use for the 'Marker' parameter in a subsequent pagination request.
ggrMarker :: Lens' GetGroupResponse (Maybe Text)
ggrMarker = lens _ggrMarker (\s a -> s { _ggrMarker = a })
-- | A list of users in the group.
ggrUsers :: Lens' GetGroupResponse [User]
ggrUsers = lens _ggrUsers (\s a -> s { _ggrUsers = a }) . _List
instance ToPath GetGroup where
toPath = const "/"
instance ToQuery GetGroup where
toQuery GetGroup{..} = mconcat
[ "GroupName" =? _ggGroupName
, "Marker" =? _ggMarker
, "MaxItems" =? _ggMaxItems
]
instance ToHeaders GetGroup
instance AWSRequest GetGroup where
type Sv GetGroup = IAM
type Rs GetGroup = GetGroupResponse
request = post "GetGroup"
response = xmlResponse
instance FromXML GetGroupResponse where
parseXML = withElement "GetGroupResult" $ \x -> GetGroupResponse
<$> x .@ "Group"
<*> x .@? "IsTruncated"
<*> x .@? "Marker"
<*> x .@? "Users" .!@ mempty
instance AWSPager GetGroup where
page rq rs
| stop (rs ^. ggrIsTruncated) = Nothing
| otherwise = Just $ rq
& ggMarker .~ rs ^. ggrMarker
| romanb/amazonka | amazonka-iam/gen/Network/AWS/IAM/GetGroup.hs | mpl-2.0 | 5,619 | 0 | 16 | 1,348 | 862 | 508 | 354 | 89 | 1 |
-- (c) The University of Glasgow, 1997-2006
{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples,
GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -O -funbox-strict-fields #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is severely affected
-- |
-- There are two principal string types used internally by GHC:
--
-- ['FastString']
--
-- * A compact, hash-consed, representation of character strings.
-- * Comparison is O(1), and you can get a 'Unique.Unique' from them.
-- * Generated by 'fsLit'.
-- * Turn into 'Outputable.SDoc' with 'Outputable.ftext'.
--
-- ['LitString']
--
-- * Just a wrapper for the @Addr#@ of a C string (@Ptr CChar@).
-- * Practically no operations.
-- * Outputing them is fast.
-- * Generated by 'sLit'.
-- * Turn into 'Outputable.SDoc' with 'Outputable.ptext'
-- * Requires manual memory management.
-- Improper use may lead to memory leaks or dangling pointers.
-- * It assumes Latin-1 as the encoding, therefore it cannot represent
-- arbitrary Unicode strings.
--
-- Use 'LitString' unless you want the facilities of 'FastString'.
module FastString
(
-- * ByteString
fastStringToByteString,
mkFastStringByteString,
fastZStringToByteString,
unsafeMkByteString,
hashByteString,
-- * FastZString
FastZString,
hPutFZS,
zString,
lengthFZS,
-- * FastStrings
FastString(..), -- not abstract, for now.
-- ** Construction
fsLit,
mkFastString,
mkFastStringBytes,
mkFastStringByteList,
mkFastStringForeignPtr,
mkFastString#,
-- ** Deconstruction
unpackFS, -- :: FastString -> String
bytesFS, -- :: FastString -> [Word8]
-- ** Encoding
zEncodeFS,
-- ** Operations
uniqueOfFS,
lengthFS,
nullFS,
appendFS,
headFS,
tailFS,
concatFS,
consFS,
nilFS,
-- ** Outputing
hPutFS,
-- ** Internal
getFastStringTable,
hasZEncoding,
-- * LitStrings
LitString,
-- ** Construction
sLit,
mkLitString#,
mkLitString,
-- ** Deconstruction
unpackLitString,
-- ** Operations
lengthLS
) where
#include "HsVersions.h"
import Encoding
import FastFunctions
import Panic
import Util
import Control.DeepSeq
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString.Internal as BS
import qualified Data.ByteString.Unsafe as BS
import Foreign.C
import GHC.Exts
import System.IO
import System.IO.Unsafe ( unsafePerformIO )
import Data.Data
import Data.IORef ( IORef, newIORef, readIORef, atomicModifyIORef' )
import Data.Maybe ( isJust )
import Data.Char
import Data.List ( elemIndex )
import GHC.IO ( IO(..), unsafeDupablePerformIO )
import Foreign
#if STAGE >= 2
import GHC.Conc.Sync (sharedCAF)
#endif
import GHC.Base ( unpackCString# )
#define hASH_TBL_SIZE 4091
#define hASH_TBL_SIZE_UNBOXED 4091#
fastStringToByteString :: FastString -> ByteString
fastStringToByteString f = fs_bs f
fastZStringToByteString :: FastZString -> ByteString
fastZStringToByteString (FastZString bs) = bs
-- This will drop information if any character > '\xFF'
unsafeMkByteString :: String -> ByteString
unsafeMkByteString = BSC.pack
hashByteString :: ByteString -> Int
hashByteString bs
= inlinePerformIO $ BS.unsafeUseAsCStringLen bs $ \(ptr, len) ->
return $ hashStr (castPtr ptr) len
-- -----------------------------------------------------------------------------
newtype FastZString = FastZString ByteString
deriving NFData
hPutFZS :: Handle -> FastZString -> IO ()
hPutFZS handle (FastZString bs) = BS.hPut handle bs
zString :: FastZString -> String
zString (FastZString bs) =
inlinePerformIO $ BS.unsafeUseAsCStringLen bs peekCAStringLen
lengthFZS :: FastZString -> Int
lengthFZS (FastZString bs) = BS.length bs
mkFastZStringString :: String -> FastZString
mkFastZStringString str = FastZString (BSC.pack str)
-- -----------------------------------------------------------------------------
{-|
A 'FastString' is an array of bytes, hashed to support fast O(1)
comparison. It is also associated with a character encoding, so that
we know how to convert a 'FastString' to the local encoding, or to the
Z-encoding used by the compiler internally.
'FastString's support a memoized conversion to the Z-encoding via zEncodeFS.
-}
data FastString = FastString {
uniq :: {-# UNPACK #-} !Int, -- unique id
n_chars :: {-# UNPACK #-} !Int, -- number of chars
fs_bs :: {-# UNPACK #-} !ByteString,
fs_ref :: {-# UNPACK #-} !(IORef (Maybe FastZString))
}
instance Eq FastString where
f1 == f2 = uniq f1 == uniq f2
instance Ord FastString where
-- Compares lexicographically, not by unique
a <= b = case cmpFS a b of { LT -> True; EQ -> True; GT -> False }
a < b = case cmpFS a b of { LT -> True; EQ -> False; GT -> False }
a >= b = case cmpFS a b of { LT -> False; EQ -> True; GT -> True }
a > b = case cmpFS a b of { LT -> False; EQ -> False; GT -> True }
max x y | x >= y = x
| otherwise = y
min x y | x <= y = x
| otherwise = y
compare a b = cmpFS a b
instance IsString FastString where
fromString = fsLit
instance Monoid FastString where
mempty = nilFS
mappend = appendFS
mconcat = concatFS
instance Show FastString where
show fs = show (unpackFS fs)
instance Data FastString where
-- don't traverse?
toConstr _ = abstractConstr "FastString"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNoRepType "FastString"
cmpFS :: FastString -> FastString -> Ordering
cmpFS f1@(FastString u1 _ _ _) f2@(FastString u2 _ _ _) =
if u1 == u2 then EQ else
compare (fastStringToByteString f1) (fastStringToByteString f2)
foreign import ccall unsafe "ghc_memcmp"
memcmp :: Ptr a -> Ptr b -> Int -> IO Int
-- -----------------------------------------------------------------------------
-- Construction
{-
Internally, the compiler will maintain a fast string symbol table, providing
sharing and fast comparison. Creation of new @FastString@s then covertly does a
lookup, re-using the @FastString@ if there was a hit.
The design of the FastString hash table allows for lockless concurrent reads
and updates to multiple buckets with low synchronization overhead.
See Note [Updating the FastString table] on how it's updated.
-}
data FastStringTable =
FastStringTable
{-# UNPACK #-} !(IORef Int) -- the unique ID counter shared with all buckets
(MutableArray# RealWorld (IORef [FastString])) -- the array of mutable buckets
string_table :: FastStringTable
{-# NOINLINE string_table #-}
string_table = unsafePerformIO $ do
uid <- newIORef 603979776 -- ord '$' * 0x01000000
tab <- IO $ \s1# -> case newArray# hASH_TBL_SIZE_UNBOXED (panic "string_table") s1# of
(# s2#, arr# #) ->
(# s2#, FastStringTable uid arr# #)
forM_ [0.. hASH_TBL_SIZE-1] $ \i -> do
bucket <- newIORef []
updTbl tab i bucket
-- use the support wired into the RTS to share this CAF among all images of
-- libHSghc
#if STAGE < 2
return tab
#else
sharedCAF tab getOrSetLibHSghcFastStringTable
-- from the RTS; thus we cannot use this mechanism when STAGE<2; the previous
-- RTS might not have this symbol
foreign import ccall unsafe "getOrSetLibHSghcFastStringTable"
getOrSetLibHSghcFastStringTable :: Ptr a -> IO (Ptr a)
#endif
{-
We include the FastString table in the `sharedCAF` mechanism because we'd like
FastStrings created by a Core plugin to have the same uniques as corresponding
strings created by the host compiler itself. For example, this allows plugins
to lookup known names (eg `mkTcOcc "MySpecialType"`) in the GlobalRdrEnv or
even re-invoke the parser.
In particular, the following little sanity test was failing in a plugin
prototyping safe newtype-coercions: GHC.NT.Type.NT was imported, but could not
be looked up /by the plugin/.
let rdrName = mkModuleName "GHC.NT.Type" `mkRdrQual` mkTcOcc "NT"
putMsgS $ showSDoc dflags $ ppr $ lookupGRE_RdrName rdrName $ mg_rdr_env guts
`mkTcOcc` involves the lookup (or creation) of a FastString. Since the
plugin's FastString.string_table is empty, constructing the RdrName also
allocates new uniques for the FastStrings "GHC.NT.Type" and "NT". These
uniques are almost certainly unequal to the ones that the host compiler
originally assigned to those FastStrings. Thus the lookup fails since the
domain of the GlobalRdrEnv is affected by the RdrName's OccName's FastString's
unique.
Maintaining synchronization of the two instances of this global is rather
difficult because of the uses of `unsafePerformIO` in this module. Not
synchronizing them risks breaking the rather major invariant that two
FastStrings with the same unique have the same string. Thus we use the
lower-level `sharedCAF` mechanism that relies on Globals.c.
-}
lookupTbl :: FastStringTable -> Int -> IO (IORef [FastString])
lookupTbl (FastStringTable _ arr#) (I# i#) =
IO $ \ s# -> readArray# arr# i# s#
updTbl :: FastStringTable -> Int -> IORef [FastString] -> IO ()
updTbl (FastStringTable _uid arr#) (I# i#) ls = do
(IO $ \ s# -> case writeArray# arr# i# ls s# of { s2# -> (# s2#, () #) })
mkFastString# :: Addr# -> FastString
mkFastString# a# = mkFastStringBytes ptr (ptrStrLength ptr)
where ptr = Ptr a#
{- Note [Updating the FastString table]
The procedure goes like this:
1. Read the relevant bucket and perform a look up of the string.
2. If it exists, return it.
3. Otherwise grab a unique ID, create a new FastString and atomically attempt
to update the relevant bucket with this FastString:
* Double check that the string is not in the bucket. Another thread may have
inserted it while we were creating our string.
* Return the existing FastString if it exists. The one we preemptively
created will get GCed.
* Otherwise, insert and return the string we created.
-}
{- Note [Double-checking the bucket]
It is not necessary to check the entire bucket the second time. We only have to
check the strings that are new to the bucket since the last time we read it.
-}
mkFastStringWith :: (Int -> IO FastString) -> Ptr Word8 -> Int -> IO FastString
mkFastStringWith mk_fs !ptr !len = do
let hash = hashStr ptr len
bucket <- lookupTbl string_table hash
ls1 <- readIORef bucket
res <- bucket_match ls1 len ptr
case res of
Just v -> return v
Nothing -> do
n <- get_uid
new_fs <- mk_fs n
atomicModifyIORef' bucket $ \ls2 ->
-- Note [Double-checking the bucket]
let delta_ls = case ls1 of
[] -> ls2
l:_ -> case l `elemIndex` ls2 of
Nothing -> panic "mkFastStringWith"
Just idx -> take idx ls2
-- NB: Might as well use inlinePerformIO, since the call to
-- bucket_match doesn't perform any IO that could be floated
-- out of this closure or erroneously duplicated.
in case inlinePerformIO (bucket_match delta_ls len ptr) of
Nothing -> (new_fs:ls2, new_fs)
Just fs -> (ls2,fs)
where
!(FastStringTable uid _arr) = string_table
get_uid = atomicModifyIORef' uid $ \n -> (n+1,n)
mkFastStringBytes :: Ptr Word8 -> Int -> FastString
mkFastStringBytes !ptr !len =
-- NB: Might as well use unsafeDupablePerformIO, since mkFastStringWith is
-- idempotent.
unsafeDupablePerformIO $
mkFastStringWith (copyNewFastString ptr len) ptr len
-- | Create a 'FastString' from an existing 'ForeignPtr'; the difference
-- between this and 'mkFastStringBytes' is that we don't have to copy
-- the bytes if the string is new to the table.
mkFastStringForeignPtr :: Ptr Word8 -> ForeignPtr Word8 -> Int -> IO FastString
mkFastStringForeignPtr ptr !fp len
= mkFastStringWith (mkNewFastString fp ptr len) ptr len
-- | Create a 'FastString' from an existing 'ForeignPtr'; the difference
-- between this and 'mkFastStringBytes' is that we don't have to copy
-- the bytes if the string is new to the table.
mkFastStringByteString :: ByteString -> FastString
mkFastStringByteString bs =
inlinePerformIO $
BS.unsafeUseAsCStringLen bs $ \(ptr, len) -> do
let ptr' = castPtr ptr
mkFastStringWith (mkNewFastStringByteString bs ptr' len) ptr' len
-- | Creates a UTF-8 encoded 'FastString' from a 'String'
mkFastString :: String -> FastString
mkFastString str =
inlinePerformIO $ do
let l = utf8EncodedLength str
buf <- mallocForeignPtrBytes l
withForeignPtr buf $ \ptr -> do
utf8EncodeString ptr str
mkFastStringForeignPtr ptr buf l
-- | Creates a 'FastString' from a UTF-8 encoded @[Word8]@
mkFastStringByteList :: [Word8] -> FastString
mkFastStringByteList str =
inlinePerformIO $ do
let l = Prelude.length str
buf <- mallocForeignPtrBytes l
withForeignPtr buf $ \ptr -> do
pokeArray (castPtr ptr) str
mkFastStringForeignPtr ptr buf l
-- | Creates a Z-encoded 'FastString' from a 'String'
mkZFastString :: String -> FastZString
mkZFastString = mkFastZStringString
bucket_match :: [FastString] -> Int -> Ptr Word8 -> IO (Maybe FastString)
bucket_match [] _ _ = return Nothing
bucket_match (v@(FastString _ _ bs _):ls) len ptr
| len == BS.length bs = do
b <- BS.unsafeUseAsCString bs $ \buf ->
cmpStringPrefix ptr (castPtr buf) len
if b then return (Just v)
else bucket_match ls len ptr
| otherwise =
bucket_match ls len ptr
mkNewFastString :: ForeignPtr Word8 -> Ptr Word8 -> Int -> Int
-> IO FastString
mkNewFastString fp ptr len uid = do
ref <- newIORef Nothing
n_chars <- countUTF8Chars ptr len
return (FastString uid n_chars (BS.fromForeignPtr fp 0 len) ref)
mkNewFastStringByteString :: ByteString -> Ptr Word8 -> Int -> Int
-> IO FastString
mkNewFastStringByteString bs ptr len uid = do
ref <- newIORef Nothing
n_chars <- countUTF8Chars ptr len
return (FastString uid n_chars bs ref)
copyNewFastString :: Ptr Word8 -> Int -> Int -> IO FastString
copyNewFastString ptr len uid = do
fp <- copyBytesToForeignPtr ptr len
ref <- newIORef Nothing
n_chars <- countUTF8Chars ptr len
return (FastString uid n_chars (BS.fromForeignPtr fp 0 len) ref)
copyBytesToForeignPtr :: Ptr Word8 -> Int -> IO (ForeignPtr Word8)
copyBytesToForeignPtr ptr len = do
fp <- mallocForeignPtrBytes len
withForeignPtr fp $ \ptr' -> copyBytes ptr' ptr len
return fp
cmpStringPrefix :: Ptr Word8 -> Ptr Word8 -> Int -> IO Bool
cmpStringPrefix ptr1 ptr2 len =
do r <- memcmp ptr1 ptr2 len
return (r == 0)
hashStr :: Ptr Word8 -> Int -> Int
-- use the Addr to produce a hash value between 0 & m (inclusive)
hashStr (Ptr a#) (I# len#) = loop 0# 0#
where
loop h n | isTrue# (n ==# len#) = I# h
| otherwise = loop h2 (n +# 1#)
where !c = ord# (indexCharOffAddr# a# n)
!h2 = (c +# (h *# 128#)) `remInt#`
hASH_TBL_SIZE#
-- -----------------------------------------------------------------------------
-- Operations
-- | Returns the length of the 'FastString' in characters
lengthFS :: FastString -> Int
lengthFS f = n_chars f
-- | Returns @True@ if this 'FastString' is not Z-encoded but already has
-- a Z-encoding cached (used in producing stats).
hasZEncoding :: FastString -> Bool
hasZEncoding (FastString _ _ _ ref) =
inlinePerformIO $ do
m <- readIORef ref
return (isJust m)
-- | Returns @True@ if the 'FastString' is empty
nullFS :: FastString -> Bool
nullFS f = BS.null (fs_bs f)
-- | Unpacks and decodes the FastString
unpackFS :: FastString -> String
unpackFS (FastString _ _ bs _) =
inlinePerformIO $ BS.unsafeUseAsCStringLen bs $ \(ptr, len) ->
utf8DecodeString (castPtr ptr) len
-- | Gives the UTF-8 encoded bytes corresponding to a 'FastString'
bytesFS :: FastString -> [Word8]
bytesFS fs = BS.unpack $ fastStringToByteString fs
-- | Returns a Z-encoded version of a 'FastString'. This might be the
-- original, if it was already Z-encoded. The first time this
-- function is applied to a particular 'FastString', the results are
-- memoized.
--
zEncodeFS :: FastString -> FastZString
zEncodeFS fs@(FastString _ _ _ ref) =
inlinePerformIO $ do
m <- readIORef ref
case m of
Just zfs -> return zfs
Nothing -> do
atomicModifyIORef' ref $ \m' -> case m' of
Nothing -> let zfs = mkZFastString (zEncodeString (unpackFS fs))
in (Just zfs, zfs)
Just zfs -> (m', zfs)
appendFS :: FastString -> FastString -> FastString
appendFS fs1 fs2 = mkFastStringByteString
$ BS.append (fastStringToByteString fs1)
(fastStringToByteString fs2)
concatFS :: [FastString] -> FastString
concatFS = mkFastStringByteString . BS.concat . map fs_bs
headFS :: FastString -> Char
headFS (FastString _ 0 _ _) = panic "headFS: Empty FastString"
headFS (FastString _ _ bs _) =
inlinePerformIO $ BS.unsafeUseAsCString bs $ \ptr ->
return (fst (utf8DecodeChar (castPtr ptr)))
tailFS :: FastString -> FastString
tailFS (FastString _ 0 _ _) = panic "tailFS: Empty FastString"
tailFS (FastString _ _ bs _) =
inlinePerformIO $ BS.unsafeUseAsCString bs $ \ptr ->
do let (_, n) = utf8DecodeChar (castPtr ptr)
return $! mkFastStringByteString (BS.drop n bs)
consFS :: Char -> FastString -> FastString
consFS c fs = mkFastString (c : unpackFS fs)
uniqueOfFS :: FastString -> Int
uniqueOfFS (FastString u _ _ _) = u
nilFS :: FastString
nilFS = mkFastString ""
-- -----------------------------------------------------------------------------
-- Stats
getFastStringTable :: IO [[FastString]]
getFastStringTable = do
buckets <- forM [0.. hASH_TBL_SIZE-1] $ \idx -> do
bucket <- lookupTbl string_table idx
readIORef bucket
return buckets
-- -----------------------------------------------------------------------------
-- Outputting 'FastString's
-- |Outputs a 'FastString' with /no decoding at all/, that is, you
-- get the actual bytes in the 'FastString' written to the 'Handle'.
hPutFS :: Handle -> FastString -> IO ()
hPutFS handle fs = BS.hPut handle $ fastStringToByteString fs
-- ToDo: we'll probably want an hPutFSLocal, or something, to output
-- in the current locale's encoding (for error messages and suchlike).
-- -----------------------------------------------------------------------------
-- LitStrings, here for convenience only.
-- | A 'LitString' is a pointer to some null-terminated array of bytes.
type LitString = Ptr Word8
--Why do we recalculate length every time it's requested?
--If it's commonly needed, we should perhaps have
--data LitString = LitString {-#UNPACK#-}!Addr# {-#UNPACK#-}!Int#
-- | Wrap an unboxed address into a 'LitString'.
mkLitString# :: Addr# -> LitString
mkLitString# a# = Ptr a#
-- | Encode a 'String' into a newly allocated 'LitString' using Latin-1
-- encoding. The original string must not contain non-Latin-1 characters
-- (above codepoint @0xff@).
{-# INLINE mkLitString #-}
mkLitString :: String -> LitString
mkLitString s =
unsafePerformIO (do
p <- mallocBytes (length s + 1)
let
loop :: Int -> String -> IO ()
loop !n [] = pokeByteOff p n (0 :: Word8)
loop n (c:cs) = do
pokeByteOff p n (fromIntegral (ord c) :: Word8)
loop (1+n) cs
loop 0 s
return p
)
-- | Decode a 'LitString' back into a 'String' using Latin-1 encoding.
-- This does not free the memory associated with 'LitString'.
unpackLitString :: LitString -> String
unpackLitString (Ptr p) = unpackCString# p
-- | Compute the length of a 'LitString', which must necessarily be
-- null-terminated.
lengthLS :: LitString -> Int
lengthLS = ptrStrLength
-- -----------------------------------------------------------------------------
-- under the carpet
foreign import ccall unsafe "ghc_strlen"
ptrStrLength :: Ptr Word8 -> Int
{-# NOINLINE sLit #-}
sLit :: String -> LitString
sLit x = mkLitString x
{-# NOINLINE fsLit #-}
fsLit :: String -> FastString
fsLit x = mkFastString x
{-# RULES "slit"
forall x . sLit (unpackCString# x) = mkLitString# x #-}
{-# RULES "fslit"
forall x . fsLit (unpackCString# x) = mkFastString# x #-}
| olsner/ghc | compiler/utils/FastString.hs | bsd-3-clause | 20,911 | 0 | 26 | 4,819 | 4,110 | 2,128 | 1,982 | 331 | 5 |
module Snap.App
(module Snap.Core
,module Snap.App.Types
,module Snap.App.Controller
,module Snap.App.Model)
where
import Snap.Core
import Snap.App.Types
import Snap.App.Controller
import Snap.App.Model
| lwm/haskellnews | upstream/snap-app/src/Snap/App.hs | bsd-3-clause | 214 | 0 | 5 | 30 | 58 | 39 | 19 | 9 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE ExistentialQuantification, FlexibleContexts, FlexibleInstances, StandaloneDeriving #-}
--------------------------------------------------------------------
-- |
-- Module : XMonad.Util.NamedActions
-- Copyright : 2009 Adam Vogt <vogt.adam@gmail.com>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Adam Vogt <vogt.adam@gmail.com>
-- Stability : unstable
-- Portability : unportable
--
-- A wrapper for keybinding configuration that can list the available
-- keybindings.
--
-- Note that xmonad>=0.11 has by default a list of the default keybindings
-- bound to @M-S-/@ or @M-?@.
--------------------------------------------------------------------
module XMonad.Util.NamedActions (
-- * Usage:
-- $usage
sendMessage',
spawn',
submapName,
addDescrKeys,
addDescrKeys',
xMessage,
showKmSimple,
showKm,
noName,
oneName,
addName,
separator,
subtitle,
(^++^),
NamedAction(..),
HasName,
defaultKeysDescr
) where
import XMonad.Actions.Submap(submap)
import XMonad
import System.Posix.Process(executeFile)
import Control.Arrow(Arrow((&&&), second, (***)))
import Data.Bits(Bits((.&.), complement))
import Data.List (groupBy)
import System.Exit(ExitCode(ExitSuccess), exitWith)
import Control.Applicative ((<*>))
import qualified Data.Map as M
import qualified XMonad.StackSet as W
-- $usage
-- Here is an example config that demonstrates the usage of 'sendMessage'',
-- 'mkNamedKeymap', 'addDescrKeys', and '^++^'
--
-- > import XMonad
-- > import XMonad.Util.NamedActions
-- > import XMonad.Util.EZConfig
-- >
-- > main = xmonad $ addDescrKeys ((mod4Mask, xK_F1), xMessage) myKeys
-- > def { modMask = mod4Mask }
-- >
-- > myKeys c = (subtitle "Custom Keys":) $ mkNamedKeymap c $
-- > [("M-x a", addName "useless message" $ spawn "xmessage foo"),
-- > ("M-c", sendMessage' Expand)]
-- > ^++^
-- > [("<XF86AudioPlay>", spawn "mpc toggle" :: X ()),
-- > ("<XF86AudioNext>", spawn "mpc next")]
--
-- Using '^++^', you can combine bindings whose actions are @X ()@
-- as well as actions that have descriptions. However you cannot mix the two in
-- a single list, unless each is prefixed with 'addName' or 'noName'.
--
-- If you don't like EZConfig, you can still use '^++^' with the basic XMonad
-- keybinding configuration too.
--
-- Also note the unfortunate necessity of a type annotation, since 'spawn' is
-- too general.
-- TODO: squeeze titles that have no entries (consider titles containing \n)
--
-- Output to Multiple columns
--
-- Devin Mullin's suggestions:
--
-- Reduce redundancy wrt mkNamedSubmaps, mkSubmaps and mkNamedKeymap to have a
-- HasName context (and leave mkKeymap as a specific case of it?)
-- Currently kept separate to aid error messages, common lines factored out
--
-- Suggestions for UI:
--
-- - An IO () -> IO () that wraps the main xmonad action and wrests control
-- from it if the user asks for --keys.
--
-- Just a separate binary: keep this as the only way to show keys for simplicity
--
-- - An X () that toggles a cute little overlay like the ? window for gmail
-- and reader.
--
-- Add dzen binding
deriving instance Show XMonad.Resize
deriving instance Show XMonad.IncMasterN
-- | 'sendMessage' but add a description that is @show message@. Note that not
-- all messages have show instances.
sendMessage' :: (Message a, Show a) => a -> NamedAction
sendMessage' x = NamedAction $ (XMonad.sendMessage x,show x)
-- | 'spawn' but the description is the string passed
spawn' :: String -> NamedAction
spawn' x = addName x $ spawn x
class HasName a where
showName :: a -> [String]
showName = const [""]
getAction :: a -> X ()
instance HasName (X ()) where
getAction = id
instance HasName (IO ()) where
getAction = io
instance HasName [Char] where
getAction _ = return ()
showName = (:[])
instance HasName (X (),String) where
showName = (:[]) . snd
getAction = fst
instance HasName (X (),[String]) where
showName = snd
getAction = fst
-- show only the outermost description
instance HasName (NamedAction,String) where
showName = (:[]) . snd
getAction = getAction . fst
instance HasName NamedAction where
showName (NamedAction x) = showName x
getAction (NamedAction x) = getAction x
-- | An existential wrapper so that different types can be combined in lists,
-- and maps
data NamedAction = forall a. HasName a => NamedAction a
-- | 'submap', but propagate the descriptions of the actions. Does this belong
-- in "XMonad.Actions.Submap"?
submapName :: (HasName a) => [((KeyMask, KeySym), a)] -> NamedAction
submapName = NamedAction . (submap . M.map getAction . M.fromList &&& showKm)
. map (second NamedAction)
-- | Combine keymap lists with actions that may or may not have names
(^++^) :: (HasName b, HasName b1) =>
[(d, b)] -> [(d, b1)] -> [(d, NamedAction)]
a ^++^ b = map (second NamedAction) a ++ map (second NamedAction) b
-- | Or allow another lookup table?
modToString :: KeyMask -> String
modToString mask = concatMap (++"-") $ filter (not . null)
$ map (uncurry pick)
[(mod1Mask, "M1")
,(mod2Mask, "M2")
,(mod3Mask, "M3")
,(mod4Mask, "M4")
,(mod5Mask, "M5")
,(controlMask, "C")
,(shiftMask,"Shift")]
where pick m str = if m .&. complement mask == 0 then str else ""
keyToString :: (KeyMask, KeySym) -> [Char]
keyToString = uncurry (++) . (modToString *** keysymToString)
showKmSimple :: [((KeyMask, KeySym), NamedAction)] -> [[Char]]
showKmSimple = concatMap (\(k,e) -> if snd k == 0 then "":showName e else map ((keyToString k ++) . smartSpace) $ showName e)
smartSpace :: String -> String
smartSpace [] = []
smartSpace xs = ' ':xs
_test :: String
_test = unlines $ showKm $ defaultKeysDescr XMonad.def { XMonad.layoutHook = XMonad.Layout $ XMonad.layoutHook XMonad.def }
showKm :: [((KeyMask, KeySym), NamedAction)] -> [String]
showKm keybindings = padding $ do
(k,e) <- keybindings
if snd k == 0 then map ((,) "") $ showName e
else map ((,) (keyToString k) . smartSpace) $ showName e
where padding = let pad n (k,e) = if null k then "\n>> "++e else take n (k++repeat ' ') ++ e
expand xs n = map (pad n) xs
getMax = map (maximum . map (length . fst))
in concat . (zipWith expand <*> getMax) . groupBy (const $ not . null . fst)
-- | An action to send to 'addDescrKeys' for showing the keybindings. See also 'showKm' and 'showKmSimple'
xMessage :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
xMessage x = addName "Show Keybindings" $ io $ do
xfork $ executeFile "xmessage" True ["-default", "okay", unlines $ showKm x] Nothing
return ()
-- | Merge the supplied keys with 'defaultKeysDescr', also adding a keybinding
-- to run an action for showing the keybindings.
addDescrKeys :: (HasName b1, HasName b) =>
((KeyMask, KeySym),[((KeyMask, KeySym), NamedAction)] -> b)
-> (XConfig Layout -> [((KeyMask, KeySym), b1)])
-> XConfig l
-> XConfig l
addDescrKeys k ks = addDescrKeys' k (\l -> defaultKeysDescr l ^++^ ks l)
-- | Without merging with 'defaultKeysDescr'
addDescrKeys' :: (HasName b) =>
((KeyMask, KeySym),[((KeyMask, KeySym), NamedAction)] -> b)
-> (XConfig Layout -> [((KeyMask, KeySym), NamedAction)]) -> XConfig l -> XConfig l
addDescrKeys' (k,f) ks conf =
let shk l = f $ [(k,f $ ks l)] ^++^ ks l
keylist l = M.map getAction $ M.fromList $ ks l ^++^ [(k, shk l)]
in conf { keys = keylist }
-- | A version of the default keys from the default configuration, but with
-- 'NamedAction' instead of @X ()@
defaultKeysDescr :: XConfig Layout -> [((KeyMask, KeySym), NamedAction)]
defaultKeysDescr conf@(XConfig {XMonad.modMask = modm}) =
[ subtitle "launching and killing programs"
, ((modm .|. shiftMask, xK_Return), addName "Launch Terminal" $ spawn $ XMonad.terminal conf) -- %! Launch terminal
, ((modm, xK_p ), addName "Launch dmenu" $ spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") -- %! Launch dmenu
, ((modm .|. shiftMask, xK_p ), addName "Launch gmrun" $ spawn "gmrun") -- %! Launch gmrun
, ((modm .|. shiftMask, xK_c ), addName "Close the focused window" kill) -- %! Close the focused window
, subtitle "changing layouts"
, ((modm, xK_space ), sendMessage' NextLayout) -- %! Rotate through the available layout algorithms
, ((modm .|. shiftMask, xK_space ), addName "Reset the layout" $ setLayout $ XMonad.layoutHook conf) -- %! Reset the layouts on the current workspace to default
, separator
, ((modm, xK_n ), addName "Refresh" refresh) -- %! Resize viewed windows to the correct size
, subtitle "move focus up or down the window stack"
, ((modm, xK_Tab ), addName "Focus down" $ windows W.focusDown) -- %! Move focus to the next window
, ((modm .|. shiftMask, xK_Tab ), addName "Focus up" $ windows W.focusUp ) -- %! Move focus to the previous window
, ((modm, xK_j ), addName "Focus down" $ windows W.focusDown) -- %! Move focus to the next window
, ((modm, xK_k ), addName "Focus up" $ windows W.focusUp ) -- %! Move focus to the previous window
, ((modm, xK_m ), addName "Focus the master" $ windows W.focusMaster ) -- %! Move focus to the master window
, subtitle "modifying the window order"
, ((modm, xK_Return), addName "Swap with the master" $ windows W.swapMaster) -- %! Swap the focused window and the master window
, ((modm .|. shiftMask, xK_j ), addName "Swap down" $ windows W.swapDown ) -- %! Swap the focused window with the next window
, ((modm .|. shiftMask, xK_k ), addName "Swap up" $ windows W.swapUp ) -- %! Swap the focused window with the previous window
, subtitle "resizing the master/slave ratio"
, ((modm, xK_h ), sendMessage' Shrink) -- %! Shrink the master area
, ((modm, xK_l ), sendMessage' Expand) -- %! Expand the master area
, subtitle "floating layer support"
, ((modm, xK_t ), addName "Push floating to tiled" $ withFocused $ windows . W.sink) -- %! Push window back into tiling
, subtitle "change the number of windows in the master area"
, ((modm , xK_comma ), sendMessage' (IncMasterN 1)) -- %! Increment the number of windows in the master area
, ((modm , xK_period), sendMessage' (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area
, subtitle "quit, or restart"
, ((modm .|. shiftMask, xK_q ), addName "Quit" $ io (exitWith ExitSuccess)) -- %! Quit xmonad
, ((modm , xK_q ), addName "Restart" $ spawn "xmonad --recompile && xmonad --restart") -- %! Restart xmonad
]
-- mod-[1..9] %! Switch to workspace N
-- mod-shift-[1..9] %! Move client to workspace N
++
subtitle "switching workspaces":
[((m .|. modm, k), addName (n ++ i) $ windows $ f i)
| (f, m, n) <- [(W.greedyView, 0, "Switch to workspace "), (W.shift, shiftMask, "Move client to workspace ")]
, (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]]
-- mod-{w,e,r} %! Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r} %! Move client to screen 1, 2, or 3
++
subtitle "switching screens" :
[((m .|. modm, key), addName (n ++ show sc) $ screenWorkspace sc >>= flip whenJust (windows . f))
| (f, m, n) <- [(W.view, 0, "Switch to screen number "), (W.shift, shiftMask, "Move client to screen number ")]
, (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]]
-- | For a prettier presentation: keymask, keysym of 0 are reserved for this
-- purpose: they do not happen, afaik, and keysymToString 0 would raise an
-- error otherwise
separator :: ((KeyMask,KeySym), NamedAction)
separator = ((0,0), NamedAction (return () :: X (),[] :: [String]))
subtitle :: String -> ((KeyMask, KeySym), NamedAction)
subtitle x = ((0,0), NamedAction $ x ++ ":")
-- | These are just the @NamedAction@ constructor but with a more specialized
-- type, so that you don't have to supply any annotations, for ex coercing
-- spawn to @X ()@ from the more general @MonadIO m => m ()@
noName :: X () -> NamedAction
noName = NamedAction
oneName :: (X (), String) -> NamedAction
oneName = NamedAction
addName :: String -> X () -> NamedAction
addName = flip (curry NamedAction)
| pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Util/NamedActions.hs | bsd-2-clause | 12,707 | 0 | 16 | 2,907 | 3,056 | 1,755 | 1,301 | -1 | -1 |
module FVTests where
import FVision
import GraphicsZ
import GeometryZ
import qualified GeometryStatic as GS
import qualified Graphics as G
import FRP
import FRPSignal
import FRPTask
import qualified NXVision2 as XV
import IOExts (unsafePerformIO)
dotAt c p = withColor c $ moveTo p $ stretch 10 $ circle
testF p = runmpeg "test.mpg" "" (showPic p)
test p = runmpeg "firewire" "" (showPic p)
main = test emptyPic
main1 = test (dotAt red (point2XY (50*timeB) (30*timeB)))
main2 = test (dotAt red mouseB)
main3 = test (dotAt (cycleColors [red, white, blue] lbpE) mouseB)
main4 = test (dotAt (cycleColors [red, white, blue] rbpE) mouseB)
--cycleColors colors e = cc1 (cycle colors)
-- where cc1 (c:cs) = c `till` e -=> cc1 cs
cycleColors colors e = switch (head colors) (tagE_ e (tail (cycle colors)))
followMe :: VBehavior Picture
followMe = emptyPic `till` lbpPosE ==>
(\corner1 -> rectangle (lift0 corner1) mouseB
`till` lbpPosE ==>
(\corner2 -> fillRectangle (lift0 corner1) (lift0 corner2)))
track :: VBehavior Picture
track = emptyPic `till` lbpPosE ==>
(\corner1 -> rectangle (lift0 corner1) mouseB
`till` (lbpPosE `snapshotE` inputB) ==>
(\(corner2,inp) ->
let (x1,y1)=GS.point2XYCoords corner1
(x2,y2)=GS.point2XYCoords corner2
(x,y)=(round x1,round y1)
(dx,dy)=(round (x2-x1), round (y2-y1))
im = XV.getRegion (viImage inp) x y dx dy
c = XV.getColorSelector im
f img = let (xc, yc, area) = XV.stepBlob (viImage img) c
area' = (round (area*0.5)) :: Int
(x,y)=(round xc,round yc)
in ( ipoint2XY (x - area') (y - area'),
ipoint2XY (x + area') (y + area') )
(corner1B, corner2B) = pairZSplit $ lift1 f inputB
in
rectangle corner1B corner2B))
capture :: Behavior inp XV.ImageRGB -> XV.ColorSelector -> Event inp XV.ImageRGB
capture ims c = snapshotE_ (whenE (lift2 change posB pos2B <* close)) ims
where
posB = lift2 XV.stepBlob ims (lift0 c)
pos2B = delayNB 10 posB
close = lift0 (1,1,4)
change (x1,y1,a1) (x2,y2,a2) = if (a1==0) || (a2==0)
then (100,100,100)
else (abs(x2-x1),abs(y2-y1),abs(a2-a1))
delayNB 1 b = delay1B b
delayNB n b = delay1B $ delayNB (n-1) b
gesture = emptyPic `till` lbpPosE ==>
(\corner1 -> rectangle (lift0 corner1) mouseB
`till` (lbpPosE `snapshotE` inputB) ==>
(\(corner2,inp) ->
let (x1,y1)=GS.point2XYCoords corner1
(x2,y2)=GS.point2XYCoords corner2
(x,y)=(round x1,round y1)
(dx,dy)=(round (x2-x1), round (y2-y1))
im = XV.getRegion (viImage inp) x y dx dy
c = XV.getColorSelector im
subims x y x' y' = lift5 XV.getRegion imageB (lift0 x)
(lift0 y) (lift0 (x'-x))
(lift0 (y'-y))
in
rectangle (lift0 (ipoint2XY c1x c1y))
(lift0 (ipoint2XY c2x c2y))
`till` (capture (subims c1x c1y c2x c2y) c
-=> emptyPic)
))
where
(c1x,c1y,c2x,c2y) = (400,250,600,400)
imageB :: Behavior VideoInput XV.ImageRGB
imageB = lift1 viImage inputB
ipoint2XY :: Int -> Int -> Point2
ipoint2XY i1 i2 = GS.point2XY (fromInt i1) (fromInt i2)
rectangle p1 p2 = withColor white $
polyline [p1, p3, p2, p4]
where p3 = point2XY (point2XCoord p1) (point2YCoord p2)
p4 = point2XY (point2XCoord p2) (point2YCoord p1)
rectangle' p1 p2 = polyline [p1, p3, p2, p4]
where p3 = point2XY (point2XCoord p1) (point2YCoord p2)
p4 = point2XY (point2XCoord p2) (point2YCoord p1)
rect' p1 p2 = G.polyline [p1, p3, p2, p4]
where p3 = GS.point2XY (GS.point2XCoord p1) (GS.point2YCoord p2)
p4 = GS.point2XY (GS.point2XCoord p2) (GS.point2YCoord p1)
fillRectangle p1 p2 = withColor white $
polygon [p1, p3, p2, p4]
where p3 = point2XY (point2XCoord p1) (point2YCoord p2)
p4 = point2XY (point2XCoord p2) (point2YCoord p1)
main5 = test followMe
main6 = test track
mainG = test gesture
-- FVision Tasks
type VisionTask e = SimpleTask VideoInput Picture e
type IRegion = (Int,Int,Int,Int)
runVisionTask t = test (runSimpleT_ t emptyPic)
getImage :: IRegion -> VisionTask XV.ImageRGB
getImage (c1x,c1y,c2x,c2y) =
do mkTask (rectangle (lift0 (ipoint2XY c1x c1y)) (lift0 (ipoint2XY c2x c2y))) lbpE
im0 <- snapshotNowT imageB
return (XV.getRegion im0 c1x c1y (c2x-c1x) (c2y-c1y))
gesture' = do let reg1 = (400,250,520,400)
reg2 = (400,100,520,250)
reg = (400,100,600,400)
im11 <- getImage reg1
im12 <- getImage reg1
im13 <- getImage reg1
im14 <- getImage reg2
im21 <- getImage reg1
im22 <- getImage reg1
im23 <- getImage reg1
im24 <- getImage reg2
liftT $ findG [im11,im12,im13,im21,im22,im23] reg1
-- `over` findG [im12,im14,im22,im24] reg2
findG' :: [XV.ImageRGB] -> IRegion -> XV.ImageRGB -> Color
findG' temps reg im =
let [f11,f12,f13,f21,f22,f23] = map XV.compareImageInt temps
(c1x,c1y,c2x,c2y) = reg
subim = XV.getRegion im c1x c1y (c2x-c1x) (c2y-c1y)
err1 = f11 subim + f12 subim + f13 subim
err2 = f21 subim + f22 subim + f23 subim
b = unsafePerformIO $ do{ print (show err1 ++ " : " ++ show err2 ++
if (err1<err2) then " -> 1ST" else " -> 2ND"); return 5 }
in
if (b==5) then
if (err1<err2) then Red else Blue
else White
{-
findG' :: [XV.ImageRGB] -> IRegion -> XV.ImageRGB -> Color
findG' temps reg im =
let [ssd11,ssd12,ssd13,ssd21,ssd22,ssd23] = map XV.createSSDstepper temps
(c1x,c1y,c2x,c2y) = reg
subim = XV.getRegion im c1x c1y (c2x-c1x) (c2y-c1y)
err1 = XV.compareSSD ssd11 subim + XV.compareSSD ssd12 subim + XV.compareSSD ssd13 subim
err2 = XV.compareSSD ssd21 subim + XV.compareSSD ssd22 subim + XV.compareSSD ssd23 subim
b = unsafePerformIO $ do{ print (show err1 ++ " : " ++ show err2 ++
if (err1<err2) then " -> 1ST" else " -> 2ND"); return 5 }
in
if (b==5) then
if (err1<err2) then Red else Blue
else White
-}
findG temps reg =
let (c1x,c1y,c2x,c2y) = reg
rect = rectangle' (lift0 (ipoint2XY c1x c1y)) (lift0 (ipoint2XY c2x c2y))
colorB = lift1 (findG' temps reg) imageB
in
withColor colorB rect
main11 = runVisionTask gesture'
type DRegion = (Double, Double, Double, Double)
getCorner :: VisionTask Point2
getCorner = mkTask emptyPic lbpPosE
getColor :: VisionTask (XV.ColorSelector, DRegion)
getColor = do c1 <- mkTask emptyPic lbpPosE
(c2,im) <- mkTask (rectangle (lift0 c1) mouseB) lbpPosE
`snapshotT` imageB
let (x1,y1)=GS.point2XYCoords c1
(x2,y2)=GS.point2XYCoords c2
(x,y)=(round x1,round y1)
(dx,dy)=(round (x2-x1), round (y2-y1))
c = XV.getColorSelector (XV.getRegion im x y dx dy)
return (c,(x1-10.0,y1-10.0,(x2-x1+10.0),(y2-y1+10.0)))
getRegion :: XV.ImageRGB -> DRegion -> XV.ImageRGB
getRegion im (x,y,w,h) = XV.getRegion im (round x) (round y) (round w) (round h)
trackT =
do (c,reg0) <- getColor
let regB = delayB reg0 (lift2 (findRegion c) imageB regB)
f reg = let (x,y,w,h) = reg
in (GS.point2XY x y, GS.point2XY (x+w) (y+h))
(c1,c2) = pairZSplit $ lift1 f regB
liftT $ rectangle c1 c2
findRegion :: XV.ColorSelector -> XV.ImageRGB -> DRegion -> DRegion
findRegion c im reg = let (x,y,w,h) = reg
dist = 5.0
subim = getRegion im reg
(x2, y2, w2, h2) = toDouble $ XV.stepBlob2 subim c
x' = if w2<=0 then x else x+x2-dist
y' = if h2<=0 then y else y+y2-dist
w' = if w2<=0 then w else w2+2*dist
h' = if h2<=0 then h else h2+2*dist
in
(x',y',w',h')
main12 = runVisionTask trackT
toDouble :: (Float,Float,Float,Float) -> (Double,Double,Double,Double)
toDouble (a,b,c,d) = (f a, f b, f c, f d)
where f = fromInt . round
trackT2 =
do (c,reg0) <- getColor
let regB = delayB reg0 (lift2 (findRegion c) imageB regB)
f reg = let (x,y,w,h) = reg
in (GS.point2XY x y, GS.point2XY (x+w) (y+h))
g reg im = let subim = getRegion im reg
(x0,y0,w0,h0) = reg
regs = map (\(x2,y2,w2,h2) -> (x0+x2,y0+y2,w2,h2))
(XV.blobRegions c subim)
hck = unsafePerformIO $ do { print regs; return 5 }
in
-- map f regs
if hck==5 then map f regs
else error "debug"
rects [] = G.emptyPic
rects ((p1,p2):ps) = G.over (rect' p1 p2) (rects ps)
liftT $ withColor red $ lift1 rects (lift2 g regB imageB)
main14 = runVisionTask trackT2
main13 = test (dotAt red (fstZ pos_v) `over`
dotAt blue mouseB)
pos_v :: VBehavior (Point2,Vector2)
pos_v = delayB center (lift2 f pos_v mouseB)
where
center = (GS.point2XY 320 240, GS.zeroVector)
f (p,v) p2 = (p GS..+^ (speed GS.*^ GS.normalize newv), newv)
where
vec = p GS..-.p2
newv = if GS.magnitude vec < radius then vec GS.^+^ oldv else oldv
oldv = friction GS.*^ v
radius = GS.magnitude (GS.Vector2XY 20 20)
speed = 5
friction = 0.5
| jatinshah/autonomous_systems | project/fvision.hugs/fvtests.hs | mit | 10,742 | 0 | 22 | 3,979 | 3,850 | 2,045 | 1,805 | 194 | 5 |
main = print $ foldl1 (+) [i | i <- [0..(1000 - 1)], i `mod` 3 == 0 || i `mod` 5 == 0]
| liuyang1/euler | 001.hs | mit | 87 | 0 | 13 | 24 | 68 | 38 | 30 | 1 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
-- | Effectful functions that create and convert disk image files.
module B9.DiskImageBuilder
( materializeImageSource,
substImageTarget,
preferredDestImageTypes,
preferredSourceImageTypes,
resolveImageSource,
createDestinationImage,
resizeImage,
importImage,
exportImage,
exportAndRemoveImage,
convertImage,
shareImage,
ensureAbsoluteImageDirExists,
getVirtualSizeForRawImage
)
where
import B9.Artifact.Content.StringTemplate
import B9.B9Config
import B9.B9Error
import B9.B9Exec
import B9.B9Logging
import B9.B9Monad
import B9.BuildInfo
import B9.DiskImages
import B9.Environment
import qualified B9.PartitionTable as P
import B9.RepositoryIO
import Control.Eff
import qualified Control.Exception as IO
import Control.Lens (view, (^.))
import Control.Monad
import Control.Monad.IO.Class
import qualified Data.ByteString.Char8 as Strict
import Data.Char (isDigit)
import Data.Generics.Aliases
import Data.Generics.Schemes
import Data.List
import Data.Maybe
import qualified Foreign.C.Error as IO
import qualified GHC.IO.Exception as IO
import GHC.Stack
import System.Directory
import System.FilePath
import System.IO.B9Extras
( ensureDir,
prettyPrintToFile,
)
import Text.Printf (printf)
import Text.Show.Pretty (ppShow)
-- -- | Convert relative file paths of images, sources and mounted host directories
-- -- to absolute paths relative to '_projectRoot'.
-- makeImagePathsAbsoluteToBuildDirRoot :: ImageTarget -> B9 ImageTarget
-- makeImagePathsAbsoluteToBuildDirRoot img =
-- getConfig >>= maybe (return img) (return . go) . _projectRoot
-- where
-- go rootDir = everywhere mkAbs img
-- where mkAbs = mkT
-- | Replace $... variables inside an 'ImageTarget'
substImageTarget ::
forall e.
(HasCallStack, Member EnvironmentReader e, Member ExcB9 e) =>
ImageTarget ->
Eff e ImageTarget
substImageTarget = everywhereM gsubst
where
gsubst :: GenericM (Eff e)
gsubst =
mkM substMountPoint `extM` substImage `extM` substImageSource
`extM` substDiskTarget
substMountPoint NotMounted = pure NotMounted
substMountPoint (MountPoint x) = MountPoint <$> substStr x
substImage (Image fp t fs) = Image <$> substStr fp <*> pure t <*> pure fs
substImageSource (From n s) = From <$> substStr n <*> pure s
substImageSource (EmptyImage l f t s) =
EmptyImage <$> substStr l <*> pure f <*> pure t <*> pure s
substImageSource s = pure s
substDiskTarget (Share n t s) = Share <$> substStr n <*> pure t <*> pure s
substDiskTarget (LiveInstallerImage name outDir resize) =
LiveInstallerImage <$> substStr name <*> substStr outDir <*> pure resize
substDiskTarget s = pure s
-- | Resolve an ImageSource to an 'Image'. The ImageSource might
-- not exist, as is the case for 'EmptyImage'.
resolveImageSource :: IsB9 e => ImageSource -> Eff e Image
resolveImageSource src =
case src of
(EmptyImage fsLabel fsType imgType _size) ->
let img = Image fsLabel imgType fsType
in return (changeImageFormat imgType img)
(SourceImage srcImg _part _resize) -> ensureAbsoluteImageDirExists srcImg
(CopyOnWrite backingImg) -> ensureAbsoluteImageDirExists backingImg
(From name _resize) ->
getLatestImageByName (SharedImageName name)
>>= maybe
( errorExitL
(printf "Nothing found for %s." (show (SharedImageName name)))
)
ensureAbsoluteImageDirExists
-- | Return all valid image types sorted by preference.
preferredDestImageTypes :: IsB9 e => ImageSource -> Eff e [ImageType]
preferredDestImageTypes src =
case src of
(CopyOnWrite (Image _file fmt _fs)) -> return [fmt]
(EmptyImage _label NoFileSystem fmt _size) ->
return (nub [fmt, Raw, QCow2, Vmdk])
(EmptyImage _label _fs _fmt _size) -> return [Raw]
(SourceImage _img (Partition _) _resize) -> return [Raw]
(SourceImage (Image _file fmt _fs) _pt resize) ->
return
( nub [fmt, Raw, QCow2, Vmdk]
`intersect` allowedImageTypesForResize resize
)
(From name resize) ->
getLatestImageByName (SharedImageName name)
>>= maybe
( errorExitL
(printf "Nothing found for %s." (show (SharedImageName name)))
)
( \sharedImg ->
preferredDestImageTypes (SourceImage sharedImg NoPT resize)
)
-- | Return all supported source 'ImageType's compatible to a 'ImageDestinaion'
-- in the preferred order.
preferredSourceImageTypes :: HasCallStack => ImageDestination -> [ImageType]
preferredSourceImageTypes dest =
case dest of
(Share _ fmt resize) ->
nub [fmt, Raw, QCow2, Vmdk] `intersect` allowedImageTypesForResize resize
(LocalFile (Image _ fmt _) resize) ->
nub [fmt, Raw, QCow2, Vmdk] `intersect` allowedImageTypesForResize resize
Transient -> [Raw, QCow2, Vmdk]
(LiveInstallerImage _name _repo _imgResize) -> [Raw]
allowedImageTypesForResize :: HasCallStack => ImageResize -> [ImageType]
allowedImageTypesForResize r =
case r of
Resize _ -> [Raw]
ShrinkToMinimumAndIncrease _ -> [Raw]
ShrinkToMinimum -> [Raw]
ResizeImage _ -> [Raw, QCow2, Vmdk]
KeepSize -> [Raw, QCow2, Vmdk]
-- | Create the parent directories for the file that contains the 'Image'.
-- If the path to the image file is relative, prepend '_projectRoot' from
-- the 'B9Config'.
ensureAbsoluteImageDirExists :: IsB9 e => Image -> Eff e Image
ensureAbsoluteImageDirExists img@(Image path _ _) = do
b9cfg <- getConfig
let dir =
let dirRel = takeDirectory path
in if isRelative dirRel
then
let prefix = fromMaybe "." (b9cfg ^. projectRoot)
in prefix </> dirRel
else dirRel
liftIO $ do
createDirectoryIfMissing True dir
dirAbs <- canonicalizePath dir
return $ changeImageDirectory dirAbs img
-- | Create an image from an image source. The destination image must have a
-- compatible image type and filesystem. The directory of the image MUST be
-- present and the image file itself MUST NOT alredy exist.
materializeImageSource :: IsB9 e => ImageSource -> Image -> Eff e ()
materializeImageSource src dest =
case src of
(EmptyImage fsLabel fsType _imgType size) ->
let (Image _ imgType _) = dest
in createEmptyImage fsLabel fsType imgType size dest
(SourceImage srcImg part resize) ->
createImageFromImage srcImg part resize dest
(CopyOnWrite backingImg) -> createCOWImage backingImg dest
(From name resize) ->
getLatestImageByName (SharedImageName name)
>>= maybe
( errorExitL
(printf "Nothing found for %s." (show (SharedImageName name)))
)
( \sharedImg ->
materializeImageSource (SourceImage sharedImg NoPT resize) dest
)
createImageFromImage ::
IsB9 e => Image -> Partition -> ImageResize -> Image -> Eff e ()
createImageFromImage src part size out = do
importImage src out
extractPartition part out
resizeImage size out
where
extractPartition :: IsB9 e => Partition -> Image -> Eff e ()
extractPartition NoPT _ = return ()
extractPartition (Partition partIndex) (Image outFile Raw _) = do
(start, len, blockSize) <- liftIO (P.getPartition partIndex outFile)
let tmpFile = outFile <.> "extracted"
dbgL (printf "Extracting partition %i from '%s'" partIndex outFile)
cmd
( printf
"dd if='%s' of='%s' bs=%i skip=%i count=%i &> /dev/null"
outFile
tmpFile
blockSize
start
len
)
cmd (printf "mv '%s' '%s'" tmpFile outFile)
extractPartition (Partition partIndex) (Image outFile fmt _) =
error
( printf
"Extract partition %i from image '%s': Invalid format %s"
partIndex
outFile
(imageFileExtension fmt)
)
-- | Convert some 'Image', e.g. a temporary image used during the build phase
-- to the final destination.
createDestinationImage :: IsB9 e => Image -> ImageDestination -> Eff e ()
createDestinationImage buildImg dest =
case dest of
(Share name imgType imgResize) -> do
resizeImage imgResize buildImg
let shareableImg = changeImageFormat imgType buildImg
exportAndRemoveImage buildImg shareableImg
void (shareImage shareableImg (SharedImageName name))
(LocalFile destImg imgResize) -> do
resizeImage imgResize buildImg
exportAndRemoveImage buildImg destImg
(LiveInstallerImage name repo imgResize) -> do
resizeImage imgResize buildImg
let destImg = Image destFile Raw buildImgFs
(Image _ _ buildImgFs) = buildImg
destFile =
repo </> "machines" </> name </> "disks" </> "raw" </> "0.raw"
sizeFile =
repo </> "machines" </> name </> "disks" </> "raw" </> "0.size"
versFile =
repo </> "machines" </> name </> "disks" </> "raw" </> "VERSION"
exportAndRemoveImage buildImg destImg
eitherSize <- getVirtualSizeForRawImage destFile
case eitherSize of
Left err -> error err
Right value -> liftIO (writeFile sizeFile (show value))
buildDate <- getBuildDate
buildId <- getBuildId
liftIO (writeFile versFile (buildId ++ "-" ++ buildDate))
Transient -> return ()
-- | Determine the virtual size of a raw image
getVirtualSizeForRawImage :: (IsB9 e) => FilePath -> Eff e (Either String Integer)
getVirtualSizeForRawImage file = do
outPut <- cmdStdout (printf "qemu-img info -f raw '%s'" file)
return (getVirtualSizeFromQemuImgInfoOutput outPut)
getVirtualSizeFromQemuImgInfoOutput :: Strict.ByteString -> Either String Integer
getVirtualSizeFromQemuImgInfoOutput qemuOutput = case filter (Strict.isPrefixOf (Strict.pack "virtual size")) (Strict.lines qemuOutput) of
[] -> Left ("no line starting with 'virtual size' in output while parsing " <> Strict.unpack qemuOutput)
(_ : _ : _) -> Left ("multiple lines starting with 'virtual size' in output" <> Strict.unpack qemuOutput)
[x] -> let (digits, rest) = (Strict.span isDigit . Strict.drop 1 . Strict.dropWhile (/= '(')) x
in
if Strict.isPrefixOf (Strict.pack " bytes)") rest
then Right (read (Strict.unpack digits))
else Left ("rest after digits didn't continue in ' bytes)'" <> Strict.unpack qemuOutput)
createEmptyImage ::
IsB9 e =>
String ->
FileSystem ->
ImageType ->
ImageSize ->
Image ->
Eff e ()
createEmptyImage fsLabel fsType imgType imgSize dest@(Image _ imgType' fsType')
| fsType /= fsType' =
error
( printf
"Conflicting createEmptyImage parameters. Requested is file system %s but the destination image has %s."
(show fsType)
(show fsType')
)
| imgType /= imgType' =
error
( printf
"Conflicting createEmptyImage parameters. Requested is image type %s but the destination image has type %s."
(show imgType)
(show imgType')
)
| otherwise = do
let (Image imgFile imgFmt imgFs) = dest
qemuImgOpts = conversionOptions imgFmt
dbgL
( printf
"Creating empty raw image '%s' with size %s and options %s"
imgFile
(toQemuSizeOptVal imgSize)
qemuImgOpts
)
cmd
( printf
"qemu-img create -f %s %s '%s' '%s'"
(imageFileExtension imgFmt)
qemuImgOpts
imgFile
(toQemuSizeOptVal imgSize)
)
case (imgFmt, imgFs) of
(Raw, Ext4_64) -> do
let fsCmd = "mkfs.ext4"
dbgL (printf "Creating file system %s" (show imgFs))
cmd (printf "%s -F -L '%s' -O 64bit -q '%s'" fsCmd fsLabel imgFile)
(Raw, Ext4) -> do
ext4Options <- view ext4Attributes <$> getB9Config
let fsOptions = "-O " <> intercalate "," ext4Options
let fsCmd = "mkfs.ext4"
dbgL (printf "Creating file system %s" (show imgFs))
cmd (printf "%s -F -L '%s' %s -q '%s'" fsCmd fsLabel fsOptions imgFile)
(imageType, fs) ->
error
( printf
"Cannot create file system %s in image type %s"
(show fs)
(show imageType)
)
createCOWImage :: IsB9 e => Image -> Image -> Eff e ()
createCOWImage (Image backingFile _ _) (Image imgOut imgFmt _) = do
dbgL (printf "Creating COW image '%s' backed by '%s'" imgOut backingFile)
cmd
( printf
"qemu-img create -f %s -o backing_file='%s' '%s'"
(imageFileExtension imgFmt)
backingFile
imgOut
)
resizeExtFS :: (IsB9 e) => ImageSize -> FilePath -> Eff e ()
resizeExtFS newSize img = do
let sizeOpt = toQemuSizeOptVal newSize
dbgL (printf "Resizing ext4 filesystem on raw image to %s" sizeOpt)
cmd (printf "e2fsck -p '%s'" img)
cmd (printf "resize2fs -f '%s' %s" img sizeOpt)
shrinkToMinimumExtFS :: (IsB9 e) => FilePath -> Eff e ()
shrinkToMinimumExtFS img = do
dbgL "Shrinking image to minimum size"
cmd (printf "e2fsck -p '%s'" img)
cmd (printf "resize2fs -f -M '%s'" img)
-- | Resize an image, including the file system inside the image.
resizeImage :: IsB9 e => ImageResize -> Image -> Eff e ()
resizeImage KeepSize _ = return ()
resizeImage (Resize newSize) (Image img Raw fs)
| fs == Ext4 || fs == Ext4_64 = resizeExtFS newSize img
resizeImage (ShrinkToMinimumAndIncrease sizeIncrease) (Image img Raw fs)
| fs == Ext4 || fs == Ext4_64 = do
shrinkToMinimumExtFS img
fileSize <- liftIO (getFileSize img)
let newSize =
addImageSize
(bytesToKiloBytes (fromInteger fileSize))
sizeIncrease
resizeExtFS newSize img
resizeImage (ResizeImage newSize) (Image img _ _) = do
let sizeOpt = toQemuSizeOptVal newSize
dbgL (printf "Resizing image to %s" sizeOpt)
cmd (printf "qemu-img resize -q '%s' %s" img sizeOpt)
resizeImage ShrinkToMinimum (Image img Raw fs)
| fs == Ext4 || fs == Ext4_64 = shrinkToMinimumExtFS img
resizeImage _ img =
error
( printf
"Invalid image type or filesystem, cannot resize image: %s"
(show img)
)
-- | Import a disk image from some external source into the build directory
-- if necessary convert the image.
importImage :: IsB9 e => Image -> Image -> Eff e ()
importImage imgIn imgOut@(Image imgOutPath _ _) = do
alreadyThere <- liftIO (doesFileExist imgOutPath)
unless alreadyThere (convert False imgIn imgOut)
-- | Export a disk image from the build directory; if necessary convert the image.
exportImage :: IsB9 e => Image -> Image -> Eff e ()
exportImage = convert False
-- | Export a disk image from the build directory; if necessary convert the image.
exportAndRemoveImage :: IsB9 e => Image -> Image -> Eff e ()
exportAndRemoveImage = convert True
-- | Convert an image in the build directory to another format and return the new image.
convertImage :: IsB9 e => Image -> Image -> Eff e ()
convertImage imgIn imgOut@(Image imgOutPath _ _) = do
alreadyThere <- liftIO (doesFileExist imgOutPath)
unless alreadyThere (convert True imgIn imgOut)
-- | Convert/Copy/Move images
convert :: IsB9 e => Bool -> Image -> Image -> Eff e ()
convert doMove (Image imgIn fmtIn _) (Image imgOut fmtOut _)
| imgIn == imgOut = do
ensureDir imgOut
dbgL (printf "No need to convert: '%s'" imgIn)
| doMove && fmtIn == fmtOut = do
ensureDir imgOut
dbgL (printf "Moving '%s' to '%s'" imgIn imgOut)
liftIO $ do
let exdev e =
if IO.ioe_errno e == Just ((\(IO.Errno a) -> a) IO.eXDEV)
then copyFile imgIn imgOut >> removeFile imgIn
else IO.throw e
renameFile imgIn imgOut `IO.catch` exdev
| otherwise = do
ensureDir imgOut
dbgL
( printf
"Converting %s to %s: '%s' to '%s'"
(imageFileExtension fmtIn)
(imageFileExtension fmtOut)
imgIn
imgOut
)
cmd
( printf
"qemu-img convert -q -f %s -O %s %s '%s' '%s'"
(imageFileExtension fmtIn)
(imageFileExtension fmtOut)
(conversionOptions fmtOut)
imgIn
imgOut
)
when doMove $ do
dbgL (printf "Removing '%s'" imgIn)
liftIO (removeFile imgIn)
conversionOptions :: ImageType -> String
conversionOptions Vmdk = " -o adapter_type=lsilogic "
conversionOptions QCow2 = " -o compat=1.1,lazy_refcounts=on "
conversionOptions _ = " "
toQemuSizeOptVal :: ImageSize -> String
toQemuSizeOptVal (ImageSize amount u) =
show amount
++ case u of
GB -> "G"
MB -> "M"
KB -> "K"
-- | Publish an sharedImage made from an image and image meta data to the
-- configured repository
shareImage :: IsB9 e => Image -> SharedImageName -> Eff e SharedImage
shareImage buildImg sname@(SharedImageName name) = do
sharedImage <- createSharedImageInCache buildImg sname
infoL (printf "SHARED '%s'" name)
pushToSelectedRepo sharedImage
return sharedImage
-- TODO Move the functions below to RepositoryIO???
-- | Return a 'SharedImage' with the current build data and build id from the
-- name and disk image.
getSharedImageFromImageInfo ::
IsB9 e => SharedImageName -> Image -> Eff e SharedImage
getSharedImageFromImageInfo name (Image _ imgType imgFS) = do
buildId <- getBuildId
date <- getBuildDate
return
( SharedImage
name
(SharedImageDate date)
(SharedImageBuildId buildId)
imgType
imgFS
)
-- | Convert the disk image and serialize the base image data structure.
-- If the 'maxLocalSharedImageRevisions' configuration is set to @Just n@
-- also delete all but the @n - 1@ newest images from the local cache.
createSharedImageInCache ::
IsB9 e => Image -> SharedImageName -> Eff e SharedImage
createSharedImageInCache img sname@(SharedImageName name) = do
dbgL (printf "CREATING SHARED IMAGE: '%s' '%s'" (ppShow img) name)
sharedImg <- getSharedImageFromImageInfo sname img
dir <- getSharedImagesCacheDir
convertImage img (changeImageDirectory dir (sharedImageImage sharedImg))
prettyPrintToFile (dir </> sharedImageFileName sharedImg) sharedImg
dbgL (printf "CREATED SHARED IMAGE IN CACHE '%s'" (ppShow sharedImg))
cleanOldSharedImageRevisionsFromCache sname
return sharedImg
--
--
--
--
--
--
-- imgDir <- getSharedImagesCacheDir
-- let filesToDelete = (imgDir </>) <$> (infoFiles ++ imgFiles)
-- infoFiles = sharedImageFileName <$> toDelete
-- imgFiles = imageFileName . sharedImageImage <$> toDelete
-- unless (null filesToDelete) $ do
-- traceL
-- ( printf
-- "DELETING %d OBSOLETE REVISIONS OF: %s"
-- (length filesToDelete)
-- (show sn)
-- )
-- mapM_ traceL filesToDelete
-- mapM_ removeIfExists filesToDelete
-- where
-- newestSharedImages :: IsB9 e => Eff e [SharedImage]
-- newestSharedImages =
-- reverse . map snd
-- <$> lookupSharedImages (== Cache) ((sn ==) . sharedImageName)
-- removeIfExists fileName = liftIO $ removeFile fileName `catch` handleExists
-- where
-- handleExists e
-- | isDoesNotExistError e = return ()
-- | otherwise = throwIO e
--
| sheyll/b9-vm-image-builder | src/lib/B9/DiskImageBuilder.hs | mit | 19,278 | 0 | 23 | 4,686 | 4,732 | 2,348 | 2,384 | -1 | -1 |
module Graphics.Urho3D.UI.Internal.FileSelector(
FileSelector
, fileSelectorCntx
, sharedFileSelectorPtrCntx
, weakFileSelectorPtrCntx
, SharedFileSelector
, WeakFileSelector
, FileSelectorEntry(..)
, HasName(..)
, HasDirectory(..)
) where
import Control.Lens
import GHC.Generics
import Graphics.Urho3D.Container.Ptr
import qualified Data.Map as Map
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Context as C
import qualified Language.C.Types as C
-- resolve lens fields
import Graphics.Urho3D.Graphics.Internal.Skeleton
-- | File selector dialog
data FileSelector
-- | File selector's list entry (file or directory.)
data FileSelectorEntry = FileSelectorEntry {
_fileSelectorEntryName :: !String -- ^ Name
, _fileSelectorEntryDirectory :: !Bool -- ^ Directory flag
} deriving (Generic)
makeFields ''FileSelectorEntry
fileSelectorCntx :: C.Context
fileSelectorCntx = mempty {
C.ctxTypesTable = Map.fromList [
(C.TypeName "FileSelector", [t| FileSelector |])
, (C.TypeName "FileSelectorEntry", [t| FileSelectorEntry |])
]
}
sharedPtrImpl "FileSelector"
sharedWeakPtrImpl "FileSelector"
| Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Internal/FileSelector.hs | mit | 1,165 | 0 | 11 | 172 | 232 | 150 | 82 | -1 | -1 |
module Main where
import System.Environment
import Lib
main :: IO ()
main = do
env <- getEnvironment
let port = maybe 3000 read $ lookup "PORT" env
startApp port
| aaronshim/whenisbad | app/Main.hs | mit | 170 | 0 | 11 | 37 | 63 | 31 | 32 | 8 | 1 |
module System.AtomicWrite.Writer.Text.BinarySpec (spec) where
import Test.Hspec (Spec, describe, it,
shouldBe)
import System.AtomicWrite.Writer.Text.Binary (atomicWriteFile,
atomicWriteFileWithMode)
import System.FilePath.Posix (joinPath)
import System.IO.Temp (withSystemTempDirectory)
import System.PosixCompat.Files (fileMode, getFileStatus,
setFileCreationMask,
setFileMode)
import Data.Text (pack)
spec :: Spec
spec = do
describe "atomicWriteFile" $ do
it "writes contents to a file" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let path = joinPath [ tmpDir, "writeTest.tmp" ]
atomicWriteFile path $ pack "just testing"
contents <- readFile path
contents `shouldBe` "just testing"
it "preserves the permissions of original file, regardless of umask" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let filePath = joinPath [tmpDir, "testFile"]
writeFile filePath "initial contents"
setFileMode filePath 0o100644
newStat <- getFileStatus filePath
fileMode newStat `shouldBe` 0o100644
-- New files are created with 100600 perms.
_ <- setFileCreationMask 0o100066
-- Create a new file once different mask is set and make sure that mask
-- is applied.
writeFile (joinPath [tmpDir, "sanityCheck"]) "with sanity check mask"
sanityCheckStat <- getFileStatus $ joinPath [tmpDir, "sanityCheck"]
fileMode sanityCheckStat `shouldBe` 0o100600
-- Since we move, this makes the new file assume the filemask of 0600
atomicWriteFile filePath $ pack "new contents"
resultStat <- getFileStatus filePath
-- reset mask to not break subsequent specs
_ <- setFileCreationMask 0o100022
-- Fails when using atomic mv command unless apply perms on initial file
fileMode resultStat `shouldBe` 0o100644
it "creates a new file with permissions based on active umask" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let
filePath = joinPath [tmpDir, "testFile"]
sampleFilePath = joinPath [tmpDir, "sampleFile"]
-- Set somewhat distinctive defaults for test
_ <- setFileCreationMask 0o100171
-- We don't know what the default file permissions are, so create a
-- file to sample them.
writeFile sampleFilePath "I'm being written to sample permissions"
newStat <- getFileStatus sampleFilePath
fileMode newStat `shouldBe` 0o100606
atomicWriteFile filePath $ pack "new contents"
resultStat <- getFileStatus filePath
-- reset mask to not break subsequent specs
_ <- setFileCreationMask 0o100022
-- The default tempfile permissions are 0600, so this fails unless we
-- make sure that the default umask is relied on for creation of the
-- tempfile.
fileMode resultStat `shouldBe` 0o100606
describe "atomicWriteFileWithMode" $ do
it "writes contents to a file" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let path = joinPath [ tmpDir, "writeTest.tmp" ]
atomicWriteFileWithMode 0o100777 path $ pack "just testing"
contents <- readFile path
contents `shouldBe` "just testing"
it "changes the permissions of a previously created file, regardless of umask" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let filePath = joinPath [tmpDir, "testFile"]
writeFile filePath "initial contents"
setFileMode filePath 0o100644
newStat <- getFileStatus filePath
fileMode newStat `shouldBe` 0o100644
-- New files are created with 100600 perms.
_ <- setFileCreationMask 0o100066
-- Create a new file once different mask is set and make sure that mask
-- is applied.
writeFile (joinPath [tmpDir, "sanityCheck"]) "with sanity check mask"
sanityCheckStat <- getFileStatus $ joinPath [tmpDir, "sanityCheck"]
fileMode sanityCheckStat `shouldBe` 0o100600
-- Since we move, this makes the new file assume the filemask of 0600
atomicWriteFileWithMode 0o100655 filePath $ pack "new contents"
resultStat <- getFileStatus filePath
-- reset mask to not break subsequent specs
_ <- setFileCreationMask 0o100022
-- Fails when using atomic mv command unless apply perms on initial file
fileMode resultStat `shouldBe` 0o100655
it "creates a new file with specified permissions" $
withSystemTempDirectory "atomicFileTest" $ \tmpDir -> do
let
filePath = joinPath [tmpDir, "testFile"]
atomicWriteFileWithMode 0o100606 filePath $ pack "new contents"
resultStat <- getFileStatus filePath
fileMode resultStat `shouldBe` 0o100606
| stackbuilders/atomic-write | spec/System/AtomicWrite/Writer/Text/BinarySpec.hs | mit | 5,286 | 0 | 18 | 1,629 | 884 | 433 | 451 | 77 | 1 |
module Oracles.Flag (
Flag (..), flag, platformSupportsSharedLibs,
ghcWithSMP, ghcWithNativeCodeGen, supportsSplitObjects
) where
import Hadrian.Oracles.TextFile
import Base
import Oracles.Setting
data Flag = ArSupportsAtFile
| CrossCompiling
| GccIsClang
| GccLt44
| GccLt46
| GhcUnregisterised
| LeadingUnderscore
| SolarisBrokenShld
| SplitObjectsBroken
| SupportsThisUnitId
| WithLibdw
| UseSystemFfi
-- Note, if a flag is set to empty string we treat it as set to NO. This seems
-- fragile, but some flags do behave like this, e.g. GccIsClang.
flag :: Flag -> Action Bool
flag f = do
let key = case f of
ArSupportsAtFile -> "ar-supports-at-file"
CrossCompiling -> "cross-compiling"
GccIsClang -> "gcc-is-clang"
GccLt44 -> "gcc-lt-44"
GccLt46 -> "gcc-lt-46"
GhcUnregisterised -> "ghc-unregisterised"
LeadingUnderscore -> "leading-underscore"
SolarisBrokenShld -> "solaris-broken-shld"
SplitObjectsBroken -> "split-objects-broken"
SupportsThisUnitId -> "supports-this-unit-id"
WithLibdw -> "with-libdw"
UseSystemFfi -> "use-system-ffi"
value <- lookupValueOrError configFile key
when (value `notElem` ["YES", "NO", ""]) . error $ "Configuration flag "
++ quote (key ++ " = " ++ value) ++ "cannot be parsed."
return $ value == "YES"
platformSupportsSharedLibs :: Action Bool
platformSupportsSharedLibs = do
badPlatform <- anyTargetPlatform [ "powerpc-unknown-linux"
, "x86_64-unknown-mingw32"
, "i386-unknown-mingw32" ]
solaris <- anyTargetPlatform [ "i386-unknown-solaris2" ]
solarisBroken <- flag SolarisBrokenShld
return $ not (badPlatform || solaris && solarisBroken)
ghcWithSMP :: Action Bool
ghcWithSMP = do
goodArch <- anyTargetArch ["i386", "x86_64", "sparc", "powerpc", "arm"]
ghcUnreg <- flag GhcUnregisterised
return $ goodArch && not ghcUnreg
ghcWithNativeCodeGen :: Action Bool
ghcWithNativeCodeGen = do
goodArch <- anyTargetArch ["i386", "x86_64", "sparc", "powerpc"]
badOs <- anyTargetOs ["ios", "aix"]
ghcUnreg <- flag GhcUnregisterised
return $ goodArch && not badOs && not ghcUnreg
supportsSplitObjects :: Action Bool
supportsSplitObjects = do
broken <- flag SplitObjectsBroken
ghcUnreg <- flag GhcUnregisterised
goodArch <- anyTargetArch [ "i386", "x86_64", "powerpc", "sparc" ]
goodOs <- anyTargetOs [ "mingw32", "cygwin32", "linux", "darwin", "solaris2"
, "freebsd", "dragonfly", "netbsd", "openbsd" ]
return $ not broken && not ghcUnreg && goodArch && goodOs
| izgzhen/hadrian | src/Oracles/Flag.hs | mit | 2,920 | 0 | 14 | 840 | 605 | 316 | 289 | 64 | 12 |
module Language.Binal.StyleGuidance where
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.State
import qualified Text.Trifecta as T
import qualified Text.Trifecta.Delta as D
import Language.Binal.Types
import qualified Language.Binal.Parser as P
type StyleGuidance a = StateT [Where] T.Parser a
isStyleError :: StyleError -> Bool
isStyleError (UnexpectedEOFWhileReading _) = True
isStyleError (ExtraCloseParenthesis _) = True
isStyleError (BadToken _) = True
isStyleError (MismatchIndent _ _) = False
isStyleWarning :: StyleError -> Bool
isStyleWarning (UnexpectedEOFWhileReading _) = False
isStyleWarning (ExtraCloseParenthesis _) = False
isStyleWarning (BadToken _) = False
isStyleWarning (MismatchIndent _ _) = True
styleErrors :: [StyleError] -> [StyleError]
styleErrors = filter isStyleError
examineStyleWithinProgram :: StyleGuidance [StyleError]
examineStyleWithinProgram = do
errs1 <- examineStyle
errs2 <- concat <$> many (T.spaces *> examineExtraCloseParenthesis <* T.spaces)
return (errs1 ++ errs2)
examineStyle :: StyleGuidance [StyleError]
examineStyle = concat <$> many (T.spaces *> examineStyle1 <* T.spaces)
examineStyle1 :: StyleGuidance [StyleError]
examineStyle1 = examineStyleAtom <|> examineStyleList <|> examineBadToken
examineStyleAtom :: StyleGuidance [StyleError]
examineStyleAtom = lift P.atom >> return []
examineExtraCloseParenthesis :: StyleGuidance [StyleError]
examineExtraCloseParenthesis = do
(pos, _) <- lift (P.withPosition (T.char ')'))
return [ExtraCloseParenthesis pos]
examineBadToken :: StyleGuidance [StyleError]
examineBadToken = do
(pos, _) <- lift (P.withPosition (some (T.noneOf " \n()")))
return [BadToken pos]
examineStyleList :: StyleGuidance [StyleError]
examineStyleList = do
stack <- get
let before = case stack of
[] -> Nothing
(x:_) -> Just x
(begin, _) <- lift (P.withPosition (T.char '('))
let mkIndent =
case (before, begin) of
(Just (AtFile _ beforeL _ _ _ _), AtFile _ beginL _ _ _ _)
| beforeL == beginL -> False
| otherwise -> True
(Just (AtLine beforeL _ _ _ _), AtLine beginL _ _ _ _)
| beforeL == beginL -> False
| otherwise -> True
_ -> True
when mkIndent $ do
modify (begin:)
mismatches1 <- examineStyle
matchingParen <- lift (P.withPosition (optional (T.char ')')))
when mkIndent $ do
modify tail
let mismatches2
= case (before, begin) of
(Just b@(AtFile _ beforeL beforeC _ _ _), AtFile _ beginL beginC _ _ _)
| beforeL == beginL -> do
[]
| beforeC < beginC -> do
[]
| beforeC >= beginC -> do
[MismatchIndent b begin]
(Just b@(AtLine beforeL beforeC _ _ _), AtLine beginL beginC _ _ _)
| beforeL == beginL -> do
[]
| beforeC < beginC -> do
[]
| beforeC >= beginC -> do
[MismatchIndent b begin]
_ -> []
let mismatches3
= case matchingParen of
(_, Just _) -> []
(pos, Nothing) -> [UnexpectedEOFWhileReading pos]
return (mismatches1 ++ mismatches2 ++ mismatches3)
examineStyleFromFile :: FilePath -> IO (Maybe [StyleError])
examineStyleFromFile path = T.parseFromFile (evalStateT (examineStyleWithinProgram <* T.eof) []) path
examineStyleString :: String -> IO (Maybe [StyleError])
examineStyleString str = do
case T.parseString (evalStateT (examineStyleWithinProgram <* T.eof) []) (D.Columns 0 0) str of
T.Success x -> return (Just x)
T.Failure doc -> do
putStrLn (show doc)
return Nothing
| pasberth/binal1 | Language/Binal/StyleGuidance.hs | mit | 3,787 | 0 | 17 | 948 | 1,308 | 657 | 651 | 94 | 7 |
module Phb.Db
( module Phb.Db.Internal
, module Phb.Db.Esqueleto
, module Phb.Db.Event
, module Phb.Db.Backlog
, module Phb.Db.Customer
, module Phb.Db.Action
, module Phb.Db.Person
, module Phb.Db.PersonLogin
, module Phb.Db.Project
, module Phb.Db.Heartbeat
, module Phb.Db.Success
, module Phb.Db.Standup
, module Phb.Db.Task
, module Phb.Db.TimeLog
, module Phb.Db.WorkCategory
, module Phb.Db.Enums
) where
import Phb.Db.Action
import Phb.Db.Backlog
import Phb.Db.Customer
import Phb.Db.Enums
import Phb.Db.Esqueleto
import Phb.Db.Event
import Phb.Db.Heartbeat
import Phb.Db.Internal
import Phb.Db.Person
import Phb.Db.PersonLogin
import Phb.Db.Project
import Phb.Db.Standup
import Phb.Db.Success
import Phb.Db.Task
import Phb.Db.TimeLog
import Phb.Db.WorkCategory
| benkolera/phb | hs/Phb/Db.hs | mit | 965 | 0 | 5 | 279 | 216 | 149 | 67 | 33 | 0 |
{-# LANGUAGE OverloadedStrings #-}
-- | Style attributes.
--
-- See http://www.graphviz.org/doc/info/attrs.html#k:style for more info on graphviz styles
module Text.Dot.Attributes.Styles where
import Text.Dot.Types.Internal
-- * Style attributes
style :: AttributeName
style = "style"
-- * Style attribute values
bold :: AttributeValue
bold = "bold"
striped :: AttributeValue
striped = "striped"
filled :: AttributeValue
filled = "filled"
solid :: AttributeValue
solid = "solid"
dashed :: AttributeValue
dashed = "dashed"
dotted :: AttributeValue
dotted = "dotted"
rounded :: AttributeValue
rounded = "rounded"
-- ** Styles only for nodes
diagonals :: AttributeValue
diagonals = "diagonals"
wedged :: AttributeValue
wedged = "wedged"
| NorfairKing/haphviz | src/Text/Dot/Attributes/Styles.hs | mit | 760 | 0 | 4 | 124 | 122 | 78 | 44 | 23 | 1 |
module Main where
import Control.Concurrent
import Control.Monad
import Network
import System.IO
main = do
putStrLn "aclick client"
forever $ do
h <- connectTo "localhost" (PortNumber (fromIntegral 6666))
hGetLine h
getLine >>= hPutStrLn h
hGetLine h >>= putStrLn
hClose h
| ZerglingRush/aclick | src/Client.hs | mit | 299 | 0 | 15 | 65 | 96 | 45 | 51 | 13 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BC
import Data.FileEmbed (embedFile)
import Data.Foldable (traverse_)
import Data.List (transpose)
import Data.List.Split (chunksOf)
import Data.Maybe (fromJust)
triple :: ByteString -> [Int]
triple =
map (fst . fromJust . BC.readInt) . filter (/= "") . BC.splitWith (== ' ')
input :: ByteString
input = $(embedFile "input.txt")
triples :: [[Int]]
triples = map triple . BC.lines $ input
validTriangle :: [Int] -> Bool
validTriangle xs = (a + b) > c && (a + c) > b && (b + c) > a
where [a, b, c] = take 3 xs
countValid :: [[Int]] -> Int
countValid = length . filter validTriangle
part1 :: Int
part1 = countValid triples
part2 :: Int
part2 = countValid . concatMap (chunksOf 3) . transpose $ triples
main :: IO ()
main = traverse_ print [part1, part2]
| genos/online_problems | advent_of_code_2016/day3/src/Main.hs | mit | 1,041 | 0 | 11 | 275 | 359 | 202 | 157 | 28 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module TruthTable.Logic where
import TruthTable.Types
import TruthTable.Mapping
import Data.List (nub)
import qualified Data.Map.Strict as Map
uniqueVariables :: Statement -> [Variable]
uniqueVariables = nub . vars
where vars (StatementResult _) = []
vars (NestedStatement s) = vars s
vars (NegationStatement s) = vars s
vars (VariableStatement v) = [v]
vars (Statement s1 _ s2) = (vars s1) ++ (vars s2)
getTruthSets :: Statement -> [TruthSet]
getTruthSets = binaryToMap . uniqueVariables
lookupEither :: Ord k => k -> Map.Map k v -> Either k v
lookupEither k m = case Map.lookup k m of Just r -> Right r
Nothing -> Left k
-- | TODO: Better error handling: Change return type to
-- Either (TruthSet, Variable) Bool so we have context for the bad input
-- (can say "could not find Variable in TruthSet")
evaluateStatement :: TruthSet -> Statement -> Either Variable Bool
evaluateStatement vars s =
let eval = evaluateStatement vars in
-- ^ evaluate in the context of the current set of truth values
case s of StatementResult b -> Right b
NestedStatement stmt -> eval stmt
VariableStatement thisVar -> lookupEither thisVar vars
NegationStatement stmt -> fmap not $ eval stmt
Statement s1 op s2 -> do
let fOp = evaluateOperator op
firstResult <- eval s1
secondResult <- eval s2
return $ fOp firstResult secondResult
evaluateOperator :: Operator -> Bool -> Bool -> Bool
evaluateOperator And a b = (a && b)
evaluateOperator Or a b = (a || b)
evaluateOperator Xor a b = (a || b) && (a /= b)
catEithers :: [Either a b] -> Either [a] [b]
catEithers = foldr f (Right [])
where f (Left x) (Left cs) = Left $ x : cs
f (Left x) (Right _) = Left [x]
f (Right x) (Right ds) = Right $ x : ds
f (Right _) cs = cs
-- | TODO: should probably change Either [Variable] TruthTable to
-- Either [TruthSet] TruthTable so we can see all of the problematic input
-- instead of just getting a list of bad variables with no context
genTruthTable :: Statement -> Either [Variable] TruthTable
genTruthTable stmt = case genTruthTable' of Left vs -> Left vs
Right res -> Right . (uncurry $ TruthTable vars) . unzip $ res
where
genTruthTable' :: Either [Variable] [(TruthSet, Bool)]
genTruthTable' = catEithers allResults
vars :: [Variable]
vars = uniqueVariables stmt
inputTruthSets :: [TruthSet]
inputTruthSets = binaryToMap vars
allResults :: [Either Variable (TruthSet, Bool)]
allResults = map (\thisTruthSet ->
evaluateStatement thisTruthSet stmt >>= \r -> return (thisTruthSet, r)) inputTruthSets
| tjakway/truth-table-generator | src/TruthTable/Logic.hs | mit | 3,033 | 0 | 15 | 947 | 855 | 436 | 419 | 52 | 5 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.SQLTransaction (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.SQLTransaction
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.SQLTransaction
#else
#endif
| plow-technologies/ghcjs-dom | src/GHCJS/DOM/SQLTransaction.hs | mit | 335 | 0 | 5 | 33 | 31 | 24 | 7 | 4 | 0 |
-- |Netrium is Copyright Anthony Waite, Dave Hewett, Shaun Laurens & Contributors 2009-2018, and files herein are licensed
-- |under the MIT license, the text of which can be found in license.txt
--
{-# LANGUAGE DeriveFunctor, GADTs, PatternGuards #-}
module DecisionTreeSimplify (
decisionTreeSimple,
decisionStepWithTime,
simplifyWait
) where
import Contract
import Observable (Steps(..))
import qualified Observable as Obs
import DecisionTree
import Prelude hiding (product, until, and, id)
import Data.List hiding (and)
-- ---------------------------------------------------------------------------
-- * Apply our knowledge of time
-- ---------------------------------------------------------------------------
decisionTreeSimple :: Time -> Contract -> DecisionTree
decisionTreeSimple t c = unfoldDecisionTree
decisionStepWithTime
(initialProcessState t c)
decisionStepWithTime :: ProcessState -> (DecisionStep ProcessState, Time)
decisionStepWithTime st@(PSt time _ _) = case decisionStep st of
Done -> (Done, time)
Trade d sf t st1 -> (Trade d sf t st1, time)
Choose p id st1 st2 -> (Choose p id st1 st2, time)
ObserveCond o st1 st2 -> case Obs.eval time o of
Result True -> decisionStepWithTime st1
Result False -> decisionStepWithTime st2
_ -> (ObserveCond o st1 st2, time)
ObserveValue o k -> case Obs.eval time o of
Result v -> decisionStepWithTime (k v)
_ -> (ObserveValue o k, time)
Wait conds opts -> case simplifyWait time conds (not (null opts)) of
Left st' -> decisionStepWithTime st'
Right [] -> (Done, time)
Right conds' -> (Wait conds' opts, time)
-- The Wait action is the complicated one
--
simplifyWait :: Time
-> [(Obs Bool, Time -> ProcessState)]
-> Bool
-> Either ProcessState
[(Obs Bool, Time -> ProcessState)]
simplifyWait time conds opts =
-- Check if any conditions are currently true,
case checkCondTrue time conds of
-- if so we can run one rather than waiting.
Left k -> Left (k time)
-- If all the conditions are evermore false...
Right [] | opts -> Right [(konst False, \time' -> PSt time' [] [])]
| otherwise -> Right []
-- Otherwise, all conditions are either false or are unknown.
Right otherConds ->
-- We look at the remaining conditions and check if there is
-- a time at which one of the conditions will become true.
case Obs.earliestTimeHorizon time otherConds of
-- Of course, there may be no such time, in which case we
-- simply return a new Wait using the remaining conditions
Nothing -> Right otherConds
-- but if this time does exists (call it the time horizon)
-- then we can use it to simplify or eliminate the
-- remaining conditions.
-- Note that we also get the continuation step associated
-- with the condition that becomes true at the horizon.
Just (horizon, k) ->
-- For each remaining condition we try to simplify it
-- based on the knowledge that the time falls in the
-- range between now and the time horizon (exclusive).
-- If a condition will be false for the whole of this
-- time range then it can be eliminated.
let simplifiedConds = [ (obs', k')
| (obs, k') <- otherConds
, let obs' = Obs.simplifyWithinHorizon
time horizon obs
, not (Obs.isFalse time obs') ]
-- It is possible that all the conditions are false
-- in the time period from now up to (but not
-- including) the horizon.
in if null simplifiedConds
-- In that case the condition associated with the
-- time horizon will become true first, and we
-- can advance time to the horizon and follow its
-- associated continuation.
then if opts then Right [(at horizon, k)]
else Left (k horizon)
-- Otherwise, we return a new Wait, using the
-- simplified conditions
else Right ((at horizon, k) : simplifiedConds)
checkCondTrue :: Time -> [(Obs Bool, a)] -> Either a [(Obs Bool, a)]
checkCondTrue time conds
| ((_,k) :_) <- trueConds = Left k
| otherwise = Right otherConds'
where
(trueConds, otherConds) = partition (Obs.isTrue time . fst) conds
otherConds' = filter (not . Obs.evermoreFalse time . fst) otherConds
| netrium/Netrium | src/DecisionTreeSimplify.hs | mit | 5,104 | 0 | 21 | 1,808 | 943 | 500 | 443 | 60 | 11 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -O0 -fno-warn-missing-signatures -fno-warn-partial-type-signatures #-}
module Example.Extras where
name = "plugin"
| sboosali/simple-plugins | executables/Example/Extras.hs | mit | 165 | 0 | 4 | 17 | 13 | 9 | 4 | 4 | 1 |
module Jhc.ForeignPtr(
ForeignPtr(),
newPlainForeignPtr_,
newForeignPtr_,
mallocPlainForeignPtrAlignBytes,
mallocForeignPtrAlignBytes,
unsafeForeignPtrToPtr,
castForeignPtr,
touchForeignPtr
) where
import Jhc.Addr
import Jhc.IO
import Jhc.Prim.Rts
import Jhc.Basics
type FinalizerPtr a = FunPtr (Ptr a -> IO ())
-- not Addr_ because we need to make sure it is allocated in a real heap
-- location. The actual ForeignPtr heap location may contain more than the
-- single BitsPtr_ argument.
data ForeignPtr a = FP BitsPtr_
-- | This function creates a plain ForeignPtr from a Ptr, a plain foreignptr
-- may not have finalizers associated with it, hence this function may be pure.
newPlainForeignPtr_ :: Ptr a -> ForeignPtr a
newPlainForeignPtr_ (Ptr (Addr_ addr)) = FP addr
newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)
newForeignPtr_ ptr = fromUIO $ \w ->
case gc_new_foreignptr ptr w of
(# w', bp #) -> (# w', fromBang_ bp #)
-- | This function is similar to 'mallocForeignPtrAlignBytes', except that the
-- internally an optimised ForeignPtr representation with no finalizer is used.
-- Attempts to add a finalizer will cause the program to abort.
mallocPlainForeignPtrAlignBytes
:: Int -- ^ alignment in bytes, must be power of 2. May be zero.
-> Int -- ^ size to allocate in bytes.
-> IO (ForeignPtr a)
mallocPlainForeignPtrAlignBytes align size = fromUIO $ \w ->
case gc_malloc_foreignptr (int2word align) (int2word size) False w of
(# w', bp #) -> (# w', fromBang_ bp #)
-- | Allocate memory of the given size and alignment that will automatically be
-- reclaimed. Any Finalizers that are attached to this will run before the
-- memory is freed.
mallocForeignPtrAlignBytes
:: Int -- ^ alignment in bytes, must be power of 2. May be zero.
-> Int -- ^ size to allocate in bytes.
-> IO (ForeignPtr a)
mallocForeignPtrAlignBytes align size = fromUIO $ \w ->
case gc_malloc_foreignptr (int2word align) (int2word size) True w of
(# w', bp #) -> (# w', fromBang_ bp #)
foreign import safe ccall gc_malloc_foreignptr
:: Word -- alignment in words
-> Word -- size in words
-> Bool -- false for plain foreignptrs, true for ones with finalizers.
-> UIO (Bang_ (ForeignPtr a))
foreign import safe ccall gc_new_foreignptr ::
Ptr a -> UIO (Bang_ (ForeignPtr a))
foreign import unsafe ccall gc_add_foreignptr_finalizer
:: Bang_ (ForeignPtr a)
-> FinalizerPtr a
-> IO ()
unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a
unsafeForeignPtrToPtr (FP x) = Ptr (Addr_ x)
touchForeignPtr :: ForeignPtr a -> IO ()
touchForeignPtr x = fromUIO_ (touch_ x)
castForeignPtr :: ForeignPtr a -> ForeignPtr b
castForeignPtr x = unsafeCoerce x
foreign import primitive touch_ :: ForeignPtr a -> UIO_
foreign import primitive "B2B" int2word :: Int -> Word
foreign import primitive unsafeCoerce :: a -> b
| m-alvarez/jhc | lib/jhc/Jhc/ForeignPtr.hs | mit | 2,928 | 22 | 11 | 600 | 630 | 337 | 293 | -1 | -1 |
module Main where
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import Data.List
import System.Random
fromYear :: Integer
fromYear = 1900
toYear :: Integer
toYear = 1920
supportedYears :: [Integer]
supportedYears = [fromYear .. toYear]
randomYear :: IO Integer
randomYear =
do
g <- newStdGen
return $ fst $ randomR (fromYear, toYear) g
forkDelay :: Int -> IO ()-> IO ()
forkDelay n f = replicateM_ n $ forkIO (randomDelay >> f)
main :: IO ()
main =
do
ys <- replicateM 10 randomYear
print $ nub ys
stYs <- newTVarIO $ nub ys
forkDelay 10 $ randomYear >>= \y -> atomically $ sim stYs y `orElse` return ()
randomDelay :: IO ()
randomDelay = do r <- randomRIO (3, 15)
threadDelay (r * 100000)
canTravel1 :: TVar Integer -> STM Bool
canTravel1 clientNum =
do
num <- readTVar clientNum
if num > 8
then return False
else return True
canTravel2 :: Integer -> TVar [Integer] -> STM Bool
canTravel2 y years =
do
ys <- readTVar years
return $ y `notElem` ys
sim :: TVar [Integer] -> Integer -> STM ()
sim ys y =
do
--cond1 <- canTravel1 y
cond2 <- canTravel2 y ys
if not cond2
--if not cond1 || not cond2
then retry
else return ()
| hnfmr/beginning_haskell | ex8.2/src/Main.hs | mit | 1,268 | 0 | 11 | 324 | 471 | 237 | 234 | 48 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Text.Inflections.UnderscoreSpec (spec) where
import Test.Hspec
import Text.Inflections
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
#endif
spec :: Spec
spec = describe "underscore" $
it "converts a word list to snake case" $ do
test <- SomeWord <$> mkWord "test"
this <- SomeWord <$> mkWord "this"
underscore [test, this] `shouldBe` "test_this"
| stackbuilders/inflections-hs | test/Text/Inflections/UnderscoreSpec.hs | mit | 451 | 0 | 10 | 88 | 101 | 55 | 46 | 12 | 1 |
module Example.Sorting where
import Control.Category hiding ((>>>),(<<<))
import Control.Applicative
import Prelude hiding ((.), id)
import Melchior.Control
import Melchior.Data.String
import Melchior.Dom
import Melchior.Dom.Events
import Melchior.Dom.Html
import Melchior.Dom.Selectors
import Melchior.EventSources.Mouse
import Melchior.Remote.Internal.ParserUtils --maybe more useful than an internal
import Melchior.Time
main :: IO Element
main = runDom setupSorting
setupSorting :: [Element] -> Dom Element
setupSorting html = do
inp <- Dom $ select (byId "inp" . from) html >>= \m -> return $ ensures m
ordering <- Dom $ select (byId "numbers" . from) html >>= \m -> return $ ensures m
input <- return $ createEventedSignal (Of "string") inp (ElementEvt InputEvt)
put ordering ((\_ -> qsort $ parseToNumbers $ value $ toInput inp) <$> input)
return $ UHC.Base.head html
stringListToNumbers :: String -> [Int]
stringListToNumbers s = case parse numbers s of
[] -> []
(x:xs) -> map (\x -> (read x :: Int)) (fst x)
numbers = many1 numberAndDelim
numberAndDelim = do { n <- many1 digit; space; symb "," +++ return []; return n }
parseToNumbers :: JSString -> [Int]
parseToNumbers s = stringListToNumbers $ jsStringToString s
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (pivot:rest) = (qsort lesser) ++ [pivot] ++ (qsort greater)
where
lesser = filter (< pivot) rest
greater = filter (>= pivot) rest
put :: (Renderable a) => Element -> Signal (a) -> Dom ()
put el s = terminate s (\x -> return $ set el "innerHTML" $ render x)
| kjgorman/melchior | example/assets/hs/sorting.hs | mit | 1,565 | 0 | 14 | 274 | 633 | 336 | 297 | 37 | 2 |
{-# htermination ($!) :: (a -> b) -> a -> b #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_DOLLARBANG_1.hs | mit | 48 | 0 | 2 | 12 | 3 | 2 | 1 | 1 | 0 |
module JobReport.Insert where
import Control.Monad
import Database.HDBC
import Database.HDBC.Sqlite3
import JobReport.Database
newtype InsertOptions = InsertOptions Working
deriving (Read, Show)
data Job = Job
{ jobName :: String
} deriving (Read, Show)
data Payment = Payment
{ paymentJob :: Job
, paymentYear :: Int
, paymentMonth :: Int
} deriving (Read, Show)
data Working = Working
{ workingPayment :: Payment
, workingYear :: Int
, workingMonth :: Int
, workingDay :: Int
, workingStartHour :: Int
, workingStartMinute :: Int
, workingEndHour :: Int
, workingEndMinute :: Int
} deriving (Read, Show)
insertAction :: InsertOptions -> IO ()
insertAction (InsertOptions w) = withDatabase (flip withTransaction f)
where
f c = do
insertPayment c (workingPayment w)
insertWorking c w
insertPayment :: Connection -> Payment -> IO ()
insertPayment c (Payment j y m) = void $ run c stm [toSql (jobName j), toSql y, toSql m]
where
stm = unlines
[ "INSERT OR IGNORE INTO Payment (job, year, month)"
, " SELECT id, ?2, ?3"
, " FROM Job"
, " WHERE name = ?1"
]
insertWorking :: Connection -> Working -> IO ()
insertWorking c w = void $ run c stm args
where
args =
[ toSql $ jobName $ paymentJob $ workingPayment w
, toSql $ paymentYear $ workingPayment w
, toSql $ paymentMonth $ workingPayment w
, toSql $ workingYear w
, toSql $ workingMonth w
, toSql $ workingDay w
, toSql $ workingStartHour w
, toSql $ workingStartMinute w
, toSql $ workingEndHour w
, toSql $ workingEndMinute w
]
stm = unlines
[ "INSERT INTO Working (payment, year, month, day, startHour, startMinute, endHour, endMinute)"
, " SELECT Payment.id, ?4, ?5, ?6, ?7, ?8, ?9, ?10"
, " FROM Payment"
, " INNER JOIN Job ON Job.id = Payment.job"
, " WHERE Job.name = ?1"
, " AND Payment.year = ?2"
, " AND Payment.month = ?3"
]
| haliner/jobreport | src/JobReport/Insert.hs | mit | 2,126 | 0 | 11 | 652 | 535 | 290 | 245 | 58 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.