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 java.time.Duration | |
import javax.cache.processor.EntryProcessor | |
EntryProcessor<String, List<Map<String, Any?>>, List<Any?>> { entry, args -> | |
data class ExtParameter( | |
val function: String, | |
val historyFilter: (Map<String, Any?>) -> Boolean, |
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 --> неизменяемая ссылка на объект (в нашем случае объект типа Function | |
// transformer --> имя переменной aka имя ссылки на объект | |
// : --> разделяет имя переменной и ее тип | |
// (Int) -> String --> тип переменной, функция, принимающая (в скобочках) целое число (тип Int) и возвращающая (после стрелочки) строковый тип (String) | |
// = --> оператор присвоения значения переменной | |
// { .. } --> содержат функцию целиком | |
// element : Int --> аргумент функции с именем element и типом 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
import java.util.concurrent.ThreadLocalRandom | |
fun generateTask() { | |
fun generateTask(param1: Any, param2: Any, compareOperator: String): String = | |
""" | |
Необходимо написать функцию, которая принимает два аргумента с типами ${param1::class.simpleName} | |
и ${param2::class.simpleName} и возвращает тот аргумент, который $compareOperator. | |
Далее, нужно функцию вызвать с аргументами $param1 и $param2 и вывести значение на экран в | |
следующем формате: |
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(args: Array<String>) { | |
val sum: (Int, Int) -> Int = { x: Int, y: Int -> | |
x + y | |
} | |
val print: (String) -> Unit = { println(it) } | |
print("hello") |
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 java.time.Instant | |
import java.util.* | |
fun main(args: Array<String>) { | |
var historyStructure = listOf("id", "timestamp", "subtype") | |
val list = mutableListOf<Map<String, Any?>>() | |
val event = mapOf( | |
"id" to UUID.randomUUID(), |
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 java.net.InetSocketAddress | |
import java.nio.ByteBuffer | |
import java.nio.ByteOrder | |
import java.nio.channels.FileChannel | |
import java.nio.channels.SocketChannel | |
import java.nio.file.Files | |
import java.nio.file.Path | |
import java.nio.file.StandardOpenOption.* | |
fun main(args: Array<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
package zone.bi.biplan.card | |
import io.netty.buffer.ByteBufAllocator | |
import java.net.InetSocketAddress | |
import java.net.Socket | |
import java.nio.ByteBuffer | |
object Application | |
fun main(args: Array<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
package com.github.eutkin; | |
import org.apache.ignite.Ignite; | |
import org.apache.ignite.Ignition; | |
import org.apache.ignite.cache.CacheEntryProcessor; | |
import org.apache.ignite.configuration.IgniteConfiguration; | |
import org.apache.ignite.lang.IgniteFuture; | |
import org.apache.ignite.lang.IgniteInClosure; | |
import javax.cache.processor.EntryProcessorException; |
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 zone.bi.biplan.ignite | |
import io.micronaut.context.annotation.Value | |
import io.micronaut.http.annotation.Controller | |
import io.micronaut.http.annotation.Post | |
import org.apache.ignite.Ignite | |
import org.apache.ignite.cache.CacheEntryProcessor | |
import org.slf4j.LoggerFactory | |
import reactor.core.publisher.Flux | |
import reactor.core.publisher.Mono |
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 com.github.eutkin | |
import kotlin.script.experimental.annotations.KotlinScript | |
import kotlin.script.experimental.api.* | |
import kotlin.script.experimental.host.StringScriptSource | |
import kotlin.script.experimental.jvm.dependenciesFromCurrentContext | |
import kotlin.script.experimental.jvm.jvm | |
import kotlin.script.experimental.jvmhost.BasicJvmScriptingHost | |
import kotlin.script.experimental.jvmhost.createJvmCompilationConfigurationFromTemplate |