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
import org.allenai.common.Config._ | |
object ClassificationReader { | |
/** Reads classifications from disk, using the given config to find the classification file(s). | |
* This requires that the config have a key {classificationType}.file for each classification | |
* type. | |
* @throws IllegalArgumentException if any of the required keys are missing | |
*/ | |
def readClassifications(config: Config): Seq[PaperClassification] = { | |
// Read a classification per file. This will generate PaperClassification instances with a |
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
implicit val intMapFormat = new JsonFormat[Map[Int, Int]] = { | |
override def write(map: Map[Int, Int]): JsValue = { | |
map.toSeq.toJson | |
} | |
override def read(json: JsValue): Map[Int, Int] = json match { | |
case value: JsArray => value.convertTo[Seq[(Int, Int)]].toMap | |
case _: => "Expected . . . " | |
} | |
} |
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
object Example { | |
val seq = Seq(1, 2, 3) | |
/////////// | |
// RIGHT // | |
/////////// | |
// You can either use parens: | |
val parens: Seq[Double] = seq.map(value => value + 1).map(value => value / 1.0) | |
// Or braces, which can look nicer for multi-line expressions: |
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
# You should always specify a full version here to ensure all of your developers | |
# are running the same version of Node. | |
FROM node:7.8.0 | |
# The base node image sets a very verbose log level. | |
ENV NPM_CONFIG_LOGLEVEL warn | |
# Copy all local files into the image. | |
COPY . . |
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
# Items that don't need to be in a Docker image. | |
# Anything not used by the build system should go here. | |
Dockerfile | |
.dockerignore | |
.gitignore | |
README.md | |
# Artifacts that will be built during image creation. | |
# This should contain all files created during `npm run build`. | |
build |
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
# You should always specify a full version here to ensure all of your developers | |
# are running the same version of Node. | |
FROM node:7.8.0 | |
# Override the base log level (info). | |
ENV NPM_CONFIG_LOGLEVEL warn | |
# Install and configure `serve`. | |
RUN npm install -g serve | |
CMD serve -s build |
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
kind: Deployment | |
metadata: | |
name: echo-service | |
labels: | |
application: echo-service | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
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
# Service definition for a http/https service. | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: echo-service | |
annotations: | |
# Note that the backend talks over HTTP. | |
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http | |
# TODO: Fill in with the ARN of your certificate. | |
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:{region}:{user id}:certificate/{id} |
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
kind: Deployment | |
metadata: | |
name: echo-service | |
labels: | |
application: echo-service | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
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
# Vim swap files. | |
.*.sw[p-z] | |
# Emacs backups. | |
*~ | |
# OS X cache files. | |
.DS_Store | |
.Trashes | |
.Spotlight-V100 |
OlderNewer