Michael Bryant
03/06/2019, 4:27 AMmacosTest > kotlin > sample > SampleTestsMacos.kt
isn’t finding the kotlin.test
modules. i tried to add the dependencies to the macosTest
sourceSets section, but i’m still just missing something.bjonnh
03/06/2019, 5:45 PMursus
03/06/2019, 11:12 PMKenneth
03/07/2019, 10:33 AMbjonnh
03/07/2019, 7:40 PMKenneth
03/08/2019, 10:43 AMRichard Cumberland
03/08/2019, 12:09 PMtry/catch
?
val port: Int = when (val p = System.getenv().getOrDefault("PORT","8080").toInt()) {
is Int -> p
else -> 8080
}
ursus
03/08/2019, 4:06 PMclass ApiReactionMapper() : (ApiReaction?) -> Reaction?, _(Reaction?) -> ApiReaction?_ {
febs
03/08/2019, 5:24 PMbjonnh
03/08/2019, 8:01 PM/**
* Applies the given [transform] to each of the Nodes from the NodeList
*
*/
inline fun <R> NodeList.map(transform: (Node) -> R): List<R> {
val array = ArrayList<R>(this.length)
for (n in 0 until this.length)
array[n] = transform(this.item(n))
return array
}
Olav Hermansen
03/09/2019, 11:40 PMlist1.allNonZero() eq true
, but when I copy code into IntelliJ I get unresolved reference. Is eq part of Kotlinlang or hidden extension in the course code?bjonnh
03/10/2019, 4:22 PMKenneth
03/11/2019, 12:14 PMval nodeId: UUID = UUID.randomUUID()
inside a data class generate a new uuid each time I make a new instance of the class?ursus
03/12/2019, 1:23 AMoverride fun decode(databaseValue: Long) = when (databaseValue) {
1L -> DbMessageType.APPOINTMENT
2L -> DbMessageType.FILE
3L -> DbMessageType.LINK
4L -> DbMessageType.WEB_MEETING
5L -> DbMessageType.PIN
else -> DbMessageType.TEXT
}
override fun encode(value: DbMessageType) = when (value) {
DbMessageType.APPOINTMENT -> 1L
DbMessageType.FILE -> 2L
DbMessageType.LINK -> 3L
DbMessageType.WEB_MEETING -> 4L
DbMessageType.PIN -> 5L
DbMessageType.TEXT -> 0L
}
to get unified - safer, without allocating Pair instance (or any other)?karelpeeters
03/12/2019, 8:43 AMsomeFun<SomeImplementation>()
and remove the clazz
pqrameter.voddan
03/12/2019, 1:28 PMobject A {
sealed class B
class C : B()
class D : B()
}
gives cane be inherited only by nested classes
,
but sealed class B
class C : B()
class D : B()
works fine?azeDevs
03/13/2019, 10:20 PMErnesto Gimeno
03/14/2019, 1:26 PModay
03/14/2019, 1:50 PMDennis Schröder
03/14/2019, 2:13 PMUser.find {
Users[fieldName] eq fieldName
}.firstOrNull()
I am using Kotlin Expose DAO Model! And Iam trying to buld a generic query to query for the fieldName by pasing it in. How can I do this? I mean, how can I access the field from Users
by a variable?poohbar
03/14/2019, 6:57 PMVlad
03/14/2019, 7:25 PMVlad
03/14/2019, 7:26 PMCanOfBees
03/14/2019, 9:19 PMleosan
03/15/2019, 10:58 AMwith(screens) {
filter { it.showProgress }.mapTo(hasProgressScreens) { it.viewId }
filter { it.showSkip }.mapTo(hasSkipScreens) { it.viewId }
filter { it.showToolbar }.mapTo(hasToolbar) { it.viewId }
filter { it.showBack }.mapTo(hasBackButton) { it.viewId }
}
Matt
03/15/2019, 2:42 PMval myMap = mutableMapOf<String, List<String>>()
and try to add:
myMap["a"] = listOf("1")
myMap["a"] = listOf("2")
I'd like to have:
"a"=["1","2"]
How can I achieve this? Can I achieve it using an immutable map?cspotcode
03/15/2019, 7:27 PMval
fields in an enum? Something like this? Or do I have to refactor them into getters?
enum class Foo {
abstract val bar: String
FIRST { override val bar = "FIRST BAR" }
SECOND { override val bar = "SECOND BAR" }
}
matt tighe
03/15/2019, 9:19 PMRichard Green
03/18/2019, 10:33 AMfun fatal(m: String): Nothing {
with(TermColors()) {
println(red(m))
System.exit(1)
}
}
Nicolas Pittion-Rossillon
03/18/2019, 10:51 AMMaven
multi-modules project in Kotlin; i can’t seem to import a Kotlin module as dependency the way I would have done it in Java. Getting an Unresolved moduleName
though IntelliJ is happy.
Could someone point me towards the right channel or person to investigate? Please 😁