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
#!/usr/bin/env ruby | |
require "net/http" | |
require "uri" | |
require "json" | |
require "base64" | |
class Imgur | |
API_KEY = "15a6efd29935f62ea87579a8325d945a" | |
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 System.IO | |
import System.Posix | |
import Network | |
import Network.Socket hiding (accept) | |
import Data.List | |
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
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
Please try to write in here | |
Hey look it's a new line! |
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
data NumTree a b = NumNode (a, b) (Maybe [NumTree a b]) | |
| NumNil | |
deriving (Eq, Show) | |
data Tree a = Node a (Maybe [Tree a]) | |
| Nil | |
deriving (Eq, Show) | |
numberTree :: Tree a -> State Int (NumTree Int a) | |
numberTree Nil = return NumNil |
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
ncInq :: NCID -> IO (Int, Int, Int, Int) | |
ncInq ncid = do | |
alloca $ \ndims_ptr -> do | |
alloca $ \nvars_ptr -> do | |
alloca $ \natts_ptr -> do | |
alloca $ \unlimdimid_ptr -> do | |
status <- nc_inq ncid ndims_ptr nvars_ptr natts_ptr unlimdimid_ptr | |
ndims <- peek ndims_ptr | |
nvars <- peek nvars_ptr | |
natts <- peek natts_ptr |
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
ncInq :: NCID -> IO (Int, Int, Int, Int) | |
ncInq ncid = | |
alloca $ \ndims_ptr -> | |
alloca $ \nvars_ptr -> | |
alloca $ \natts_ptr -> | |
alloca $ \unlimdimid_ptr -> do | |
status <- nc_inq ncid ndims_ptr nvars_ptr natts_ptr unlimdimid_ptr | |
ndims <- peek ndims_ptr | |
nvars <- peek nvars_ptr | |
natts <- peek natts_ptr |
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
Here is a section of a message I sent to Francois-Regis Sinot regarding his paper | |
Complete Laziness: A Natural Semantics | |
http://www.lsv.ens-cachan.fr/Publis/PAPERS/PDF/sinot-wrs07.pdf | |
--------------- | |
I have simplified the problem down to this expression: | |
(\z. (\x. \y. x) (\w. z)) I I I | |
Where I is the identity function. Preprocessing, this translates to (with some manual simplifications): |