CLOVIS
02/19/2020, 1:02 PMIterator
and Sequence
?Leon K
02/19/2020, 1:04 PMSequence
is lazyLeon K
02/19/2020, 2:32 PMMap<K, V>.putAllWith(other: Map<K, V>, remappingFunction: (V, V) -> V): Map<K,V>
equivalent?jojo.lichtenberger
02/19/2020, 2:58 PMpublic interface ResourceManager<R extends NodeReadOnlyTrx & NodeCursor, W extends NodeTrx & NodeCursor>
rook
02/19/2020, 5:33 PMlateinit var func: () -> Unit
has been initialized? Or, if there’s a better strategy for this, I’m open to other solutions.Chills
02/20/2020, 1:06 AM// <https://mvnrepository.com/artifact/io.ktor/ktor-client-features>
compile group: 'io.ktor', name: 'ktor-client-features', version: '1.3.0'
// <https://mvnrepository.com/artifact/io.ktor/ktor-client-json>
compile group: 'io.ktor', name: 'ktor-client-json', version: '1.3.0'
// <https://mvnrepository.com/artifact/io.ktor/ktor-client-apache>
compile group: 'io.ktor', name: 'ktor-client-apache', version: '1.3.1'
Chills
02/20/2020, 3:02 AMBurkhard
02/20/2020, 9:05 AM\u1f1e9\u1f1ea
but for some reason only the first 4 chars of each unicode codepoint are recognized as part of the character. Do I have to encode unicode codepoints as a surrogate pair if they aren’t part of the BMP or is there a better way to do this?Mikael Alfredsson
02/20/2020, 9:32 AMactivesince93
02/20/2020, 11:10 AMBernhard
02/20/2020, 12:28 PMBernhard
02/20/2020, 12:40 PMotakusenpai
02/20/2020, 1:30 PMjava.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 6
In this code
fun getMarketMap(stats: MarketStats): Map<String,MarketResponse> {
var map = mutableMapOf<String,MarketResponse>()
for(i in 0 until (stats.marketPrice.size)) {
println("$i th: ${locations[i]}")
map[locations[i]] = stats.marketPrice[i]
}
return map
}
and if possible any way to improve the codeadnigam
02/20/2020, 1:52 PMkevin.cianfarini
02/20/2020, 3:09 PMThere's a cycle in the delegation calls chain
and I'm not quite sure why. Does anyone know how to fix this?
internal class EmptyComponentModel private constructor(
override val countryCode: CountryCode,
override val saleStatus: SaleStatus,
override val price: Monetary? = null,
override val saleNotes: String? = null
) : PlacardComponentModel(ListingSaleType.Unknown) {
constructor(countryCode: CountryCode, saleStatus: SaleStatus) : this(
countryCode = countryCode,
saleStatus = saleStatus
)
}
Chills
02/20/2020, 3:53 PMBob Glamm
02/20/2020, 7:20 PMHanno
02/20/2020, 7:41 PMGyuhyeon
02/21/2020, 6:40 AMclass A {
var x: Int = 0
var y: Int = 0
constructor(x: Int) {
this.x = x
}
constructor(x: Int, y: Int) {
this(x + y)
this.y = y
}
}
is syntax error in kotlin for whatever reasonNikola Milovic
02/21/2020, 8:41 AMtjohnn
02/21/2020, 9:21 AMnull
value to a kotlin non-nullable field?elect
02/21/2020, 10:05 AMremoveIf((E) -> Boolean)
and removeAll((E)->Boolean)
?frogger
02/21/2020, 2:27 PMapi.fetchEntry(entry)
there is also a variant that returns a Future<String>
for(indexPage in api.fetchIndexIterable()) {
for(entry in indexPage) {
val document = api.fetchEntry(entry)
val changed = computeSomeChanges(document)
writeInOrder(changed)
}
}
Leon K
02/21/2020, 2:30 PMasync {}
coroutine builder and then create a list (of say, max 100 elements) from the resulting `deferred`s, then .awaitAll()
and process them. do this for as many entries as you need, maybe by chunking your entries into blocks of max-length 100 before an then just
map { async { api.fetchEntry(it) } }.awaitAll()
iex
02/21/2020, 5:27 PMdata class Flow(
val ids: List<MyId>,
val steps: MySteps
) {
constructor(ids: List<MyId>) : this(
ids,
MySteps(ids.toSteps(), ids.toSteps().first())
)
}
data class MySteps(val steps: List<MyStep>, val currentStep: MyStep)
How can I throw an error in the convenience constructor if ids
is not empty (such that it crashes before ds.toSteps().first()
?elect
02/21/2020, 6:05 PMvararg args: Any
down the function stack, in order to format later a String
. However I keep getting IllegalFormatConversionException
logDebug("WindowRef %08X", ref.id) // ref.id is an Int
fun logDebug(fmt: String, vararg args: Any) {
val toAppend = fmt.format(args) // IllegalFormatConversionException
...
}
ursus
02/21/2020, 11:55 PMHexa
02/22/2020, 11:01 AMError:(2, 44) Kotlin: Type parameter T is declared as 'in' but occurs in 'invariant' position in type SomeClass<String, T>
But it compiles when I remove the in
keyword like this: abstract class A<T>
? Given someMethod(item: SomeClass<String, T>)
takes T
as an input then using in
should work in this case?
abstract class A<in T> {
fun someMethod(item: SomeClass<String, T>) {
println(item)
}
}
open class SomeClass<K,V>(
override val entries: Set<Map.Entry<K, V>>,
override val keys: Set<K>,
override val size: Int,
override val values: Collection<V>
) : Map<K,V>{
override fun containsKey(key: K): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun containsValue(value: V): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun get(key: K): V? {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun isEmpty(): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
Piet Bronders
02/22/2020, 2:30 PMCLOVIS
02/22/2020, 8:14 PM::
notation?
fun foo(a: KClass) = ...
foo(String) // Illegal
foo(String::class) // Legal
CLOVIS
02/22/2020, 8:14 PM::
notation?
fun foo(a: KClass) = ...
foo(String) // Illegal
foo(String::class) // Legal
streetsofboston
02/22/2020, 8:41 PMString
would refer to its companion object (if it had one 😀)CLOVIS
02/23/2020, 3:46 PM