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
module Data.BKTree ( | |
BKTree, | |
MetricSpace(..), | |
empty, | |
null, | |
size, | |
singleton, | |
insert, | |
query, |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
var push = function (value) { | |
return function (stack) { | |
var newStack = [value].concat(stack); | |
return { value:undefined, stack:newStack }; | |
}; | |
}; | |
var pop = function () { | |
return function (stack) { | |
var value = stack[0]; |
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 python | |
# -*- coding: utf-8 -*- | |
## Copyright (C) 2011 by Jiang Yio <http://inportb.com/> | |
## The latest code is available at <https://gist.github.com/962122> | |
## | |
## Permission is hereby granted, free of charge, to any person obtaining a copy | |
## of this software and associated documentation files (the "Software"), to deal | |
## in the Software without restriction, including without limitation the rights | |
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
module OpTransVec where | |
open import Data.Vec | |
open import Data.Nat | |
open import Data.Product | |
open import Relation.Binary.PropositionalEquality | |
open import Function using (_∘_) | |
data Op (A : Set) : ℕ → ℕ → Set where | |
ε : Op A 0 0 |
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
module Routing where | |
open import Function hiding (type-signature) | |
open import Data.Bool hiding (_≟_) | |
open import Data.Maybe | |
open import Data.Char hiding (_≟_) | |
open import Data.String as String | |
open import Data.List as List hiding ([_]) | |
open import Data.Product hiding (curry; uncurry) |
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
module Nicomachus where | |
open import Function | |
open import Relation.Binary.PropositionalEquality | |
import Relation.Binary.EqReasoning as EqReasoning | |
open import Data.Nat | |
open import Data.Nat.Properties | |
-- http://en.wikipedia.org/wiki/Nicomachus%27s_theorem |
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
Internet Engineering Task Force K. Zyp, Ed. | |
Internet-Draft SitePen (USA) | |
Intended status: Informational G. Court | |
Expires: February 3, 2013 August 2, 2012 | |
A JSON Media Type for Describing the Structure and Meaning of JSON |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} | |
import System.Environment (getArgs, getProgName) | |
import Control.Monad (forM_, replicateM_) | |
import Data.Binary (Binary, encode, decode) | |
import Data.Typeable (Typeable) | |
import Data.ByteString.Lazy (ByteString) | |
import Control.Concurrent (threadDelay) | |
import Data.Rank1Dynamic (toDynamic) | |
import Control.Distributed.Static | |
( Static |
OlderNewer