halirutan
03/08/2019, 6:40 AMis Base
. Something along val clazzes : MutableSet< ???> = ...
and then e.g. clazzes.forEach { c -> if(obj is c){..}}
. How can I do that?4ntoine
03/08/2019, 12:23 PMSiva
03/08/2019, 1:13 PMmarcinmoskala
03/08/2019, 4:12 PMamadeu01
03/08/2019, 4:23 PMGianpaolo
03/08/2019, 4:32 PMigor.wojda
03/08/2019, 9:58 PM// now
listOf(
listOf(1, 2),
listOf(3, 4)
)
// want
listOf(
listOf(3, 1),
listOf(4, 2)
)
basher
03/08/2019, 11:15 PMdata class
, but ended up being unused?LeoColman
03/09/2019, 4:11 AMzsmb
03/09/2019, 5:55 PM@Deprecated(level = ERROR, ...)
, or even HIDDEN
, but still use it in my own code somehow? Seems like I can only suppress the WARNING
level of deprecation.Cihan Soylular
03/09/2019, 6:44 PMgroostav
03/09/2019, 10:11 PMProcessBuilder.start()
is somehow intrinsically labeled (annotated?) as Blocking (@Blocking
?), which is simply wrong. I have no idea how to find out where this metadata about ProcessBuilder.start as being a blocking method is coming from, but I'd like to log it as a bug. How might I do that?kieran
03/10/2019, 10:23 AMiex
03/10/2019, 12:04 PMwhen
clause, to be used in the right side?
when {
toFoo(line) != null -> elements.add(toFoo(line)) // reuse left side result instead?
}
olegstepanov
03/10/2019, 1:53 PMval String.prop
get() = object : Supplier<Int> {
override fun get(): Int = this@prop.toInt()
}
even though completion actually suggests this@prop?karelpeeters
03/10/2019, 7:51 PMNicole
03/10/2019, 8:09 PMLeoColman
03/11/2019, 2:23 AMfun bar(fn: suspend () -> Unit ) { }
fun far() {
val fn = {} // () -> Unit
bar(fn)
}
While I can easily do:
fun far() {
val fn = {}
bar { fn() }
}
sitepodmatt
03/11/2019, 2:42 AMinline fun bar(fn: () -> Unit ) {
fn()
}
class InlineSuspendExperiments : StringSpec({
"test experimenting" {
runBlocking {
bar {
delay(100)
}
}
}
})
reik.schatz
03/11/2019, 8:34 AMcount
as in: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/generate-sequence.html)mahdi_perfect
03/11/2019, 11:58 AMGiorgio Antonioli
03/11/2019, 1:44 PMLeoColman
03/11/2019, 2:15 PMval foo = firstArr.flatMap { a -> secondArr.map { b -> a to b } }
morbidmerve
03/11/2019, 3:21 PMArrayList<UserActivity>
is the type of the list. anyone have any suggestions on standard practice for ArrayLists? lets say the arrayListString looks something like {{...somefields...}, {...somefields...}, ... }
where somefields
are the fields of the UserActivity type.AndreasBackx
03/11/2019, 3:27 PM[2019-03-11 16:13:33.075] [INFO] Sending items...
[2019-03-11 16:13:35.746] [INFO] Items received...
[{"segment": 1, "tile": -1, "quality": 0}, {"segment": 1, "tile": -2, "quality": 0}, {"segment": 1, "tile": -3, "quality": 0}, {"segment": 1, "tile": -4, "quality": 0}, {"segment": 1, "tile": -5, "quality": 0}, {"segment": 1, "tile": -6, "quality": 0}, {"segment": 1, "tile": -7, "quality": 0}, {"segment": 1, "tile": -8, "quality": 0}, {"segment": 1, "tile": -9, "quality": 0}, {"segment": 1, "tile": -10, "quality": 0}, {"segment": 1, "tile": -11, "quality": 0}, {"segment": 1, "tile": -12, "quality": 0}, {"segment": 1, "tile": -13, "quality": 0}, {"segment": 1, "tile": -14, "quality": 0}, {"segment": 1, "tile": -15, "quality": 0}, {"segment": 1, "tile": -16, "quality": 0}, {"segment": 1, "tile": -17, "quality": 0}, {"segment": 1, "tile": 1, "quality": 1}, {"segment": 1, "tile": 13, "quality": 1}, {"segment": 1, "tile": 10, "quality": 1}, {"segment": 1, "tile": 9, "quality": 1}, {"segment": 1, "tile": 6, "quality": 1}, {"segment": 1, "tile": 17, "quality": 1}, {"segment": 1, "tile": 14, "quality": 1}, {"segment": 1, "tile": 5, "quality": 1}, {"segment": 1, "tile": 2, "quality": 1}, {"segment": 1, "tile": 16, "quality": 1}, {"segment": 1, "tile": 15, "quality": 1}, {"segment": 1, "tile": 4, "quality": 1}, {"segment": 1, "tile": 3, "quality": 1}, {"segment": 1, "tile": 12, "quality": 1}, {"segment": 1, "tile": 11, "quality": 1}, {"segment": 1, "tile": 8, "quality": 1}, {"segment": 1, "tile": 7, "quality": 1}]
David Cuesta
03/11/2019, 5:56 PMGlobalScope.launch {
CoroutineScope(a.context).launch {
val b = c.await()
store(b)
println("Hello")
}.join()
}
where a
is an object which contains a Coroutine context and c
is a deferred value obtained from a calling a suspend function. It never prints Hello
because there is a NullPointerException when tries to store a
. Anyone knows why is it happening?? My target is to wait until the deferred value a is completed and then store it using the store
function, which is not a suspend function.Ruckus
03/11/2019, 6:56 PMkotlin.math.ceil()
it says it returns:the smallest double value that is greater than the given valueand is a mathematical integerx
the smallest double value that is greater than or equal to the given valueand is a mathematical integerx
floor
, but obviously the other way around)vkuznetsov
03/11/2019, 6:56 PMbbaldino
03/11/2019, 7:50 PMfun ByteArray.getShort(byteIndex: Int): Short {
val b1 = (get(byteIndex) and 0xFF.toByte()).toInt()
val b2 = (get(byteIndex + 1) and 0xFF.toByte()).toInt()
return ((b1 shl 8 ) or (b2)).toShort()
}
i could keep static instances of the masks (0xFF.toByte()
) but i still have to create the Ints which seems like a waste.bbaldino
03/11/2019, 10:16 PMclass Foo {
var baz: Int
}
such that callers accessed baz
by doing Foo.bar.baz
?