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
| require 'rdkafka' | |
| config = { | |
| :"bootstrap.servers" => "localhost:9092" | |
| } | |
| rdkafka = Rdkafka::Config.new(config) | |
| producer = rdkafka.producer | |
| topic = "test.test_foobar" | |
| payload = '{"foo":"bar"}' |
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
| plugins { | |
| id 'java' | |
| id 'application' | |
| id "com.github.johnrengelman.shadow" version "4.0.4" | |
| } | |
| group 'com.gomlog' | |
| version '1.0-SNAPSHOT' | |
| mainClassName = 'com.gomlog.hll.benchmark.Comparison' |
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
| require 'benchmark' | |
| require 'set' | |
| # Create random topics | |
| cl = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map { |i| i.to_a }.flatten | |
| topics = ->(m) { (0..rand(m)).map{ (0..1).map { cl[rand(cl.length)] }.join }} | |
| MAX_TOPICS = [5, 10, 20, 50, 100] | |
| TRIALS = 1000000 |
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
| hostPort: localhost:port | |
| lowercaseOutputName: true | |
| lowercaseOutputLabelNames: false | |
| whitelistObjectNames: | |
| - "java.lang:*" | |
| - "org.apache.flink.jobmanager.*:*" | |
| - "org.apache.flink.taskmanager.*:*" | |
| rules: | |
| - pattern: "^java.lang.*" |
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
| 2018-04-04 15:30:58,215 WARN org.apache.flink.runtime.metrics.MetricRegistryImpl - Error while registering metric. | |
| java.lang.IllegalArgumentException: Invalid metric name: flink_jobmanager.Status.JVM.CPU_Time | |
| at org.apache.flink.shaded.io.prometheus.client.Collector.checkMetricName(Collector.java:171) | |
| at org.apache.flink.shaded.io.prometheus.client.SimpleCollector.<init>(SimpleCollector.java:163) | |
| at org.apache.flink.shaded.io.prometheus.client.Gauge.<init>(Gauge.java:68) | |
| at org.apache.flink.shaded.io.prometheus.client.Gauge$Builder.create(Gauge.java:74) | |
| at org.apache.flink.metrics.prometheus.PrometheusReporter.createCollector(PrometheusReporter.java:170) | |
| at org.apache.flink.metrics.prometheus.PrometheusReporter.notifyOfAddedMetric(PrometheusReporter.java:146) | |
| at org.apache.flink.runtime.metrics.MetricRegistryImpl.register(MetricRegistryImpl.java:319) | |
| at org.apache.flink.runtime.metrics.groups.AbstractMetricGroup.addMetric(AbstractMetri |
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
| sudo apt-get install bcmwl-kernel-source | |
| sudo apt-get install \ | |
| vim \ | |
| scratch \ | |
| leafpad \ | |
| julia \ | |
| scratch \ | |
| git \ | |
| bpython3 \ |
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
| from datetime import datetime | |
| from dateutil.relativedelta import relativedelta, SU | |
| from dateutil.rrule import rrule, WEEKLY | |
| import argparse | |
| def main(args): | |
| start = datetime.strptime(args.start_date, "%Y%m%d") | |
| today = datetime.today() | |
| rule = rrule(WEEKLY, byweekday=SU, dtstart=start, until=today) |
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 sandbox; | |
| import java.util.Set; | |
| import javax.validation.ConstraintViolation; | |
| import javax.validation.Validation; | |
| import javax.validation.Validator; | |
| import javax.validation.ValidatorFactory; | |
| import javax.validation.constraints.NotNull; |
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 math | |
| def count_seven(n): | |
| c = 0 | |
| for i in range(n+1): | |
| c += str(i).count("7") | |
| return c | |
| def count_seven_digit_num(num): | |
| digit_num = len(str(num)) - 1 |
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 main | |
| type Spannable interface { | |
| Len() int | |
| } | |
| type MyString struct { | |
| v string | |
| } | |
| type MyStringPointer struct { |
NewerOlder