Dico
01/13/2019, 9:01 PMDico
01/13/2019, 9:02 PM..
were exclusive, it's so confusing to use now.Dico
01/13/2019, 9:03 PMCzar
01/13/2019, 9:08 PMn == list.size
? 🙂tseisel
09/01/2020, 2:28 PMsealed class LoadRequest<out T> {
object Pending : LoadRequest<Nothing>()
class Success<T>(val data: T) : LoadRequest<T>()
class Failure(val error: Throwable) : LoadRequest<Nothing>()
}
When writing the following code with Kotlin 1.4, I have a warning telling me that the following cast is unnecessary:
val someFlow: Flow<String> = ...
val requestFlow: Flow<LoadRequest<String>> = someFlow
.map { LoadRequest.Success(it) as LoadRequest<String> }
^^^^^^^^^^^^^^^^^^^^^^
.onStart { emit(LoadRequest.Pending) }
.catch { emit(LoadRequest.Failure(it) }
But removing it makes onStart
and catch
incompatible with the type of the returned Flow
.
Is this some new compiler inference bug ?AlexJuca
09/02/2020, 3:42 PMniqo01
09/02/2020, 9:05 PMuser
09/03/2020, 11:47 AMNicholas Bilyk
09/03/2020, 4:19 PMstephanmg
09/03/2020, 4:49 PMuser
09/04/2020, 11:45 AMuser
09/04/2020, 11:58 AMstephanmg
09/04/2020, 12:57 PMstephanmg
09/04/2020, 12:58 PMpp.amorim
09/04/2020, 3:03 PMOr Cohen
09/04/2020, 5:26 PMbuild.gradle.kts
script in which I apply the Dokka plugin to all libraries -
configure(subprojects.filter { it.parent?.name == "libs" }) {
apply {
plugin("org.jetbrains.dokka")
}
}
I’ve also added the following block that is mentioned in the docs for multi module support -
tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput"))
documentationFileName.set("README.md")
}
I also have a README.md
file under each of my libraries under libs
folder, and I added the following to the build.gradle.kts
script of each of the libraries which I want to include in the generated docs -
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
includes.from("README.md")
}
}
After running dokkaHtmlMultiModule
, it seems like I get a folder for each library under build/dokkaCustomMultiModuleOutput/libs
(with all generated docs inside), but I can’t seem to find any top-level index.html
file. In addition, none of the libraries are listed in the top level -modules.html
file.
Am I missing something, or doing something wrong?
Thanks in advance 🙏Animesh Sahu
09/05/2020, 4:30 AMkotlin-compiler-embeddable
? I see no docs online, neither there is sources attached with it (importing from gradle).fkrauthan
09/06/2020, 6:59 AMXabier Gorostidi
09/06/2020, 6:41 PMoverride fun startScan(
timeout: Long
): Flow<Result<List<Devices>>> {
return merge(
devicesData.foundList.map { Result.Success(it) },
flow {
delay(timeout)
emit(Result.Error(Errors.DeviceDiscoveryError))
}
)
.onStart {
// Here device discovery is launched, but it's callback based so withTimeout doesn't fit very well here
}
.map {
logger().d("device received here")
stopScan()
it
}
.catch { e ->
logger().e("Error: $e")
stopScan()
emit(Result.Error(Errors.DeviceDiscoveryError))
}
.flowOn(ioDispatcher)
}
What I want is the first item emitted by either of those two flows may finish the returning one and ignore future ones. For example, in this example, if a device is found, the timeout will also be called there emitting another item. I've tried using withTimeout
and also coroutineContext.cancelChildren()
when an item is received, but I'm getting into a loop when that's captured in the catch
block. What should be the best approach for this problem?Steven Wang
09/07/2020, 2:56 PMval df = dataFrameOf("strcol") ("s1", "s2", "s3")
val l = listOf("s1", "s2")
// Is there any vectorized version to achieve this filter?
df.filterByRow { l.contains(it["strcol"]) }
Posted in #datascienceHullaballoonatic
09/07/2020, 9:34 PMuser
09/08/2020, 9:30 AMuser
09/08/2020, 9:31 AMrrva
09/08/2020, 10:24 AMvinny2020
09/08/2020, 5:03 PMjojo.lichtenberger
09/08/2020, 6:44 PMBilel El Oud
09/09/2020, 7:59 AMAdam
09/09/2020, 10:15 AMBrett Best
09/09/2020, 9:54 PMFabio
09/10/2020, 5:58 AM