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 <vector> | |
| #include <math.h> | |
| #include <algorithm> | |
| #include <stdio.h> | |
| #include <map> | |
| #define INIFINITY INT_MAX | |
| #define NEGATIVE_INFINITY INT_MIN |
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 (websok). | |
| -export ([listen/2]). | |
| lines(Str) -> | |
| regexp:split(Str,"\r\n"). | |
| isEmpty([]) -> | |
| true; | |
| isEmpty(X) -> | |
| false. |
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> | |
| <style type="text/css"> | |
| .log { | |
| color: red; | |
| } | |
| </style> | |
| <script> | |
| ws = new WebSocket("ws://localhost:8090"); |
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
| template <typename T> | |
| std::vector<T> merge(std::vector<T> A, int p, int q, int r) | |
| { | |
| using namespace std; | |
| int n1 = q-p+1; | |
| int n2 = r-q; | |
| vector<T> L = vector<T>(n1); | |
| vector<T> R = vector<T>(n2); |
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 <vector> | |
| #include <math.h> | |
| #include <algorithm> | |
| #include <stdio.h> | |
| #define print(v) for_each(v.begin(), v.end(), Print()) | |
| //============================================== | |
| struct Print { |
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
| Theorem FilterLength : | |
| forall {a:Type} (f : a -> bool) (xs : list a), | |
| length (filter f xs) <= length xs. | |
| induction xs. | |
| simpl. | |
| auto. | |
| case f. | |
| assumption. | |
| simpl. | |
| case (f a0). |
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
| Section Qsort. | |
| Require Import List. | |
| Require Import Bool. | |
| Require Import Omega. | |
| Variable A:Set. | |
| Lemma fliter_length : forall (A : Set) (l : list A) (p : A -> bool), | |
| length (filter p l) <= length l. | |
| Proof. |
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 | |
| import Network.MessagePackRpc.Server | |
| import Control.Monad | |
| import Control.Monad.IO.Class | |
| import Data.MessagePack | |
| import Data.MessagePack.Object | |
| import qualified Data.Hashable as HK |
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 | |
| import Network.MessagePackRpc.Server | |
| import Control.Monad | |
| import Control.Monad.IO.Class | |
| import Data.MessagePack | |
| import Data.MessagePack.Object | |
| import qualified Data.Hashable as HK |
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
| {-# OPTIONS_GHC -O2 -fexcess-precision -fvia-C -optc-O3 -optc-ffast-math -cpp #-} | |
| module Main where | |
| import Control.Applicative | |
| import Data.List | |
| import Data.Function (on) | |
| import Text.Printf | |
| import Control.Monad |