aviran
12/28/2019, 7:51 PMkyleg
12/28/2019, 10:14 PMsrc/main/resources/logback.xml
and logs correctly, but when I build a fat jar to run on my production, there is no logging whatsoever. I can only assume the logback.xml
is not being found. But I have set up Intellij to include it in the build via the Module settings. How does one get logback to work with an artifact?James Richardson
12/29/2019, 1:04 PMMichał Kalinowski
12/30/2019, 3:28 PMclass Angle<T>
where T can be Int or Float or Double and nothing elsekyleg
01/03/2020, 7:11 AMBoolean
in your code because the function must always deal with Boolean no matter which type of Term?)
Assuming the pastebin contains the Output that only deals with Boolean, then why not
class Output<U: Term<V>, V>(val name: String) {
private val callbacks: MutableList<suspend (U) -> V> = mutableListOf()
// ...
}
and then have class Term
be class Term<V>
instead? I’m a relative neophyte with generics, though, so could be wrong. Plus I don’t have all your code, so maybe my suggestion doesn’t work anyway.Will Nixon
01/03/2020, 2:49 PMFling Listener
to a RecyclerView
without creating a new RecyclerView class?A
01/04/2020, 8:30 PMbbaldino
01/06/2020, 5:23 PMImany
01/06/2020, 6:09 PMwith
and apply
?Ricjhill
01/10/2020, 1:20 PMgabrielfv
01/10/2020, 8:37 PMsealed class State<out T : Any>
object Loading : State</* Type isn't relevant here */>()
data class Loaded<T : Any>(data: T) : State<T>()
There's no reason for Loading
not to be an object in this context, neither is there any reason for it to specify a type. Changing the variance to contravariance and making it an Any
is a design flaw in this scenario. Is there any convenient alternative to what I'm trying to accomplish here?bbaldino
01/10/2020, 8:58 PMList<Int>
) to do listOf<Int>().javaClass.kotlin
? I get complaints trying to do List<Int>::class
oday
01/11/2020, 5:38 PModay
01/11/2020, 5:38 PMjohnfn
01/11/2020, 11:44 PMif (key in batches) {
batches[key].add(entity)
}
johnfn
01/11/2020, 11:50 PMif (!batches.containsKey(key)) {
batches[key] = emptyValue;
}
batches[key].add(entity);
Jérôme Gully
01/13/2020, 8:49 AMif (message.fileDescriptor?.isImageType ?: false)
Is there a better way to write that ? because fileDescriptor
can be null, i'm forced to write ?: false
, maybe kotlin as a sugar syntax to avoid the ?: false
like "if this is null, it's false"oday
01/14/2020, 12:09 PMindices
val n = arr.size
for (i in 0 until n - 1) {
for (j in 0 until n - i - 1) {
Mark
01/15/2020, 3:12 AMList<(Int) -> Unit>
but I’d rather be more explicit so define an interface MyFun: (Int) -> Unit
so that my list now looks like List<MyFun>
. However, now, to create such a MyFun
, I need to do something like object: MyFun { override invoke(val: Int) { //some stuff } }
. Does this mean I’m creating an extra object compared to with not using the interface? If so, is there a better way?Mark
01/16/2020, 2:45 AMfun childVisible(left: Int, top: Int, right: Int, bottom: Int): Boolean
and I want to pass in the properties of an Android Rect
. Is there a way to do the following more concisely?
val (childLeft, childTop, childRight, childBottom) = childRect
return childVisible(childLeft, childTop, childRight, childBottom)
Esa
01/16/2020, 11:47 AMn
amount of workers can pick tasks from, where do I start? Java has ThreadPool, what do we have when we use coroutines instead?
The reason I want to convert it to a pool with fixed size of tasks to be run concurrently is because in my current .awaitAll()
-implementation I rarely have all workers working simultaneously, but very often only half or less working because the other half is already completed, leading to a very inefficient implementation.
The tasks themselves involve api-calls to the same destination, so some kind of throttling is very important.
What I am looking for is someone to tell me what these concepts are called so I can do the googling more efficiently 🙂
Thanks in advance.glade
01/16/2020, 7:13 PMCould not determine the dependencies of task ':models-js:compileKotlinJs'.
> Could not resolve all task dependencies for configuration ':models-js:compileClasspath'.
> Could not resolve project :models.
Required by:
project :models-js
> Unable to find a matching variant of project :models:
- Variant 'apiElements' capability com.gigwell.shared.models:models:1.0:
Can someone recommend a recently updated project (hopefully on 1.3.61+) and Gradle 5/6 that demonstrates this? The closest I found is kotlin-todomvc but its still using
"org.jetbrains.kotlin.frontend"
Cheersglade
01/16/2020, 9:53 PMMark
01/19/2020, 2:23 PMx..x+y
?bum
01/20/2020, 6:14 PMkotlin.test
from somewhere else?
For what I understood the references says kotlin.test
is a core library
(https://kotlinlang.org/api/latest/kotlin.test/index.html)
but when I try to use @Test
annotation, Intellij tells me it is not defined
What should I do to use kotlin.test library?
Thanks in advance.nfrankel
01/20/2020, 6:24 PMemphasis on “library” it’s not part of kotlin per se so it should be used through your usual build tool cf. https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-test/1.3.61library provides annotations to mark test functions and a set of utility functions for performing assertions in tests, independently of the test framework being used.kotlin.test
frogger
01/21/2020, 10:12 AMn
?Wesley Acheson
01/21/2020, 3:01 PMNikola Milovic
01/21/2020, 3:31 PMMartinZaubitzer
01/21/2020, 10:59 PMMartinZaubitzer
01/21/2020, 10:59 PMCasey Brooks
01/21/2020, 11:05 PMMartinZaubitzer
01/21/2020, 11:27 PMCasey Brooks
01/22/2020, 12:00 AM