This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // author: Brian Mock <mock.brian@gmail.com> | |
| #include <stdio.h> | |
| typedef unsigned int uint; | |
| double clamp(double, double, double); | |
| uint pack_rgb(uint, uint, uint); | |
| uint shade_color(uint, double); | |
| void unpack_rgb(uint, uint*, uint*, uint*); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| update_interval 1 | |
| #out_to_x no | |
| out_to_console yes | |
| temperature_unit fahrenheit | |
| #temperature_unit celsius | |
| TEXT | |
| ${uptime_short}\ | |
| ::: ${mem}\ | |
| ::: ${mixer}%${if_mixer_mute} (M)${endif}\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Test where | |
| data Range | |
| = FromTo Integer Integer | |
| deriving (Eq, Ord) | |
| instance Show Range where | |
| show (FromTo x y) = show x ++ " --> " ++ show y | |
| x --> y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # vim: syn=sh: | |
| # | |
| # Sleep before doing a command | |
| SleepDo() { | |
| local time="$1" | |
| shift | |
| sleep "$time" | |
| eval "$@" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a [] = 0 | |
| a (x:xs) = x + a xs | |
| b xs = b' 0 xs | |
| where | |
| b' a [] = 0 | |
| b' a (x:xs) = b' (a+x) xs | |
| c xs = foldl (+) 0 xs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Sum where | |
| a [] = 0 | |
| a (x:xs) = x + a xs | |
| b xs = b' 0 xs | |
| where | |
| b' q [] = q | |
| b' q (x:xs) = b' (q + x) xs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module List where | |
| data List a | |
| = Null | |
| | Node (List a) a | |
| deriving (Show, Eq) | |
| build = build' Null | |
| where | |
| build' Null [] = Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module BST where | |
| -- Define the BST data type | |
| data BST a | |
| = Node (BST a) (BST a) a | |
| | Tip | |
| deriving (Show, Eq) | |
| -- Make a leaf node | |
| leaf y = Node Tip Tip y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module List where | |
| data List a | |
| = Null | |
| | Node (List a) a | |
| deriving (Show, Eq) | |
| build = build' Null | |
| where | |
| build' Null [] = Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| -- Define the BST data type | |
| data BST a = Node (BST a) (BST a) a | |
| | Tip | |
| deriving (Show, Eq) | |
| -- Make a leaf node | |
| leaf y = Node Tip Tip y |