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
// A simple MapReduce primary implementation that supports the following RPCs: | |
// - Map(handle, mapFnId, fileName) | |
// - perform map function mapFnId on the file fileName | |
// - Reduce(handle, reduceFnId, fileName) | |
// - perform reduce function reduceFnId on the file fileName | |
// - Emit(key, value) | |
// - emit the key-value pair | |
// | |
// Usage: go run mrworkermain.go [id] [ip:port] [ip: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
// A simple MapReduce primary implementation that supports the following RPCs: | |
// val <- MapReduce(mapFnId, reduceFnId, fileName) | |
// - perform map function mapFnId and reduce function reduceFnId on the | |
// file fileName | |
// - NotifyFinished(workerId, handle) | |
// - notify the primary that the worker is done with work handle | |
// val <- IsFinished(handle) | |
// - query whether the operation is finished | |
// | |
// Usage: go run kvservicemain.go [ip:port] [num-clients] |
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
// Simple client to connect to the key-value service and exercise the | |
// key-value RPC API. | |
// | |
// Usage: go run kvclientmain.go [clientid] [clock-update-rate] [ip1:port1] ... [ipN:portN] | |
// | |
// - [clientid] : the clientid uint8 to use for this client | |
// | |
// - [ip1:port1] : the ip and TCP port of the 1st replica listening for clients | |
// - ... | |
// - [ipN:portN] : the ip and TCP port of the Nth replica listening for clients |
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
// A simple key-value store that supports four API calls over RPC: | |
// val <- get(key): execute k-v get | |
// - put(key,val) : execute k-v put | |
// val <- delete(key) : execute k-v delete, returns the value the key was associated with | |
// - newElection() : potentially elect a new primary | |
// | |
// Usage: go run kvservicemain.go [ip:port] [num-clients] | |
// | |
// - [ip:port] : the ip and TCP port on which the service will listen | |
// for connections |
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
using System; | |
using System.Collections.Generic; | |
using Microsoft.ML.Probabilistic.Distributions; | |
using Microsoft.ML.Probabilistic.Math; | |
using Microsoft.ML.Probabilistic.Models; | |
namespace ModelInference { | |
class Program { | |
static void Main(string[] args) { | |
var nIdState = new Range(4); |
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
diff --git a/src/pgo/trans/passes/type/PlusCalStatementTypeConstraintVisitor.java b/src/pgo/trans/passes/type/PlusCalStatementTypeConstraintVisitor.java | |
index 3633254..17554c8 100644 | |
--- a/src/pgo/trans/passes/type/PlusCalStatementTypeConstraintVisitor.java | |
+++ b/src/pgo/trans/passes/type/PlusCalStatementTypeConstraintVisitor.java | |
@@ -13,6 +13,7 @@ import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Map; | |
+import java.util.stream.Collectors; | |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
var iters int | |
var procs int |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"math/rand" | |
"net/http" | |
"os" | |
"strconv" |
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
version: '2' | |
services: | |
etcd1: | |
image: quay.io/coreos/etcd | |
container_name: etcd1 | |
command: > | |
etcd -name etcd1 | |
-advertise-client-urls http://172.28.128.7:2379,http://172.28.128.7:4001 | |
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 | |
-initial-advertise-peer-urls http://172.28.128.7:2380 |
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 dqueue ------------------------ | |
EXTENDS Integers, Sequences, TLC | |
(* | |
--algorithm DistributedQueue { | |
\* Globals | |
variables | |
\** @PGo{ var queue []uint64 }@PGo |
NewerOlder