Skip to content

Instantly share code, notes, and snippets.

View kubaracek's full-sized avatar
🇨🇿

Jakub Ráček kubaracek

🇨🇿
  • Pleo.io
  • Innsbruck, Austria
View GitHub Profile
-- |
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 _ [] = []
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
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
checkCoord :: Board -> Coord -> Bool
checkCoord board (x,y) =
all (==True) [
validateVector $ getRow x board
, validateVector $ getCol y board
]
#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;
Config {
-- appearance
font = "xft:Bitstream Vera Sans Mono:size=9:bold:antialias=true"
, bgColor = "black"
, fgColor = "#646464"
, position = Top
, border = BottomB
, borderColor = "#646464"
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"
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
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
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