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 Game where | |
import Data.List (isInfixOf, sort, nub, any) | |
newtype Available = Available String deriving (Show, Eq) | |
type Word = [Char] | |
data WordError = NothingAvailable | CharNotAvailable Char deriving (Show) | |
deleteFirst _ [] = [] |
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
useWord :: Game.Word -> AvailableChars -> Maybe AvailableChars | |
useWord [] [] = Just [] | |
useWord (a) [] = Nothing | |
useWord [] (a) = Just a | |
useWord (x:xs) (y) | |
| elem x y = useWord xs $ deleteFirst x y | |
| otherwise = Nothing |
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 Sudoku where | |
import Data.List (length, nub) | |
import Data.Matrix (Matrix, fromLists, safeSet, getRow, getCol) | |
import Data.Vector (Vector, filter, uniq) | |
type Board = Matrix (Maybe Int) | |
type Coord = (Int, Int) | |
validateVector :: Vector (Maybe Int) -> Bool |
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
checkCoord :: Board -> Coord -> Bool | |
checkCoord board (x,y) = | |
all (==True) [ | |
validateVector $ getRow x board | |
, validateVector $ getCol y board | |
] |
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
#reactapp, | |
#reactapp * { | |
align-content: stretch; | |
align-items: stretch; | |
align-self: auto; | |
animation-delay: 0s; | |
animation-direction: normal; | |
animation-duration: 0s; | |
animation-fill-mode: none; | |
animation-iteration-count: 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
Config { | |
-- appearance | |
font = "xft:Bitstream Vera Sans Mono:size=9:bold:antialias=true" | |
, bgColor = "black" | |
, fgColor = "#646464" | |
, position = Top | |
, border = BottomB | |
, borderColor = "#646464" |
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
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.Run(spawnPipe) | |
import XMonad.Util.EZConfig(additionalKeys) | |
import System.IO | |
main = do | |
xmproc <- spawnPipe "xmobar" |
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
decorations none | |
transparent false | |
dockapp_mode none | |
geometry 5x1-400+0 | |
max_geometry 5x1-325-10 | |
background "#000000" | |
kludges force_icons_size | |
grow_gravity NE | |
icon_gravity NE | |
icon_size 12 |
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
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*" | |
, borderColor = "black" | |
, border = TopB | |
, bgColor = "black" | |
, fgColor = "grey" | |
, position = TopW L 100 | |
, commands = [ Run Weather "CYVR" ["-t","<tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 | |
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 | |
, Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 | |
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert_to_chronicle_format(weights: pd.Series) -> Generator[Dict[str, Dict[str, float]], Any, None]: | |
"""Take out panelprovider on the beginning of respondents | |
index and returns generator with format suitable for | |
pychronicle | |
Args: | |
weights: Series with weightings data | |
Returns: | |
generator with dicts containing respondents weighting |