The Vim on the server is horribly outdated. Many of the things below won’t work, or will require extensive setup. In order to ease the pain, I suggest using the version installed and maintained by Micha via the [EBI-predoc config][config].
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
| #include <iostream> | |
| #include <functional> | |
| #include <memory> | |
| using std::function; | |
| using std::unique_ptr; | |
| template<typename A> | |
| class Maybe { | |
| public: |
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
| import Control.Monad.State | |
| data Field = Black | White | Empty deriving(Eq, Show) | |
| type Board = [Field] | |
| data Winner = PlayerBlack | PlayerWhite | NoOneYet deriving(Eq, Show) | |
| nth :: Int -> Board -> Field | |
| nth n = head . drop (n-1) | |
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
| import Control.Monad.State | |
| type Count = Int | |
| --type Sum = Int | |
| type MyState = State Count | |
| n :: Float -> Float -> MyState Float | |
| n x s = do | |
| c <- get |
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
| import Control.Monad.State | |
| import Control.Monad.Trans | |
| f :: State Int Int | |
| f = do | |
| x <- get | |
| let x' = x+1 | |
| put x' | |
| return 0 |
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
| --DECLARE @czas TABLE (czasid int) | |
| CREATE TABLE #tempczas (czasid int) | |
| INSERT INTO Czas (id,x) | |
| OUTPUT INSERTED.id INTO #tempczas(czasid) | |
| VALUES (2,5); | |
| declare @czasid int | |
| set @czasid = (select * from #tempczas) |
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
| void breaking() { | |
| std::cout << "Nice!~\n"; | |
| } | |
| std::tuple<double, double> breaking_multi() { | |
| return std::make_tuple(567.2, 2.567); | |
| } | |
| struct a_type { | |
| std::tuple<double, double> breaking_multi() { |
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
| <html> | |
| <head> | |
| <script> | |
| function preloader() { | |
| var img = new Image(); // Create new img element | |
| img.addEventListener("load", function() { | |
| var myWorker = new Worker("run.js"); | |
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
| import Text.ParserCombinators.Parsec | |
| import Text.Parsec.Numbers | |
| data Value = Kilometer Double | Mile Double | |
| value = try valKm <|> valMile | |
| valKm, valMile :: GenParser Char st Value |
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
| /* Thunk | |
| Creates a thunk representing the given closure. | |
| Since we want automatic memoization of as many expressions as possible, we | |
| use a JS object as a sort of tagged pointer, where the member x denotes the | |
| object actually pointed to. If a "pointer" points to a thunk, it has a | |
| member 't' which is set to true; if it points to a value, be it a function, | |
| a value of an algebraic type of a primitive value, it has no member 't'. | |
| */ | |
| function T(f) { |