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
Copyright 2018 Dominik Liebler | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O |
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
Process.flag(:trap_exit, true) | |
current = self() | |
spawn(fn -> send(current, {self(), 1 + 1}); exit(:no_normal_exit) end) | |
defmodule Foobar do | |
def foo(current) do | |
receive do | |
{current, n} -> IO.puts "Result: #{n}"; foo(current) | |
{:EXIT, pid, reason} -> IO.puts "EXIT with #{reason}" |
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
def aliases do | |
[ | |
"ensure_consistency": ["test", "dialyzer", "credo --strict", "inch", "coveralls"] | |
] | |
end | |
def project do | |
[ | |
app: :belief_structure, | |
aliases: aliases(), |
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
tasks.withType<Jar> { | |
manifest { | |
attributes["Main-Class"] = "com.example.MainKt" | |
} | |
} |
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
fun primes(): Sequence<Long> { | |
var i = 0L | |
return sequence { | |
generateSequence { i++ } | |
.filter { n -> n > 1 && ((2 until n).none { i -> n % i == 0L }) } | |
.forEach { yield(it) } | |
} | |
} |
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
/*.o | |
/example |
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
{"lastUpload":"2021-10-26T13:10:18.801Z","extensionVersion":"v3.4.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
fun main() { | |
val config = mapOf( | |
"bootstrap.servers" to "localhost:9092", | |
"schema.registry.url" to "http://localhost:8081", | |
"key.serializer" to "org.apache.kafka.common.serialization.StringSerializer", | |
"value.serializer" to "io.confluent.kafka.serializers.KafkaAvroSerializer", | |
) | |
val consumer = KafkaConsumer<String, Cats>(config) | |
consumer.subscribe(listOf("cats")) |
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
.whatever { | |
animation-name: color-transition; | |
animation-duration: 25s; | |
animation-direction: alternate; | |
animation-iteration-count: infinite; | |
animation-timing-function: linear; | |
} | |
@keyframes color-transition { | |
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
class ParquetWriter<T : SpecificRecord>(private val outputFile: String, schema: Schema, conf: Configuration) { | |
private var closed = false | |
private val writer by lazy { | |
val timeSupport = GenericData().also { | |
it.addLogicalTypeConversion(TimeConversions.DateConversion()) | |
} | |
AvroParquetWriter.builder<T>(HadoopOutputFile.fromPath(Path(outputFile), conf)) | |
.withSchema(schema) |
OlderNewer