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
File = File-a File-b StatementList empty | |
File-a = '' | PackageClause | |
PackageClause = "package" identifier empty | |
empty = '' | |
File-b = '' | ImportList | |
ImportList = ImportList-a empty | |
ImportList-a = '' | ImportDeclaration ImportList-a | |
ImportDeclaration = "import" ImportDeclaration-a string_lit | |
ImportDeclaration-a = '' | identifier | |
StatementList = StatementList-a empty |
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" | |
"github.com/influxdata/flux/ast" | |
"github.com/influxdata/flux/parser" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
) |
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 | |
docker run --net host --rm byrnedo/alpine-curl -XPOST -d "$@" http://localhost:8093/query/ | |
# example query | |
# '{"query": "from(bucket: \"telegraf\") |> range(start: -10s) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_system\")"}' | |
# or (unescaped): | |
# from(bucket: "telegraf") |> range(start: -10s) |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system") |
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
################################################################################ | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
################################################################################ | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
################################################################################ | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
''' | |
Implementation of 2 Phase Commit as explained at Wikipedia: | |
https://en.wikipedia.org/wiki/Two-phase_commit_protocol | |
''' | |
import random, logging, time | |
from threading import Thread, Semaphore, Lock | |
_fmt = '%(user)s:%(levelname)s >>> %(message)s' | |
logging.basicConfig(format=_fmt) | |
LOG = logging.getLogger(__name__) |
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
from azure.storage.blob import BlockBlobService | |
from utils import get_storage_credentials | |
if __name__ == '__main__': | |
import sys, time | |
if len(sys.argv) < 2: | |
print 'Specify container name, please.' | |
sys.exit(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
import org.apache.storm.spout.SpoutOutputCollector; | |
import org.apache.storm.task.TopologyContext; | |
import org.apache.storm.topology.OutputFieldsDeclarer; | |
import org.apache.storm.topology.base.BaseRichSpout; | |
import org.apache.storm.tuple.Fields; | |
import org.apache.storm.tuple.Values; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
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 random | |
import numpy as np | |
# Ok, the point is now to create a naive | |
# bayes model and stop without accounting | |
# for the lab... | |
# We want to model for example the food. | |
# The food can be terrific, bad, not bad, good | |
# or awesome: |
NewerOlder