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
blueprint: | |
name: Aqara TRV E1 External Temperature Control | |
description: > | |
This automation allows the Aqara TRV E1 Smart Radiator Thermostat to use temperature readings from an external sensor rather than its internal sensor. Whenever the temperature sensor reports a new value, it is sent to the TRV for more accurate climate control. | |
domain: automation | |
source_url: "https://gist.github.com/pavax/8d6ed250765d89cb281d4a1762b8d2e8" | |
input: | |
external_temp_sensor: | |
name: External Temperature Sensor |
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
val stream = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](job.ssc, kafkaParams, topics) | |
stream.foreachRDD(rdd => | |
import sparkSession.implicits._ | |
val offsetRanges = rdd.asInstanceOf[HasOffsetRanges].offsetRanges | |
val df = rdd.toDF() | |
df.write.format("sequence").mode("append").save(s"$workDir/$targetFile") | |
stream.asInstanceOf[CanCommitOffsets].commitAsync(offsetRanges) | |
}) |
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
class RDDMultipleTextOutputFormat extends MultipleTextOutputFormat[Any, Any] { | |
override def generateActualKey(key: Any, value: Any): Any = | |
NullWritable.get() | |
override def generateFileNameForKeyValue(key: Any, value: Any, name: String): String = { | |
key.asInstanceOf[String] | |
} | |
} |
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
CREATE TABLE events ( | |
created TIMESTAMP, | |
user STRING, | |
time STRING, | |
request STRING, | |
status STRING, | |
size STRING, | |
referer STRING | |
) PARTITION BY ( | |
year INT, |
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
case class T(x: Int, y: Int) | |
val tOrdering = Ordering.fromLessThan[T](_.x > _.x) | |
var tree = scala.collection.immutable.TreeSet.empty(tOrdering) | |
tree = tree + T(10,2) | |
tree = tree + T(1,2) | |
tree = tree + T(1,3) | |
tree = tree + T(5,3) |
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
Statistical profiling result from v8.log, (5361 ticks, 46 unaccounted, 0 excluded). | |
[Unknown]: | |
ticks total nonlib name | |
46 0.9% | |
[Shared libraries]: | |
ticks total nonlib name | |
3405 63.5% 0.0% /usr/local/bin/node | |
1322 24.7% 0.0% /usr/lib/system/libsystem_kernel.dylib |