class CommunicationOp << (I, #9922DD) abstract >>
CommunicationOp <|-- BaseSendOp
CommunicationOp <|-- BaseRecvOp
CommunicationOp : __init__([CommunicationOp] paired)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def balance_teams(players, n_players, balance_mode): | |
# Partition or all set of team combinations | |
possible_teams = sympy.utilities.iterables.multiset_partitions(players,2) | |
# Filter possible teams to | |
filtered_possible_teams = [] | |
for p in possible_teams: | |
if(all([len(p_)==int(n_players/2) for p_ in p])): | |
filtered_possible_teams.append(p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# status: (:error (error connection-failed failed with code 22 | |
:host 127.0.0.1 :service 61649)) | |
# point: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Lib where | |
import Control.Arrow (first, second) | |
data Dir = N | E | S | W deriving (Show, Enum, Bounded) | |
type Pos = (Int, Int) | |
data Robot = Robot Dir Pos deriving Show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flags: {} | |
packages: | |
- '.' | |
- location: | |
git: https://github.com/HeinrichApfelmus/threepenny-gui.git | |
commit: cd9e931cbd5706e8a7fd860a52e5beb9c23cabda | |
extra-dep: true | |
- location: | |
git: https://github.com/benl23x5/gloss.git | |
commit: c7a88173a08692cc9b0834604fc7d76868289eaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
demographicsAnalysis :: (MonadIO m, H.MonadR m) => Frame User -> m () | |
demographicsAnalysis fr = do | |
let demographics = fmap (rcast :: User -> Record '[HaskellExperience | |
,RecommendHaskell | |
,Occupation]) | |
(nubbed, counts) = view (runGetter ((,) <$> Getter (_1) <*> Getter _2)) | |
(unzip | |
(sortByLens (_1.recommendHaskell) | |
(sortByLens (_1.haskellExperience) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def appendWithDefault(val, lst = []): | |
lst.append(val) | |
return lst | |
val = 42 | |
mylist = appendWithDefault(val) | |
print(mylist) | |
# Does this do what you expect? | |
mylist2 = appendWithDefault(101) |