ohwelp
08/16/2018, 9:23 AMkarelpeeters
08/16/2018, 12:19 PMAyden
08/16/2018, 1:36 PMchristophsturm
08/16/2018, 1:56 PMMohit Gurumukhani
08/16/2018, 5:03 PMNikhil
08/16/2018, 6:51 PMSeri
08/16/2018, 8:49 PMsealed class OutsideGroup {
class Option1: OutsideGroup()
class Option2: OutsideGroup()
sealed class InsideGroup: OutsideGroup() {
class Option3: InsideGroup()
class Option4: InsideGroup()
}
}
fun returnOuter(): OutsideGroup = OutsideGroup.Option1()
fun returnInner(): OutsideGroup.InsideGroup = OutsideGroup.InsideGroup.Option3()
supaham
08/16/2018, 11:53 PMjkbbwr
08/17/2018, 3:00 AMjkbbwr
08/17/2018, 3:02 AM@ExperimentalUnsignedTypes
fun main(args: Array<String>) {
var a: UByte = 0u
println(--a) // -1
}
but
@ExperimentalUnsignedTypes
fun main(args: Array<String>) {
var a: UByte = 0u
--a
println(a) // 255
}
karelpeeters
08/17/2018, 10:58 PMrahulpr27
08/18/2018, 4:15 AMkarelpeeters
08/18/2018, 5:01 PMpsvm
in them just fine in AS.Nikky
08/19/2018, 12:33 PMval cachedCall = ::expensiveCall.memoize()
with suspend functions ?gmariotti
08/19/2018, 5:31 PMjvmTarget = "11"
? And what would be the implications from a performance/optimization point of view?david-wg2
08/20/2018, 9:06 AMMatt
08/20/2018, 3:07 PMError
includes more than just fatal JVM throwables (e.g. AssertionError
), which is why Scala has NonFatal
epool
08/20/2018, 6:53 PMclassLoaders: Array<out ClassLoader>?
when *classLoaders
is passed as parameter
val classLoaders = reflections.configuration.classLoaders // Array<out ClassLoader>?
ReflectionUtils.forNames<Any>(reflections.allTypes, *classLoaders)
edwardwongtl
08/21/2018, 8:13 AMval defaults: MutableLiveData<Boolean> = MutableLiveData().apply { value = false }
Bernhard
08/21/2018, 11:10 AMinterface EntityRepository<T> {
fun fullTextSearch(text: String?, selectedIds: Array<String>?, exclude: Boolean?, size: Int): List<T>
fun textSearch(text: String?, size: Int): List<T> {
return fullTextSearch(text, null, null, size)
}
}
ahegazy
08/21/2018, 1:03 PMisValidUsername
or isValidEmail
, do you feel it’s okay to write this as an extension method to String?GarouDan
08/21/2018, 5:05 PM./folder/subfolder1
./folder/subfolder2/subfolder21
jo
08/22/2018, 1:22 AMCan Orhan
08/22/2018, 11:44 AMrebookingList.filter {
val data = it.data
when (data) {
is AccountFeedItem<*> -> {
data.data is FeedItemTreatment
}
else -> false
}
}
But this isn't?
rebookingList.filter {
when (it.data) {
is AccountFeedItem<*> -> {
it.data.data is FeedItemTreatment
}
else -> false
}
}
Viral Thakker
08/22/2018, 1:38 PMrakeeb
08/22/2018, 3:43 PMlet
instead of run
. I find run
more convenient, cause of the lamda receiver (no it
is my reason for choosing it over let
), but I want to know if I’m using misusing these functions.diesieben07
08/22/2018, 9:31 PMmap
operations after another, but that requires me to do some computations twice. Do I really have to write a for loop and add to two lists?
Example:
val list = listOf(1, 2, 3)
val a = list.map { expensiveOperation(it).value1 }
val b = list.map { expensiveOperation(it).value2 }
Tony Hoyle
08/22/2018, 9:33 PMKrs
08/23/2018, 4:59 AMBernhard
08/23/2018, 8:37 AMBernhard
08/23/2018, 8:37 AMdiesieben07
08/23/2018, 8:38 AMBernhard
08/23/2018, 8:40 AMgildor
08/23/2018, 8:40 AMdiesieben07
08/23/2018, 8:40 AMsealed class Sealed {
data class OptionA(val foo: String) : Sealed()
data class OptionB(val foo: Int) : Sealed()
}
Bernhard
08/23/2018, 8:43 AMdiesieben07
08/23/2018, 8:44 AMBernhard
08/23/2018, 8:44 AMdiesieben07
08/23/2018, 8:44 AMBernhard
08/23/2018, 8:44 AM