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
| {"lang":"cs","karelAndRoom":{"room":{"0":{"0":{"bricks":0,"mark":false,"inRoom":true},"1":{"bricks":0,"mark":false,"inRoom":true},"2":{"bricks":0,"mark":false,"inRoom":true},"3":{"bricks":0,"mark":false,"inRoom":true},"4":{"bricks":0,"mark":false,"inRoom":true},"5":{"bricks":0,"mark":false,"inRoom":true},"6":{"bricks":0,"mark":false,"inRoom":true},"7":{"bricks":0,"mark":false,"inRoom":true}},"1":{"0":{"bricks":0,"mark":false,"inRoom":true},"1":{"bricks":0,"mark":false,"inRoom":true},"2":{"bricks":0,"mark":false,"inRoom":true},"3":{"bricks":0,"mark":false,"inRoom":true},"4":{"bricks":0,"mark":false,"inRoom":true},"5":{"bricks":0,"mark":false,"inRoom":true},"6":{"bricks":0,"mark":false,"inRoom":true},"7":{"bricks":0,"mark":false,"inRoom":true}},"2":{"0":{"bricks":0,"mark":false,"inRoom":true},"1":{"bricks":0,"mark":false,"inRoom":true},"2":{"bricks":0,"mark":false,"inRoom":true},"3":{"bricks":0,"mark":false,"inRoom":true},"4":{"bricks":0,"mark":false,"inRoom":true},"5":{"bricks":0,"mark":false,"inRoom":true},"6 |
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 example; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| abstract class BaseBundle { | |
| protected abstract Object handleGetKey(String key); | |
| } | |
| abstract class ListResourceBundle extends BaseBundle { |
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 java.util.HashMap; | |
| import java.util.Map; | |
| abstract class BaseBundle { | |
| protected abstract Object handleGetKey(String key); | |
| } | |
| interface ExternallyLoadableBundle { | |
| default Map<String, Object> tryLoadExternal() { |
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 sys | |
| import time | |
| from PyQt5.QtCore import pyqtSlot, pyqtSignal, QThread | |
| from PyQt5.QtWidgets import QApplication, QWidget, QPushButton | |
| """ | |
| Example how to make asynchronous computation in PyQt5 | |
| """ |
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
| /** | |
| * Infers state of a combined reducer based on return types of individual reducers | |
| */ | |
| export type StateFromReducers<T> = { | |
| [K in keyof T]: T[K] extends (...args: any) => any ? ReturnType<T[K]> : T[K] | |
| }; |
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
| /** | |
| * Example how to use delegation to avoid sending unnecessary data between backend components while still | |
| * being able to send all the data to the client. | |
| * | |
| * The architecture is the following: | |
| * client -> gateway -> Array<Servers> | |
| * | |
| * We want to be able to tell the client which server the result came from without the need to include it in the dto sent between | |
| * the gateway and the server. This information should be added to the result on the gateway, but without the need to provide | |
| * a fully redundant copy of the ResponseDto class. To do this, delegation can be used. |
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 kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| import kotlinx.coroutines.runBlocking | |
| fun fac(n: Int): Int = if (n == 0) 1 else n * fac(n - 1) | |
| suspend fun calc(n: Int): Int { | |
| println("[${Thread.currentThread()}] computing fac of $n") | |
| delay(1500) | |
| return fac(n).also { |
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 kotlin.reflect.KMutableProperty | |
| import kotlin.reflect.full.declaredMemberProperties | |
| data class Person( | |
| var name: String, | |
| var age: Int, | |
| var address: Address | |
| ) | |
| data class Address( |
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 io.dkozak.inverted.index | |
| import java.util.* | |
| /** | |
| * Minimalistic example how inverted index can be implemented. | |
| * The implementation is simplified, it expects the data to be small enough to fit in memory, which might not be the case | |
| * Therefore real implementation should be much more memory efficient. | |
| * This is just an example for educational purposes | |
| */ |
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 io.dkozak.microstreams | |
| /** | |
| * A very minimalistic implementation of a subset of the Stream(Java) / Sequence(Kotlin) API | |
| */ | |
| /** | |
| * Represents a MicroStream, which is basically a chain of operations that should be performed over a collection | |
| * of data. Streams are evaluated lazily, that is until you perform a terminal operation ( which is forEach() and toList() in the current implementation), | |
| * nothing is actually executed. |
NewerOlder