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
| { | |
| "AttributeDefinitions": [ | |
| { | |
| "AttributeName": "string", | |
| "AttributeType": "string" | |
| } | |
| ], | |
| "GlobalSecondaryIndexes": [ | |
| { | |
| "IndexName": "string", |
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.concurrent.atomic.AtomicReference; | |
| /* | |
| * #%L | |
| * ConcurrentStack.java | |
| * ~~ | |
| * covemarkets.com © 2018, Cove Markets, Inc. | |
| * ~~ | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. |
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 sys | |
| for buffer in sys.stdin.read(): | |
| for ch in buffer: | |
| if (ord(ch) < 128): | |
| sys.stdout.write(ch) | |
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
| package com.covemarkets.market.filter; | |
| import com.covemarkets.covelibrary.datastructures.Pair; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.Comparator; | |
| import java.util.List; | |
| import java.util.Set; | |
| import java.util.Spliterator; |
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
| # pip install websocket-client | |
| import datetime | |
| import websocket | |
| import json | |
| import sys | |
| #PRODUCTID='BTC_USD' | |
| PRODUCTID='BTC_JPY' | |
| SNAPSHOT_CHANNEL = 'lightning_board_snapshot_' + PRODUCTID |
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
| public static final class InstrumentUpdateFeedBuilder { | |
| private Set<String> supportedInstruments; | |
| private ErrorListener errorListener; | |
| private ExchangeInstrumentTranslator translator; | |
| private InstrumentRepresentationProvider relevantInstrumentInformationProvider; | |
| private InstrumentUpdateFeedBuilder() { | |
| } | |
| public static InstrumentUpdateFeedBuilder aInstrumentUpdateFeed() { |
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 networkx as nx | |
| # pip install networkx | |
| # directed graph example using networkx as a graph engine | |
| G = nx.DiGraph() | |
| roots = set() |
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
| $ bin/zookeeper-server-start.sh config/zookeeper.properties. | |
| $ bin/kafka-server-start.sh config/server.properties. | |
| $ bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testtopic | |
| $ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testtopic | |
| $ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 | |
| --topic testtopic --from-beginning |
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
| #!/usr/bin/env /bin/sh | |
| for table in book | |
| do | |
| echo ${table} | |
| aws dynamodb scan \ | |
| --table-name=${table} \ | |
| --attributes-to-get '["Count", "ScannedCount", "ConsumedCapacity"]' \ | |
| --endpoint-url http://localhost:9198 | |
| done |
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
| aws dynamodb delete-table --table-name=book --endpoint-url http://localhost:9198 | |
| aws dynamodb create-table \ | |
| --table-name=book \ | |
| --attribute-definitions \ | |
| AttributeName=Sequence,AttributeType=N \ | |
| AttributeName=InstrumentId,AttributeType=S \ | |
| AttributeName=Exchange,AttributeType=S \ | |
| AttributeName=ExchangeTime,AttributeType=N \ | |
| AttributeName=CaptureTime,AttributeType=N \ | |
| AttributeName=BookJson,AttributeType=S \ |