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
auto socket_ = TAsyncSocket::newSocket(ev_, super::address()); | |
std::shared_ptr<HeaderClientChannel> channel | |
= HeaderClientChannel::newChannel(socket_); | |
auto client_ = std::make_shared<ClientType>(channel); | |
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
case class State[S, A](runState: S => (A, S)) { | |
def flatMap[B](f: A => State[S, B]): State[S, B] = State({ | |
s: S => | |
val (res, s1) = runState(s) | |
f(res).runState(s1) | |
}) | |
def >>=[B](f: A => State[S, B]): State[S, B] = flatMap(f) | |
def >>[B](f: State[S, B]): State[S, B] = flatMap({ _ => f }) |
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
#!/bin/bash | |
concord kill --zookeeper-hosts localhost:2181 --zookeeper-path /bolt --task-id $1 |
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
#pragma once | |
#include <chrono> | |
#include <concord/time_utils.hpp> | |
namespace bolt { | |
class SnowflakeWorker { | |
public: | |
SnowflakeWorker(const uint8_t datacenterId, const uint8_t workerId) | |
: datacenterId_(datacenterId), workerId_(workerId) {} |
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
// feel free to add a `namespace` annotation here for your chosen language | |
namespace py concord.pubsub | |
namespace rb Concord.PubSub | |
namespace cpp concord.pubsub | |
namespace java concord.pubsub | |
service PubSubBroker { | |
// subscribe / unsubscribe a new consumer to a topic | |
void subscribe(1:string topic, 2:string host, 3:i32 port); | |
void unsubscribe(1:string topic, 2:string host, 3:i32 port); |
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
usage: mediachain [-h] {ingest,list,get,history,revise,works,config} ... | |
Mediachain CLI | |
positional arguments: | |
{ingest,list,get,history,revise,works,config} | |
Mediachain subcommands | |
ingest Ingest a dataset | |
list List canonical IDs in the system | |
get Get the data for a canonical |
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
bigs@mako:~/code/L-SPACE$ mediachain history 3fab9a8b-570d-47df-9157-6fd2cf94a5e5 | |
{ | |
"canonicalID":"3fab9a8b-570d-47df-9157-6fd2cf94a5e5", | |
"revisions":[ | |
{ | |
"signatures":{}, | |
"description":"Photograph, gelatin silver print on paper", | |
"title":"Hy\u00e8res, France", | |
"author":{ | |
"external_ids":{}, |
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
// pulse threshold (v) | |
Param threshold(1.5); | |
// clock mul (pos) or div (neg) factor | |
Param factor(1); | |
History last(0.); | |
History ticks(0.); | |
History childTicks(0.); | |
History clockLength(0.); | |
History childClockLength(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 PushState where | |
import Prelude | |
import Control.Coroutine as CR | |
import Control.Coroutine.Aff as CRA | |
import Control.Monad.Aff (Aff) | |
import Control.Monad.Aff.AVar (AVAR) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Class (liftEff, class MonadEff) |
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
#lang racket | |
(define miLRco | |
(lambda (new oldL oldR lat col) | |
(cond | |
((null? lat) | |
(col '() 0 0)) | |
((eq? (car lat) oldL) | |
(miLRco new oldL oldR | |
(cdr lat) |