//file.js
C = require('./C.js')
console.log(typeof C);
module.exports = function() {
//var c = new C();
return {c: new C()};
func main() { | |
addr := flag.String("addr", ":4000", "HTTPS network address") | |
certFile := flag.String("certfile", "cert.pem", "certificate PEM file") | |
keyFile := flag.String("keyfile", "key.pem", "key PEM file") | |
flag.Parse() | |
mux := http.NewServeMux() | |
mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | |
if req.URL.Path != "/" { | |
http.NotFound(w, req) |
FROM alpine:latest | |
RUN apk add -U libcap netcat-openbsd | |
RUN apk add --no-cache iptables ip6tables | |
RUN apk --no-cache add tcpdump | |
ENTRYPOINT ["sleep", "1h"] |
FROM alpine:latest | |
RUN apk add -U libcap netcat-openbsd | |
RUN apk add --no-cache iptables ip6tables | |
RUN apk --no-cache add tcpdump | |
ENTRYPOINT ["sleep", "1h"] |
public static void main(String[] args) throws IOException { | |
//create scope list with DataFlow's scopes | |
Set<String> scopeList = new HashSet<>(); | |
scopeList.addAll(DataflowScopes.all()); | |
GoogleCredentials credential = null; | |
try { | |
String curDir = Paths.get(".").toAbsolutePath().normalize().toString(); | |
FileInputStream credFile = new FileInputStream(curDir + "/secrete.json"); |
PCollection<String> lines = pipeline.apply("readDataFromGCS", | |
TextIO.read().from("gcs path") | |
.watchForNewFiles(Duration.standardMinutes(2), Watch.Growth.never())); | |
PCollection<KV<String, Map<String, String>>> filter_event = lines.apply("ParseAndFilterFn", ParDo.of(new ParseAndFilterFn())); | |
PCollection<KV<String, Map<String, String>>> minute_window_events = filter_event.apply("MinuteFixwindow", | |
Window.<KV<String, Map<String, String>>>into(FixedWindows.of(Duration.standardMinutes(3))) | |
.triggering(AfterProcessingTime | |
.pastFirstElementInPane() | |
.plusDelayOf(Duration.standardMinutes(2))) |
class RedisSink(object): | |
def __init__(self, host='localhost', port=6379, password=None, field=None): | |
self._host = host | |
self._port = port | |
self._field = field | |
self._password = password | |
self._client = None | |
self._pool = None | |
def _connect(self): |
command = { | |
'group' : { //mongodb group command | |
'ns' : 'pings', //the collection to query | |
'cond' : {'active.end' : { $gt: new Date() }}, //active.end must be in the future | |
'initial': {'count': 0}, //initialize any count object properties | |
'$reduce' : 'function(doc, out){ out.count++ }', | |
'key' : {'url': 1} //fields to group by | |
} | |
} | |
mongoose = require('mongoose'); | |
var GridStore = mongoose.mongo.GridStore, | |
Grid = mongoose.mongo.Grid, | |
ObjectID = mongoose.mongo.BSONPure.ObjectID; | |
exports.getGridFile = function(id, fn) { | |
var db = mongoose.connection.db, | |
id = new ObjectID(id), |
//file.js
C = require('./C.js')
console.log(typeof C);
module.exports = function() {
//var c = new C();
return {c: new C()};
var peopleSchema = new mongoose.Schema({ | |
name: { | |
type: String, | |
required: true, | |
minlength: 3, | |
maxlength: 25 | |
}, | |
age: Number | |
}); |