This is a vimdiff cheat sheet as a git mergetool.
]c - go to next difference
| A Whirlwind Tour of Combinatorial Games in Haskell | |
| ================================================== | |
| Combinatorial games are an interesting class of games where two | |
| players take turns to make a move, changing the game from one position | |
| to another. In these games, both players have perfect information | |
| about the state of the game and there is no element of chance. In | |
| 'normal play', the winner is declared when the other player is unable | |
| to move. A lot of famous strategy games can be analysed as | |
| combinatorial games: chess, go, tic-tac-toe. |
| #!/bin/bash | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: $0 file partSizeInMb"; | |
| exit 0; | |
| fi | |
| file=$1 | |
| if [ ! -f "$file" ]; then |
| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } |
Have you ever had to write code that made a complex series of succesive modifications to a single piece of mutable state? (Almost certainly yes.)
Did you ever wish you could make the compiler tell you if a particular operation on the state was illegal at a given point in the modifications? (If you're a fan of static typing, probably yes.)
If that's the case, the indexed state monad can help!
Motivation
| // Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement | |
| // for using the mouse displacement for calculating the amount of camera movement and panning code. | |
| using UnityEngine; | |
| using System.Collections; | |
| public class MoveCamera : MonoBehaviour | |
| { | |
| // | |
| // VARIABLES |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| ## Acer | |
| #SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0600", OWNER="<username>" | |
| ## ASUS | |
| #SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0600", OWNER="<username>" | |
| ## Dell | |
| #SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0600", OWNER="<username>" | |
| ## Foxconn |
| main :: IO () | |
| main = scotty 3000 app | |
| app :: ScottyM () | |
| app = do | |
| rcon <- liftIO $ R.connect R.defaultConnectInfo {R.connectPort = R.UnixSocket "redis.sock"} | |
| get "/favicon.ico" $ html "ಠ_ಠ" | |
| get "/:method" $ do |