Skip to content

Instantly share code, notes, and snippets.

#include <vector>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <map>
#define INIFINITY INT_MAX
#define NEGATIVE_INFINITY INT_MIN
-module (websok).
-export ([listen/2]).
lines(Str) ->
regexp:split(Str,"\r\n").
isEmpty([]) ->
true;
isEmpty(X) ->
false.
<html>
<head>
<style type="text/css">
.log {
color: red;
}
</style>
<script>
ws = new WebSocket("ws://localhost:8090");
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);
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#define print(v) for_each(v.begin(), v.end(), Print())
//==============================================
struct Print {
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).
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.
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
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
{-# 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