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
| pub fn generate_layer(x: Box<ExprAST>) -> Expr<Box<ExprAST>> { | |
| match *x { | |
| ExprAST::Add(a, b) => Expr::Add(a, b), | |
| ExprAST::Sub(a, b) => Expr::Sub(a, b), | |
| ExprAST::Mul(a, b) => Expr::Mul(a, b), | |
| ExprAST::LiteralInt(x) => Expr::LiteralInt(x), | |
| } | |
| } | |
| pub fn eval_layer(node: Expr<i64>) -> i64 { |
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
| -- Note: There is a more complete explanation at https://github.com/hwayne/lets-prove-leftpad/tree/master/idris | |
| import Data.Vect | |
| -- `minus` is saturating subtraction, so this works like we want it to | |
| eq_max : (n, k : Nat) -> maximum k n = plus (n `minus` k) k | |
| eq_max n Z = rewrite minusZeroRight n in rewrite plusZeroRightNeutral n in Refl | |
| eq_max Z (S _) = Refl | |
| eq_max (S n) (S k) = rewrite sym $ plusSuccRightSucc (n `minus` k) k in rewrite eq_max n k in Refl | |
| -- The type here says "the result is" padded to (maximum k n), and is padding plus the original |
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
| image: golang:1.7 | |
| stages: | |
| - build | |
| - test | |
| before_script: | |
| - go get github.com/tools/godep | |
| - cp -r /builds/user /go/src/github.com/user/ | |
| - cd /go/src/github.com/user/repo |
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
| use std::rc::Rc; | |
| trait HKT<U> { | |
| type C; // Current type | |
| type T; // Type with C swapped with U | |
| } | |
| macro_rules! derive_hkt { | |
| ($t:ident) => { | |
| impl<T, U> HKT<U> for $t<T> { |
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
| Think Distributed Systems Summer School | |
| Providence, RI | |
| Curriculum | |
| Friday (night session, open discussion) | |
| * Background, introductions | |
| * What are you working on in distributed systems? | |
| * Lightning talks on research or open problems |
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
| -- see also | |
| -- http://apfelmus.nfshost.com/blog/2012/06/07-forklift.html | |
| module ForkLift where | |
| import Control.Concurrent | |
| import Control.Monad | |
| import Control.Monad.IO.Class | |
| import Control.Monad.Trans.State |
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 java.util.Properties | |
| import kafka.server.KafkaServer | |
| import kafka.server.KafkaConfig | |
| import kafka.producer.ProducerConfig | |
| import kafka.producer.Producer | |
| import kafka.message.Message | |
| import kafka.producer.ProducerData | |
| import kafka.consumer.ConsumerConfig | |
| import kafka.consumer.Consumer | |
| import kafka.utils.Utils |